/ factorpad.com / tech / linux-essentials / pwd-command.html
An ad-free and cookie-free website.
Beginner
Learn to view the directory location at the Linux command line.
Videos can also be accessed from the Linux Essentials Playlist on YouTube.
Linux pwd Command Summary with Examples (3:18)
Our sixth word, or command to memorize is pwd
from the category Navigation.
pwd
allows you to print the name of
the current directory, sometimes called the working directory. It's
always a good idea to know where you are, right? And
pwd
will tell you where you are in
the computer's directory structure.
-options | description |
---|---|
--help |
Print help on the pwd program |
--version |
Print the version of pwd |
If it helps, think of commands as mini programs and most have this
structure. First, type the
command
, second the
-option(s)
and third the
argument(s)
.
The pwd
command has 4
options and no arguments, meaning the current directory is assumed and
you don't need to enter it.
For now, we'll skip the options because they are rarely used, but you
can use the man
command from video 4
if you are curious.
So why is pwd
an important command?
Well, it is easy to get lost in the maze of a file structure, so
pwd
helps you find exactly where
you are.
And now you know how to do that.
Okay, the best way to embed this in your memory is by typing in your own terminal window.
Find this on your Mac using a program called Terminal. On Linux use Terminal or Konsole, and currently Microsoft is adding this functionality to Windows 10.
Here we go, type pwd
and Enter for
the directory name and path from the starting point, or root, as they
call it.
It helps to visualize the directory structure on Linux as a tree, and
the root is the name given to the base, or starting point. It is
depicted with the forward slash. In that we have the
home
directory and within that is a
directory called paul
, which is my
own private directory. We'll explore this structure in future videos.
Okay now you know how to use pwd
.
And you know the syntax for commands, options and arguments.
One last tip about the pwd
command.
Later we will see how to use permissions to keep others' eyes out
of your directory.
Okay, thanks for visiting today. I hope this was a fun introduction
to the pwd
command.
For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:
There's a lot to learn on the FactorPad Channel, why not subscribe and follow for reminders?
less
command,
hit Back.ls
, click Next./ factorpad.com / tech / linux-essentials / pwd-command.html
A newly-updated free resource. Connect and refer a friend today.