How to copy the top 10 most recent files from one directory to another?
cp
seems to understand back-ticked commands. So you could use a command like this one to copy the 10 latest files to another folder like e.g. /test
:
cp `ls -t *.htm | head -10` /test
ls -lt *.htm | head -10 | awk '{print "cp " $9 " ../Test/"$9}' | sh