Skip to content

Instantly share code, notes, and snippets.

@andyj
Forked from anonymous/ubunut-*.nix-cheat-sheet
Last active September 7, 2015 21:32
Show Gist options
  • Save andyj/5de73e45a188fa5d75f1 to your computer and use it in GitHub Desktop.
Save andyj/5de73e45a188fa5d75f1 to your computer and use it in GitHub Desktop.
Ubuntu / *nix cheat sheet

##File size

Display the biggest top-20 directories

du -ah . | sort -rh | head -20

Display largest files

find [directory i.e. ~/] -type f -printf "%s - %p\n" | sort -n | tail -n 100

##General

Acess the ascii table quickly

man ascii

Find out what process are running

top

Create and password protect a zip file

zip -er [archive] [folder]

##History

Find all SSH commands in your history

history | grep ssh

Find last 10 history commands

history 10

Find the last SSH command and run it

!ssh will surch your history for the last SSH command (or whatever command you want i.e. !ls or !mkdir) and run it

!ssh

Find last SSH command and DON'T run it

!ssh:p will surch your history for the last SSH command (or whatever command you want i.e. !ls:p or !mkdir:p) and run it

!ssh:p

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment