Each command in Linux has a specific function that performs various tasks. To do this, you need to use a tool called a terminal. Therefore, it’s important to know how to back up files in Linux using commands so you can recover all your files in the event of a system failure.
How to backup Linux using commands – Best shortcuts
Index( )
- What do you need to do a backup within Linux using commands?
- What are the most commonly used backup commands in Linux?
- To backup the ‘/home’ directory
- If you want to backup to a remote directory
- To create a local copy while preserving licenses and links
- How to know if the backup in Linux was done correctly?
- Tools for creating backups in Linux
What do you need to do a backup within Linux using commands?
To create a backup in Linux using commands , all you need to do is access the system terminal, review the different command options, and use the most appropriate ones to save a copy of your files. You’ll also need to specify the location where the backup will be stored.
What are the most commonly used backup commands in Linux?
The most commonly used backup commands in Linux are ‘dump’, ‘restore’, ‘rsync’, and ‘dd’. ‘dump’ is used to save the /home directory; ‘restore’ is used to restore files generated by ‘dump’; ‘rsync’ is used to perform remote file synchronization, and ‘dd’ backs up the entire hard drive.
To backup the ‘/home’ directory
To back up your ‘/home’ directory, press Ctrl+Alt+T to open a Linux terminal and type the command dump -0aj –f /tmp/home0.bak /home. ‘dump’ specifies which files to back up, ‘-f’ specifies where to save the backup, and ‘0’ means a full backup .
If you want to backup to a remote directory
Sometimes it’s necessary to merge files from a computer that are on the same or different networks. Therefore, if you want to back up a remote directory, you’ll need to access the Linux terminal and type the command rsync –rogpav –e ssh –delete /home ip_address: /tmp and press Enter.
The ‘-e’ parameter will use the information transfer protocol, while SSH allows you to synchronize the local computer with the remote computer to perform data transfer. Then, type rsync -az -e ssh –delete ip_addr:/home/public /home/local to compress the files during the transfer process.
To create a local copy while preserving licenses and links
If you want to create a local copy while preserving the licenses and links, open a Linux terminal, type the command tar cf – . | (cd /tmp/backup ; tar xf -) and press Enter. This will group all the text documents into a single .tar file, which can then be transferred, along with its licenses and links, to another directory.
How to know if the backup in Linux was done correctly?
If you’ve already performed a backup in Linux using commands, you’re probably wondering how to know if your Linux backup was successful. If you’re not sure, go to your home directory in /home and check if your computer’s settings and users have been saved.
If you’re using a Mac, open iTunes (if the backup was created there) to locate the backup. If you’re using Linux on your iPhone, connect your phone to your computer to open the “Summary” page, where you’ll see the date of the last backup. From the “Edit” and “Preferences” options, tap “Devices” to view the list of backups.
Tools for creating backups in Linux
In addition to using Linux commands, you can choose to run tools with a graphical interface to create backups. This is the case with ‘KBackup,’ an application that lets you back up files and directories on your PC. Simply select the files displayed in the panel and then press ‘Start Backup.’
Another backup application is Box Backup. After accessing the Box website , you can encrypt your backups, authenticate users with an SSL certificate, and easily restore them. This tool also uses command lines and is compatible with various platforms besides Linux.
You can also use the ‘Fwbackups’ tool, which is also available for various operating systems. This application allows you to back up an entire computer or just a single file. You also have the option to restore them quickly. Fwbackups makes it easy to create local and remote backups and supports various formats.

