1, how to shut down the command line? (the server generally does not shut down, the virtual machine does not have to shut down, click "Hibernate", keep its running state)
Enter shutdown or halt or Poweroff in the terminal
2. How to restart the command line?
Terminal input reboot
3. Go to directory CD directory path
CD/var/tmp
4. Create one or more directories mkdir dir
mkdir dir1 //Create a directory
mkdir dir2 dir3 //Create multiple directories mkdir dir{4,5,6} //Create multiple directories
MKDIR-P/D1/D2/D3 //Create a cascading directory
5, list the current file ls
LS //lists the current directory's file ls-a/-l (optional parameter)
-a means to show hidden files as well
-L indicates show details, create date/size/permissions/attributes, etc.
6. Move files or folders or change the file name MV
MV source folder/File destination folder/file eg: mv./dir1 ./dir2
MV source filename New file name
MV Name1 name2
7. copy file CP
CP source file target file CP Source directory target directory-R [recursive copy entire Directory]
8. Delete empty folder RmDir
Delete a file or folder rm
RmDir Empty folder name rmdir./dir2/dir1rm file name rm-rf folder name (-R indicates meaning of loop iteration,-f is mandatory meaning RM tmp.txt RM- RF./dir1
9. Show current Location pwd
10. Link Command ln (equivalent to a shortcut under Windows)
Ln-s source folder or source file destination link name ln-s/var/tmp ./link.var
Linux basic commands