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 ofgzip
by passing the-j
option to thetar
command:
tar -cjvf file.tar.bz2 /home/vivek/data/
- c
- v
- f
- z
- j
tar xvf <.tar file>
tar xzvf <.tar.gz file>
tar xjvf <.tar.bz2 file>