Info

This page will serve as a collected reference of the commands introduced in the lecture videos and slides. It is not intended to replace the man pages or watching lectures or reading over the slides, but will hopefully help you navigate the commands we have shared.

Warning

This is the first time we are making this page so we make no guarantees about the completeness of this guide.


Linux Commands

Basic Shell Commands

ssh - LEC 01

Log in to a remote Linux server (e.g., attu)

pwd - LEC 01

Print current working directory

cd - LEC 01

Change working directory

ls - LEC 01

List files in working directory

man - LEC 01

Bring up manual for a command

exit - LEC 01

Log out of shell


System Commands

clear - LEC 01

Clears all output from console

date - LEC 01

Output the system date

cal - LEC 01

Output a text calendar

uname - LEC 01

Print information about the current system


Directory Commands

ls - LEC 01

List files in working directory

pwd - LEC 01

Print current working directory

cd - LEC 01

Change working directory

mkdir - LEC 01

Make a new directory

rmdir - LEC 01

Remove the given directory (must be empty)


File Commands

cp - LEC 01

Copy a file

mv - LEC 01

Move a file (also used to rename files)

rm - LEC 01

Remove the given file

touch - LEC 01

Create empty file, or change time-modified



Unix File System

Relative Directories

. - LEC 01

References the working directory

.. - LEC 01

References the parent of working directory

~username - LEC 01

username’s home directory

~/Desktop - LEC 01

Your desktop


Unix File System

/ - LEC 01

Root directory that contains all directories

/bin - LEC 01

Applications/programs (i.e. binaries)

/dev - LEC 01

Hardware devices

/etc - LEC 01

Configuration files

/home - LEC 01

Contains user’s home directories

/proc - LEC 01

Running programs (processes)

/tmp, /var - LEC 01

Temporary files

/usr - LEC 01

Universal system resources



Text Editors

nano - LEC 01

Very simple editor

vim - LEC 01

More advanced text-editor

emacs - LEC 01

More advanced text-editor

Vim Basics

:w - LEC 01

Write (save) the current file

:wq - LEC 01

Write (save) the current file and exit

:q! - LEC 01

Quit, ignoring all changes

i - LEC 01

Go into insert mode

Esc - LEC 01

Go back to normal mode

hjkl - LEC 01

Move cursor left, down, up, right

u - LEC 01

Undo last change

x - LEC 01

Delete character


Emacs Basics

C = control key, M = alt/meta key

C-x C-f - LEC 01

Read a file into emacs

C-x C-s - LEC 01

Save a file to disk

C-x C-c - LEC 01

Exit emacs

C-s - LEC 01

Search forward

C-r - LEC 01

Search backwards

C-v - LEC 01

Scroll to next screen

M-v - LEC 01

Scroll to previous screen

C-x u - LEC 01

Undo