ls -rt will show you the files most recent first.
To move the most recent five to a subdirectory:
mkdir -p recent && find -maxdepth 1 -type f -printf '%T@ %P\n' | sort -rn | cut -d' ' -f2- | head -n 5 | xargs -I{} mv {} recent
Tuesday, March 19, 2019
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment