Skip to content

Linux Tar Command Guide

Published: at 12:00 PMSuggest Changes

Linux Tar Command Guide

Introduction

Tar is a command-line utility used to create and manipulate archive files. It is commonly used for compressing and packaging files.

Usage

To create an archive, use the following command:

tar [options] [archive-file] [file-or-directory]

Common Options

Examples

  1. Create a new archive:

    tar -cvf archive.tar /path/to/directory
    
  2. Extract an archive:

    tar -xvf archive.tar
    
  3. Create a compressed archive:

    tar -czvf archive.tar.gz /path/to/directory
    
  4. Extract a compressed archive:

    tar -xzvf archive.tar.gz
    

Previous Post
Linux SSH Command Guide
Next Post
Linux Wget Command Guide