Home » LPI » 117-201 » What command would you type to use the cpio command to create a backup called backup.cpio of all the users home directories?
SIMULATION
What command would you type to use the cpio command to create a backup called backup.cpio of all the users home directories?
Correct Answer: find /home | cpio -o > backup.cpio
Explanation/Reference:
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 thels 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 thecpio 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
Download Printable PDF. VALID exam to help you PASS.
|
|