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 () 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 () below!
You can also find further discussion and get answers to your questions over in Language Help.
Agree with a comment or answer? Like () to up-vote the contribution!
Before writing ls, I had written ls -a, maybe that’s why, but I cleared the shell, rewrote the whole exercise but Bash seems to be unforgetting.
So is this the mistake I made ? Should I come back tomorrow on the exercise, see if Bash has finally forgotten or is there something else to do ?
Thank you in advance for your answer !
`
We want to copy all the files in the current directory into satire. Right now, you’re trying to copy only files with certain characteristics. Take a look at the first example provided in this lesson; it demonstrates how to copy all the files from one directory into another.
This does not reset the exercise, this just clears the console. To reset, click the x at the top of the console and then click the + to open a new console
The problem is that earlier in the lesson, we are taught that there are “files” and “directories” and that they are separate objects which is true. In these instructions we are told to copy all the “files” in the current directory when in fact, in order to get passed this step one has to copy all the files andfolders despite the instructions not mentioning this.
Once you copy all the files and folders to the destination, the step is updated to completed.
Someone should fix the instructions to included “Directories” or “Folders”.
I was replying to someone else in this thread with a different issue.
However, with your problem, the command you need to use, cp * satire/, does not copy the directories, it only copies files. You need to copy all the files in the current directory, regardless of their file extension. Using *.txt, you will only copy text files (although there are only text files in the current directory, the lesson is trying to teach you that you can move all files quickly and with few keystrokes by just using *).
It’s actually not an error, you were correct in using cp rather than cp -r.
Here, the -r is a modifer that could be used to copy items recursively. If you used -r, not only would the_office.txt and shrek.txt be copied, the contents of the satire and slapstick directories (and any subdirectories of the two directories, and any subdirectories of those subdirectories, and so on) would be copied as well.
Thank you for explaining this. For me, it was unclear why the console outputted these “comments” - “cp: -r not specified; omitting directory ‘satire’”.
Without any command modifiers, it copies only the files in the current directory.
cp * some_directory
With the recursive command modifier, it copies the files in the current directory, as well as all of the subdirectories and files in those subdirectories of the current directory, and any subdirectories and files in the subdirectories of those subdirectories, etc.
cp -r * some_directory
cp -R * some_directory
You can find the modifiers for the cp command here.
Does anyone know what is wrong with my code? I have reset and create a new bash page but when I copied what joshuajackson4732703 did, it is still not right. Thank you so much!!