How To Monitor File System Changes In Linux In Real Time

Share on FacebookShare on Google+Tweet about this on TwitterPin on PinterestShare on RedditPrint this page

Here’s how to monitor file system changes in Linux in real time:

1. Issue the following command at the terminal –

watch -d -n 1 ‘df; ls -FIAt;’

Monitor File System Changes In Linux In Real Time

The above command will monitor your file system for any changes and will refresh the information every second. If you want to change the interval of information refresh, change to value after ‘n’ to some other number. For example, to refresh the information every 10 seconds, issue the following command – watch -d -n 10 ‘df; ls -FIAt;’

2. Now let us test if the command really works. Note the file named ‘aYAGB11YrSs.webm’ in our home folder. As soon as we delete the file, the information is updated on the screen.

Monitor File System Changes In Linux In Real Time

Monitor File System Changes In Linux In Real Time

3. Also, notice that we immediately got an updated information about 3 new files copied in to the home folder. A large change in ‘Used’ and ‘Available’ capacity of the mounted file systems also alerts you about any changes in the file system (large amount of data being copied / deleted).

Monitor File System Changes In Linux In Real Time

One Comment

  1. Eric B. says:

    Thanks. I have been looking for something like the watch command for a while, but just didn’t know of it. This is really useful.