Thursday, March 27, 2008

Tail the newest file in a directory

tail -f `ls -tr | tail -1 | head -1`

1 comment:

Unknown said...

tail -f `ls -tr | tail -1 | head -1`
Isn't this superfluous? I think
$ tail -f `ls -t | head -1`
would do it.