Next, I want you to copy this
hello_terminal file into a subdirectory named
hello. Okay. A few operations there, I guess.
So there’s a few things we need to do. We need a new folder called
hello. That was the name of the folder, right? Yeah. Okay, so now if I list (
ls) in here, we’ll see that we’ve got the folder and the file.
The folder has this blue highlighted thing to show you that it’s a folder. Okay, so the
mkdir command stands for make directory? Correct, yes, I used
mkdir to to create the folder, so
mkdir with the folder name afterwards, and that made it.
Okay, so now to copy the
hello_terminal file into the
hello\ subdirectory, what’s the command there? Well, it’s
cp, also for copy.
I believe the full command is
copy-item. But you can just use
cp. And then you just take the file path or the path that you want to copy. I’m just going to use tab auto-complete here as well.
And then you pass in the path that you want it to be moved to. So in this case, I can just put the folder name, and it will copy that into
hello\. So I can press Enter here. Okay—And so— Go ahead. Again, the terminal doesn’t output anything, which it sometimes does.
Like with some commands you get some feedback, but with others not. Yes. I’m not sure what the rhyme or reason is there. I don’t know why
cp wouldn’t have an output, whereas
01:47 I’m not sure what the logic is there, but I’m sure they had a good reason for it. Okay. So maybe a rule of thumb is the other way around. If the terminal doesn’t complain, it probably did what you wanted it to do, or at least, it did something and hopefully what you wanted it to do. Right, that’s a good point.
02:05 If you don’t get any output, it can either mean nothing happened or it went through the command without an error. If it does run into an error, it will usually complain.
Like if I just said something like
realpython , which is not a command on my computer, it will give me an error. It will say that it’s not recognized as the name of a command.
Become a Member to join the conversation.