Function description: cpio command is to redirect the file by redirecting the file, restore the recovery tool, it can be decompressed with ".cpio" or "<quo;.tar" The ending file.
Use format: cpio [options] > file name or device name cpio [options] < file name or device name option description: detailed option description see the table below
option meaning-o Package a copy of the file into a file or output the file to the device. -i Extract the packaged files or restore the backups on the device to the system. -t View the contents of the files packaged by cpio or the contents of the files output to the device. -v Displays the file name during the packaging process. -d Automatically create the corresponding directory during cpio restore file. -c A newer way of storing. -B allows the default Blocks to be increased to 5120 bytes and the default Blocks to 512 bytes. This has the advantage of speeding up access.
Example: 1. Back up all the normal files under /etc to /opt/etc.cpio, using the following command: [root@mylinux ~]# find /etc –type f |
Cpio –ocvB >/opt/etc.cpio2. Back up all the data on the system to the tape drive, use the following command: [root@mylinux ~]# find /-print |
Cpio -covB > /dev/st0# The "/dev/st0&rdquo" is the device name of the tape, which represents the SCSI tape drive. 3. To view the files backed up on the tape drive, use the following command: # Sometimes it may be because there are too many files backed up, and one screen cannot be displayed. At this time, we use the following command to output the file information of the tape drive to the file. [root@mylinux ~]# cpio -icdvt < /dev/st0 > /tmp/st_content4. Restore the backup package in Example 1 to the appropriate location. If there is the same file to overwrite, use the following command:
[root@mylinux ~]#cpio –icduv < /opt/etc.cpio# Note that the path of cpio recovery, if cpio uses absolute path when packaging backup, then it will automatically restore to these absolute paths when recovering. In this case, all backup files will be restored to the corresponding /etc path. In the catalog. Similarly, if a backup path is used for a backup, the restore will also return to the relative path. Through the above example, it can be seen that cpio can not directly read the file, it needs the full path name of each file or directory to recognize the read, and the output of the find command just does this, so the cpio command is generally and find The command is used together. In fact, the above example we have seen their combined usage.
When I maintain the blog file today, I found that I cant delete some folders and files in the websi
As the demand for PaaS and DevOps solutions grows, we can see that legacy applications running on v
1.LinuxOSVersion:RedHat AS 52. Network Environment Settings: Host (Linux): IP: 192.168.1.1 NetMark:
Find the virtual machine settings, set as shown below (additional figure: must be 3.0 u disk and pl
Simple comparison of linear power supply, thyristor power supply, switching power supply circuit
Linux system troubleshooting log: Logrotate
How Linux uses commands to generate bounce SHELL
VMware View4.5 Virtual Desktop Solution FAQ
Virtual machine VMware uninstall is not a thorough solution
Linux changes the user name of a file f1 to user, the user group is group code
LINUX device driver - race, blocking, reentrant code
How to manually clear or refresh the SWAP partition of Linux
Solve the method of viewing pdf reader under linux
Netizen collection: Linux operating system experience sharing
Ten more common server management error analysis
Win10 10074 latest preview user interface new features overview
New ideas to restore system administrator password with Gene (5)
Using Win8 Credential Manager to view the account password saved on the webpage.
Windows 7 system security maintenance a few tips (2)
How to open and use the recorder software
Win7 system web page font size setting method
The experience of the rookie-level netizens' own hands-on system (2)
How to solve the problem of WinXP system IE prompt "Do you want to stop running this script"
Win7 user directory has an additional Administrator.xxx solution