user3139545
user3139545

Reputation: 7394

Piping ls to less and have real time monitoring of filesystem changes

How would I make something like the following work in Linux?

ls -l | less

While in less I hit F and now I would like to be able to automatically monitor filesystem changes from the ls command? I understand that this is not the usecase of the above command but what would the closes thing be that can do what I want?

Upvotes: 0

Views: 69

Answers (2)

Jean-Christophe Meillaud
Jean-Christophe Meillaud

Reputation: 2071

Use watch command which by default runs the passed command in shell and update every 2s by default. You can still change the delay.

watch -n 0.5 ls -l

Upvotes: 2

P.P
P.P

Reputation: 121407

You can use watch command:

watch 'ls -l'

Upvotes: 1

Related Questions