Linux common commands summary_1

1. The path where the mkdir
mkdir make directories
command is located: / bin / mkdir
execute permission: all users
Syntax: mkdir -p [directory name]
Function description: create a new directory -p recursively create
Example: $ mkdir -p / home / username / word

Second, the path where the cd
cd change directory
command is located: / bin / mkdir
Execution authority: all users
Syntax: cd [directory]
Function description: switch directories
Example: $ cd / home / username / word Switch to the specified directory
$ cd… / back The upper level directory./ indicates the current directory

3. The path of the pwd
pwd print working directory
command: / bin / pwd
execution authority: all users
Syntax: pwd
function description: display the current directory
Example: $ pwd
/ home / username

4. The path where the rmdir
rmdir remove empty directory
command is located: / bin / rmdir
Execution authority: all users
Syntax: rmdir [directory name]
Function description: delete an empty directory
Example: $ rmdir / home / username / word

5. The path where the cp
cp copy
command is located: / bin / cp
execute permission: all users
Syntax: cp -rp [source file or directory] / [target directory]
-r copy directory
-p retain file attribute
function description: copy file or directory Rename

6. The path where the mv
mv move
command is located: / bin / mv
execute permission: all users
Syntax: mv [original file or directory] / [target directory]
Function description: cut files, rename

cp: Copy the file and rename it.
cp… / log / run.log ./log/testcase1_run.log
rm -rf… / log / run.log
mv: cut the file and rename it.
mv… / log / run.log ./log/testcase1_run.log

7. The path where the rm
rm remove
command is located: / bin / rm
Execution authority: all users
Syntax: rm -rf [file or directory]
-r delete directory
-f delete file
Function description: delete file or directory

8. The path where the touch
touch
command is located: / bin / touch
Execution authority: all users
Syntax: touch [file name]
Function description: create an empty file
Example: $ touch filelist.f

Nine, the path where the cat
cat
command is located: / bin / cat
execution authority: all users
Syntax: cat [file name]
Function description: display file content -n display line number

Ten. The path where the tac
tac
command is located: / bin / tac
Execution authority: all users
Syntax: tac [file name]
Function description: display file contents (listed in reverse)

11. The path where the more
more
command is located: / bin / more
Execution authority: all users
Syntax: more [file name]
space or f turn the page
enter line feed
q or Q to exit
Function description: display the contents of the file in pages

12. The path where the less
less
command is located: / bin / less
Execution authority: all users
Syntax: less [file name]
Function description: display the file content in pages (you can turn up)

13. Path where the head
head
command is located: / bin / head
Execution authority: all users
Syntax: head [file name]
Function description: display the first few lines of the file -n specify the number of lines

14. The path where the tail
tail
command is located: / bin / tail
Execution authority: all users
Syntax: tail [file name]
Function description: display a few lines after the file
-n specify the number of lines
-f dynamically display the content of the end of the file

Published 38 original articles · Like 29 · Visits 10,000+

Guess you like

Origin blog.csdn.net/weixin_45270982/article/details/105234964