» Linux » Examen sur Linux » Examen 201 : Advanced Administration » Section 5 » Question 7/23
7.What command would you type to use the cpio command to create a backup called backup.cpio of all the users home directories?
Explanation: The cpio command expects to receive a list that contains one file per line. That is exactly the type of list that the find utility creates. The ls utility can also create this type of list, meaning that you will see either of the ls or the find utilities used in conjunction with cpio. And since cpio archives a list of files it receives from standard input, you usually use a pipe (|) whenever you create an archive with the cpio utility. A lot of documentation suggests using the -print option with the find command. For example, find /home - print | cpio -o > backup.cpio. However, this is not required on Linux systems, and other systems that use GNU find, although it is required on Unix systems.

Reference: http://www.unet.univie.ac.at/aix/cmds/aixcmds1/cpio.htm

« Question 6 Question 8 »