Learn the command line


$ pwd
$ blog/
bash: blog/: No such file or directory
$ pwd

pwd stands for "print working directory". It outputs the name of the directory you are currently in, called the working directory.

Here the working directory is blog/. In Codecademy courses, your working directory is usually inside the home/ccuser/workspace/ directory.

Together with ls, the pwd command is useful to show where you are in the filesystem.

Let's continue with more commands. In the terminal, print the working directory.

List all files and directories in the working directory.

Then type

cd 2015

Again, print the new current working directory.

List all files and directories in the working directory.
Report a Bug
If you see a bug or any other issue with this page, please report it here.

  1. pwd


Could you provide the Instruction
the pre-presented code


list all files and directories in the working directory. You'll see that there is now a new file named keyboard.txt.from command line.



# have a look at the current working directory
#list All files in Long-format with Size
ls -als



ls lists all of the parent directories. Above these directories, there is one root directory.

Question: What is the command line if I'd like to know the parent directory?

Thank you very much.




========== a bit of info ==============================


cd by itself or cd ~ will always put you in your home directory.

cd . will leave you in the same directory you are currently in (i.e. your current directory won't change)

cd ~username will put you in username's home directory.

cd dir (without a /) will put you in a subdirectory. for example, if you are in /usr, typing cd bin will put you in /usr/bin, while cd /bin puts you in /bin.

cd .. will move you up one directory.
So, if you are /usr/bin/tmp, cd .. moves you to /usr/bin, while cd ../.. moves you to /usr (i.e. up two levels).
You can use this indirection to access subdirectories too. So, from /usr/bin/tmp, you can use cd ../../local to go to /usr/local.

cd - will switch you to the previous directory (UNIX only).
For example, if you are in /usr/bin/tmp, and go to /etc., you can type cd - to go back to /usr/bin/tmp.
You can use this to toggle back and forth between two directories.

cd is frequently included built directly into a command-line interpreter.
This is the case in most of the Unix shells (Bourne shell, tcsh, bash, etc.), cmd.exe and Windows PowerShell on Windows and COMMAND.COM on DOS.


Thank you very much for the reply. Here is a copy of output after typing "pwd":



  1. Is "home" the root directory?

  2. What does the "/" on the very left signify?

Thank you very much.





I'm stuck on the very first one the learn how to use command centre. it asks me to type 1 in letter\
i type "one" and it gives me that replie