Ahhh renaming.
For that we use the
mv command ("move" command).
It is done like this:
mv old_name new_name
The old_name is the file you have, the new_name is the name you want to give it.
lets take a look at an example:
Code:
[admiralty:~/pictures] admiral% mkdir jow
[admiralty:~/pictures] admiral% ls
jow
[admiralty:~/pictures] admiral% mv jow joe
[admiralty:~/pictures] admiral% ls
joe
[admiralty:~/pictures] admiral%
Explanation:
I made a directory called "jow" ... of course I made a typo!
To correct this is a simple matter with the MV command.
I just do
mv jow (the file I made)
joe (the new name I want to give it).
To make sure I did what I wanted it to do, I did an LS command, and I see that it worked!
---
How do you copy something ?
Simple! Use the command called
cp (for CoPy).
The syntax of this command is similar to the MV command
cp source destination
where source is the source file, and destination is the destination file.
Lets say I want to duplicate my "AK" text file so that I have "AK" and "AK1":
Code:
[admiralty:~/pictures] admiral% ls
AK joe
[admiralty:~/pictures] admiral% cp AK AK1
[admiralty:~/pictures] admiral% ls
AK AK1 joe
[admiralty:~/pictures] admiral%
Explanation:
I did an LS to see what I had, and I DID have the AK file,
did the CP command as
cp AK AK1 , where AK was my original file and AK1 is my duplicate "cloned" file.
Then I did an LS to double check and actually see that I did what I wanted to do
And that ladies and gents is how you copy and rename
