tail */filename
works, but
tail -1 */filename
doesn't. Why is this? And is there a 1 liner to perform this task without loops?
head -1 */filename
works for some strange reason.
Use the tail command to write the file specified by the File parameter to standard output beginning at a specified point. This displays the last 10 lines of the accounts file. The tail command continues to display lines as they are added to the accounts file.
MultiTail is an improvement on the well-known program tail, which allows you to view multiple files at the same time in the same window. a package for most distros, and you can also install it from source. Tip of the Trade: MultiTail makes it possible to watch two files simultaneously in real-time.
include ssh-api ssh = getSSHConnection(); cmd = 'cd to folder'; ssh. command(cmd); cmd = 'tail -f log. txt'; ssh. command(cmd); wait for special event to occur... cmd = 'stop the tail now!
While head
works with -1
on multiple files, tail
does not. But it works with the -n
argument instead:
tail -n 1 */filename
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With