What A Beginner Can Gain From Learning The Command Line Basics

Amber Anne Mary Fowke
Communication & New Media
3 min readJan 20, 2015

Participating in a Command Line Interface Crash Course taught me much about the inner-workings of my computer. Until embarking on this command line project, I had never done any work with a computer’s command line before. I feel that I particularly benefitted from learning simpler functions like pwd, mkdir, grep, man and apropos, as I can see myself using these in the future. Learning about directories, files and .txt files and how they can be altered with the command line allows one to better know how programs and functions work when not simply dealing with the GUI (what the computer displays to its user). I still consider myself a beginner with the command line, but I have definitely learned much about the functions that I was taught in Zed A. Shaw’s crash course.

Previously, it had seemed intimidating to do anything with the command line, but once I had started with simple functions like learning pwd and mkdir, I was off to a good start. I appreciate that pwd was the first function I learned, as I was comfortable in knowing that I could check myself along the way.

Working with directories and files showed me how these are dealt with in the command line. Most of the directory and file functions that I learned to do on the command line were functions that I often perform using the GUI. Now I know how to change things like a directory path through computer programming. It is good to know that I can perform these functions both with the GUI and know how I am, through GUI functions, using the command line interface.

Each command line function learnt enables one to better understand how elements of a computer are controlled. For example, after doing much work in moving, altering and viewing .txt files on the command line, I will be aware of these behind-the-scenes elements each time I use a text file on a computer.

Using grep, man and apropos were three key functions that I learned and will likely use in the future, as these allow one to find and explore different functions. Should I want to learn more (such as in the crash course’s “do more” sections where I used man to learn the functions of xargs, sudo, chmod, and chown), these search and help tools can aid one when looking for a specific function.

As an avid computer user, I found the exercise of learning the command line rewarding. I now have a deeper understanding of the computer functions that go on beyond the hardware and software applications that I’m used to seeing and using.

My Cheat Sheet:

To see where I’m at=

pwd

Make directory=

mkdir (name)

Directory path=

mkdir (nameA)/(nameB)/(nameC)

Change directory=

cd (name A)

cd (name B)

List the directory I’m in=

cd (name A)

ls

Remove directory=

rmdir (name)

Hold this directory=

pushd

Take back to that directory=

popd

Make empty file=

cd temp

touch (name).txt

ls

Copy file=

cp (name.txt)

Moving (renaming)=

mv (oldname.txt) (newname.txt)

View text file=

less (filename.txt)

more (filename.txt)

Stream text file=

cat (filename.txt)

Remove file=

rm (filename.txt)

Pipe left to right=

|

Input from right to program on left=

<

Output from left to right=

>

Left output appended to right=

>>>

Show .txt files=

ls *.txt

Find file=

find . –name “*.txt” –print . .
find . –name “*.txt” –print | less

Find files by search word=

grep (word) *.txt

Command help=

man (command word)

Forgot command name=

apropos (search keyword e.g. remove)

Environment=

env
echo ($USER/$PWD)
export ($USER/$PWD)
unset ($USER/$PWD)

--

--