How to tail the last line of multiple files using "tail -1 */filename" How to tail the last line of multiple files using "tail -1 */filename" linux linux

How to tail the last line of multiple files using "tail -1 */filename"


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