2

Suppose I am extracting a huge file or slowly building up a huge file. Is there a way to have ls -lh "on" much like tail -f, so that I can constantly see the size of the file grow until I decide to terminate it?

hobbes3
  • 615
  • 2
  • 10
  • 23

2 Answers2

10

ls(1) doesn't have any feature built in to do that, but you can probably get what you want with the more generic watch(1) command.

watch ls -lh will run that ls command every two seconds (by default; see the manual page for details) and show the output nicely.

Daniel Pittman
  • 5,842
  • 1
  • 23
  • 20
-1
while [ true ]; do clear; ls -lah /path/to/dir; sleep 30; done
Mark
  • 323
  • 2
  • 5