Skip to content

Instantly share code, notes, and snippets.

@darkwater4213
Last active April 29, 2023 19:30
Show Gist options
  • Save darkwater4213/7226144a139b5022d9eb5af32fd9125d to your computer and use it in GitHub Desktop.
Save darkwater4213/7226144a139b5022d9eb5af32fd9125d to your computer and use it in GitHub Desktop.
Nushell fancy df
#! /usr/bin/env nu
# aliases df to a hacky way of turning it into a somewhat nice table
# because df | detect columns actually doesn't work all that well.
alias df = nu -c ( nu -c 'df | rg -e " +" -r " " | rg -Ue "\n" -r "] [" | rg -e "Mounted on\\]" -r "Mountpoint];" | rg -e "Filesystem" -r "[[Filesystem" | rg -e "\\] \\[$" -r "]]"' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment