Linux entry 4: process and task management commands

Source: Internet
Author: User

Because there are many Linux commands and many options, you can only master some common commands to learn:

 

Process and task management commands

1. ps command
The ps command is the most basic and very powerful process.
Which processes are running and which processes are running, whether the processes are terminated or not?
The process occupies too many resources.
Common options:
-E: display all processes
-F full format
-L long format
Uid pid ppid C stime tty time cmd
Root 26847 26845 0 00:00:00 pts/1 bash
Root 28380 26847 1 00:00:00 pts/1 PS-F

This command displays information about all execution processes. The displayed items are
User ID of the UID Execution Process
PID (process ID)
Ppid (parent process ID)
Tty (terminal name)
Stime (process start time)
Time (process execution time)
CMD (command line input of the process)

You can use the grep command to overwrite the output of this command for ease of viewing, as shown in
PS-Ef | grep Oracle
Only the output lines containing Oracle are displayed and the execution process can be queried.
All processes of Oracle
2. Top Command
The basic functions of the top command and the ps command are to display the current process and other conditions of the system.
However, top is a dynamic display process, which allows you to constantly refresh the current status by interactions.
The top command parameters are not important. Simply enter the TOP command to view the system running status.
Parameters
H or? The help screen displays some brief command summary instructions.
M switch Display memory information
T Switch displays process and CPU status information
C switch display command name and complete command line
M is sorted by resident memory size
P sort by CPU usage percentage
Q exit
3. Kill command
The kill command can terminate the background process. The kill command ends the process by sending a specified signal to the process.
Kill-9 1234 terminate a process with a PID (process number) of 1234 and view it using PS-lf
4. cron command
The cron command is used to complete a scheduled task, for example, a task process that is executed once a day.
The cron command should not be started manually.
For example, the crontab file corresponding to a user whose user name is user should be
/Var/spool/cron/user, that is, the crontab file named after this user is stored in
The cron command under the/var/spool/cron directory will also search for the/etc/crontab file which is
It is written in different formats.
You can run the crontab-l command to view existing cron tasks.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.