My name is Stefan Ashwell and when I'm not coding personal projects or painting miniatures, I'm a Software Engineer at Holmes Media in Market Harborough.

This blog is a place for me to write about things that require that little bit extra to solve. We all have gaps in our knowledge and every now and then I need to reach out on search engines or blogs to find an answer. Often, these answers come from multiple sources. This blog serves as a personal resource, but if it's helpful for me I'm sure it'll help others too!

Quick tar command reference

Posted on 24 June 2015

Create an archive of a directory

tar cvzf archivename.tar.gz directory/to/archive

The above command will create an archive of a directory and save it in the location specified. The commands are:

c – Creates a new .tar archive file.
v – Verbosely show the .tar file progress.
f – File name type of the archive file.
z – Compress the archive.

Extract an archive to a directory

tar xvfz archivename.tar.gz

The above command will extract the contents of an archive and put them in the current directory. The commands are:

x – Extract files from archive.
v – Verbosely show the .tar file progress.
f – File name type of the archive file.
z – The archive we’re extracting is compressed.