The Ultimate Tar Command Tutorial with 10 Practical Examples

Written By
Web Webster
Web Webster
Apr 27, 2010

“On Unix platform, tar command is the primary archiving utility.
Understanding various tar command options will help you master the
archive file manipulation.

“In this article, let us review various tar examples including
how to create tar archives (with gzip and bzip compression),
extract a single file or directory, view tar archive contents,
validate the integrity of tar archives, finding out the difference
between tar archive and file system, estimate the size of the tar
archives before creating it etc.,

“1. Creating an archive using tar command

“Creating an uncompressed tar archive using option cvf

“This is the basic command to create a tar archive.

$ tar cvf archive_name.tar dirname/

“In the above command:

* c – create a new archive
* v – verbosely list files which are processed.
* f – following is the archive file name

Complete
Story

Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.