FAQ: Manipulation - mv

This is borked just like the last lesson, wonderwoman.txt is outside directory superhero and batman.txt is already within, i’ve moved Batman.txt out then moved them back in, moved just wonderwoman, moved them both in then out, erased them both then created new files in action/ then moved them back in and it all fails

The first step using pwd also fails because they want you to check your directory and execute an argument based on the information but running pwd fails as two steps are not completed as one

report the bug under ‘get unstuck’ in the upper right

Yep I thought the same thing because in the filesystem layout sheet they provided it shows that Batman.txt is within the superhero folder. But if you $ pwd you should find yourself in the Action folder. From there $ ls and you should get ‘batman.txt matrix-reloaded.txt matrix-revolutions.txt matrix.txt scifi superhero wonderwoman.txt’. This shows that the batman file is outside of the superhero folder. I believe that the filesystem layout sheet is incorrect.

I think I have a bit of the same confusion on the mv command section.
as I went from section to section 5 to 6 or 6 to 7 i learned the first thing to do is check both the pwd and ls to find were this new section is starting on the tree. Section 5 ends at action or superhero ( I can not go back to check) section 6 starts at a different place on the tree. At the beginning of each section test for your location. PWD then list LS. Check out were you are on the tree follow directions from that point. How to see the tree? near the top of the page just above the first question is a high lighted "here " click on that to see the tree.

Should we always use the relative path to the files if the files that we are trying to rename aren’t part of the current directory?

It works if you move both wonderwoman.txt and batman.txt all the way into movies, then mv batman.txt wonderwoman.txt action/superhero

Hello, I don’t know what I’m doining wrong in my answer?


There’s a couple of possible issues that are worth trying out. So far as I’ve interpreted the instructions you should not be in the superhero/ directory, you should be in /home/ccuser/workspace/movies/action and all previous tasks required the use of relative paths. Try changing back to the action/ directory before attempting this instruction.

So the command to view the contents of the superhero directory with a relative path would then be ls superhero.

Based on the previous instructions it looks like there should also be a superman.txt file in the superhero/ directory. Try following the instructions from the start just to make sure you’re in the right working directory, using relative paths for the tasks and making sure the contents of the directory are as expected.

2 Likes

yes! it worked, I did the exact steps you described,

thanks very much, tgrtim

Best regards Michel from the Netherlands

1 Like

batman.txt doesn’t exist in my folder should i just make it using touch?

resolved my issue on step 6 by resetting the excercise and going at it again. “if at first you don’t succeed, try try again!”

2 Likes

Well the only ways I would know how to do it are to either use the relative path or change directories. If you need to stay in the directory you’re in than relative path seems like the right way to go, but if it’s more convenient to change directories then why not? Obviously if the exercises are telling you to do it a specific way than that’s the way they want you to do it, but other than that, if your working in the terminal separately from the exercises, :man_shrugging: do what ever feels comfortable I guess, it will work either way.

Maybe there’s a best practices way to do it, depending on the situation, but I don’t know what it is. Would like to learn it though since I am a total beginner and don’t really know what I’m talking about. Just trying to learn by asking questions and giving whatever help I think I can.

Hi guys,

Could someone clearly explain how to get past Q4? Really enjoying my experience but havent been able to get past it…I think its a bug.

I had some issues with this exercise as well:

  • Step 1.: Got stuck rigth from the start. The error message always prompted me to use $ pwd, even if I was already in the action/ directory.
    Solution: Use “Get Unstuck” - “Reset Exercise”. Use $ pwd, then proceed as expected.

  • Step 4.: batman.txt was already inside superhero/.
    Solution: Use $ mv superhero/batman.txt . ← this moves batman.txt into your working directory, which should still be action/ (pay attention to the single . I used as target directory). You should now be able to resolve the step.

Anyway, filled in a bug ticket for this one as well :slight_smile:

1 Like

Lesson - mv
Stuck in first step - ls action/ not working while I am already lisiting the files

Im also stuck here. have you been able to figure out a way to move forward ?

Why the first part accepts the “direction/” but not “direction”? Using “direction” i can also get the right place and list the content.

I too am stuk here.
Looks like the tree structure is incorrect. batman.txt is already in the superhero directory. Does anyone know how to move past this?

Im confused. How does cp or mv know what the starting argument and ending argument is?
For example, file.txt file1.txt another file.txt directory/ is all separated by spaces. I might be overthinking this but I would like to know

1 Like

Mv - Manipulation.
Hello everybody if your stuck im here to help your. This will help you unlock you boxes with those beautiful cheekmarks.

$ cd action/
$ ls
batman.txt matrix-revolutions.txt sifi superman.txt
matrix-reloaded.txt matrix.txt superhero wonderwoman.txt
$ mv superman.txt superhero/
$ mv batman.txt wonderwoman.txt superhero/
$ cd superhero/
$ ls
batman.txt superman.txt wonderwoman.txt
$

here you go guys you got it from Mr. Bad Ducky yourself. Remember keep up the good work hard studying and keep hacking hopefully we can chat on the Dark web soon god bless my readers

1 Like

Hi adriandelk! Thank you so much