[Linux] [7] commonly used commands - directory command processing

Preface:

Syntax: command [- options] [parameters] (ls -al / etc)

(1) individual commands do not follow this format

(2) When there are multiple selection, can be written together

(3) simplify the options and complete option (-a equal --all)

1, ls: display the directory file

2, cd: Switch to the specified directory

3, pwd: displays the current directory

4, mkdir: create directory

5, rmdir: delete empty directories

6, cp: copy files or directories

7, mv: Cut file / rename

8, rm: deleting files

9, clear: clear screen (Ctrl + L)

 

text:

1, ls: display the directory file

Intent: list

Options:

-a --all Show all files, including hidden files
-l --long For more information show
-d   Displays the current directory itself
-lh   The file size conversion (1205-1.2K)
-i   id file

 Note: where the query result is -l -rw-r - r-- 1 root root 1873 9 Yue 16 21:06 profile.

(-: file type, - binaries, d directory, l soft link file) (rw-: u owner; r--: g belonging group; r--: o else - Read R & lt; W Write; X execution) (base file) (owner) (the owning group) (file size) (time of last modification) (file name)

 

2, cd: Switch to the specified directory

Intent: change directory

parameter:

~ The current directory location of the parent directory
.. The current directory location of the parent directory

 

3, pwd: displays the current directory

Intent: print working directory

 

4, mkdir: create directory

Intent: make directories

Options:

-p Recursively create that together create multi-level directory

 

5, rmdir: delete empty directories

原意:remove empty directories

 

6, cp: copy files or directories

Intent: copy

Syntax: cp [-rp] [original file or directory] [destination directory]

Options:

-r Copy directory
-p Preserve file attributes (modification time)

 

7, mv: Cut file / rename

Intent: move

Syntax: mv [original file or directory] [destination directory]

 

8, rm: deleting files

Intent: remove

Syntax: rm [-rf] [file or directory]

-r Remove directory
-f Forced to delete

 

9, clear: clear screen (Ctrl + L)

Clear screen

 

Guess you like

Origin www.cnblogs.com/huashengweilong/p/11531303.html