In addition to the commands we've talked about directories, files, users, permissions, and more, there are other common commands.
(1) grep
We created a 3.txt text file, and then we wrote three rows of data, and then we used the grep command to find the line that contained the "Rld" string:
Therefore, the grep command is used to check which line of the text file contains a message.
It is often used when checking the process later.
(2) Date
Display and set Date time
Displays the current date of the system
Modify date command and parameter options: date-s
Examples are as follows:
#date-S 08/08/2088------Set the system time to August 8, 2088
#date-S 22:22:22------Set the system time to 22 points, 22 minutes, 22 seconds.
(3) Stat
Displays information about the specified file
For example, view information about a 3.txt file under the test folder
(4) hostname
Show host Name
(5) uname
displaying operating system Information
(6) Du
Displays the total amount of disk space that is used by the specified file (directory)
Displays the total amount of disk space used by the test folder
(7) DF
Display the usage of file system disk space
Displays the usage of disk space for the test folder
(8) Free
Show usage of current memory and swap space
(9) Fdisk
Display disk information
Let's take a look at all the information on the CentOS system disk currently installed in VMware
We can see that the total space of our operating system is 21.5G, there are 255 heads, 63 sectors, 2,610 cylinders.
The size of each sector is 512byte
I/o size of input/output stream is 512byte
(Ten) locale
Show current locale
As you can see, our current encoding format is UTF-8
PS (Main)
Used to view processes
A. Command format:
ps[parameters]
B. Command function:
Used to display the status of the current process
C. Command parameters:
A Show All Processes
-a displays all programs under the same terminal
-A Show All processes
C Displays the real name of the process
-N Reverse Selection
-e equals "-A"
e Display Environment variables
F show the relationship between programs
-H Display tree structure
R shows the process of the current terminal
T displays all programs for the current terminal
U specify all processes for the user
-au Show more detailed information
-aux Show all itineraries that contain other users
-c< commands > lists the status of the specified command
--lines< lines > number of rows displayed per page
--width< characters > number of characters displayed per page
--HELP Display Help information
--version Display version display
For example, show all processes Ps-a
Displays the specified user information ps-u root
Show all process information, along with command line Pa-ef
PS and grep common use combination to find specific processes
Command: Ps-ef|grep 9090 to find the 9090 port process
List all the programs that are currently in memory
Command: PS aux
NOTE: PS gives us a one-time view of the process, it provides a view of the results is not dynamic continuous, if you want to monitor the process, you should use the top tool.
Reprint Please specify source: http://blog.csdn.net/acmman/article/details/52020508
"Comprehensive Linux Learning" 9. Other common commands