建设部人事教育司网站网页版传奇合击版
- 作者: 五速梦信息网
- 时间: 2026年03月21日 10:46
当前位置: 首页 > news >正文
建设部人事教育司网站,网页版传奇合击版,怎样学装修设计快速入门,如何制作可以下单的网站0 前言
在Linux系统中#xff0c;除了tar命令#xff0c;我们还可以使用cpio命令来进行文件和目录的归档。
1 cpio命令的功能#xff0c;帮助信息#xff0c;格式#xff0c;选项和参数说明
1.1 cpio命令的功能
cpio 名字来自 copy in, copy out#xf… 0 前言
在Linux系统中除了tar命令我们还可以使用cpio命令来进行文件和目录的归档。
1 cpio命令的功能帮助信息格式选项和参数说明
1.1 cpio命令的功能
cpio 名字来自 copy in, copy out拷进拷出是Linux中用于处理归档文件例如.cpio或.tar文件的工具即从一个地方复制文件到另一个地方同时保留文件的属性如所有权、权限和时间戳。
使用cpio命令必须带参数或选项。
1.2 cpio命令的帮助信息
我们可以使用命令 cpio –help 或 cpio –usage 来查看cpio命令的帮助信息。
1.2.1 bash下的cpio命令帮助信息
[purpleendurer bash ~] cpio –help
Usage: cpio [OPTION…] [destination-directory]
GNU cpio copies files to and from archivesExamples:# Copy files named in name-list to the archivecpio -o name-list [ archive]# Extract files from the archivecpio -i [ archive]# Copy files named in name-list to destination-directorycpio -p destination-directory name-listMain operation mode:-i, –extract Extract files from an archive (run in copy-inmode)-o, –create Create the archive (run in copy-out mode)-p, –pass-through Run in copy-pass mode-t, –list Print a table of contents of the inputOperation modifiers valid in any mode:–block-sizeBLOCK-SIZE Set the I/O block size to BLOCK-SIZE * 512bytes-B Set the I/O block size to 5120 bytes-c Identical to -H newc, use the new (SVR4)portable format.If you wish the old portable(ASCII) archive format, use -H odc instead.-C, –io-sizeNUMBER Set the I/O block size to the given NUMBER ofbytes–force-local Archive file is local, even if its name containscolons-f, –nonmatching Only copy files that do not match any of the givenpatterns-F, –file[[USER]HOST:]FILE-NAMEUse this FILE-NAME instead of standard input oroutput. Optional USER and HOST specify the userand host names in case of a remote archive-H, –formatFORMAT Use given archive FORMAT-M, –messageSTRING Print STRING when the end of a volume of thebackup media is reached-n, –numeric-uid-gid In the verbose table of contents listing, shownumeric UID and GID–quiet Do not print the number of blocks copied–rsh-commandCOMMAND Use remote COMMAND instead of rsh-v, –verbose Verbosely list the files processed-V, –dot Print a . for each file processed-W, –warningFLAG Control warning display. Currently FLAG is one ofnone, truncate, all. Multiple optionsaccumulate.Operation modifiers valid only in copy-in mode:-b, –swap Swap both halfwords of words and bytes ofhalfwords in the data. Equivalent to -sS-r, –rename Interactively rename files-s, –swap-bytes Swap the bytes of each halfword in the files-S, –swap-halfwords Swap the halfwords of each word (4 bytes) in thefiles–to-stdout Extract files to standard output-E, –pattern-fileFILE Read additional patterns specifying filenames toextract or list from FILE–only-verify-crc When reading a CRC format archive, only verify thechecksum of each file in the archive, dontactually extract the filesOperation modifiers valid only in copy-out mode:-A, –append Append to an existing archive.–device-independent, –reproducibleCreate device-independent (reproducible) archives–ignore-devno Dont store device numbers-O [[USER]HOST:]FILE-NAME Archive filename to use instead of standardoutput. Optional USER and HOST specify the userand host names in case of a remote archive–renumber-inodes Renumber inodesOperation modifiers valid only in copy-pass mode:-l, –link Link files instead of copying them, whenpossibleOperation modifiers valid in copy-in and copy-out modes:–absolute-filenames Do not strip file system prefix components fromthe file names–no-absolute-filenames Create all files relative to the currentdirectoryOperation modifiers valid in copy-out and copy-pass modes:-0, –null A list of filenames is terminated by a nullcharacter instead of a newline-a, –reset-access-time Reset the access times of files after readingthem-I [[USER]HOST:]FILE-NAME Archive filename to use instead of standard input.Optional USER and HOST specify the user and hostnames in case of a remote archive-L, –dereference Dereference symbolic links (copy the filesthat they point to instead of copying the links).-R, –owner[USER][:.][GROUP] Set the ownership of all files created to thespecified USER and/or GROUPOperation modifiers valid in copy-in and copy-pass modes:-d, –make-directories Create leading directories where needed-m, –preserve-modification-timeRetain previous file modification times whencreating files–no-preserve-owner Do not change the ownership of the files–sparse Write files with large blocks of zeros as sparsefiles-u, –unconditional Replace all files unconditionally-?, –help give this help list–usage give a short usage message–version print program versionMandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.Report bugs to bug-cpiognu.org. 1.2.2 银河麒麟kylin系统中的cpio命令帮助信息
[purpleendurer kylin ~] cpio –help
用法 cpio [选项…] [目标目录]
GNU cpio 归档文件及从包中提取文件例子:# 归档 name-list 中的文件到 archivecpio -o name-list [ archive]# 从 archive 中提取文件cpio -i [ archive]# 拷贝 name-list 中的文件到目标目录(destination-directory)cpio -p destination-directory name-list主操作模式-i, –extract 从包中提取文件 (运行 copy-in 模式)-o, –create 创建包 (运行 copy-out 模式)-p, –pass-through 运行 copy-pass 模式-t, –list 打印输入内容列表应用于所有模式的选项:–block-sizeBLOCK-SIZE 设置 I/O 块大小为 BLOCK-SIZE * 512字节-B 设置 I/O 块大小为 5120 字节-c 使用老的可移植的 (ASCII) 包格式-C, –io-sizeNUMBER 设置 I/O 块大小为指定的 NUMBER 字节–force-local包文件是本地的尽管名字中含有冒号-f, –nonmatching 仅拷贝不匹配任意给定的模式的文件-F, –file[[用户]主机:]文件名用“文件名”来替代标准输入和输出。如果是非本地的文件则用可选的“用户”和“主机”来指定用户名和主机名。-H, –format格式 使用指定的包格式-M, –messageSTRING 当到达备份介质的尾部的时候打印STRING-n, –numeric-uid-gid 在内容列表的详表中显示数字的 UID和 GID–quiet 不要打印已拷贝的块数–rsh-commandCOMMAND 用 COMMAND 替代 rsh-v, –verbose 详细列出已处理的文件-V, –dot 每处理一个文件就打印一个“.”-W, –warningFLAG 控制警告信息显示。当前 FLAG可为“none”、“truncate”或“all”。多个选项可以累积。命令修饰仅在 copy-in 模式中有效:-b, –swap交换数据中每个字的两个半字以及每个半字中的两个字节。等价于-sS-r, –rename 交互式重命名文件-s, –swap-bytes 交换文件中每个半字中的两个字节-S, –swap-halfwords交换文件中每个字(4个字节)中的两个半字–to-stdout 提取文件到标准输出-E, –pattern-fileFILE 从 FILE中读取额外的用于指定提取或列表的文件名的模式–only-verify-crc 当读取一个 CRC格式的包仅检验包中每个文件的CRC不提取文件应用于 copy-out 模式的选项-A, –append 追加到已存在的归档文件。-O [[用户]主机:]文件名使用包文件名而不是标准输出。如果文件在远程机器上则可指定用户和主机应用于 copy-pass 模式的选项:-l, –link 在可行时链接文件而不是拷贝文件应用于 copy-in 及 copy-out 模式的选项:–absolute-filenames 文件名不去除文件系统前缀–no-absolute-filenames 相对于当前目录来创建所有文件应用于 copy-out 及 copy-pass 模式的选项:-0, –null 文件名列表采用 NULL而不是换行作为分割符-a, –reset-access-time 文件读取后恢复文件的访问时间-I [[用户]主机:]文件名从文件读入而不是从标准输入读入。如果文件在远程机器上则可指定用户和主机-L, –dereference 跟随符号链接(拷贝符号链接指向的文件而不是拷贝链接本身)-R, –owner[用户][:.][组]设置所有文件的所有权信息到指定的用户和/或组应用于 copy-in 和 copy-pass 模式的选项:-d, –make-directories 需要时创建目录–extract-over-symlinks Force writing over symbolic links-m, –preserve-modification-time创建文件时保留以前文件的修改时间–no-preserve-owner 不改变文件的所有权–sparse把含有大块零的文件以稀疏文件方式写出-u, –unconditional 无条件覆盖所有文件-?, –help 显示此帮助列表–usage 显示简短的用法说明–version 打印程序版本对长选项必须或可选的参数同样适用于相应的短选项。请向 bug-cpiognu.org 报告错误。
[purpleendurer kylin ~] 1.3 cpio 命令格式 cpio [选项…] [目标目录] 1.4 cpio命令的选项说明
与tar命令相似cpio命令的选项也很多分为
1.4.1 主要操作模式选项 选项说明-i, –extract从包中提取文件 (运行 copy-in 模式)-o, –create创建包 (运行 copy-out 模式)-p, –pass-through运行 copy-pass 模式-t, –list将输入内容以列表形式打印
1.4.2 应用于所有模式的选项 选项说明–block-sizeBLOCK-SIZE设置 I/O 块大小为 BLOCK-SIZE * 512字节-B设置 I/O 块大小为 5120 字节-c使用老的可移植的 (ASCII) 包格式-C, –io-sizeNUMBER设置 I/O 块大小为指定的 NUMBER 字节–force-local包文件是本地的尽管名字中含有冒号-f, –nonmatching仅拷贝不匹配任意给定的模式的文件-F, –file[[用户]主机:]文件名用“文件名”来替代标准输入和输出。如果是非本地的文件则用可选的“用户”和“主机”来指定用户名和主机名。-H, –format格式使用指定的包格式-M, –messageSTRING当到达备份介质的尾部的时候打印 STRING-n, –numeric-uid-gid在内容列表的详表中显示数字的 UID和 GID–quiet不要打印已拷贝的块数–rsh-commandCOMMAND用 COMMAND 替代 rsh-v, –verbose详细列出已处理的文件-V, –dot每处理一个文件就打印一个“.”-W, –warningFLAG 控制警告信息显示。 FLAG可为“none”、“truncate”或“all”。多个选项可以累积。
1.4.3 仅在copy-in 模式中有效的选项 选项说明-b, –swap交换数据中每个字的两个半字以及每个半字中的两个字节。等价于-sS-r, –rename交互式重命名文件-s, –swap-bytes交换文件中每个半字中的两个字节-S, –swap-halfwords交换文件中每个字(4个字节)中的两个半字–to-stdout提取文件到标准输出-E, –pattern-fileFILE从 FILE中读取额外的用于指定提取或列表的文件名的模式–only-verify-crc当读取一个 CRC格式的包时仅检验包中每个文件的CRC不提取文件
1.4.4 仅在copy-out 模式中有效的选项 选项说明备注-A, –append追加到已存在的归档文件。–device-independent, –reproducible创建独立于设备可重现的存档银河麒麟操作系统不支持–ignore-devno不存储设备编号银河麒麟操作系统不支持-O [[用户]主机:]文件名使用包文件名而不是标准输出。如果文件在远程机器上则可指定用户和主机–renumber-inodes对 inode 重新编号银河麒麟操作系统不支持
1.4.5 仅在copy-out 模式中有效的选项 选项说明-l, –link在可行时链接文件而不是拷贝文件
1.4.6 在copy-in 及 copy-out 模式中有效的选项 选项说明–absolute-filenames文件名不去除文件系统前缀–no-absolute-filenames相对于当前目录来创建所有文件 1.4.7 在 copy-out 及 copy-pass 模式中有效的选项 选项说明-0, –null文件名列表采用 NULL而不是换行作为分割符-a, –reset-access-time文件读取后恢复文件的访问时间-I [[用户]主机:]文件名从文件读入而不是从标准输入读入。如果文件在远程机器上则可指定用户和主机-L, –dereference跟随符号链接拷贝符号链接指向的文件而不是拷贝链接本身-R, –owner[用户][:.][组]设置所有文件的所有权信息到指定的用户和/或组
1.4.8 在 copy-in 及 copy-pass 模式中有效的选项 选项说明备注-d, –make-directories需要时创建目录–extract-over-symlinks强制复写符号链接银河麒麟系统支持-m, –preserve-modification-time创建文件时保留以前文件的修改时间–no-preserve-owner不改变文件的所有权–sparse把含有大块零的文件以稀疏文件方式写出-u, –unconditional无条件覆盖所有文件-?, –help显示此帮助列表–usage显示简短的用法说明–version打印程序版本
1.4.9 相关说明 对长选项必须或可选的参数同样适用于相应的短选项。
1.5 cpio命令的三种模式
cpio命令的选项和参数取决于它运行的模式即copy-out, copy-in或copy-pass模式。
1.5.1 将文件复制到归档文件中copy-out模式
在copy-out模式下cpio命令将文件复制到归档文件中。它从标准输入读取文件名列表每行一个然后将归档文件写入标准输出。
生成文件名列表的典型方法是使用find命令给find命令加上-depth选项以最小化不可读目录的权限问题。 1.5.2 从归档文件中提取文件copy-in模式
copy-in模式下cpio命令从归档文件中提取文件或列出归档文件的内容。
它从标准输入读取归档文件。
任何非选项的命令行参数都是shell通配符模式只有归档文件中名称与一个或多个模式匹配的文件才会从归档文件中提取。
与shell不同的是文件名中的初始.可以匹配模式开头的通配符而文件名中的/也可以匹配通配符。
如果没有给出模式所有文件都会被提取。
1.5.3 将文件从一个目录树复制到另一个目录树copy-pass模式
在copy-pass模式下cpio命令将文件从一个目录树复制到另一个目录树将copy-out和copy-in步骤结合在一起而不实际使用归档文件。
1.6 cpio命令支持的归档格式
cpio命令支持多种归档格式包括binary, old ASCII, new ASCII, CRC, HP-UX binary, HP-UX old ASCII, old tar, 和 POSIX .1 tar。
默认情况下cpio命令创建binary格式的归档文件以便与旧版本的cpio程序兼容。
在从归档文件中提取文件时cpio命令会自动识别归档文件的类型并且可以读取在不同字节顺序的机器上创建的归档文件。
- 上一篇: 建设部科技项目申报网站房源管理免费系统
- 下一篇: 建设部人事考试网站官网网页 开发
相关文章
-
建设部科技项目申报网站房源管理免费系统
建设部科技项目申报网站房源管理免费系统
- 技术栈
- 2026年03月21日
-
建设部考试中心网站万表网手表官网
建设部考试中心网站万表网手表官网
- 技术栈
- 2026年03月21日
-
建设部精神文明建设网站企业管理培训课程心得体会
建设部精神文明建设网站企业管理培训课程心得体会
- 技术栈
- 2026年03月21日
-
建设部人事考试网站官网网页 开发
建设部人事考试网站官网网页 开发
- 技术栈
- 2026年03月21日
-
建设部特种作业证网站查询网站开发语言检测
建设部特种作业证网站查询网站开发语言检测
- 技术栈
- 2026年03月21日
-
建设部网站 挂证水网站建设
建设部网站 挂证水网站建设
- 技术栈
- 2026年03月21日


