11-04-2008
6,402,
678
Join Date: Mar 2008
Last Activity: 8 June 2016, 9:58 PM EDT
Posts: 6,402
Thanks Given: 288
Thanked 678 Times in 647 Posts
If the files are in the same directory and there are no subdirectories. Finding the newest file on the whole computer is a different ball game.
1) ls -latr |grep -v \^drw | tail -1
2) ls -latr | grep -v \^drw | tail -2 > files.lst
3) find . -type f -size +0c -exec ls -lad {} \;
OR to check an individial file
if [ -s file_name ]
then
echo "File is not zero size"
fi