Linux Cheat Sheet


Linux is hard. Really hard. I didn’t start getting good at it until I started writing everything I learned down. Maybe this stuff will help someone else.


Recording sessions

File system

Disk management


Archiving and compression

Finding stuff

Search the root directory for anything with ‘something’ in it and pipe that to less:


Editing Files


User management

Release and renew IP

  1. sudo dhclient -r
  2. sudo dhclient
  3. sudo ifdown eth0
  4. sudo ifup eth0

Compiling programs

  1. ./configure
  2. make
  3. sudo make install install as root

Environment Variables


Set time zone

  1. sudo rm /etc/localtime
  2. sudo ln -s /usr/share/zoneinfo/US/Pacific /etc/localtime


Generating a new ssh key

For the best security, you should be using one SSH key per device you use. An SSH key can optionally be password protected for extra security. When you generate a key, two files are created. One is the private key (don’t give it to anyone), the other is the public key, which is meant to be public.

  1. Make sure you don’t already have an ssh key you can use, check ~/.ssh
  2. ssh-keygen -t rsa -C ""
  3. ssh-add ~/.ssh/id_rsa

Using ssh-add puts your private key into ssh-agent that stores your password and private key while your machine is running

Make sure your ssh-agent is running with ssh-agent bash

System info

Ubuntu unity