X-Git-Url: https://mattmccutchen.net/utils/utils.git/blobdiff_plain/40ea9b7868f2b7746e7cbabfba6aba982096392a..273c390351c42303171c25215304d1cfd6ca02d4:/stat2 diff --git a/stat2 b/stat2 new file mode 100755 index 0000000..e3b9845 --- /dev/null +++ b/stat2 @@ -0,0 +1,19 @@ +#!/bin/bash +# stat2: Display just about everything about a file except its data -- Matt McCutchen + +indent=$'|\t' +while [ "$#" != "0" ] ; do + echo "File $1" + echo "+-- Basic i-node information from \`stat':" + stat -- "$1" | sed -e "s/^/$indent/" + echo "+-- File version/generation and attributes from \`lsattr':" + lsattr -d -v -- "$1" | (read version attributes filenameignored && echo "$indent$version $attributes") + if [ ! -h "$1" ] ; then + echo "+-- POSIX ACLs from \`getfacl':" + getfacl --absolute-names --tabular -- "$1" | tail -n +2 | head -n -1 | sed -e "s/^/$indent/" + fi + echo "+-- Extended attributes in all namespaces from \`getfattr':" + getfattr --absolute-names -h -d -m '' -- "$1" | tail -n +2 | head -n -1 | sed -e "s/^/$indent/" + echo "'---------------------------------------" + shift +done