Brief introduction
You can use the PS command. It can display information about the current running process, including the PID of the process. Both Linux and UNIX support the PS command, which displays information about all running processes. The PS command can provide 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
which
-A: Show All processes
A: Show all processes that include other users in the terminal
X: Show the process without control terminal
Task: View each process in the system.
#?ps?-a#?ps?-e
tasks: Viewing non-root running processes
#?ps?-u?root?-u?root?-n
Task: View the process that the user Vivek runs
#?ps?-u?vivek
Task: Top command
The top command provides a dynamic, real-time view of the running system. At the command prompt, enter top:
#?top
Output:
Figure 1:top Command: displaying Linux tasks
Press Q to exit and press H to enter help.
Task: Displays a tree view of the process.
Pstree displays the running process in a tree-like way. The root node of the tree is PID or init. If a user name is specified, the process tree takes the process owned by the user as the root node.
$?pstree
Output Example:
Figure 2:pstree-Show the tree of the process
Task: Using the PS print process tree
#?ps?-ejh#?ps?axjf
Task: Getting thread information
Enter the following command:
#?ps?-elf#?ps?axms
Execute command:
Task: Get security information
Enter the following command:
#?ps?-eo?euser,ruser,suser,fuser,f,comm,label#?ps?axz#?ps?-em
Task: Save a process snapshot to a file
Enter the following command:
#?top?-b?-n1?>?/tmp/process.log
You can also send your results to yourself via email:
#?top?-b?-n1?|? Mail?-s? ' Process?snapshot ' [email protected]
tasks: Finding processes
Use the Pgrep command. Pgrep can find the currently running process and lists the process IDs that match the criteria. For example, show the process ID of Firefox:
$?pgrep?firefox
The following command displays the process named sshd and owner-root.
$?pgrep?-u?root?sshd
Say hello to htop and atop.
Htop is a top-like interactive process viewing tool, but you can scroll vertically and horizontally to see all the processes and their command line. The associated operation of the process (killing,renicing) does not require a PID input. To install the Htop Input command:
#?apt-get?install?htop
Or
#?yum?install?htop
At the command prompt, enter Htop:
#?htop
Output Example:
Figure 3:htop-interactive Linux/unix Process Viewer
Atop tools
Atop is an interactive monitoring tool for viewing the load on Linux systems. It demonstrates the use of critical hardware resources (from a performance perspective) at the system level, such as CPUs, memory, hard disks, and networks.
It can also show which process is causing a specific load based on the CPU and memory load at the process level, and if a kernel patch is installed, the hard disk and network load for each process can be displayed. Enter the following command to start atop:
#?atop
Output Example:
Figure 4:at Computing ' s System & Process Monitor
Summarize! Linux Basics are important! I hope I can make every little point!
I'll show you all the running processes of Linux