I just found out a few days ago that `-F` works with multiple files, too. When there's new content on one, tail prefixes the output with a header, telling you what file it is.
I've used that to watch all logs apache and descendant processes could be writing to:
A lot of people only know about its use for literally killing a process. But as an example of where I find myself using it fairly often is:
kill -USR1 <dd>
where <dd> is the process ID (obtained from ps) for the dd command.
Instead of killing dd, it reports back how much has been read/copied so far. Especially useful for working with large files and you decide you want to guestimate how much longer the copy will take.
17 comments
[ 3.0 ms ] story [ 48.6 ms ] threadjk, but also not.
w !sudo tee % in vim, even tho that's not really directly a unix thing?
Extras: sort, uniq, sed, sftp, apropos, man
This will also follow a log file if it rotates.
I've used that to watch all logs apache and descendant processes could be writing to:
ls -l
the "alias" command in a file for setting up quick-commands
But in truth, it's the bash scripting 'glue' that holds everything together.
kill -USR1 <dd>
where <dd> is the process ID (obtained from ps) for the dd command.
Instead of killing dd, it reports back how much has been read/copied so far. Especially useful for working with large files and you decide you want to guestimate how much longer the copy will take.