SlideShare a Scribd company logo
1 of 31
Compression
Commands in
Linux
Pegah Taheri
Linux / Unix
Command: gzip
Linux / Unix Command: gzip
• gzip is a fast and efficient compression
program
– .gz filename extension
– gzip test.txt
• By default, gzip keeps the original file
name and timestamp in the compressed
file.
gzip Synopsis
• gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ]
• gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ]
• zcat [ -fhLV ] [ name ... ]
• gunzip also recognizes the special
extensions .tgz and .taz as shorthands
for .tar.gz and .tar.Z respectively.
gzip OPTIONS
• -c --stdout --to-stdout
– Write output on standard output
– keeps original files unchanged.
– If there are several input files, the output
consists of a sequence of independently
compressed members
• -f –force
– Force compression or decompression even if
the file has multiple links or the corresponding
file already exists
gzip OPTIONS
• -l –list
– For each compressed file, list the following
fields:
• compressed size: size of the compressed file
• uncompressed size: size of the uncompressed file
• ratio: compression ratio (0.0% if unknown)
• uncompressed_name: name of the uncompressed
file
• -n --no-name
– When compressing, do not save the original file
name and time stamp by default.
– When decompressing, do not restore the original
file name if present (remove only the gzip suffix
from the compressed file name) and do not restore
the original time stamp if present.
• -N –name
– When compressing, always save the original file
name and time stamp
– this is the default!
gzip OPTIONS
• -r –recursive
– Travel the directory structure recursively
• -t –test
– Test : Check the compressed file integrity.
gzip OPTIONS
• -# --fast –best
– Regulate the speed of compression using the
specified digit #
• -1 or --fast
– indicates the fastest compression method
– less compression
• -9 or --best
– indicates the slowest compression method
– best compression
• The default compression level is-6
• That is, biased towards high compression at
expense of speed
gzip OPTIONS
gzip decompression
• Compressed files can be restored to their
original form using:
– gzip -d oror
– gunzip oror
– zcat
• gunzip can currently decompress files created
by gzip, zip, compress, compress -H or pack.
– The detection of the input format is automatic.
• gzip and gunzip can also compress or
decompress data from standard input and
output
– ls -laR $HOME | gzip > filelist.gz
– Or by using –c option
gzip decompression
Linux / Unix
Command: bzip2
bzip2
• bzip2, bunzip2
– a block-sorting file compressor, v1.0.2
• bzcat
– decompresses files to stdout
• bzip2recover
– recovers data from damaged bzip2 files
• on the average about 10-20% better than
gzip
– at the expense of longer compression times
• Output with .bz2 filename extension
bzip2
• bzip2 [ -cdfkqstvzVL123456789 ] [ filenames ... ]
• bunzip2 [ -fkvsVL ] [ filenames ... ]
• bzcat [ -s ] [ filenames ... ]
• bzip2recover filename
• Each file is replaced by a compressed version of
itself, with the name "original_name.bz2“
bzip2: SYNOPSIS
• -c –stdout
– (as in gzip) Compress or decompress to
standard output.
• -t –test
– Check integrity of the specified file(s), but
don't decompress them.
• This really performs a trial decompression and
throws away the result.
bzip2 OPTIONS
• -k –keep
– Keep (don't delete) input files during
compression or decompression.
• -s –small
– Reduce memory usage, for compression,
decompression and testing.
• -1 (or --fast) to -9 (or --best)
– Set the block size to 100 k, 200 k .. 900 k
when compressing.
– Has no effect when decompressing.
bzip2 OPTIONS
• bzcat
• decompresses files to stdout
• bunzip2
• Cannot use bunzip2 to uncompress files
compressed with gzip and vice versa
bzip2 decompression
• bzip2 -d
– decompresses all specified files.
– Files which were not created by bzip2 will be
detected and ignored
• warning issued.
bzip2 decompression
bzip2 decompression
filename.bz2
->
filename
filename.bz filename
filename.tbz2 filename.tar
filename.tbz filename.tar
anyothername anyothername.out
• If the file does not end in one of the recognised endings:
• bz2
• bz
• tbz2
• Tbz
• bzip2 uses the original name with.out appended.
Linux / Unix
Command: tar
tar
• tar is a general-purpose archiving utility
– Stands for Tape Archive
– capable of packing many files into a single
archive file,
– while retaining information needed to restore
the files fully, such as file permissions and
ownership.
Tar options
• -c
– Create a new archive
• -x
– Extract files from an archive
• -t
– List table of contents to an archive
• -r
– append
Tar options
• -u
– Update files
• -d
– Compare files in the archive to those in the
file system
• -v
– print verbose information
• -k
– To keep any existing files when extracting
• f filename
– To specify that the tar file to be read or written is
filename.
• Parameter for gzip and bzip2:Parameter for gzip and bzip2:
• z
– To specify that the data to be written to the tar file should
be compressed or that the data in the tar file is compressed
with gzip.
• j
– Like z, but uses bzip2 instead of gzip;
• works only with newer versions of tar.
• Note:
– f must be the last letter in the list of options.
Tar options
tar
• tar saves the pathname of each file
relative to the location where the tar file
was originally created.
– tar cvf bin.tar /bin
  the directory bin is created in the working
directory of tar
– You can override this behavior using the P option when packing
tar files (not recommended to do!)
Other commands
Compress
Synopsis:
•compress [ -f ] [ -v ] [ -c ] [ -V ] [ -r ] [ -b bits ] [ name ... ]
•uncompress [ -f ] [ -v ] [ -c ] [ -V ] [ name ... ]
•zcat [ -V ] [ name ... ]
zip
SYNOPSIS
•zip [-aABcdDeEfFghjklLmoqrRSTuvVwXyz!@$] [-
b path] [-n suffixes] [-t mmddyyyy] [-tt
mmddyyyy] [ zipfile [ file1 file2 ...]] [-xi list]
•zipcloak [-dhL] [-b path] zipfile
•zipnote [-hwL] [-b path] zipfile
•zipsplit [-hiLpst] [-n size] [-b path] zipfile
unzip
SYNOPSIS
•unzip [-Z] [-cflptuvz[abjnoqsCLMVX$/:]]
file[.zip] [file(s) ...] [-x xfile(s) ...] [-d exdir]
•unzip will list, test, or extract files from a ZIP
archive.
The End! ;)The End! ;)

More Related Content

What's hot

Linux Linux Traffic Control
Linux Linux Traffic ControlLinux Linux Traffic Control
Linux Linux Traffic ControlSUSE Labs Taipei
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentationnishantsri
 
Supporting Apache HBase : Troubleshooting and Supportability Improvements
Supporting Apache HBase : Troubleshooting and Supportability ImprovementsSupporting Apache HBase : Troubleshooting and Supportability Improvements
Supporting Apache HBase : Troubleshooting and Supportability ImprovementsDataWorks Summit
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
 
Apache Spark on K8S Best Practice and Performance in the Cloud
Apache Spark on K8S Best Practice and Performance in the CloudApache Spark on K8S Best Practice and Performance in the Cloud
Apache Spark on K8S Best Practice and Performance in the CloudDatabricks
 
Compression
CompressionCompression
Compressionaswathyu
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory ManagementNi Zo-Ma
 
Lightweight Transactions in Scylla versus Apache Cassandra
Lightweight Transactions in Scylla versus Apache CassandraLightweight Transactions in Scylla versus Apache Cassandra
Lightweight Transactions in Scylla versus Apache CassandraScyllaDB
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL AdministrationEDB
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linuxPapu Kumar
 
Scaling Apache Storm - Strata + Hadoop World 2014
Scaling Apache Storm - Strata + Hadoop World 2014Scaling Apache Storm - Strata + Hadoop World 2014
Scaling Apache Storm - Strata + Hadoop World 2014P. Taylor Goetz
 
Linux Locking Mechanisms
Linux Locking MechanismsLinux Locking Mechanisms
Linux Locking MechanismsKernel TLV
 
x86 Mimarisi ve Tersine Mühendislik
x86 Mimarisi ve Tersine Mühendislikx86 Mimarisi ve Tersine Mühendislik
x86 Mimarisi ve Tersine Mühendislikcanyoupwn.me
 
Data Pipelines with Kafka Connect
Data Pipelines with Kafka ConnectData Pipelines with Kafka Connect
Data Pipelines with Kafka ConnectKaufman Ng
 
Optimizing Apache Spark SQL Joins
Optimizing Apache Spark SQL JoinsOptimizing Apache Spark SQL Joins
Optimizing Apache Spark SQL JoinsDatabricks
 
RocksDB Performance and Reliability Practices
RocksDB Performance and Reliability PracticesRocksDB Performance and Reliability Practices
RocksDB Performance and Reliability PracticesYoshinori Matsunobu
 
Spark shuffle introduction
Spark shuffle introductionSpark shuffle introduction
Spark shuffle introductioncolorant
 

What's hot (20)

Linux Linux Traffic Control
Linux Linux Traffic ControlLinux Linux Traffic Control
Linux Linux Traffic Control
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Supporting Apache HBase : Troubleshooting and Supportability Improvements
Supporting Apache HBase : Troubleshooting and Supportability ImprovementsSupporting Apache HBase : Troubleshooting and Supportability Improvements
Supporting Apache HBase : Troubleshooting and Supportability Improvements
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 
Apache Spark on K8S Best Practice and Performance in the Cloud
Apache Spark on K8S Best Practice and Performance in the CloudApache Spark on K8S Best Practice and Performance in the Cloud
Apache Spark on K8S Best Practice and Performance in the Cloud
 
Compression
CompressionCompression
Compression
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Lightweight Transactions in Scylla versus Apache Cassandra
Lightweight Transactions in Scylla versus Apache CassandraLightweight Transactions in Scylla versus Apache Cassandra
Lightweight Transactions in Scylla versus Apache Cassandra
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linux
 
Know the UNIX Commands
Know the UNIX CommandsKnow the UNIX Commands
Know the UNIX Commands
 
Scaling Apache Storm - Strata + Hadoop World 2014
Scaling Apache Storm - Strata + Hadoop World 2014Scaling Apache Storm - Strata + Hadoop World 2014
Scaling Apache Storm - Strata + Hadoop World 2014
 
Linux Locking Mechanisms
Linux Locking MechanismsLinux Locking Mechanisms
Linux Locking Mechanisms
 
x86 Mimarisi ve Tersine Mühendislik
x86 Mimarisi ve Tersine Mühendislikx86 Mimarisi ve Tersine Mühendislik
x86 Mimarisi ve Tersine Mühendislik
 
Spark tuning
Spark tuningSpark tuning
Spark tuning
 
Rds data lake @ Robinhood
Rds data lake @ Robinhood Rds data lake @ Robinhood
Rds data lake @ Robinhood
 
Data Pipelines with Kafka Connect
Data Pipelines with Kafka ConnectData Pipelines with Kafka Connect
Data Pipelines with Kafka Connect
 
Optimizing Apache Spark SQL Joins
Optimizing Apache Spark SQL JoinsOptimizing Apache Spark SQL Joins
Optimizing Apache Spark SQL Joins
 
RocksDB Performance and Reliability Practices
RocksDB Performance and Reliability PracticesRocksDB Performance and Reliability Practices
RocksDB Performance and Reliability Practices
 
Spark shuffle introduction
Spark shuffle introductionSpark shuffle introduction
Spark shuffle introduction
 

Viewers also liked

Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Scriptsbmguys
 
Comandos unix y linux
Comandos unix y linuxComandos unix y linux
Comandos unix y linuxssk01
 
August 2013 HUG: Compression Options in Hadoop - A Tale of Tradeoffs
August 2013 HUG: Compression Options in Hadoop - A Tale of TradeoffsAugust 2013 HUG: Compression Options in Hadoop - A Tale of Tradeoffs
August 2013 HUG: Compression Options in Hadoop - A Tale of TradeoffsYahoo Developer Network
 
Formatos compresión de archivos jonatan
Formatos compresión de archivos jonatanFormatos compresión de archivos jonatan
Formatos compresión de archivos jonatanjmdiazcas
 
4.6 create and change hard and symbolic links v2
4.6 create and change hard and symbolic links v24.6 create and change hard and symbolic links v2
4.6 create and change hard and symbolic links v2Acácio Oliveira
 
Managing your data - Introduction to Linux for bioinformatics
Managing your data - Introduction to Linux for bioinformaticsManaging your data - Introduction to Linux for bioinformatics
Managing your data - Introduction to Linux for bioinformaticsBITS
 
Course 102: Lecture 11: Environment Variables
Course 102: Lecture 11: Environment VariablesCourse 102: Lecture 11: Environment Variables
Course 102: Lecture 11: Environment VariablesAhmed El-Arabawy
 
Unit 3
Unit  3Unit  3
Unit 3siddr
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scriptingvceder
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsDr.Ravi
 
Shell Scripting in Linux
Shell Scripting in LinuxShell Scripting in Linux
Shell Scripting in LinuxAnu Chaudhry
 
Process management
Process managementProcess management
Process managementMohd Arif
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell ScriptingMustafa Qasim
 
Memory management in Linux kernel
Memory management in Linux kernelMemory management in Linux kernel
Memory management in Linux kernelVadim Nikitin
 

Viewers also liked (20)

Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
Comandos unix y linux
Comandos unix y linuxComandos unix y linux
Comandos unix y linux
 
August 2013 HUG: Compression Options in Hadoop - A Tale of Tradeoffs
August 2013 HUG: Compression Options in Hadoop - A Tale of TradeoffsAugust 2013 HUG: Compression Options in Hadoop - A Tale of Tradeoffs
August 2013 HUG: Compression Options in Hadoop - A Tale of Tradeoffs
 
Formatos compresión de archivos jonatan
Formatos compresión de archivos jonatanFormatos compresión de archivos jonatan
Formatos compresión de archivos jonatan
 
4.6 create and change hard and symbolic links v2
4.6 create and change hard and symbolic links v24.6 create and change hard and symbolic links v2
4.6 create and change hard and symbolic links v2
 
Basic Linux kernel
Basic Linux kernelBasic Linux kernel
Basic Linux kernel
 
Memory management in linux
Memory management in linuxMemory management in linux
Memory management in linux
 
Managing your data - Introduction to Linux for bioinformatics
Managing your data - Introduction to Linux for bioinformaticsManaging your data - Introduction to Linux for bioinformatics
Managing your data - Introduction to Linux for bioinformatics
 
Course 102: Lecture 11: Environment Variables
Course 102: Lecture 11: Environment VariablesCourse 102: Lecture 11: Environment Variables
Course 102: Lecture 11: Environment Variables
 
Unit 3
Unit  3Unit  3
Unit 3
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Intro to Linux Shell Scripting
Intro to Linux Shell ScriptingIntro to Linux Shell Scripting
Intro to Linux Shell Scripting
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
Shell Scripting in Linux
Shell Scripting in LinuxShell Scripting in Linux
Shell Scripting in Linux
 
Shell programming
Shell programmingShell programming
Shell programming
 
Process management
Process managementProcess management
Process management
 
Basic Unix
Basic UnixBasic Unix
Basic Unix
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
Memory management in Linux kernel
Memory management in Linux kernelMemory management in Linux kernel
Memory management in Linux kernel
 

Similar to Compression Commands in Linux

Linux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveLinux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveKenny (netman)
 
Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files Ahmed El-Arabawy
 
Basic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersBasic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersDevanand Gehlot
 
12 linux archiving tools
12 linux archiving tools12 linux archiving tools
12 linux archiving toolsShay Cohen
 
Part 4 of 'Introduction to Linux for bioinformatics': Managing data
Part 4 of 'Introduction to Linux for bioinformatics': Managing data Part 4 of 'Introduction to Linux for bioinformatics': Managing data
Part 4 of 'Introduction to Linux for bioinformatics': Managing data Joachim Jacob
 
Basic commands of linux By Adam
Basic commands of linux By Adam Basic commands of linux By Adam
Basic commands of linux By Adam Mohammed Adam
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryMongoDB
 
Bullwinkle introduction
Bullwinkle introductionBullwinkle introduction
Bullwinkle introductionTurner England
 
HadoopCompression
HadoopCompressionHadoopCompression
HadoopCompressionDemet Aksoy
 
Linux basics and commands - from lynxbee.com
Linux basics and commands - from lynxbee.comLinux basics and commands - from lynxbee.com
Linux basics and commands - from lynxbee.comGreen Ecosystem
 
Basic linux commands
Basic linux commands Basic linux commands
Basic linux commands Raghav Arora
 
The Linux Command Cheat Sheet
The Linux Command Cheat SheetThe Linux Command Cheat Sheet
The Linux Command Cheat SheetTola LENG
 
Piratte installation
Piratte installationPiratte installation
Piratte installationKampa Lavanya
 
Linux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsLinux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsKenny (netman)
 

Similar to Compression Commands in Linux (20)

Linux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archiveLinux fundamental - Chap 04 archive
Linux fundamental - Chap 04 archive
 
Basic Linux day 6
Basic Linux day 6Basic Linux day 6
Basic Linux day 6
 
linuxtl04.pptx
linuxtl04.pptxlinuxtl04.pptx
linuxtl04.pptx
 
Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files
 
Basic shell commands by Jeremy Sanders
Basic shell commands by Jeremy SandersBasic shell commands by Jeremy Sanders
Basic shell commands by Jeremy Sanders
 
12 linux archiving tools
12 linux archiving tools12 linux archiving tools
12 linux archiving tools
 
Part 4 of 'Introduction to Linux for bioinformatics': Managing data
Part 4 of 'Introduction to Linux for bioinformatics': Managing data Part 4 of 'Introduction to Linux for bioinformatics': Managing data
Part 4 of 'Introduction to Linux for bioinformatics': Managing data
 
101 apend. backups
101 apend. backups101 apend. backups
101 apend. backups
 
Basic commands of linux By Adam
Basic commands of linux By Adam Basic commands of linux By Adam
Basic commands of linux By Adam
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster Recovery
 
Bullwinkle introduction
Bullwinkle introductionBullwinkle introduction
Bullwinkle introduction
 
HadoopCompression
HadoopCompressionHadoopCompression
HadoopCompression
 
4.8 apend backups
4.8 apend backups4.8 apend backups
4.8 apend backups
 
Linux basics and commands - from lynxbee.com
Linux basics and commands - from lynxbee.comLinux basics and commands - from lynxbee.com
Linux basics and commands - from lynxbee.com
 
Basic linux commands
Basic linux commands Basic linux commands
Basic linux commands
 
Linux
LinuxLinux
Linux
 
The Linux Command Cheat Sheet
The Linux Command Cheat SheetThe Linux Command Cheat Sheet
The Linux Command Cheat Sheet
 
Piratte installation
Piratte installationPiratte installation
Piratte installation
 
FUSE Filesystems
FUSE FilesystemsFUSE Filesystems
FUSE Filesystems
 
Linux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fsLinux fundamental - Chap 10 fs
Linux fundamental - Chap 10 fs
 

Recently uploaded

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 

Recently uploaded (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 

Compression Commands in Linux

  • 3. Linux / Unix Command: gzip • gzip is a fast and efficient compression program – .gz filename extension – gzip test.txt • By default, gzip keeps the original file name and timestamp in the compressed file.
  • 4. gzip Synopsis • gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ... ] • gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ... ] • zcat [ -fhLV ] [ name ... ] • gunzip also recognizes the special extensions .tgz and .taz as shorthands for .tar.gz and .tar.Z respectively.
  • 5. gzip OPTIONS • -c --stdout --to-stdout – Write output on standard output – keeps original files unchanged. – If there are several input files, the output consists of a sequence of independently compressed members • -f –force – Force compression or decompression even if the file has multiple links or the corresponding file already exists
  • 6. gzip OPTIONS • -l –list – For each compressed file, list the following fields: • compressed size: size of the compressed file • uncompressed size: size of the uncompressed file • ratio: compression ratio (0.0% if unknown) • uncompressed_name: name of the uncompressed file
  • 7. • -n --no-name – When compressing, do not save the original file name and time stamp by default. – When decompressing, do not restore the original file name if present (remove only the gzip suffix from the compressed file name) and do not restore the original time stamp if present. • -N –name – When compressing, always save the original file name and time stamp – this is the default! gzip OPTIONS
  • 8. • -r –recursive – Travel the directory structure recursively • -t –test – Test : Check the compressed file integrity. gzip OPTIONS
  • 9. • -# --fast –best – Regulate the speed of compression using the specified digit # • -1 or --fast – indicates the fastest compression method – less compression • -9 or --best – indicates the slowest compression method – best compression • The default compression level is-6 • That is, biased towards high compression at expense of speed gzip OPTIONS
  • 10. gzip decompression • Compressed files can be restored to their original form using: – gzip -d oror – gunzip oror – zcat • gunzip can currently decompress files created by gzip, zip, compress, compress -H or pack. – The detection of the input format is automatic.
  • 11. • gzip and gunzip can also compress or decompress data from standard input and output – ls -laR $HOME | gzip > filelist.gz – Or by using –c option gzip decompression
  • 13. bzip2 • bzip2, bunzip2 – a block-sorting file compressor, v1.0.2 • bzcat – decompresses files to stdout • bzip2recover – recovers data from damaged bzip2 files
  • 14. • on the average about 10-20% better than gzip – at the expense of longer compression times • Output with .bz2 filename extension bzip2
  • 15. • bzip2 [ -cdfkqstvzVL123456789 ] [ filenames ... ] • bunzip2 [ -fkvsVL ] [ filenames ... ] • bzcat [ -s ] [ filenames ... ] • bzip2recover filename • Each file is replaced by a compressed version of itself, with the name "original_name.bz2“ bzip2: SYNOPSIS
  • 16. • -c –stdout – (as in gzip) Compress or decompress to standard output. • -t –test – Check integrity of the specified file(s), but don't decompress them. • This really performs a trial decompression and throws away the result. bzip2 OPTIONS
  • 17. • -k –keep – Keep (don't delete) input files during compression or decompression. • -s –small – Reduce memory usage, for compression, decompression and testing. • -1 (or --fast) to -9 (or --best) – Set the block size to 100 k, 200 k .. 900 k when compressing. – Has no effect when decompressing. bzip2 OPTIONS
  • 18. • bzcat • decompresses files to stdout • bunzip2 • Cannot use bunzip2 to uncompress files compressed with gzip and vice versa bzip2 decompression
  • 19. • bzip2 -d – decompresses all specified files. – Files which were not created by bzip2 will be detected and ignored • warning issued. bzip2 decompression
  • 20. bzip2 decompression filename.bz2 -> filename filename.bz filename filename.tbz2 filename.tar filename.tbz filename.tar anyothername anyothername.out • If the file does not end in one of the recognised endings: • bz2 • bz • tbz2 • Tbz • bzip2 uses the original name with.out appended.
  • 22. tar • tar is a general-purpose archiving utility – Stands for Tape Archive – capable of packing many files into a single archive file, – while retaining information needed to restore the files fully, such as file permissions and ownership.
  • 23. Tar options • -c – Create a new archive • -x – Extract files from an archive • -t – List table of contents to an archive • -r – append
  • 24. Tar options • -u – Update files • -d – Compare files in the archive to those in the file system • -v – print verbose information • -k – To keep any existing files when extracting • f filename – To specify that the tar file to be read or written is filename.
  • 25. • Parameter for gzip and bzip2:Parameter for gzip and bzip2: • z – To specify that the data to be written to the tar file should be compressed or that the data in the tar file is compressed with gzip. • j – Like z, but uses bzip2 instead of gzip; • works only with newer versions of tar. • Note: – f must be the last letter in the list of options. Tar options
  • 26. tar • tar saves the pathname of each file relative to the location where the tar file was originally created. – tar cvf bin.tar /bin   the directory bin is created in the working directory of tar – You can override this behavior using the P option when packing tar files (not recommended to do!)
  • 28. Compress Synopsis: •compress [ -f ] [ -v ] [ -c ] [ -V ] [ -r ] [ -b bits ] [ name ... ] •uncompress [ -f ] [ -v ] [ -c ] [ -V ] [ name ... ] •zcat [ -V ] [ name ... ]
  • 29. zip SYNOPSIS •zip [-aABcdDeEfFghjklLmoqrRSTuvVwXyz!@$] [- b path] [-n suffixes] [-t mmddyyyy] [-tt mmddyyyy] [ zipfile [ file1 file2 ...]] [-xi list] •zipcloak [-dhL] [-b path] zipfile •zipnote [-hwL] [-b path] zipfile •zipsplit [-hiLpst] [-n size] [-b path] zipfile
  • 30. unzip SYNOPSIS •unzip [-Z] [-cflptuvz[abjnoqsCLMVX$/:]] file[.zip] [file(s) ...] [-x xfile(s) ...] [-d exdir] •unzip will list, test, or extract files from a ZIP archive.
  • 31. The End! ;)The End! ;)