![]() It also shows information about CPU and memory utilization of a list of running processes. The top command (table of processes) displays the processor activity of your Linux box and also displays tasks managed by the kernel in real-time. In this article, we are trying to explore the top command which is one of the most frequently used commands in our daily system administrative jobs. $ cat mem.In our previous articles, we have covered the basics of ls command and cat command. The following script displays the total, used and free memory space. List of users logged in and what they are doingġ5:53:55 up 230 days, 2:38, 7 users, load average: 0.19, 0.26, 0.24 Total number of unique users logged in currentlyĠ.99s reshma pts/5 192.168.2.1 15:26 3:01 1.02s 0.99s custom-download.sh ![]() $ cat loggedin.shĮcho "Total number of unique users logged in currently"Ĭat /tmp/a| sed '1,2d' | awk ''Įcho "List of users logged in and what they are doing" This script displays few information about the currently logged in users and what they are doing. Display Logged in users and who is using high CPU percentage You can execute the above script as shown below. Ps -e -o pcpu,cpu,nice,state,cputime,args -sort pcpu Ps -e -orss=,args= | sort -b -k1,1n # sorted bases rss value Ps -e -o pcpu,cpu,nice,state,cputime,args -sort pcpu # sorted based on %cpuĮcho "List of processes based on the memory Usage" # By default, it display the list of processes based on the cpu and memory usage #Įcho "List of processes based on the %cpu Usage" #List processes based on %cpu and memory usage This script list the processes based on %CPU and Memory usage, with out argument (by default), If you specify the argument (cpu or mem), it lists the processes based on CPU usage or memory usage. List Processes based on %CPU and Memory Usage
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |