--- /dev/null
+#!/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