In this video we'll talk about moving files.
That's with the MV utility.
So the MV command will move a file and it also is used to rename a file.
That is because renaming a file is really no different from moving a file. Because when you rename
it, you move it from the old name to the new name. And that's how it works.
Let me demonstrate.
Let me start by using Touch TMP test file.
You remember Touch it creates an empty file.
LS l always a good idea if you want to verify that it works? Yay, it works.
Now I'm using MV of TMP test file to Tilde.
Tilde is your home directory and that works. And we should see that I now have test file in my home directory.
And in case you are wondering, could I have done that tilde in a different way? Yeah, as
I was in my home directory, I could have used dot as well. That would also have worked.
Before moving on, let's also verify the TMP test file.
And the TMP test file doesn't exist anymore.
And that is because I just moved it to my home directory.
Now if I use MVTestVal to a FAL, LS is showing that test VAL
no longer exists. A VAL exists and that's what's happening when you move it.
When you move it, you just replace it or rename it. The interesting
thing is that you take all the properties of the file with it.
So permission wise, when you move a file, nothing changes in the permission where you copy a file,
you copy a file to the new destination and it gets the permissions according to the new destination.
That will probably make more sense when later we have also explored permissions and how they work.