grep Command in Linux : What is grep Command ?
Linux netstat Command : Linux Networking
Bubble Sort in PHP With Example | How Bubble Sort Works in PHP
PHP Form validation | Validate User Input Data In PHP In Hindi
what is VPC In Hindi ? VPC kya hai
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.
Image on pixabay
ZIP एक archive file format है जो lossless data compression
support करता है। lossless data compression का मतलब है बिना कोई data को loss किये perfectly कम size में compress करना। ZIP file format कई compression algorithms allow / use करती है , जिनमे DEFLATE
सबसे common है।
Linux में unzip
command का use किसी zip file को extract करने के लिए किया जाता है। अगर आपके system पर unzip installed नहीं है , तो नीचे दी गयी command को run करके पहले unzip install कर लें।
$ sudo apt update $ sudo apt install unzip
बैसे तो unzip command में कई options हैं जिन्हे आप unzip --help
command run करके देख सकते हैं।
$ unzip --help
Example के लिए हमने पिछले topic (Linux zip Command) में एक index.zip
file create की थी , उसी zip files को different - different तरीके से वापस unzip
करने की कोशिश करेंगे।
$ unzip zip_filename
जब आप किसी zip file को unzip करेंगे तो जिस structure में zip file में content होगा उसी structure में extract हो जायगा।
$ unzip index.zip Archive: index.zip inflating: python.html creating: dir1/ inflating: dir1/blogs
Output में आप देख सकते हैं कि index.zip file से कौन कौन सी files unzip हुई है। बाकी listing के लिए आप ls Command या tree Command का use कर सकते हैं।
$ tree . ├── dir1 │ └── blogs ├── index.zip └── python.html 1 directory, 3 files
zip file content को किसी new folder में extract करने के लिए -d
option का use कर सकते हैं। pass की गयी directory अगर नहीं बनी तो new directory create हो जाएगी और अगर बनी हुई है तो उसमे content extract हो जायगा।
$ unzip -d zip_dir index.zip Archive: index.zip inflating: zip_dir/python.html creating: zip_dir/dir1/ inflating: zip_dir/dir1/blogs
बैसे तो इसकी need कम ही पड़ती है लेकिन फिर भी आप extract किये गए content को फिर से overwrite करना चाहते हैं तो , आपको -o option का use करना पड़ेगा।
$ unzip -o index.zip
extract करते समय आप ये भी define कर सकते हैं कि zip file से कौन सी files extract हो। unzip करते समय files को exclude करने के लिए -x
option का use किया जाता है।
$ unzip -x index.zip python.html
यह option बहुत important है , जिसे आप different तरीके से use कर सकते हैं।
For example
unzip -x zip_filename file1 file2 // exclude multiple files unzip -x zip_filename *.html // exclude only html files, you can use other extensions also. unzip -x zip_filename *txt // exclude files that ends with txt name . and so on
Loading ...
Hi ! My name is Rahul Kumar Rajput. I'm a back end web developer and founder of learnhindituts.com. I live in Uttar Pradesh (UP), India and I love to talk about programming as well as writing technical tutorials and tips that can help to others.
Get connected with me. :) LinkedIn Twitter Instagram Facebook