Skip to content

Instantly share code, notes, and snippets.

@ayn
Forked from chockenberry/df.sh
Last active March 5, 2024 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayn/793dca5b76d40c01745761b083611cc1 to your computer and use it in GitHub Desktop.
Save ayn/793dca5b76d40c01745761b083611cc1 to your computer and use it in GitHub Desktop.
df Replacement
#!/bin/sh
if [ ! -z "$*" ]; then
echo "this is ~/bin/df, use /bin/df"
exit 1
fi
protect=`mount | grep -v "read-only" | grep "protect" | cut -f 3 -w`
nosuid=`mount | grep -v "read-only" | grep "nosuid" | sed -n 's/.*\(\/Volumes\/.*\) (.*/\1/p' | sed 's/[[:space:]]*$//' | sed 's/.*/"&"/'`
/bin/df -PH $protect $nosuid | cut -f 2- -w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment