How Do I Backup a Directory in Unix?
Contents in Order to Copy a Directory on Linux, You Have to Execute the “Cp” Command with the “-R” Option for Recursive and Specify the Source and Destination...
Contents
In order to copy a directory on Linux, you have to execute the “cp” command with the “-R” option for recursive and specify the source and destination directories to be copied. As an example, let’s say that you want to copy the “/etc” directory into a backup folder named “/etc_backup”.
How do I backup a folder in Linux?
Linux cp –backup
If the file you want to copy already exists in the destination directory, you can backup your existing file with the use of this command. Syntax: cp –backup <filename> <destinationDirectory>
Must Read
How do I backup a file in Unix?
2.1 Copying Files
- cp (copy) cp file1 file2 is the command which makes a copy of file1 in the current working directory and calls it file2. …
- Exercise 2a. …
- mv (move) …
- rm (remove), rmdir (remove directory) …
- Exercise 2b. …
- clear (clear screen) …
- cat (concatenate) …
- less.