cp command we regularly use and it seems the simple to us. Let’s know the power of this command:
What we already know about ‘cp’ is- copy files and directories.
Ways to use: cp [OPTION]..SOURC DEST
It means copy source to destination or multiple sources to the destination. So, this is the basic idea of cp. Noe, let’s explore more about this. cp command comes with so many additional options like -a, -b, -f, -d, -i and so on.
Question1: What’s then if you want to copy all folders/directories recursively? You can’t do this with simple cp command.
Solution: Use the option -r, -R or -recursive to copy all directories recursively.
Question: When you need to create a backup of each existing destination file?
Solution: Use –backup[=CONTROL]
Practice these 15 examples in the post (link shared below) by linoxide:
There are so many other examples. You can visit the following link for more detail: