Useful shortcuts for vi editor

Thursday 19 January 2017

output columns of top command

Columns:
PID     -> Process ID   
USER    -> Process owner   
PR      -> Priority of process 
NI      -> Nice value of process  
VIRT    -> Virtual memory using by process
RES     -> Physical memory using by process  
SHR     -> Shared memory of process
S       -> Status of process (R-> Running, S-> Sleeep, Z-> Zombie, D-> Uninterruptible Sleep, T-> Traced or Stopped)
%CPU    -> CPU usage of process (as percent)
%MEM    -> RAM usage of process (as percent)
TIME+   -> Total time activity for process 
COMMAND -> indicates of process name

Info:
PR = 20 + NI (PR-RT -> Real Time system process)
PR -> (0 is the highest priority and 39 is the lowest priority)
NI; Nice value (−20 is the highest priority and 19 is the lowest priority)
VIRT; Virtual image (kb) -> disk storage + RAM
RES;  Resident size (kb) -> RAM (non-swapped physical memory)
SHR; Shared mem size (kb)-> RAM (shared memory)

Extras:
Set priority of a process before start;
nice -n 19 tar cvzf archive.tgz largefile

Change priority of a process;
renice -n -20 -p process_id

Ref: