# # watch
APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

2003/12/28 watch

I've removed advertising from most of this site and will eventually clean up the few pages where it remains.

While not terribly expensive to maintain, this does cost me something. If I don't get enough donations to cover that expense, I will be shutting the site down in early 2020.

If you found something useful today, please consider a small donation.

Some material is very old and may be incorrect today

© December 2003 Tony Lawrence

(Linux) Runs some other command at regular intervals and shows you the result. Useful for when you are constantly checking on something like diskpace, the size of a file, some network connection: whatever, it really doesn't matter. Just run "watch" with your command , enclosing it in quotes if you are using pipes:

watch 'ps aux | grep myprocess'

The default is to run your command every two seconds, which is usually way too soon. There's a handy -d flag that highlights differences from the last run. You may want to add -c to that if your really need to notice a change whether or not you happened to be looking when it happened.

Finally, "watch" only displays the first screenful of output.

# watch logins every 10 seconds, marking changes cumulatively
watch -n 10 -dc w

If you found something useful today, please consider a small donation.

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> watch

Inexpensive and informative Apple related e-books:

Take Control of Pages

Take Control of Numbers

Take Control of OS X Server

Are Your Bits Flipped?

Take Control of Preview

More Articles by © Tony Lawrence

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

The psychological profiling [of a programmer] is mostly the ability to shift levels of abstraction, from low level to high level. To see something in the small and to see something in the large. (Donald Knuth)

Linux posts

Troubleshooting posts

This post tagged:




Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode