For the archiving command, the options are as follows:
- -o: This specifies the output
- -v: This is used for printing a list of files archived
Using cpio, we can also archive using files as absolute paths. /usr/somedir is an absolute path as it contains the full path starting from root (/).
A relative path will not start with / but it starts the path from the current directory. For example, test/file means that there is a directory named test and file is inside the test directory.
While extracting, cpio extracts to the absolute path itself. However, in the case of tar, it removes the / in the absolute path and converts it to a relative path.
A relative path will not start with / but it starts the path from the current directory. For example, test/file means that there is a directory named test and file is inside the test directory.
While extracting, cpio extracts to the absolute path itself. However, in the case of tar, it removes the / in the absolute path and converts it to a relative path.
The options in the command for listing all the files in the given cpio archive are as follows:
- -i is for specifying the input
- -t is for listing
In the command for extraction, -o stands for extracting and cpio overwrites files without prompting. The -d option tells cpio to create new directories as needed.