The next task I’m having for you—maybe we can clear it out again, and we start fresh again. So the next task I have for you is to copy the
hello_terminal.py file into a subdirectory. Let’s name it
So as you may have seen in some of the others we did here, these commands tend to have very short names. So copy is shortened down to just being
cp. And with this one, let’s say we had the
hello_terminal, and then I want to copy this file.
00:39 So then I need two arguments to it, essentially saying where do I want to copy it as well. So if I just run this, you can see that it’s giving me an error saying that it also needs a destination file. Now you’re actually asking me to copy it into a directory, and that means that we need to have a directory to copy it into.
So before doing the copying, I’ll create that directory. So this is the same as we did earlier. We do the
mkdir, and now we can see if I do
ls, we have this one—it has a slightly different color because it’s a directory—and then we have our two files over here.
So we can go with the
cd (change directory), which you also saw earlier, and have a look inside of here. And we can see that we have just now the
hello_terminal file that was copied from the one that’s in the directory above. Perfect.
So if you would have decided to rename the file in there, you could also have written
hello_newname.py and rename it in this go or— Yes, exactly. So if we started from this, I could add a
Become a Member to join the conversation.