Will Clarke

UNIX Shell For Dummies


Learning a few UNIX commands can be useful. Since it’s the ‘default’ programming language that pops up when you run the Terminal, it’s worth knowing a few of the more basic commands: These are sorted by ‘difficulty’ - you should know the first ones first.

cd - changes the current directory.

ls - list files or directories in current directory

pwd - print working directory. Shows where you are (relative to the root folder)


cp - copy

cp -r - copy recursively. Useful for directories.


rm - remove

rmdir - remove directory

Moving / Renaming

mv - move

Creating Folders

mkdir - creates a new directory

mkdir -p - creates a series of new directories.

Getting help

man - find the manual

Showing files

cat - show pure text version of the file.

less - outputs text with more features.

sort - guess what this one does…

Comparing files

diff - shows the differences between two files

Finding programs


Changing File Permissions


Search for text


I’ve written a quick primer on UNIX file permissions here

Grep’s a fairly big topic:

Grep Book
Grep Book


Flags are optional parameters that you can pass in to a shell command. We’ve met some already; here’re two: ls -la. You can see a full list of available options under the man page of the commands.


shell unix bash