For (Software Command)

From MattWiki
Jump to navigation Jump to search

Example For command's One liners

  • Lists the current directory every 5 secs for 1000 cycles
for ((i=1;i<=1000;i+=1)); do clear; ls -hl; sleep 5; done
  • Run the emailstat command every 30 secs
for a in `seq 1 10`; do clear; emailstat today; sleep 30; done