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.
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.
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 are still looking for answer please try below one :
Go to the directory in which file are available and execute below command
ls -1|while read file; do tail -1 $file; done