RSS

Usually command in linux

29 Dec




Pwd:

Return current directory

Syntax:

$ pwd

 

Cd:

Change current directory

Syntax:

$ cd [directory]

Special command:

$ cd..

Return parent directory

$ cd /

Return root directory

$ cd abc/def

Return subdirectory

 

Ls:

List file and subdirectory in folder

Syntax:

$ ls [option] [directory]

Important option:

-l

List detail information

-i

Show inode of list

-a

Show all file in folder (both invisible file)

 

Mkdir:

Make new directory

Syntax:

$ mkdir [option] <new_directory>

Important option

-p

–parents

No error if existing, make parents directory if needed

 

Cat:

View data in file

Syntax:

$ cat [name_file]

Cat also used to make new file

Syntax:

$ cat > [new_file]

 

More, less:

View data in file follow the pages

Syntax:

$ cat > [new_file]

 

Cp:

Copy file to other place

Syntax:

$ cat > [new_file]

 

Mv:

Move file to other place

Syntax:

$ cat > [new_file]

 

Rm:

Remove some files and directories

Syntax:

$ cat > [new_file]

Important option:

-r

-R

-recursive

Remove directories and their contents recusively

 

Find:

Find object following expression

Syntax:

$ find [directory] [expression]

See more by : $ man find

 

Grep:

Find string in file

Syntax:

$ grep abc text.txt

Example advance grep

$ ls |grep abc

So, we could some special character such as : -, \, ?, #. You insert prefix ‘\’ into special character. Example:

image

 

Touch:

Make new file

Syntax:

$ touch [option] <new_file>

written by hotdream1990

 
2 Comments

Posted by on December 29, 2010 in Linux, Linux Administrator Certificate

 

Tags:

2 responses to “Usually command in linux

  1. ptz ip camera

    January 1, 2011 at 6:47 am

    I’m grateful for you because of this good written content. You definitely did make my day :

     
  2. ptz ip camera

    January 1, 2011 at 3:07 pm

    Hey guys, this good wook!

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s