tar: The Most Basic Backup Tool
The tar
tool, the bewhiskered old man of archiving utilities, is installed by default. It is an excellent tool for saving entire directories full of files. For example, here is the command used to back up the /etc
directory:
matthew@seymour:~$ sudo tar cvf etc.tar /etc
Here, the options use tar
to create an archive, be verbose in the message output, and use the filename etc.tar
as the archive name for the contents of the directory /etc
.
Alternatively, if the output of tar
is sent to the standard output and redirected to a file, the command appears as follows:
matthew@seymour:~$ sudo tar cv /etc > etc.tar
The result is the same.
All files in the /etc
directory ...
Get Ubuntu Unleashed 2015 Edition: Covering 14.10 and 15.04, Tenth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.