File Commands - 14paxton/Linux GitHub Wiki


title: File-Commands permalink: Linux/File-Commands category: Linux parent: Linux layout: default has_children: false share: true shortRepo:

  • linux
  • default


Table of contents {: .text-delta } 1. TOC {:toc}



  • Say you want to compress an entire directory named

/home/vivek/data/ ,

then type:

 tar -czvf file.tar.gz /home/vivek/data/

To compress multiple directories and files, execute:

 tar -czvf file.tar.gz /home/vivek/data/ /home/vivek/pics/ /home/vivek/.accounting.db
  • One can use bzip2 compression instead of gzip by passing the -j option to the tar command:
tar -cjvf file.tar.bz2 /home/vivek/data/

Options

Create a new archive

- c

Verbose output

- v

Use archive file

- f

Filter the archive through gzipfile.tar.gz

- z

Filter the archive through bzip2

- j

Un Tar

  tar xvf  <.tar file>
  tar xzvf <.tar.gz file>
  tar xjvf <.tar.bz2 file>
⚠️ **GitHub.com Fallback** ⚠️