Basic Linux commands and Linux commands
[Epeter @ localhost ~] $
Where: epeter is the user name; localhost is the current host name ;~ The broken wave number indicates that the current user directory is used (If yes, the slash indicates that the current root directory is used ); $ indicates that you are currently logged on as a normal user (If yes, # indicates that you are currently logged on as a root user (root user or administrator privilege )).
A command consists of three parts: Command, option, and parameter.
Switch users:
Switch su epeter to epeter user
Switch su-epeter to epeter user
The difference between addition and addition is that addition enables a completely new terminal environment (shell environment.
Hostname display Host Name
Username current user name
Uanme-r kernel version
The Tab auto-completion command is used to automatically complete the file name. The parameter cannot be automatically completed.
Cd file name open this file
Cd ~ Open user directory
Cd/open the root directory
Ls
Ls-l view the file details in the directory
Ls-a indicates displaying hidden files
Ls-d directory attributes
Same as ls-ld
Ls/root user's home directory
Main directory of the user in the ls/home Directory
Ls/dev/System Device File
Mkdir tmp create the 'tmp 'directory
Mkdir-p tmp01/test recursively creates the 'tmp01' directory, while the 'test' directory is created under the 'tmp01' directory.
Touch test.txt creates the 'test.txt 'file
Touch "progam files" creates a file named 'progam files 'with spaces, and adds double quotation marks
Rm "progam files" delete 'progam files 'files with spaces, with double quotation marks
Rmdir delete an empty directory
Rm tmp Delete the 'tmp 'directory
Rm-r tmp: Delete the 'tmp 'directory and directories under the directory, and delete them cyclically.
Rm-f text.txt forcibly Delete the 'text.txt 'file
Rm-rf text.txt forcibly deletes the directory. (Use with caution)
Cp/root/test.txt test/copy the 'test.txt 'file to the 'test' directory.
Cp-r/root/tmp tmp01/copy the 'tmp 'directory to the 'tmp01' directory.
Mv test.txt test01 cut the 'test.txt' file to 'test01', and the location of 'test.txt 'is changed.
Mv test.txt epeter rename 'test.txt' as 'epeter.txt'
// To be supplemented...