PATCH 将DIFF生成的补丁应用修补程序

本文详细介绍了PATCH命令的使用方法,包括各种输入、输出选项以及备份控制选项等。通过本文,读者可以了解到如何应用补丁文件、设置不同的补丁格式以及如何进行备份等高级操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

PATCH 将DIFF生成的补丁应用修补程序

Usage: patch [OPTION]... [ORIGFILE [PATCHFILE]]

Input options:输入选项

  -p NUM  --strip=NUM  将num开头的文件忽略 Strip NUM leading components from file names.
  -F LINES  --fuzz LINES  设置模糊因子lines为行号 ??????Set the fuzz factor to LINES for inexact matching.
  -l  --ignore-whitespace  忽略空格 Ignore white space changes between patch and input.

  -c  --context  上下文格式Interpret the patch as a context difference.
  -e  --ed  Interpret ed格式the patch as an ed script.
  -n  --normal  一般格式Interpret the patch as a normal difference.
  -u  --unified  联合格式???Interpret the patch as a unified difference.

  -N  --forward  ????Ignore patches that appear to be reversed or already applied.
  -R  --reverse  ????Assume patches were created with old and new files swapped.

  -i PATCHFILE  --input=PATCHFILE  Read patch from PATCHFILE instead of stdin.

Output options:输出选项

  -o FILE  --output=FILE  输出文件 Output patched files to FILE.
  -r FILE  --reject-file=FILE  不输出file   Output rejects to FILE.

  -D NAME  --ifdef=NAME  Make merged if-then-else output using NAME.
  -E  --remove-empty-files  删除空文件Remove output files that are empty after patching.

  -Z  --set-utc  设置已打补丁文件的时间Set times of patched files, assuming diff uses UTC (GMT).
  -T  --set-time  Likewise, assuming local time.

Backup and version control options:备分选项

  -b  --backup  备分原始文件Back up the original contents of each file.
  --backup-if-mismatch  备分那些补丁不完全的文件Back up if the patch does not match exactly.
  --no-backup-if-mismatch  ??????Back up mismatches only if otherwise requested.

  -V STYLE  --version-control=STYLE  用版本style控制Use STYLE version control.
 STYLE is either 'simple', 'numbered', or 'existing'.
  -B PREFIX  --prefix=PREFIX  指定备分文件的前缀Prepend PREFIX to backup file names.
  -Y PREFIX  --basename-prefix=PREFIX  指定备分文件的前缀和名字Prepend PREFIX to backup file basenames.
  -z SUFFIX  --suffix=SUFFIX  指定备分文件的后缀Append SUFFIX to backup file names.

  -g NUM  --get=NUM  ??????Get files from RCS or SCCS if positive; ask if negative.

Miscellaneous options:

  -t  --batch  不问问题,跳过错误的补丁Ask no questions; skip bad-Prereq patches; assume reversed.
  -f  --force  Like -t, but ignore bad-Prereq patches, and assume unreversed.
  -s  --quiet  --silent  不做提示除非出错Work silently unless an error occurs.
  --verbose  详细Output extra information about the work being done.
  --dry-run  干跑???Do not actually change any files; just print what would happen.

  -d DIR  --directory=DIR  改变工作目录???Change the working directory to DIR first.
  --binary  二进制模式Read and write data in binary mode.

  -v  --version  Output version info.
  --help  Output this help.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值