Linux common commands (1)

Command At a Glance: ls, cd, pwd, mkdir, rmdir, cp, mv, rm

 

Command name: ls

English command: list

Command path: / bin / ls

Function: displays the directory file

Command syntax: ls [-aldhi] [file or directory]

Parameter Description:

-a: shows all files that contain hidden files; -l: Displays detailed information; -i: show inode number of the file;

-h: displays the size of the additional units of directory file; -d: Display Data Attributes own directory, directory file attributes are not displayed;

Command examples:

ls -lh: display the file in the current directory path details, and the file size of the additional unit display

-----------------------------------------------------------------------------------------------------------------------

Command name: cd

English command: change directory

Command path: shell built-in commands

Function: change directory

Command Syntax: cd [directory]

Command examples:

cd / tmp / file / test: Switch to the specified directory

cd ..: go back one level

 -----------------------------------------------------------------------------------------------------------------------

Command name: pwd

Command English: print working directory

Command path: / bin / pwd

Function: Display the full path of the current directory

Command Syntax: pwd

Command Example: pwd

 -----------------------------------------------------------------------------------------------------------------------

Command name: mkdir

English command: make directories

Command path: / bin / mkdir

Function: Create a new directory

Command Syntax: mkdir -p [directory name]

Parameter Description:

-p: it creates the directory recursively create that as an intermediate variable of the directory does not exist

Command examples:

mkdir -p /tmp/file/test

mkdir -p / tmp / sex / girl / tmp / sex / boy: create multiple directories

 -----------------------------------------------------------------------------------------------------------------------

Command name: rmdir

Command English: remove empty directories

Command path: / bin / rmdir

Function: Delete empty directory

Command Syntax: rmdir [directory name]

Command Example: rmdir / tmp / test

 -----------------------------------------------------------------------------------------------------------------------

Command name: cp

English command: copy

Command path: / bin / cp

Function: Copy a file or directory

Command Syntax: cp [-rp] [source file or directory] [destination directory]

Parameter Description:

-r: Copy the directory; -p: Preserve File Attributes;

Command examples:

cp -r / root / test / tmp: directory replication

 -----------------------------------------------------------------------------------------------------------------------

Command name: mv

English commands: move

Command path: / bin / mv

Function: Cut file, rename

Command syntax: mv [source file or directory] [destination directory]

Command examples:

mv /root/test/a.tar.gz / tmp: Cut Files

  -----------------------------------------------------------------------------------------------------------------------

Command name: rm

Command English: remove

Command path: / bin / rm

Function: delete files and directories

Command Syntax: rm [-fr] [file or directory]

Parameter Description:

-f: Force delete, no reminder information; -r: delete the directory

Command examples:

rm -fr / tmp / test: forced to delete directory

 

Guess you like

Origin www.cnblogs.com/jfl-xx/p/12539187.html