The cp
command in Bash is used to repeat information and directories from one location to a different.
Copy Command Syntax and Rationalization
The essential syntax of the cp
command is:
cp [OPTION]... SOURCE... DESTINATION
- SOURCE: The file or listing you wish to copy.
- DESTINATION: The situation the place you wish to place the copied file or listing.
- OPTION: Optionally available flags that modify the habits of the
cp
command.
Generally used choices embrace:
-r
or-R
: Recursively copy directories and their contents.-i
: Immediate earlier than overwriting an present file.-u
: Copy solely when the SOURCE file is newer than the DESTINATION file or when the DESTINATION file is lacking.-v
: Verbose mode, which exhibits the information being copied.-T
: Deal with the vacation spot as a traditional file. That is helpful while you don’t wish to create a brand new listing on the vacation spot.-f
: Power the copy operation by eradicating the vacation spot file if it can’t be opened.