How to Backup a File in Linux

Shares & Saves

The Linux operating system has many configuration files. These files are normally plain text files that can be edited in any text editor. It is a good idea to create a backup copy of the file before making changes when editing any of the configuration files.

  • Open a terminal window. The terminal window will be found under the "Accessories," "System Tools" or "Utilities" section of the main menu.

  • Type the command "cd Directory/" to navigate to the directory that contains the file you want to backup. Replace the word "Directory/" with the correct name of the directory.

  • Type the command "cp file.txt file.bk" to create a backup copy of the file named "file.txt". The backup copy will be called "file.bk". Replace the file name with the exact name of the file you want to backup.

  • Type the command "ls -la file.bk" to make sure the file was created correctly.

  • Type the command "exit" to close the terminal window.



You May Also Like

Read Article

Your Black Friday/Cyber Monday Survival Guide