The cp, the copy command from the Linux command line, is probably well known to those comfortable using Linux. However, here we will take a look at some of the options available to you with cp, some well known but not fully understood and some more obscure. Firstly we will start with -a option:
- -a : Is probably well known as the archive option, maintaining ownership of the files, but did you know it also turned on the recursion option so that sub-directories are included.
- -b : If a target file is overwritten then back that file up and append a ~ to the end of the name.
- -n : No-clobber, do not overwrite target file
- -u : Update the target file if source file is newer
- -s : Create sym-links as targets
The above is by no means an exhaustive list of all the options, but a selection of some of the useful tools available to you, so have a play today with those you don’t know.