unzip
आर्काइव
इस्तेमाल
unzip [-d <dir>] <archive.zip>.zip को खोलता है, और `-d` न देने पर सब कुछ सीधे मौजूदा डायरेक्टरी में उलट देता है, इसलिए पहले `-l` से देखें कि भीतर कोई शीर्ष फ़ोल्डर है या नहीं; पुराने Windows पर बने zip के नामों के लिए `-O CP932` चाहिए, और `-P` से दिया पासवर्ड शेल के इतिहास और ps में दिखता रहता है।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| -l | List the contents without extracting. |
| -d <dir> | Extract there instead of into the current directory. |
| -o | Overwrite existing files without asking. |
| -n | Never overwrite: skip files that already exist. |
| -j | Flatten the paths into one directory. |
| -q | Quiet, for scripts. |
| -O CP932 | Interpret file names in a legacy code page (Debian/Ubuntu Info-ZIP only; stock macOS unzip rejects -O). |
| -P <password> | Password on the command line, where ps and your shell history can see it. |
उदाहरण
unzip -l archive.zipCheck whether it has a top-level folder before extracting.
unzip archive.zip -d /tmp/outExtract somewhere harmless.
unzip -O CP932 japanese.zipFixes mojibake from an older Windows zip, where the patched Info-ZIP is available.
बाँधना और दबाना अलग काम हैं: tar बाँधता है, gzip छोटा करता है, और .tar.gz दोनों है।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. unzip क्या करता है?
.zip को खोलता है, और `-d` न देने पर सब कुछ सीधे मौजूदा डायरेक्टरी में उलट देता है, इसलिए पहले `-l` से देखें कि भीतर कोई शीर्ष फ़ोल्डर है या नहीं; पुराने Windows पर बने zip के नामों के लिए `-O CP932` चाहिए, और `-P` से दिया पासवर्ड शेल के इतिहास और ps में दिखता रहता है।
Q. इसे कैसे लिखें?
unzip [-d <dir>] <archive.zip> — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 8 दिए हैं; पूरी सूची man unzip में है। यह कमांड आर्काइव में आती है।
मिलती-जुलती कमांड
man पेज: man unzip