Process Management:
Automatically execute process commands, at and batch. At specifies the process execution time, and batch is automatically executed when the system is idle. Crontab can periodically execute processes, such as periodic execution of a script, which is often used for system monitoring. The command format is as follows:
The time table format is as follows::
F1 F2 F3 F4 F5 Program
F1 indicates the minute, F2 indicates the hour, F3 indicates the day of the month, F4 indicates the month, and F5 indicates the day of the week. Program indicates the program to be executed.
See http://baike.baidu.com/view/1229061.htm for details
The PS and top commands are used to view the process status. The difference is that PS is static display and top is dynamic display. Top also displays the usage of CPU, memory, and virtual memory.
Pstree: process is displayed in a tree.
Nice:Program.
Kill + process number ends the process. However, if the ps command does not add the-e option, the opened process is not displayed. If the-e option is added, many processes are displayed, and you do not know who represents the process.
View the currently used shell: Echo $ Shell
Change shell: CHSH does not know how to set the parameter. Try again if you have time.
Network Management:
Ifconfig: used to configure and view network interface configuration. ifconfig eth0 192.168.0.254 netmask 255.255.255.0 // configure the IP address of eth0 and activate
Netstat: displays network connection, route table, and network interface information, allowing you to know which network connections are currently in operation.Netstat-Na can check whether MySQL and other services are enabled and the port number.Netstat-I: displays the NIC running status. netstat-R: displays the host route list.
Route: This command can be used to set a static route for the NIC configured by the ifconfig command.
Here are several examples to illustrate how to use the route command:
Route add-net 127.0.0.0
This command adds a route entry with a specified address or network to the routing table. Note that the network is a Class A address, the mask is set to 255.0.0.0, and the newly added entry is connected to the lo device.
Route add-net XXX. XXX netmask limit 255.255.0 Dev eth0
This command adds a route for the host whose IP address is XXX. XXX, and its network mask is set to 255.255.255.0.
Route del-net XXX. XXX
This command will delete the route of the network XXX. XXX.
The route command can also be used to conveniently manage the route information of the entire network. The output result is the route table of the network.
Traceroute: used to display the route through which data packets arrive at the target host.
Tcpdump: used to monitor TCP/IP connections and directly read data headers at the data link layer. Tcpdump-I eth0 SRC host hostname can read all data sent by the host hostname; tcpdump-I eth0 SRC host hostname can monitor all data packets sent to the host hostname.
NSLookup: query the IP address corresponding to the domain name
Sleep + n seconds indicates that the process after execution is paused for n seconds.
View memory and disk usage:
Free monitor memory usage
Vmstat monitors virtual memory usage
DF checks the disk usage of the file system. That is, the usage of/,/boot, and attached sub-disks, the space used, and the available space.
Du checks disk space usage and counts the disk space occupied by directories or files.
Fdisk-L: List Disk Partitions
Common commands:
Grep is used for file content search. For example, grep-l "Asiainfo" *. CC,-l indicates listing file names
Find searches for files, recursively searches directories, and corresponding operations (such as deleting) can be performed after the search ). Find/home-name "*. c"
Sort all rows in the file
Uniq pairs and sorted files to delete adjacent duplicate rows
The number of words in the WC statistics file. -C: counts the number of bytes.-L: counts the number of rows.-W: counts the number of words.
Comm compares two sorted files.
Diff compares two files one by one to list their differences. Options A, D, and C indicate attaching, deleting, and modifying respectively.
Ln establishes links between files, which are divided into hard links and soft links.
Rm-R is used to delete files and recursively delete directories, while rmdir-P is used to recursively delete directories.
FINGER: allows the user to query information of other users.
User and user group management:
ID: displays the user name and group information.
Setuid/Setgid is also a chmod mode. After a directory is set to setgid, all files created in the Directory have the same group as those in the directory. Setuid enables the file to have the permission of the owner during execution. Chmod U + S filename, chmod g + S dirname.
/Etc/passwd,/etc/group are two important accounts in Linux, group management files. Their shadow files are shadow and gshadow respectively.
Useradd Add User
Usermod
Userdel delete user
Groupadd create user group
Groupmod modify user group attributes
Groupdel delete user group
System variables:
Env is short for Environment (Environment). It lists all environment variables.
The execution of export is the same as that of Env. However, export can also convert variables into environment variables. To continue using the variable content in the subroutine, execute:
Export variable
It is very important to use this item to reference others' archives or other programs. Basically, the reason why the environment variable allows the subroutine to continue to be referenced is:
1. When a shell is started, the operating system assigns a memory block to the shell. Variables in this region can be accessed by subprograms;
2. Using the export function, you can write the variable content to the above memory block (environment variable );
When loading another shell (that is, starting the subroutine and leaving the original parent program), the Child shell 3. you can import the memory block of the environment variable of the parent shell into your own environment variable block.
In addition to setting environment variables, the set command will be used to list other custom variables. Therefore, you can use set to observe all the variables in the Current Shell environment!
System Information
Uname: displays system information, including host name, system version, and other information.
Software management:
Whether vsftpd is installed in the query system. Run the command: rpm-Qa | grep vsftpd.