cp command

cp [OPTION]... SOURCE DEST


The cp command is used to copy a file from one location to another, for example:
cp afile.txt home


the above command copies a file called afile.txt to the home directory. This command (like most others) can be used with the '*' wild card which means all. For example:
cp *.txt home


this command will copy all files with a .txt file extension to the home directory.


This is pretty much all you needs to know about this command, you can find out more by typing 'man cp' into your terminal.

2 comments:

  1. I think worth mentioning is: to copy a directory recursively, use 'cp -r path/to/dir path/to/target'

    ReplyDelete