Skip to content

Instantly share code, notes, and snippets.

@chockenberry
Created March 4, 2024 18:51
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chockenberry/f278781a36ce217c82a0d280765c3622 to your computer and use it in GitHub Desktop.
Save chockenberry/f278781a36ce217c82a0d280765c3622 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" | cut -f 3 -w`
/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