Chapter 2
Paths, Folders, Directories (pwd)

2.1 Do This

I'm going to teach you how to read these "sessions" that I show you. You don't have to type everything I list here, just some of the parts:

  1. You do not type in the $ (unix) or > (Windows). That's just me showing you my session so you can see what I got.
  2. You type in the stuff after $ or >, then hit enter. So if I have $ pwd you type just pwd and hit enter.
  3. You can then see what I have for output followed by another $ or > prompt. That content is the output and you should see the same output.

Let's do a simple first command so you can get the hang of this:


Source 1: Linux/Mac OSX Exercise 2
  $ pwd
  /Users/zedshaw
  $


Source 2: Windows Exercise 2
  PS C:\Users\zed> pwd
  
  Path
  ----
  C:\Users\zed
  
  PS C:\Users\zed>


Note 2: The Windows vs. Unix Prompt

In this book I need to save space so that you can focus on the important details of the commands. To do this, I'm going to strip out the first part of the prompt (the PS C:\Users\zed above) and leave just the little > part. This means your prompt won't look exactly the same, but don't worry about that.

Remember that from now on I'll only have the > to tell you that's the prompt.

I'm doing the same thing for the Unix prompts, but Unix prompts are so varied that most people get used to $ meaning "just the prompt".


2.2 You Learned This

Your prompt will look different from mine. You may have your user name before the $ and the name of your computer. On Windows it will probably look different too. The key is that you see the pattern of:

  1. There's a prompt.
  2. You type a command there. In this case, it's pwd.
  3. It printed something.
  4. Repeat.

You just learned what pwd does, which means "print working directory." What's a directory? It's a folder. Folder and directory are the same thing, and they're used interchangeably. When you open your file browser on your computer to graphically find files, you are walking through folders. Those folders are the exact same things as these "directories" we're going to work with.

2.3 Do More

  1. Type pwd 20 times and each time say "print working directory."
  2. Type pwd 20 times and each time say "print working directory."
  3. Write down the path that this command gives you. Find it with your graphical file browser of choice.
  4. No, seriously, type it 20 times and say it out loud. Sssh. Just do it.


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