cpio

आर्काइव

इस्तेमाल

find <path> | cpio -o > <archive.cpio>

यह पुराना संग्राहक है जो पैक करने वाले नामों की सूची मानक इनपुट से लेता है, इसीलिए उसे आम तौर पर find खिलाता है; `-o` संग्रह बनाता है, `-i` उसे खोलता है, `-t` सूची दिखाता है, `-H newc` वही पोर्टेबल रूप है जिसे initramfs इमेज इस्तेमाल करती हैं, और `--no-absolute-filenames` किसी और के भेजे संग्रह को पूर्ण पथ पर लिखने से रोकता है।

आम विकल्प

विकल्पअर्थ
-oCopy-out: build an archive from the names arriving on stdin.
-iCopy-in: extract from an archive on stdin.
-dCreate directories as needed while extracting.
-mPreserve modification times.
-tList the contents instead of extracting.
-vPrint names as they are processed.
-H newcThe portable SVR4 format, and the one initramfs images use.
--no-absolute-filenamesRefuse to extract to absolute paths from an untrusted archive (GNU cpio only).

उदाहरण

find . -depth -print | cpio -ov -H newc > backup.cpio

Archive exactly the file list that find produced.

cpio -idmv < backup.cpio

Extract, creating directories and keeping timestamps.

cpio -itv < backup.cpio

List what is inside first.

बाँधना और दबाना अलग काम हैं: tar बाँधता है, gzip छोटा करता है, और .tar.gz दोनों है।

कैसे पढ़ें

  • बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
  • तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
  • विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।

आम सवाल

Q. cpio क्या करता है?

यह पुराना संग्राहक है जो पैक करने वाले नामों की सूची मानक इनपुट से लेता है, इसीलिए उसे आम तौर पर find खिलाता है; `-o` संग्रह बनाता है, `-i` उसे खोलता है, `-t` सूची दिखाता है, `-H newc` वही पोर्टेबल रूप है जिसे initramfs इमेज इस्तेमाल करती हैं, और `--no-absolute-filenames` किसी और के भेजे संग्रह को पूर्ण पथ पर लिखने से रोकता है।

Q. इसे कैसे लिखें?

find <path> | cpio -o > <archive.cpio> — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।

Q. कितने विकल्प जानने लायक़ हैं?

यहाँ 8 दिए हैं; पूरी सूची man cpio में है। यह कमांड आर्काइव में आती है।

मिलती-जुलती कमांड

man पेज: man cpio