![]() To list processes by PID, run $ ps -fp PIDįor instance, to list the processes associated with PID 1286 run the command: ~]$ ps -fp 1286 The PPID refers to the PID of the parent of a process. Linux processes can also be displayed using the PID ( Process ID) and the PPID (parent process ID). $ ps -fG 48ĩ) Displaying processes using PID and PPID So, instead of specifying the group name ‘ apache’ simply specify the GID no. you can obtain the GIDs from the /etc/group file.įor example, in this case, the group ID for Apache is 48. You can list a group process using the ps command by passing the name of the group by specifying the group ID.įor example, to display the processes associated with the group ‘apache’ run the command:Īlternatively, you can pass the group ID (gid) instead of the group name. Listing group processes is similar to listing user processes. Similarly, you can check using the uid of the root user whose value is 0 $ ps -u 0 8) Displaying group processes $ ps -u 1000įor the root user, run the command $ ps -u root You can then use the ps command and the uid to find the processes associated with the user. Uid=1000(linuxtechi) gid=1000(linuxtechi) ~]$įrom the output above, we can clearly see that the uid for the user ‘linuxtechi’ is 1000. You can get the user’s id by running the command: Sometimes, you may want to find out processes that are associated with a certain user, so to achieve this, use the -u flag as shown”įor instance, to view processes associated with user ‘Linuxtechi’ run the command: $ ps -u linuxtechiĪlternatively, you can use the user’s uid (User ID). ~]$ ps -efo pid,startġ3632 ~]$ 7) Show the current running processes of a user Be sure to note the columns options are passed in lowercase in the ps command. In the example below, only the PID and START columns are displayed. The -o flag determines which columns will be displayed when running the ps command. In a user-defined format output, you have the power to decide which columns to be displayed. Same as STARTĦ) Displaying output in a user-defined format
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |