Hello everyone and welcome to this
lesson so till now we have seen how to
copy a file and how to copy a directory
in this video. We are going to see how can
you move or rename files or
how you can move or rename directories?
Before going to see that important thing
that you should know is Linux is case sensitive,
which means if you want to see the output
of this directly, you cannot type the
command which is capital l or capital S.
This will give you a error Linux do
not understand case insensitive commands
because Linux is case sensitive or else
if you type L small capital S. It is again going
to show you a error because Linux things
it is a different command all over.
So if you want to see the output just type the command LS and
small case similarly.
Two file names with same name but
different case is considered
to be a different file. Let me
just show you so let's say let's create a
file which is file.
or capital E and 1
and you can see I have created an empty file
which is file 1 this is all so file 1 so
I have created two different files all though
the name looks exactly the same
but these both are different files
for Linux now if I
click try to create a file which is in smaller
case.
Let's see what happens over here. So let me just
see the content of file 1.
And you can see it does not create an
empty file now. Let me use Nano to create
a new file.
So let's say this is a new.
file one
and let me try to save this and
let me give the name as file one. Remember.
We already have a file with
this name and hit enter and you can see it says
file already exist. Do you want
to overwrite? So if you want to override you can say yes, and
it will overwrite that file. So
You can see the file has been successfully
overwritten. There is no new
file that will get created. So I
hope you guys understood this. So now let me
just clear the screen for you and let's quickly move
a file or rename a file. So let's
say we want to move the file, which is a file one
inside the directory, which is 2 so
for that we are going to type the command move.
file
1 and we want to move that into the
directory, which is 2 and also we
want to rename the file together in the
same command. So let's say we give the
name of this file as hack.
Let me just hit enter and let's see
what happened inside too. So, let's simply type 3
2 and see what is inside.
So the directory 2 already has
a file which was created previously. Remember we
have already created this file.
Previously in previous videos and a new
file has been moved over here. And the name
of the file is being changed to hack.
So let's quickly go into and let's see
if it is the same file and you
can see it is the new file. It is the same file that
we created.
Perfect. Let's go one step back and here you
can see there is no file one because we
have moved the file one inside
the directory 2 and also have renamed
the file to hack that is
the reason we have the file one moved
inside the directory 2 and the
new name Hack That is renamed. So
I hope you guys understood this how you can move
and rename the files into any
directories. Thank you.