As I was watching several google search keywords being used by most site visitors around this linux blog, I noticed several search keywords that led most users into this site
One of the recent google keyword search from CA,USA was:
~~~~~~~~~~~~~~~~~~~~~~~~~~~
linux watch ls directory
~~~~~~~~~~~~~~~~~~~~~~~~~~~
with equivalent google search URL:
google search keyword
and in turn, google replied with this URL
from one of my Linux SysAd blog entries as you can see.
However, the returned URL is about ls command usage but not watching directory and files proactively from display screen. Yes, it is somehow related but needs more command tweaking and another linux command.
So, I am creating this blog entry for monitoring directory and files proactively live from your display screen via command line terminal.
Here's several ways on how to watch live directory/files changes from your display screen.
Fire up your first terminal and issue
# cd /tmp
# watch ls -C
Then fireup your second terminal and issue the commands below
# cd /tmp
# touch A1
# touch A2
# touch Z1
During the creation of A1, A2, Z1 files using linux touch command, you need to switch and focus your screen display with the terminal which was first launched.
Here's a way to watch them change on the fly sorted by ctime or creation timestamp.
From the first terminal, issue
# watch ls -Cc
By default, 'watch' linux command refreshes every 2 seconds. You can modify it using -n watch parameter like so
# watch -n 0 ls -CC
which waits for 0.1 seconds for file changes to be displayed out from your screen terminal.
If you are only interested to file changes owned by user vertito, simply
# watch -n 0 'ls -Cc | grep vertito'
Note:
1. printing characters are being stripped by watch linux command
2. any terminal resize would not do screen repaint automatically but after the next watch update
Now, to watch your ethernet TX/RX packets from ethernet device using watch, simply
# watch -n 0 ifconfig eth0
The above is like the command line version of NIC network general properties in windoze. You can also use these when troubleshooting network card and ethernet link connectivity issues or any network congestion issue from your current broadcast network.
If somebody is transferring FTP files into one of your managed host or partition, or an external host is uploading large files into your shared SAMBA folder and you want to watch your current disk/partition space usage proactively while the transfer is occurring, simply
# watch -n 0 df -ah
# watch -n 0 du -sh
To watch your host memory and swap resources proactively using watch
# watch -n 0 free
# watch -n 0 cat /proc/swaps
partially similar to top linux command.
To watch your queued mail proactively from terminal (postfix or sendmail), simply
# watch -n 0 mailq
I guess I have monitored and reacted proactively from my blog site as well because of this entry name.
There's a lot more live monitoring of logs and statistics that can be combined with watch linux command, you can create your own combination of linux command and shell scripts too!
That's all folks, enjoy, thanks for the black box tip!
Subscription
Categories
- HowTos (612)
- Linux Devices (40)
- Linux Diggs (620)
- Linux News (1541)
- Linux Videos (24)
Recent Posts
Blog Archive
-
▼
2007
(340)
-
▼
September
(58)
- Dear Linux SysAd Blog Readers
- Proactive monitoring from linux terminal
- deleting new lines and return line from text file
- Google chat setup using PSI howto
- PSI messenger - a truly promising open messaging a...
- Google chat setup using GAIM Pidgin howto
- Linux command line shell variables defined
- ls - displaying directory contents in many ways
- Control of alternative linux executables
- Searching using whereis linux command
- Witchy which linux command
- NeroLinux - diehard Nero burning software
- Google Sky - Explore and Rediscover the Sky
- Celestia - 3D Earth and Sky visualization
- Earth3D - real-time 3D Earth visualization
- GcStar - managing personal collection items
- DStat - resource statistics linux tool
- Bandwidth Monitor-NG - terminal-based interface ba...
- KNemo - KDE network interface monitoring tool
- EtherApe - graphical network activity monitoring tool
- Beauty of Math using Linux
- print leading/trailing lines before/after a matchi...
- Nagios Monitoring - install and generic setup howto
- ChRT- change real-time attribute process scheduling
- squeezed out multiple commented lines
- UNIX to DOS text file format converter
- totally squeezed out multiple blank lines
- squeezed multiple blank lines into single line
- fmt - simple optimal text formatter
- Linux backup powered by RDiff-Backup
- Linux Ping command explained
- read and display text file from terminal
- URLView - URL and email extractor
- TFTP server - setup and install howto
- NMap - Linux port scanning
- removing garbage characters from screen terminal
- invert string match using grep
- RDesktop - remote desktop howto
- Graveman on Linux - burn baby burn burn
- HTOP - interactive process viewer alternative
- Caching DNS server install howto
- BitTorrent - downloading large files made easy
- PHPAlbum - web photo album install howto
- MRTG graph creation with Cisco routers
- Tree view of directories and file listings from co...
- MAC address packet filtering using IPTables
- GTK-based GNOME Linux Tools
- Linux backups powered by RSnapShot
- MRTG tutorial, install and howtos
- FindSMB - view shared folders from network
- Squid - upgrade and install howto
- prompt and press a key between script lines
- Devede - DVD/VCD video authoring and creation tool
- display file and file system status
- determine file type
- GNOME GUI task scheduler install howto
- Linux backups powered by Rsync
- KPackage - GUI package administration and manageme...
-
▼
September
(58)
Tuesday, September 25, 2007
Proactive monitoring from linux terminal
Subscribe to:
Post Comments (Atom)
ILoveTux - howtos and news | About | Contact | TOS | Policy
0 comments:
Post a Comment