Chapter 1
The Setup

In this book you will be instructed to do three things:

  1. Do some things in your shell (command line, Terminal, PowerShell).
  2. Learn about what you just did.
  3. Do more on your own.

For this first exercise you'll be expected to get your Terminal open and working so that you can do the rest of the book.

1.1 Do This

Get your terminal, shell, PowerShell working so you can access it quickly and know that it works.

1.1.1 Mac OSX

For Mac OSX you'll need to do this:

  1. Hold down COMMAND and hit the spacebar.
  2. In the top right the blue "search bar" will pop up.
  3. Type: terminal
  4. Click on the Terminal application that looks kind of like a black box.
  5. This will open Terminal.
  6. You can now go to your Dock and CTRL-click to pull up the menu, then select Options->Keep In Dock.

Now you have your Terminal open and it's in your Dock so you can get to it.

1.1.2 Linux

I'm assuming that if you have Linux then you already know how to get at your terminal. Look through the menu for your window manager for anything named "Shell" or "Terminal".

1.1.3 Windows

On Windows we're going to use PowerShell. People used to work with a program called cmd.exe, but it's not nearly as usable as PowerShell. If you have Windows 7 or later, do this:

  1. Click Start.
  2. In "Search programs and files" type: powershell
  3. Hit Enter.

If you don't have Windows 7, you should seriously consider upgrading. If you still insist on not upgrading then you can try installing it from the download center. You are on your own, though, since I don't have Windows XP, but hopefully the PowerShell experience is the same.

1.2 You Learned This

You learned how to get your terminal open so you can do the rest of this book.


Note 1: Avoid The Hackers and Their zsh

If you have that really smart friend who already knows Linux, ignore them when they tell you to use something other than bash. I'm teaching you bash. That's it. They will claim that zsh will give you 30 more IQ points and win you millions in the stock market. Ignore them. Your goal is to get capable enough and at this level it doesn't matter which shell you use.

The next warning is stay off IRC or other places where "hackers" hang out. They think it's funny to hand you commands that can destroy your computer. The command rm -rf / is a classic that you must never type. Just avoid them. If you need help, make sure you get it from someone you trust and not from random idiots on the internet.


1.3 Do More

This exercise has a large "do more" part. The other exercises are not as involved as this one, but I'm having you prime your brain for the rest of the book by doing some memorization. Just trust me, this will make things silky smooth later on.

1.3.1 Linux/Mac OSX

Take this list of commands and create index cards with the names on the left on one side, and the definitions on the other side. Drill them every day while you do this book for just 15 minutes or so.

pwd
print working directory
hostname
my computer's network 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 arguments
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 super user root DANGER!
chmod
change permission modifiers
chown
change ownership

1.3.2 Windows

If you're using Windows then here's your list of commands:

pwd
print working directory
hostname
my computer's network 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
robocopy
robust copy
mv
move a file or directory
more
page through a file
type
print the whole file
forfiles
run a command on lots of files
dir -r
find files
select-string
find things inside files
help
read a manual page
helpctr
find what man page is appropriate
echo
print some arguments
set
export/set a new environment variable
exit
exit the shell
runas
DANGER! become super user root DANGER!
attrib
change permission modifiers
iCACLS
change ownership

Drill, drill, drill! Drill until you can say these phrases right away when you see that word. Then drill the inverse, so that you read the phrase and know what command will do that. You're building your vocabulary by doing this, but don't spend so much time you go nuts and get bored.


Online Video Course + PDF For $9

For the price of most other course's PDFs only, you can get the full PDF for this class and 2 videos demonstrating the whole book for both Unix/OSX Terminal and Windows PowerShell. The course is self-paced so you can go through it any time you want, as many times as you want.


Signup Now At Udemy.com For $9