Common Linux commands and common linux commands
There are too many commands in Linux. Here we will sort out some of them for the time being. For the sake of practicality, no specific parameters are listed here.
Part 1: File Operations
Ll view directories and files in long format
Ls to view directories and files in short format
Df-h view disk size information
Mkdir dir_name: Create a folder
Rm-rf file_name Delete directory
Rm-f file_name delete file
Mv file path: Move the file to the path directory.
Cp file path: copy the file to the path directory.
Cat file
Vi/vim file
Pwd: view the path of the current File System
Uniq a.txt> B .txt re-operate a.txt and write the result to B .txt.
Sort a.txt> B .txt writes the.txt sequence to B .txt.
Uniq a.txt | sort> B .txt: Execute a.txt first and then sort the result to B .txt.
Wc-l a.txt statistics a.txt rows
Find path-name file: find the file named file in the path directory. You can use * as the wildcard.
Find path-name file_name | xargs grep-nH content find the specified content in the specified file
Part 2: Process Information
Ps-aux
Ps | grep java lookup Process
Kill-9 process killing by pid according to process number
Killall-9 java kills all java Processes
Free view memory
Top view CPU Information
Part 3: rpm package management
Rpm-qa list all rpm Software
Rpm-qa | grep name check whether software named name is installed
Part 4: restart and shut down
Reboot restart
Shutdown-h now shutdown
Part 5: Other parts
Passwd Change Password
& Background Startup Process
Service network restart network service