Skip to main content

Posts

Showing posts with the label Unix Basic

Useful command Unix Part 2

sar command : The sar command is useful to monitor performance for cpu, memory and i/o. #sar -u 2 6 SunOS testing 5.10 Generic_150400-11 sun4u    09/22/2015 11:14:42    %usr    %sys    %wio   %idle 11:14:44      11       3       0      86 11:14:46      20       2       0      79 11:14:48      21       4       0      75 11:14:50      20       3       0      76 11:14:52      17       4       0      79 11:14:55      16       1       0      83 Average       18       3       0      80 Display the accumulated time CPU usage for every 2 seconds and 6 times. You should focus on %idle to see cpu load, when higher less cpu load. #sar -r 2 6 Display memory free and used every 2 second and 5 times. You should focus on kbmemfree and kbmemused for free and used memory. SunOS testing 5.10 Generic_150400-11 sun4u    09/22/2015 11:16:02 freemem freeswap 11:16:04 1298575  4204592 11:16:06 1298238  4199072 11:16:08 1298502  4211904 11:16:10 1298812  4219800 11:16:12 1298712  3923088 11:16:14 1298294  4

Useful commands in Unix

find command 1.- Sort the 40 largest files : #find /apps/ora11/product -xdev -ls | sort -nrk 7 | head -40 2.-Find a file name with a specific name : #find . -name "*.jar" -print 3.-Another variant could be without specifying the file extension : find . -name  jar  -print du command du provides output in a readable format, easier to be understood. You will be able to see the information in Bytes, Kilobytes, Megabytes, Gigabytes, etc. 1.- Check all directories and files size in gigas. #du -sh *  1.5G   agent11g  819M   agent12c  120M   apex  294M   assistants  414M   bin   27M   ccr    3K   cdata  2.4M   cfgtoollogs   42K   clone    1K   config  7.8M   crs   17K   csmig  156K   css  326M   ctx  2.8M   cv   2.-check size for 20 biggest files ordered by size #du -a | sort -n -r| head -20 iostat command 1.-Check disk performance usage in solaris : #iostat    tty        md10          md11          md12          md20           cpu  tin tout kps tps serv  kps tps serv  kps tps serv