- Man command before explaining the following command, first introduce man command, custom said, there is a problem to find a man, when meeting a command do not know how to use, man command, you can get detailed explanation.
- Shutdown Shutdown command. You can run the man shutdown command to view details about the command
Shutdown -h now #
Halt # is equivalent to shutdown -h now
Shutdown -H 10 # Power off after 10 minutes
Shutdown -h 18:30 # Shutdown at 18:30
Shutdown -r now
Reboot # is equivalent to shutdown -r now
Shutdown -r 10 # Restart in 10 minutes
- Ls Displays the directory command
Ls # View subdirectories under the current directory
Ls / # Check the subdirectories under the root directory
Ls -a # Displays all subdirectories under the current directory
Ls -l # Displays details about subdirectories under the current directory
Ll # is the same thing as ls minus l
Ls -al # Details all subdirectories under the current directory
- CD Switch directory command, where
.
Represents the current directory.
Represents the upper level directory
PWD # View the absolute path to the current directory
CD / # Switch to/directory
CD /home # Switch to the home directory
cd .. # return to the previous directory
CD ~ # returns to the current user's home directory
CD # is equivalent to CD ~
- Mkdir Creates a directory
Mkdir test # create a test directory
Mkdir test/hello # Create a hello directory under test
Mkdir -p a/b/c #p is parents, create the parent directory as needed
- Rmdir Deletes a directory
Rmdir test # Delete the test directory
Rmdir -p a/b/c # Delete the parent directory as required
- Cp copy command
Copy hello. TXT to the root directory
Cp a / # copy a to the root directory
Cp -r a / #r a / #r
- Rm Removed a file or directory
Rm hello.txt # delete hello.txt
Rm -f a #f
Rm -r a # Delete the subdirectory recursively
- Mv move command
TXT / # move hello. TXT to the root directory
Mv a / # move a to the root directory
Mv -f a / # move a directory to root, overwrite not prompted.