Contents
Linux Copy File Examples
- Copy a file to another directory. To copy a file from your current directory into another directory called /tmp/, enter:
- Verbose option. To see files as they are copied pass the -v option as follows to the cp command:
- Preserve file attributes.
- Copying all files.
- Recursive copy.
How do I use CP in Linux?
Read on to find out more.
- mv: Moving (and Renaming) Files. The mv command lets you move a file from one directory location to another.
- cp: Copying Files. A basic example of the cp command to copy files (keep the original file and make a duplicate of it) might look like: cp joe_expenses cashflow.
- rm: Deleting Files.
What does CP Command do?
The cp command is a command-line utility for copying files and directories. It supports moving one or more files or folders with options for taking backups and preserving attributes.