Common commands for process and task management

Source: Internet
Author: User

Everything that runs on a Linux system can be called a process each user task each system Management daemon can call a process, and some common commands for viewing and controlling processes

1. PS PS command is the most basic and very powerful process, use this command to see which processes are running, and whether the running status process is finished, the process is not zombie, which processes are consuming too much resources, etc.

PS [options] where the commonly used options are-e display all processes-F full format-l long format

1 Enter the PS command in the console to get output similar to the following PID TTY time CMD 12039 pts/0 00:00:00 bash 18710 pts/0 00:00:00 PS This command shows the current logged on user's execution process displays a total of four items in turn PID (process ID) TTY (terminal name) T IME (Process Execution time) CMD (command line input for the process)

2 Enter the following command in the console   ps–ef   UID PID PPID C Stime TTY time CMD   Root 1 0 0 Jan14? 00:00:05 init   Root 2 1 0 Jan14? 00:00:00 [Keventd]   root 3 1 0 Jan14? 00:00:00 [KAPMD]   ...............   The command displays information for all execution processes displays the item in turn    UID execution process user ID PID (process ID) PPID (parent process ID) TTY (terminal name) stime (process startup time) time (Process execution times) CMD (Command-line input for this process)   More output of the command can be used to make use of the grep command to easily view such as    Ps–ef|grep Oracle   only display output lines that contain Oracle can query the execution process user is Ora CLE All processes   2. Top The same point: the basic effect is the same, showing the system's current process and other conditions are different: Top is a dynamic display process, you can continue to refresh the current state by interacting with the user, top command parameters are not important, Simply enter the top command to see the system running status

< spaces > Refresh now display h or? Show help screen give some brief command summary instructions m toggle display memory information T toggle display process and CPU status information C Toggle display command name and full command line M sort based on memory size P sort Q exit 3. Kill K The ill command can be used to terminate a background process by sending a specified signal to the process to end the process's kill kill [-s signal] process number where the signal can either be a signal name or correspond to a number such as the KILL-9 1234 command will terminate the PID (process number) to 1234 of the process

Kill-l The command displays a list of signals

4. Cron cron commands are used to implement timed tasks, such as task processes that are performed once a day. The cron command is automatically started by a shell script when the system starts, and the cron command searches the/var/spool/cron directory for the crontab file named after the user name in the/etc/passwd file. The files that are found will be loaded into memory, For instance, a user named user, the corresponding crontab file should be/var/spool/cron/user, that is, the user named Crontab file is stored under the/var/spool/cron directory, the cron command will also search/ Etc/crontab file, this file is written in a different format. After Cron starts it will first check if a user has set up the crontab file if it does not go to hibernation to release system resources it wakes up once every minute. To see if there are currently any commands that need to be run, you can use the Crontab–l command to view the cron tasks that are currently present.

Common commands for process and task management

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.