The Unix/Linux ecosystem is full of nifty tools and commands which makes system administration fun and painless. One of such commands is “watch(1)” which allows you to do nifty things like watching any particular folder or file size in situations when some script is creating bunch of files inside a folder or if you just want to watch the growing size of a backup file while the backup script is running.

For this purpose, you could just run the following command and it’d show you updated file sizes every 2 seconds.

Instead, if you need to watch a file content, for example, an error or access log, please use “tail(1)” for this purpose. For example, if you needed to watch the Apache web server access log, you could use a command like this:

and it’d show new lines added to your screen. Please do note that access logs can get really busy though, depending on the traffic coming to the server.

Share →
%d bloggers like this: