Skip to content

Instantly share code, notes, and snippets.

@adamburvill
Last active August 29, 2015 13:57
Show Gist options
  • Save adamburvill/9813916 to your computer and use it in GitHub Desktop.
Save adamburvill/9813916 to your computer and use it in GitHub Desktop.
Ubuntu CLI Useful Commands

For multiple screens via one bash interface (edit a file and restart a service without losing place in file)

 $ screen 

Output content of file to terminal

$ cat

Search a file for a keyword/regex

$ grep

List of current running processes. You can also grep a ps list.

$ ps -aux 
$ ps -aux | grep keyword

Disk Space Usage and Free Memory commands

$ df -m
$ free -m

List of incoming/outgoing network connections

$ netstat -ap

List of last user connections with optional user argument

$ last carzy

List of recently used commands

$ history

Run last used command as sudo

$ sudo !!

Show list of running tasks (this updates on the fly too as opposed to ps)

 $ top

Show disk usage for file or folder, -h = human readable, -s = summary (size of folder rather than folder and all files in folder)

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