May 16

how to tar your dotfiles, and ONLY dotfiles

Category: Linux   — Published by goeszen on May 16, 2014 at 1:10 pm

On Ubuntu/Debian/Linux/*nix, the dotfiles (and dot-directories) in your /home folder contain all your settings, and also your emails (if you use thunderbird) and your browser configuration/history/add-ons/etc. (if you're using firefox). So it's handy to back all this up. If you want to use tar on the CLI, here it is:

ls -A | egrep '^\.' | tar -cvJf /home/daniel/archive.tar.xz -T -

This issues a list (ls), filters it with egrep and sends all matching files and dirs to tar (read from stdin -) and compresses the tarball with xz (-J). Or use lower-case -j for bzip2 or any other compression filter of your liking.

More file archiving/compression posts:

Leave a Reply