DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

File Monitor

04.05.2007
| 6416 views |
  • submit to reddit
        I was constantly needing to see real time file stats so I wrote this little script to help me out...

Usage:
filemon FILE

FILE is the file you want to monitor.

#!/bin/bash

# File Monitor  btodd3
#
# 3/14/07	Initial Version

function list () {
ls -l
sleep 1
}

while true; do
list | grep $1
done
    

Comments

Snippets Manager replied on Thu, 2007/04/05 - 3:17pm

cool!

Snippets Manager replied on Fri, 2007/04/06 - 11:13pm

watch -n 1 "ls -l"