Command line change directory questions


#1

Hello Oduffy,

Here is the problem I’m having with the Command Line. Here is the direct URL:

https://www.codecademy.com/courses/learn-the-command-line/lessons/manipulation/exercises/cp-ii?action=resume_content_item

It is the first instruction on the page 6/10. It tells you to type the following: cd …/…/comedy. When I type this,

Navigate to the comedy/ directory.

cd …/…/comedy

it doesn’t put me back at the comedy working directory. The only way to get to the working directory from there is to type “cd comedy” So you can’t move forward to the next instruction. I restarted from the beginning four times and I get stuck in the exact spot. I use IE 11, I also used Chrome, and still it’s the same problem. I do this from home, not school. I do the CodeAcademy in the evening after 5:00 pm. I would like to sign up for Pro, but if I can’t get through this, I won’t be able to do the projects.

Thanks,
Christina


Help connecting to Codecademy
#2

Use two dots to go up one directory level. The following goes up two levels.

../../comedy

#3

Hello,
Thank you for your feedback, I tried going back one level with the cd … , it still doesn’t work. Did you experience this?

Thanks,


#4

Let’s have a look at where you are currently situated in the directory tree…

ls

to see what content your present working directory holds.

pwd

to see the complete path to that directory.

The first step would be to Refresh the page. Then at the prompt, type,

pwd

and Enter. you should see,

$ pwd
/home/ccuser/workspace/movies
$ 

Now just to quickly restore where you were,

cd drama/biopic
ls

You should see,

$ cd drama/biopic
$ ls
cleopatra.txt frida.txt lincoln.txt notorious.txt ray.txt
$

Now we are two levels below the parent directory that holds comedy. Type the following to change the directory to comedy…

cd ../../comedy
ls

You should see,

$ cd ../../comedy
$ ls
satire shrek.txt the-office.txt
$

#5

THANK YOU SO MUCH, I had no idea what I was doing wrong!! blessings!! Finally I can move on :slight_smile:


#6

Same issue on 5.

Here’s another way to use cp.

Navigate to the action/ directory. Type

cd …/…/action/ and the two directions after that. When I type "ype

cp m*.txt scifi/" I get no such file, but yet, I get a green tick mark and it lets me move on. This is strange.


#7

The SCT must have seen a correct pattern and accepted it. Not so with the terminal, it would seem. Best try to work this one out. Take your time, you’ve got the check mark so refresh all you need to start over from scratch.


#8

Refresh and then at the $ prompt,

cd comedy/satire
ls

You should see,

$ cd comedy/satire
$ ls
fight-club.txt shrek.txt the-office.txt
$

Now we can follow the later instructions.

cd ../../action
ls

You should see,

$ cd ../../action
$ ls
matrix-reloaded.txt  matrix-revolutions.txt  matrix.txt scifi superhero
$ 

Note that scifi and superhero are directories (no file extension).

Now we’re set to carry out the next instruction. The objective will be to copy any text file beginning with m to the scifi directory.

cp m*.txt scifi/
cd scifi
ls

You should see,

$ cp m*.txt scifi/
$ cd scifi
$ ls
matrix-reloaded.txt  matrix-revolution.txt  matrix.txt terminator.txt