Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save fedir/5684002 to your computer and use it in GitHub Desktop.

Select an option

Save fedir/5684002 to your computer and use it in GitHub Desktop.
Find files detailed statistics in shell : filesize, path, date of last access, date of last status change, date of last modification (in locale format; in unixstamp), ordering by size
#!/bin/bash
# ref. : man find
# printf options
# %p Files name.
# %P Files name with the name of the command line argument under which it was found removed.
# %s Files size in bytes.
# %Ak Files last access time in the format specified by k
# %Ck Files last status change time
# %Tk Files last modification time
# Time options k
# c locales date and time (Sat Nov 04 12:02:33 EST 1989)
# @ seconds since Jan. 1, 1970, 00:00 GMT.
find $1 -type f -printf '%s\t%P\t%Ac\t%Cc\t%Tc\t%A@\t%C@\t%T@\t\n' | sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment