cpio Flashcards
cpio
GNU cpio copies files between archives and directories.
cpio -o < listofnames > archive
This command copies files from the listofnames into the archive by using the -o option.
-o, –create, Creates the archive.
cpio -i < archive
This command extracts files from the archive by using the -i option.
-i, –extract, Extracts files from the archive.
cpio -p /home/user/namelist < listofnames.txt
This command reads a list of file names from stdin and copies them to a specified directory.
-p, –pass-through, Runs cpio in pass-through mode.
cat /etc/ | cpio -ov -H tar > /home/user/etcfiles.tar
This command creates a tar archive file by using -H option to specify a specific format to use.
-H, –format=FORMAT, Use give archive FORMAT.
cpio -iv -F < /home/user/etcfiles.tar
This file extracts a specific archive file with -F instead of using stdin.
-F, –file=ARCHIVE-FILE, Use this ARCHIVE-FILE instead of standard input or standard output.
cpio -it -F < /home/user/etcfiles.tar
This command lists etcfiles.tar by using the -t command.
-t, –list, Print a table of contents of the input.