The Unix/Linux ecosys­tem is full of nifty tools and com­mands which makes sys­tem admin­is­tra­tion fun and pain­less. One of such com­mands is “watch(1)” which allows you to do nifty things like watch­ing any par­tic­u­lar fold­er or file size in sit­u­a­tions when some script is cre­at­ing bunch of files inside a fold­er or if you just want to watch the grow­ing size of a back­up file while the back­up script is run­ning.

For this pur­pose, you could just run the fol­low­ing com­mand and it’d show you updat­ed file sizes every 2 sec­onds.

Instead, if you need to watch a file con­tent, for exam­ple, an error or access log, please use “tail(1)” for this pur­pose. For exam­ple, if you need­ed to watch the Apache web serv­er access log, you could use a com­mand like this:

and it’d show new lines added to your screen. Please do note that access logs can get real­ly busy though, depend­ing on the traf­fic com­ing to the serv­er.

Share →
%d bloggers like this: