The “Copy” also known as cp command is used to move files and directories around the file system. A file or directory can be copied with the command, then moved to a new location.
Syntax Example
cp [source] [destination]

Where source denotes the location of the file or directory you wish to copy, and destination denotes the place to which you wish to transfer the file or directory.
Common Options Used with cp command
- -r: Recursively copying directories and their contents is done with the -r option. A directory, together with all of its files and subdirectories, will be copied.

- -i: The -i option asks the user for approval before overwriting a file that already exists.

- -u: Only when the destination file is older than the source file should you use the -u option to copy files.

Special Note
In this article we see different variations of “ls” command. To know more about the use of the ls command look at the article below

- -v: Use the -v option to show verbose output. The command’s status and the name of the file or directory that is being copied will be displayed.

Uses of cp command and flag
- to duplicate a file or directory and put it in another location, you frequently use this command.
- for copying a directory and all of its contents, including subdirectories and files, the -r option comes in handy
- copy a file or directory and there is a potential that it might overwrite an existing file, the -i option can be helpful
- to only transfer the most recent version of the file while maintaining a backup, the -u option can be helpful.
It’s essential to remember that when you use the command to copy a file or directory, the original file or directory will remain in place. This means that the original file or directory will not be deleted from the source location.
If you want to delete the original file while placing it into another location. Have a look at the article below
May I simply say what a comfort to discover somebody who genuinely knows what they are talking about over the internet. You actually understand how to bring a problem to light and make it important. More people ought to check this out and understand this side of the story. I cant believe you arent more popular because you surely possess the gift.