CHEAT SHEET & REFLECTION

Dale Gaughan
Communication & New Media
3 min readJan 22, 2015

CHEAT SHEET

Commands — Meanings

pwd — print working directory

hostname — my computer networks name

mkdir — make directory

cd — change directory

ls — list directory

rmdir — remove directory

pushd — push directory

popd — pop directory

cp — copy a file or directory

mv — move a file or directory

less — page through a file

cat — print the whole file

xargs — execute argument

find — find files

grep — find things inside files

man — read a manual page

apropos — find what man page is appropriate

env — look at your environment

echo — print some arguments

export — export/set a new environment variable

exit — exit the shell

sudo — DANGER! become superuser root DANGER

chmod — change permission modifiers

chown — change ownership

CTRL-c — stop current command

CTRL- z — sleep program

CTRL- a — go to start of line

CTRL- e — go to end of line

CTRL- u — cut from start of line

CTRL- k — cut to end of line

CTRL- r — search history

REFLECTION

A command line is a user interface to a computer’s operating system where the computer user types in a command to respond to a visual prompt and receives a response back from the system, and then enters another command and so on. The command line enables the user to perform tasks by using commands. When the user enters in a command, the output is shown on the next line. The user can create directories, move files around, and search through files.

The command line is the easiest and simplest coding language. The first step is to hold down the command button and hit the spacebar. A search bar will pop up and the user needs to type in “terminal”. A black box will pop up and the user can now type in commands. It is important to memorize each one of the commands in order to properly interact using the command line.

There are commands to do all sorts of actions and get the desired outcome. When typing in commands, it always looks like “(User first name)-MacBook-Pro:~ (users first and last name)$”. The user types in the command after the dollar sign. It is important to press enter after every command. The next line is the output. It is extremely important to use the correct spelling to get the desired outcome.

When the user first opens up their command line interface, they are in their own personal directory. When it mentions “directory” it means folder. It is possible to change directories using “cd” or change directory. It is also possible to create or remove a directory. In order to create a directory, use “mkdir”. To remove a directory, use “rmdir”. Another important key fact to remember when using the command line is when the user removes a file in the command line, it is not sent to their recycling bin. When using files in the command line, it is necessary to use the file extension. If the user is talking about a text file, write the name and add “.txt” at the end. If the user is talking about a music file, you will use “.mp3” at the end. Different files require different file extensions.

Learning the command line is very difficult and must be practiced every day to fully understand and utilize the different commands. It is meant as a prerequisite to SQL and Python. Command line is also meant to be used as a shortcut when interacting with a computer. When the user has a firm grasp on command line, they will have the ability to control their computer and find and move files very quickly. Moving through each of the tutorials, one wrong spelling caused the whole command to fall apart. Therefore, it does require a lot of patience and observation in order to ensure proper commands. Even further, it was difficult to understand all of the programming language used in the tutorial. However, after memorizing the codes, it is easier to understand the responses after inputting each command. While following the tutorial, I misspelled one command, and suddenly, all the following commands were messed up. Although I found it very interesting, I don’t believe I will be using it on a regular basis.

--

--