You can use the ps command. It can display relevant information about the currently running process, including the process's PID. Both Linux and UNIX support the ps command, which displays information about all running processes. The ps command provides a snapshot of the current process. If you want the status to refresh automatically, you can use the top command. ps Command Enter the following ps command to display all running processes: # ps aux | less in, -A: Display all processes a: Display all processes in the terminal including those of other users x: Display processes without a controlling terminal Task: View every process in the system. # ps -A # ps -e Task: View processes running as non-root # ps -U root -u root -N Task: View the processes run by user vivek ps -u vivek Task: top command The top command provides a dynamic real-time view of a running system. Type top in the command prompt: # top Output: Press q to exit, press h to enter help. Task: Display a tree view of the process. pstree displays the running processes in a tree format. The root node of the tree is pid or init. If a username is specified, the process tree will be rooted at processes owned by that user. $ pstree Sample output: Task: Use ps to print the process tree # ps -ejH # ps axjf Task: Get thread information Enter the following command: # ps -eLf # ps axms Mission: Get security information Enter the following command: # ps -eo euser,ruser,suser,fuser,f,comm,label # ps axZ # ps -eM Task: Save process snapshot to file Enter the following command: # top -b -n1 > /tmp/process.log You can also email the results to yourself: # top -b -n1 | mail -s 'Process snapshot' [email protected] Use the pgrep command. pgrep can find currently running processes and list the process IDs that meet the conditions. For example, to display the process ID of Firefox: Task: Find Process $ pgrep firefox The following command will display the process named sshd and owned by root. $ pgrep -u root sshd Say hello to htop and atop htop is an interactive process viewer similar to top, but with vertical and horizontal scrolling to view all processes and their command lines. Process related operations (killing, renicing) do not require input of PID. To install htop enter command: # apt-get install htop or # yum install htop Type htop in the command prompt: # htop atop tool atop is an interactive monitoring tool for viewing Linux system load. It shows the usage of key hardware resources (from a performance perspective) at the system level, such as CPU, memory, disk, and network. It can also show which processes are causing a certain load based on CPU and memory load at the process level; and can show disk and network load per process if the kernel patch has been installed. Enter the following command to start atop: This is the end of this article about how to view all running processes in Linux. For more information about viewing running processes in Linux, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: JavaScript functional programming basics
>>: MySQL's method of dealing with duplicate data (preventing and deleting)
1. Which three formats? They are: gif, jpg, and pn...
Table of contents 1. Function definition 1.1 Func...
Table of contents Configure node.js+nvm+npm npm s...
Let’s start the discussion from a common question...
The EXPLAIN statement provides information about ...
To write a drop-down menu, click the button. The ...
This article shares the installation tutorial of ...
Detailed example of clearing tablespace fragmenta...
Html semantics seems to be a commonplace issue. G...
This article uses examples to describe the basic ...
1. Copy the configuration file to the user enviro...
Table of contents Deploy tomcat 1. Download and d...
Table of contents 1. Synchronous AJAX 2. Asynchro...
Install MySQL for the first time on your machine....
In Google Chrome, after successful login, Google ...