差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| linux:using_diff_and_patch [2022/09/30 06:15] – [参考文献] ともやん | linux:using_diff_and_patch [2022/10/01 05:49] (現在) – [参考文献] ともやん | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| ====== diff と patch の使い方...🤔 ====== | ====== diff と patch の使い方...🤔 ====== | ||
| + | |||
| + | ===== diff の使い方 ===== | ||
| + | |||
| + | ==== 色付きの出力 diff [--color=auto] ==== | ||
| + | <WRAP color_term> | ||
| + | <WRAP color_command>< | ||
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result>< | ||
| + | <b class=" | ||
| + | <b class=" | ||
| + | <b class=CYN> | ||
| + | <b class=RED> | ||
| + | <b class=GRN> | ||
| + | <b class=CYN> | ||
| + | <b class=RED> | ||
| + | <b class=RED> | ||
| + | <b class=GRN> | ||
| + | <b class=GRN> | ||
| + | <b class=CYN> | ||
| + | <b class=RED> | ||
| + | <b class=GRN> | ||
| + | <b class=GRN> | ||
| + | <b class=GRN> | ||
| + | <b class=CYN> | ||
| + | <b class=GRN> | ||
| + | <b class=GRN> | ||
| + | <b class=GRN> | ||
| + | <b class=GRN> | ||
| + | <b class=CYN> | ||
| + | <b class=RED> | ||
| + | <b class=RED> | ||
| + | <b class=RED> | ||
| + | <b class=GRN> | ||
| + | <b class=GRN> | ||
| + | <b class=GRN> | ||
| + | <b class=CYN> | ||
| + | <b class=RED> | ||
| + | <b class=GRN> | ||
| + | <b class=CYN> | ||
| + | <b class=RED> | ||
| + | <b class=GRN> | ||
| + | <b class=CYN> | ||
| + | <b class=RED> | ||
| + | <b class=GRN> | ||
| + | <b class=GRN> | ||
| + | </ | ||
| + | </ | ||
| + | <wrap em> | ||
| + | <WRAP color_term> | ||
| + | <WRAP color_command>< | ||
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result>< | ||
| + | <b class=RED> | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | [[https:// | ||
| + | <WRAP group mincode> | ||
| + | <WRAP left half column>< | ||
| + | NEWS | ||
| + | |||
| + | * Noteworthy changes in release 3.4 (2016-08-08) [stable] | ||
| + | |||
| + | ** New features | ||
| + | |||
| + | diff accepts two new options --color and --palette to generate | ||
| + | and configure colored output. | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | <WRAP left half column>< | ||
| + | ニュース👀 | ||
| + | |||
| + | * リリース 3.4 (2016-08-08) [安定版] の注目すべき変更点 | ||
| + | |||
| + | ** 新機能😻 | ||
| + | |||
| + | diff は、2 つの新しいオプション --color と --palette を受け入れて、色付きの出力を | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | ==== ヘルプ [--help] ==== | ||
| + | <WRAP color_term> | ||
| + | <WRAP color_command>< | ||
| + | <b class=GRN> | ||
| + | </ | ||
| + | <WRAP color_result_long>< | ||
| + | 使用法: diff [OPTION]... FILES | ||
| + | FILES を行ごとに比較します。 | ||
| + | |||
| + | 長い形式のオプションで必須の引数は、それに対応する短い形式のオプションでも同様に必須です。 | ||
| + | --normal | ||
| + | -q, --brief | ||
| + | -s, --report-identical-files | ||
| + | -c, -C NUM, --context[=NUM] | ||
| + | -u, -U NUM, --unified[=NUM] | ||
| + | -e, --ed ed スクリプトを出力する | ||
| + | -n, --rcs RCS 形式の diff を出力する | ||
| + | -y, --side-by-side | ||
| + | -W, --width=NUM | ||
| + | --left-column | ||
| + | --suppress-common-lines | ||
| + | |||
| + | -p, --show-c-function | ||
| + | -F, --show-function-line=RE | ||
| + | --label LABEL use LABEL instead of file name and timestamp | ||
| + | (can be repeated) | ||
| + | |||
| + | -t, --expand-tabs | ||
| + | -T, --initial-tab | ||
| + | --tabsize=NUM | ||
| + | --suppress-blank-empty | ||
| + | -l, --paginate | ||
| + | |||
| + | -r, --recursive | ||
| + | --no-dereference | ||
| + | -N, --new-file | ||
| + | --unidirectional-new-file | ||
| + | --ignore-file-name-case | ||
| + | --no-ignore-file-name-case | ||
| + | -x, --exclude=PAT | ||
| + | -X, --exclude-from=FILE | ||
| + | -S, --starting-file=FILE | ||
| + | --from-file=FILE1 | ||
| + | FILE1 はディレクトリーでもよい | ||
| + | --to-file=FILE2 | ||
| + | FILE2 はディレクトリーでもよい | ||
| + | |||
| + | -i, --ignore-case | ||
| + | -E, --ignore-tab-expansion | ||
| + | -Z, --ignore-trailing-space | ||
| + | -b, --ignore-space-change | ||
| + | -w, --ignore-all-space | ||
| + | -B, --ignore-blank-lines | ||
| + | -I, --ignore-matching-lines=RE | ||
| + | |||
| + | -a, --text | ||
| + | --strip-trailing-cr | ||
| + | |||
| + | -D, --ifdef=NAME | ||
| + | --GTYPE-group-format=GFMT | ||
| + | --line-format=LFMT | ||
| + | --LTYPE-line-format=LFMT | ||
| + | これらの書式整形オプションは -D/--ifdef に適用される diff の出力をきれいに | ||
| + | 見えるように制御するために提供されます。 | ||
| + | LTYPE is ' | ||
| + | GFMT でのみ指定できる書式: | ||
| + | %& | ||
| + | %& | ||
| + | %= FILE1 と FILE2 で共通の行 | ||
| + | %[-][WIDTH][.[PREC]]{doxX}LETTER | ||
| + | LETTER は次の通りです。ただし古いグループでは小文字です: | ||
| + | F 最初の行番号 | ||
| + | L 最後の行番号 | ||
| + | N 行数 = L-F+1 | ||
| + | E F-1 | ||
| + | M L+1 | ||
| + | %(A=B? | ||
| + | LFMT でのみ指定できる書式: | ||
| + | %L 行の内容 | ||
| + | %l 行末にあるすべての種類の改行文字を除いた行の内容 | ||
| + | %[-][WIDTH][.[PREC]]{doxX}n | ||
| + | GFMT と LFMT の両方で指摘できる書式: | ||
| + | %% % | ||
| + | %c' | ||
| + | %c' | ||
| + | C 文字 C (他の文字も同様に表す) | ||
| + | |||
| + | -d, --minimal | ||
| + | --horizon-lines=NUM | ||
| + | --speed-large-files | ||
| + | --color[=WHEN] | ||
| + | plain --color means --color=' | ||
| + | --palette=PALETTE | ||
| + | a colon-separated list of terminfo capabilities | ||
| + | |||
| + | --help | ||
| + | -v, --version | ||
| + | |||
| + | FILES are 'FILE1 FILE2' or 'DIR1 DIR2' or 'DIR FILE' or 'FILE DIR'. | ||
| + | --from-file または --to-file が与えられた場合、FILE に制限はありません。 | ||
| + | If a FILE is ' | ||
| + | 終了コードは、入力ファイルが同じ場合は 0、入力ファイルが異なる場合は 1、 | ||
| + | 問題が発生したときは 2 になります。 | ||
| + | |||
| + | Report bugs to: bug-diffutils@gnu.org | ||
| + | GNU diffutils のホームページ: | ||
| + | General help using GNU software: < | ||
| + | </ | ||
| + | </ | ||
| ===== 参考文献 ===== | ===== 参考文献 ===== | ||
| 行 12: | 行 207: | ||
| [[https:// | [[https:// | ||
| [[https:// | [[https:// | ||
| + | [[https:// | ||
| + | **diff**\\ | ||
| + | [[https:// | ||
| + | [[https:// | ||
| + | **diff, match, patch**\\ | ||
| + | [[git> | ||
| + | [[git> | ||
| + | [[qita> | ||
| + | ==== 付録 ==== | ||