Recursive sort-by-modification-time

This certainly isn’t rocket science, but it also is certainly not something you want to type more than once.

find . -type f -printf '%T@\t%p\n' | sort -n | cut -f2

And an application using feh:

find . -type f -printf '%T@\t%p\n' | sort -n | cut -f2 | xargs feh -F

And if you want the newest-written-to .log files, searching from the current working directory:

find . -name \*.log -type f -printf '%T@\t%p\n' | sort -rn | cut -f2 | head -30 | xargs -n 1 ls -lh

Related posts:

  1. Dealing with a directory with ~∞ files
    Got a directory with > 10K of files? Need to move them up one directory? mv will fail you: $ mv * .. -bash: /bin/mv: Argument list too long The......
  2. Securely deleting files
    I needed to switch cellphones, and given that my cell’s SD card had sensitive data, just formatting the card wasn’t sufficient — it’s trivial to recover files from high-level-formatted FAT......
  3. Running a command for all files whose name matches…
    I found a stray image named “img_1234.jpg” on a laptop and wanted to see if I already had it on my server. On my Mac I could use spotlight’s nifty......
  4. Verifying file integrity with debsums
    After upgrading my Ubuntu server, some security applications grumped about changed contents of some common binaries. Just to be safe, I wanted to verify them explicitly with debsums, but debsums......