How to Use Tar for Backups
- 1). Open a terminal window. The terminal window application is called "Konsole," "Xterm" or "Terminal," depending on the distribution you are using.
- 2). Type the command "cd dir_name" to change to the directory that you want to back up. Replace "dir_name" with the correct name of the directory. If you want to back up your entire file system, type the command "cd /". If you want to back up your home directory, skip this step.
- 3). Type the command "tar pzcvf backup.tgz ." to back up the current directory. The command options say to preserve (p) the permission attributes, compress (z) the archive with gzip, create (c) the file, print the process to the screen (v) and use the filename (f) backup.tgz. The "." says to back up the current directory.
- 4). Type the command "ls -la" to see the newly created tar file when the backup is complete.
Source...