I have read about copying files with terminal but these examples will help me a lot. So here is what I want to do:
Examples:
I have a file in
/home/levan/kdenlive untitelds.mpg
and I want to copy this file to/media/sda3/SkyDrive
and do not want to delete any thing in SkyDrive directory.I have a file in
/media/sda3/SkyDrive untitelds.mpg
and I want to copy this file to/home/levan/kdenlive
and do not want to delete any thing in kdenlive directoryI want to copy a folder from home directory to
sda3
and do not want to delete any thing onsda3
directory and oppositeI want to cut a folder/file and copy to other place without deleting files in that directory I cut it into.
1) By using
-i
for interactive you will be asked if you would like to replace the file:or you can use
-b
to create a backup of your file:2) Same as the above:
3) Use
-R
for recursive and-i
for interactive:4) This last one can be done via the
mv
command, move is like cutting:if you want to move a directory, use:
When
~/Dropbox/RECENT/
is your current directory:Again with
~/Dropbox/RECENT/
as current directory:Existing filenames can be auto-completed using TAB.
Long version of the same copy command (when you are not in
~/Dropbox/RECENT/
):I put a
/
behind every directory. IfSORT
does NOT exist acp
will also create a file namedSORT
making you think something went wrong. Adding the/
will havecp
error out and not copy the file.Use the
cp
command.Copying a file
something.txt
to filefolder
: usecp something.txt folder/
Copying a file
something.txt
to the current directory assomething2.txt
: usecp something.txt something2.txt
you will better add the option -a to cp command to preserve file-datetime, file-stats, etc.:
This will copy the
untitelds.mpg
file in the SkyDrive directory without deleting anythinguse
cp
command. Typeman cp
from the terminal for more info.