Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

while 1; do ls; sleep 5; done


Watch has a nice difference flag, so that whatever is different from the last iteration is highlighted. As in:

watch -d sudo netstat -tnp


Closer to watch -

  while 1; do datetime; ls; sleep 2; done


I used to do:

  while true; do date; ls; sleep 2; clear; done
but got tired of it and searched apt for watch.

  apt-get install procps


I used to do:

  while true; do date; ls; sleep 2; clear; done
but got tired of that and installed procps via apt.


1: command not found


try this instead:

while true; do ls; sleep 5; done




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: