Skip to content

Instantly share code, notes, and snippets.

@tommyskott
Last active August 19, 2020 08:48
Show Gist options
  • Save tommyskott/899a35ee9afe7590093bdca1c60e4106 to your computer and use it in GitHub Desktop.
Save tommyskott/899a35ee9afe7590093bdca1c60e4106 to your computer and use it in GitHub Desktop.

Ubuntu

Package manager

sudo apt-get update # update repos
sudo apt-get upgrade # upgrade installed packages
sudo apt-get dist-upgrade # upgrade system dist

Disk and RAM

df # disk space
df -h # disk space human readable
df -hT /dev/xvda1 # disk space human readable for specific disk

free -m # show free RAM
free -mh # show free RAM human readable
Copy ssh key to server

ssh-copy-id user@server

Handy commands
cd - # switch between the two last dirs
cd # shorthand for cd to home dir ~
ls -lah # human readable list

history # shows all entries from bash history
history | grep pwd # search for command in bash history
!48 # will re-run command nr 48 from history

lsb_release -a # show system info
lsb_release -h # show system info help

uname --help # show system info help
uname -a # show all system info
uname -r # show kernel version
uname -i # bit version

ps # list any running processes
ps -aux # list system processes
top # real time processes
sudo apt-get install -y htop # graphical top command

sudo -i # login as root user if you need to cd into folders that require root permission





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