Shell commands

  1. ls
  2. pwd
  3. cal
  4. time
  5. date
  6. ps -e
  7. ps -ef
  8. ps -eF
  9. ps -ely
  10. lsof -p $$
  11. ALT .
  12. CTRL l
  13. CTRL u
  14. CTRL k
  15. CTRL c
  16. CTRL z
  17. CTRL R
  18. CTRL T
    1. type -a->Find out if ls is builtin or external command
    2. yum search shell / apt-cache search shell
    3. cat /etc/shells--Pathnames of valid login shells
    4. which bash--to display the full path of (shell) commands
    5. chmod +x hello.sh---set execute permission
    6. ./hello.sh--------------Running Your Script
    7. #!--used in scripts to indicate an interpreter for execution under Linux OS
    8. #!/bin/bash-----------script starts with it
  19. while loop

while [ condition ];

do

#put ur script here

done

vmstat 3

vmstat -m Memory Utilization

vmstat -a Active / Inactive Memory Pages

w username who is loges in for what
uptime
ps -Al/ps -elps -A/e
ps -AlF
ps -AlFH threads
ps -AlLm threads after processes
ps -ejH process tree
ps -eo euser,ruser,suser,fuser,f,comm,label security information
ps -U nandan -u nandan u : process run by nandan
ps -auxf | sort -nr -k 4 | head -10 top 10 memory consumer
ps -auxf | sort -nr -k 3 | head -10 top 10 cpu consumer

free displays the total amount of free and used physical and swap memory

iostat report statistics

mpstat -P ALL    activity of each processor

date; unzip; touch; strip; finger; mount; gasp; fsck; more; yes; uptime; top; man ;unmount; sleep;