wc Command In Linux | Linux count characters in line or file
Linux ls command and it's options
Linux adduser Command In Hindi
Linux sort Command Examples | Sort files or directory in Linux
PHP Null Coalescing Operator In Hindi , Null Coalescing Operator kya hai ?
Web Performance In Hindi : Website Performance Kya Hai?
Java program to check if a number is Armstrong : Find Armstrong Number In Java
If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
Linux में Gzip एक common compression algorithm है जो file को original file format, ownership और timeline के साथ compress करती है। जब किसी file or folder को gzip
command से compress करते है। तो इसका same name पहले जैसा ही होता है लेकिन extension .gz
हो जायेगा ।
$ gzip [options] file1 file2
gzip command के सभी options देखने के लिए gzip -h
या gzip --help
command कर सकते हैं।
$ gzip --help -c, --stdout write on standard output, keep original files unchanged -d, --decompress decompress -f, --force force overwrite of output file and compress links -h, --help give this help -k, --keep keep (don't delete) input files -l, --list list compressed file contents -L, --license display software license -n, --no-name do not save or restore the original name and timestamp -N, --name save or restore the original name and timestamp -q, --quiet suppress all warnings -r, --recursive operate recursively on directories --rsyncable make rsync-friendly archive -S, --suffix=SUF use suffix SUF on compressed files --synchronous synchronous output (safer if system crashes, but slower) -t, --test test compressed file integrity -v, --verbose verbose mode -V, --version display version number -1, --fast compress faster -9, --best compress better
by default , आप जो file pass करोगे उसी name से .gz
file बन जाएगी। और सभी files delete हो जाएँगी। Example के लिए मेरी current directory में different - different size कई files और directories हैं , जिन्हे ls Command करके आप देख सकते हैं।
$ ls testfile1 testfile2 testfile3 testfile4
अब gzip
command run करके देखते हैं -
$ gzip testfile1 $ ls testfile1.gz testfile2 testfile3 testfile4
Output में आप देख सकते हैं कि testfile1
file की जगह testfile1.gz
बन गयी है।
$ gzip testfile2 testfile3 $ ls testfile1.gz testfile2.gz testfile3.gz
हालाँकि आप -k
option का use करके file को delete होने से बचा सकते हैं।
$ gzip testfile4 $ ls testfile1.gz testfile2.gz testfile3.gz testfile4 testfile4.gz
ऊपर दिए गए सभी examples files के लिए थे , किसी directory के अंदर का सभी files / sub-directory को compress करने के लिए -r
option का use किया जाता है।
$ gzip -r directory_name
same , gzip
command का use करके आप किसी compressed file को decompress भी कर सकते हैं। decompress करने के लिए -d
option का use किया जाता है।
$ gzip -d testfile1
ठीक multiple files compression की तरह ही आप एक साथ कई files भी decompress कर सकते हैं।
$ gzip -d testfile2.gz testfile3.gz testfile4.gz $ ls testfile1 testfile2 testfile3 testfile4
-l
option का use करके आप किसी compressed file का content भी देख सकते हैं।
$ gzip -l testfile1.gz compressed uncompressed ratio uncompressed_name 30 0 0.0% testfile1
Loading ...
Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)
Get connected with me. :) LinkedIn Twitter Instagram Facebook