FAQ: Manipulation - rm

This community-built FAQ covers the “rm” exercise from the lesson “Manipulation”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Learn the Command Line

FAQs on the exercise rm

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!
You can also find further discussion and get answers to your questions over in Language Help.

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head to Language Help and Tips and Resources. If you are wanting feedback or inspiration for a project, check out Projects.

Looking for motivation to keep learning? Join our wider discussions in Community

Learn more about how to use this guide.

Found a bug? Report it online, or post in Bug Reporting

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

To work with “rm”, do we need to be in the same directory as the file/directory that we want to remove?

Nope, I went to the movies/ directory and tried removing terminator.txt from the action/scifi directory and it worked.
I didn’t try removing any directories but I don’t see why that would be any different.

1 Like

I´m currently stuck at task 1. I think it´s a bug.

I went in the directory: /home/ccuser/workspace/movies/comedy/slapstick
The next step is typing in ls, but somehow I always get it wrong somehow. I tried ls -a and everything else.
It prints waterboy.txt and zoolander.txt.

Am I doing something wrong? It doesn´t help resetting the exercise…

1 Like

Hi
Im stuck on task 1 its saying that no such file for comedy/slapstick so therefore im stuck completely.

ignore it found my error, like syntax error, its staring you right in your face, you just need to notice.

What was the error? I’m still stuck.

I think there is a bug with 5’th question

“/home/ccuser/workspace/movies/comedy/slapstick” doesn’t seem to exist. Problem 9

Did you ever find a solution to this problem? The directory comedy/slapstick simply doesn’t exist.

part 1. only worked when i used cd /home/ccuser/workspace/movies/comedy/slapstick :roll_eyes:

1 Like

I’m the same I think. I’ve changed to be in the slapstick directory and listed all the files and directories, but it still prints the error message “Did you change into directory comedy/slapstick?”

Fixed it - think there might have been a bug. All I did was go to ‘Get Unstuck’ > Reset Exercise. Then typed in the last two lines of code I had before :laughing:

3 Likes

In manipulation/rm you state that “The rm command deletes files and directories”. In the next quiz when asking “How would you delete a directory called music/?” answering with “rm music” is pointed as wrong because “The rm command on its own cannot remove a directory.”

So is rm removing directories or not?

Hello everybody this is Mr. BadDucky gain aiding my fellow hackers! If you are stuck on rm here’s the correct answer to get those beautiful checkmark’s on those boxes.

rm - Manipulations

$ cd comedy/slapstick
$ ls
waterboy.txt zoolander.txt
$ rn waterboy.txt
$ cd …
$ ls
satire slapstick the-office.txt
$ rm -r slapstick
$

Here is the correct way to passing I want all of you to study and become the best person you can be and maybe we can meet on the Dark Web for hacking purposes. Goodluck and study hard i know you can do if my viewer’s!

you don’t use the pwd in this set of instructions

If you use ‘rm’ without the recursive ‘-r’ on a directory with child directories, what happens to all the child directories? Do they remain on the hard drive and don’t get removed?

I’m having the same problem as well. These comments were posted a while ago now, did anyone get through it or figure out how to pass through the bugged step?

This helped me. Thank you!

If you are stuck on rm 1.instr,which hints there are no files or directories,you can

cd /home/ccuser/workspace/movies/comedy
mkdir slapstick
cd slapstick
touch waterboy.txt zoolander.txt


So you can keep going!
Enjoying in coding! :smile: