This post has listed the basic syntax of the ps -ef command and its detailed usage with the help of suitable examples. The output of the ps -ef command can be molded as per the requirement of the user. This command, UID, PID, PPID, C, STIME, TTY, and TIME of each process. The ps -ef command lists all the running processes on your system. ![]() Now, the processes are listed in ascending order of CPU usage. The command written below will sort the ps -ef output as per the CPU usage: $ ps -ef -sort=-%cpu Like memory usage, the processes can be arranged in ascending order of the CPU usage. Example 6: Display Process Sorted By a CPU Usage The list of processes is now arranged in the ascending order of memory consumption. For this, the ps -ef command can be used with the “–sort” flag and then the %mem filter, as shown below: $ ps -ef -sort=-%mem ![]() The output of the ps -ef command can be sorted by memory usage to filter the processes and exit and if the process takes much memory. Example 5: Display Process Sorted By a Memory Usage The username is highlighted in red, as seen from the output. The username can be different in your case: $ ps -ef | grep vboxuserĪll the detailed information on the processes run by username voboxuser is displayed on the terminal. For instance, the following command is used to get the processes run by a specific user, i.e., vboxuser. Example 4: Display Processes of a Specific UserĪs from the output of the ps -ef command, the processes are associated with the username running it. Only the process id column is printed on the screen. For instance, if the user has to get the process id’s of all the running processes, then it can be done using the following command: $ ps -ef | awk '' However, the users can extract specific column information about the running processes. Example 3: Display the PIDs OnlyĪs seen, the output of the ps -ef command is in detail. What if you want to get information about any specific process? For that, you can use the ps -ef command and pipe it with the gre command alongside its process name, as we did here to find all the information of the process named firefox: $ ps -ef | grep firefoxĪlthough the output is quite messy, you can find the relevant information easily, such as username process id, parent process id, and much more, as highlighted in the above image. You have seen in the above output that all the running processes are listed.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |