4
votes
1answer
48 views

Unix /Linux show the last part of a file with line numbers

Is there a way to make tail show a line number in front of the last lines it show so that it show the growth of the file when using it in a script. e.g: when using it in a script like this one: ...
0
votes
1answer
77 views

Running `tail -F $file` then removing outputted lines

Long story short; I'm running this command to stream a forever growing audio file audio.mpg into ffmpeg tail -F audio.mp3 | ffmpeg -i - http://127.0.0.1:8090/feed1.ffm audio.mp3 is being SSH'd from ...
5
votes
2answers
3k views

Opposite of tail: all lines except the last n lines

How can I discard the last n lines of a file with a unix command line filter? That would be sort of the opposite of tail: tail discards the first n lines but pipes the rest through, but I want the ...
2
votes
1answer
404 views

running tail -f on a server which connects to another server over ssh

I have been using the following command to connect to a server, which connects to another server and runs tail -f on it: ssh server1.com ssh server2.com tail -f file.log This so far works fine. ...
0
votes
1answer
521 views

How to find the last match of a string in a bunch of files

I have a bunch of files, I'd like to find the last match of a string in each of them. grep text *.file gives me all the matches not the last ones. ls *.file | xargs grep text | tail -n 1 gives me ...
1
vote
2answers
511 views

tail stops working

I am tailing a file in unix. It stops working sometimes and I have to re-run the command. Anyone know why this happens?
1
vote
1answer
328 views

Tail the filename, not the file

In UNIX (OS X BSD to be precise), I have a "tail -f" command on a log file. From time to time I want to delete this log file so I can more easily review it in my text editor. I delete the file, and ...
1
vote
1answer
854 views

Unix “tail” that clears screen on truncation?

Using tail -F to follow a file that might not exist yet, and it works across truncations, as follows: tail: cannot open `mylog.log' for reading: No such file or directory tail: `mylog.log' has ...