cp
filename1 filename2 --> This command
will copy the first file into the second file.
cp
Amy.txt Garret.txt
Note that if Garret.txt is already a file, then it will be overwritten !!
Be careful with this command.
cp -i
Amy.txt Garret.txt
If Garret.txt exists, then this command will
inquire if you want to overwrite the file.
If Garret.txt does not exist, then you will not
be asked.
Note that you can also add directory names to
this:
cp
/home/mlevan/Amy.txt /home/guest/Garret.txt
You can also copy files to a directory :
cp
file1 file2 fileN directory_name
cp Amy.txt
Garret.txt temp/
Note that ~ can also represent your home directory. For
example, say I want to copy a file from /home/guest1/booty to the temp
directory in my account: