Linux Unix help !!

"Give respect to Time, One day at right Time, Time will respect You"

Thursday, January 27, 2011

tar,zip,bzip,bzip2 linux commands

================== Compress Archiever ===========================

==> tar
tar -cvf file.tar <source_files>         ----> tared
tar -tvf file.tar                  ----> tabular view content of file
tar -xvf file.tar                  ----> untar

==> compress & uncompress    >>> RH-9 absent in RHEL versions
tar -Zcvf file.tar.Z <source_file>    ----> compress
tar -Zxvf file.tar.Z                 ----> uncompress

compress file.tar
uncompress file.tar.Z

==> zip & unzip
gip file.tar <source_name>          ----> ziped
gunzip file.tar.zip              ----> unziped

==> gzip & gunzip
tar -zcvf file.tar.gz <source_files>  ----> gziped
tar -zxvf file.tar.gz

gzip file.tar
gunzip file.tar.gz
           

==> bzip2 & bunzip2
tar -jcvf file.tar.bz2 <source_name>  ----> bziped
tar -jxvf file.tar.bz2              ----> bunziped

bzip2 file.tar.bzip2 <source_name> 
bunzip2 file.tar.bzip2

===========>> Test file contents of compressed file
tar -tvf <filename>               
    tar -Ztvf <filename>              
    tar -ztvf <filename>           
    tar -jtvf <filename>             

zcat <filename>.gz
bcat <filename>.bz2   ---> absent in RHEL
cpio -idmv <filename>.cpio
zcat <filename>.cpio.gz | cpio -idmv


=================== Advanced =======================
1 line gungip and untar
# zcat backup.gz | tar -xvf -

##### zip .
1. zip files
# zip myzip  file1 file2 file3  <--o/p file is myfile.zip

2. zip a directory
# zip -r myzip1 mydr/    <-o/p file  myzip1.zip

3. List zipped contents and sized compressed etc..
# unzip -l myzip1.zip OR
# unzip -v myzip1.zip

4. Add a file in zip archive .
# zip myzip1.zip  newfile.cf

5. get size of ziped contents .
















# Faced any problem Feedback in above contact me
#===============================Scratch===============================#
# AND Many More .....................Linux is Endless                 #
#========================== Hope you Liked IT ========================#
#                        CMNDS(tar,bzip, bzip2.. -- BY Shirish Shukla #
#                                                   RHC Engineer 2010 #
#                                             shirish.linux@gmail.com #
#                                           shirishlinux.blogspot.com #
# "Give Respect To Time One Day At Right Time, Time Will Respect You" #
#=====================================================================#
# TRy Hard theres nothing that are un-achievable by HARDdd-WORKkk     #
#=====================================================================#

No comments:

Post a Comment

Write Here .. your comments are always wellcome ..but no spam please !!

Followers

Pls LIKE my Story !!!