Shutdown-h now shut down immediately.
Shutdown-r now restarts
Reboot now restart
Su-If you are currently a normal user, enter this command to switch to the administrator user (root), and if you want to switch to another user, type
Su-user name such as: Su-xiaoluo logout Log off from the current user (if it is at the end of the graphical interface, enter the Exit command to exit the current user)
CD switch directory "such as: CD/switch to the root directory of Linux!! (/) Represents the root directory "
PWD shows the command under which path the user is currently in (This command is particularly used, and if you do not know the current folder in the command line, you can enter the command pwd
ls "List files and directories" such as: Ls/home (List all files and directories under Home)
Ls-l "lists the files and directories displayed in a long list" such as: ls-l/Home
Ls-a "list hidden files and directories" such as: ls-a/Home
mkdir "Build directory" such as: mkdir Xiaoluo
RmDir "Delete empty directory" such as: RmDir Xiaoluo (only empty directory can be deleted, if there are other files in the directory, the command is invalid)
Touch "Create empty file" such as: Touch Test.java
More "Show file contents with paging" Less "show file contents with pagination" If there is a lot of content in one of our files, you can use the more command to give it a paging such as: more/etc/prelink.conf ( The contents of the prelink.conf file below etc are displayed in pagination)
| "Pipeline Command" "This command is used in many Linux systems" (| The function of this command is to give | The result of the command in front of | The command to be processed) such as: Ls/etc | More (| The previous command is to show all files and directories in the ETC folder, | The next command is displayed as a paging, so this command means to display all the files and directories in the ETC directory by paging)
grep "Query content in text" This command is used very much as: grep "Xiaoluo"/home/test.txt (in the Test.txt file to find the line containing the Xiaoluo text information) If you need to show the text of the number of lines used: grep- N "Xiaoluo"/home/test.txt (query the number of rows in the Test.txt file that xiaoluo the information and change all text) find "Search files and directories" such as: Find/home-name Test.java ( Look for files named Test.java under the home folder or all subfolders in home
"Cat,VI" (CAT command can only view files, vi command can view the file and can modify the file, for some of the key files we generally use the Cat command to view)
such as: Cat/etc/profile (just view the contents of the file) Vi/etc/profile (view, and can modify the contents of the file)
Linux Learning One