1. Touch filename To create a new file
2. Readlink-f filepath trace the true file path of the symbolic link
3. Id-u gets the ID of the current user, if the ID is 0, it is the root user, otherwise the general user
4. Echo $? Outputs the end state of the previous command, if it is 0, execution succeeds, otherwise execution fails
6. sudo-i Switch to root user
7. Root user, exit switch to normal user, or Su-username
8. Copying Files cp-a source destination
9. deleting files Rm-r
10. View the file Ls-l
11. View the current working directory PWD
12. Package and compress files or directories TAR-ZCVF xxx.tar.gz directory
13. Unzip the file to the specified directory TAR-ZXVF xxx.tar.gz-c directory
14. Download the entire site wget-r-p-np-k http://www.dimi.com
15. Find the location of the executable file in the directory specified by the PATH variable which executefilename
Xargs data transfer: Locate Name.txt |xargs Open, locate the file and open
17.mail Send mail: echo "This is mail content" | Mail-s "This is subject" "[Email protected]"
18. Download file from remote: scp-r [email protected]:/home/admin/file.tar.gz./file.tar.gz
19. View the specified process: Ps-ef |grep Ngix
20. Create a new File > NewFile
21. Output standard error to file command 2>error.txt
22. Use the contents of the file as command parameter < Input.txt
23. Turn uppercase to lowercase echo ' This is A TEst ' | TR ' [: Upper:] ' [: Lower:] '
24. See what Shell:cat/etc/shells are currently available on the Linux system.
25. View the current default Shell:echo $SHELL
26. Change user Default Shell:chsh-s/bin/zsh
27. View file Details: Stat filename
28. Force copying of files or directories into a directory, CP-RF SourceDir DestDir
29. View the total size of the current directory du-sh.
Linux Command Learning Notes