03-04 cp command

01

man cp
                

Copy allows us to copy file and or move it

02

We can copy the file in the same directory, using a new name as the third argument

cp file1.txt file1-copy.txt
                

03

Or copy and move it to another directory

while copying and moving you can give a different name

cp file1.txt ../mv-copy.txt
                

ls ../ will display the items in the parent directory

ls ../
                

04

Copy directory with the -r recursive flag option

cp -r 
                

05

You can rename a copy in the same directory

cp -r testDir testDirCpy