Cool Scripts and One-liners

Read this article in:

Find latest 20 files in the folder (on mac):

find . -type f ! -name '.DS_Store' -exec stat -f '%m %Sm %N' \
  -t '%Y-%m-%d %H:%M:%S' {} + | sort -nr | head -20 | cut -d' ' -f2-

Delete empty dirs:

find . -name '.DS_Store' -type f -delete
find . -type d -empty
find . -type d -empty -delete

.

Please login to post comments: