Skip to content

Instantly share code, notes, and snippets.

@endolith
Created March 13, 2009 14:17
Show Gist options
  • Save endolith/78575 to your computer and use it in GitHub Desktop.
Save endolith/78575 to your computer and use it in GitHub Desktop.
fish bash cheatsheet
# I hate the command line.
# I use fish as my default shell http://www.fishshell.org/
# List disk usage of each subdirectory
du -s --si *
# Access one computer from the other, regardless of whether Internet is down, Dynamic DNS is down, Wireless is down, or computer is outside of LAN
# Tomato assigns different hostnames to different MAC addresses, regardless of which computer it is, so I have a separate _wired hostname
function desktop --description 'Connect to desktop machine through SSH'
if ssh desktop-hostname -l desktop-username -XYC
else
ssh routers.dynamic.dns -p 12345 -l desktop-username -XYC
end
end
function laptop --description 'Connect to laptop through SSH'
if ssh laptophostname_wired -l laptop-username -XYC
else
if ssh laptophostname-wireless -l laptop-username -XYC
else
ssh routers.dynamic.dns -p 54321 -l laptop-username -XYC
end
end
end
function df --description 'Use SI units by default'
df --si
end
# Set default help browser
~> set BROWSER xdg-open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment