Skip to content

Instantly share code, notes, and snippets.

@2ec0b4
Created November 1, 2014 14:53

Revisions

  1. 2ec0b4 created this gist Nov 1, 2014.
    7 changes: 7 additions & 0 deletions last-modified-files.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    #!/bin/bash

    cd /path/to/dir/

    find . -type f -print0 | xargs -0 stat -f "%m %N" | sort -rn | head -10 | cut -f2- -d" "
    # or with modification time
    find . -type f -print0 | xargs -0 stat -f "%m %t%Sm %N" | sort -rn | head -10 | cut -f2-