Open the Terminal
You can usually find the terminal in your applications menu, or you can use a keyboard shortcut, like Ctrl+Alt+T in some distributions.
Navigate to the Directory
Before copying files, you need to navigate to the directory where your files are located. Use the cd command. For example, cd Documents takes you to the Documents directory.
Use the cp Command
The cp command is used for copying files and directories. Syntax: cp [options] source destination . Example: cp file.txt Backup/ .
Options
- i : Prompts you before overwriting a file.
- r : Recursively copies directories and their contents.
- v : Verbose mode, showing details of the copy process.
Example Command
To copy a directory named Project and all its contents to another directory named Archive , use cp -r Project Archive/ .
Check the Copy
Use the ls command to list contents of the destination directory to ensure files were copied successfully.
Note : Be cautious when using commands like cp , especially with options like -r . Double-check your command before executing, especially with important files.