Renaming Files - Linux Terminal
00:00 Yeah, I think it’s time to clear the terminal again.
00:04
Now you are back into the pb_terminal/
folder, and when you are listing the files, there should be still the hello_terminal.py
file there. Exactly, because you only copied it, but you didn’t move it. Right.
00:20
If—like, we were talking about renaming the file while copying it—but if I want the hello_terminal
file to stay where it is, but renamed it to, let’s say, hello_world
, how would you do that?
00:33
Right. So renaming, it’s really what we’re doing is just moving stuff around. So we can think of this as taking the file and moving it to a different filename essentially. So then this works very similar to cp
(copy), that I’ll just take this, and I could now, for instance, if I would do just hello
here, so the directory, that would move this file into hello
and keep the same name.
00:56
So that would, in practice, I guess overwrite what we already have there. But instead we wanted to rename this to hello_world.py
.
01:04
Exactly. So doing this should now see that we have still our hello_cat
was untouched, but hello_terminal
is gone, and we now have hello_world.py
instead.
01:17 So that’s really the same contents, but with the different filing.
Become a Member to join the conversation.