Skip to content

Instantly share code, notes, and snippets.

@gargolito
Last active July 21, 2020 13:56
Show Gist options
  • Save gargolito/dcbc4644157406086f0e94b0b4cf1711 to your computer and use it in GitHub Desktop.
Save gargolito/dcbc4644157406086f0e94b0b4cf1711 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# can use with wildcards, loop will exit if the file is not found
function finfo () {
for file in $@; do
echo -e "\033[1;31m$file \033[0m"
test -f $file || break
part=$(df $(dirname ${file})|awk '/\/dev\// {print $1}')
debugfs -R "stat <$(stat -c %i ${file})>" $part 2>&1|head -n 12|awk '/time:/ {$2="";$3=""; print $0}'
echo ""
done | sed 's/ctime/changed/;s/crtime/created/;s/atime/accessed/;s/mtime/modified/'|column -c 6
}
finfo $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment