I have two files with slight differences. A normal diff
will show me the differences between the files. With -c
or -u
I can add an amount of context to each hunk. What options can I pass to diff
to see every unchanged line alongside the changes, and get the diff as a single, large hunk?
相关问题
- Why should we check WIFEXITED after wait in order
- softlinks atime and mtime modification
- UNIX Bash - Removing double quotes from specific s
- Get unexpanded argument from bash command line
- Include and Execute EXE in C# Command Line App
相关文章
- Making new files automatically executable?
- Reverse four length of letters with sed in unix
- Compile and build with single command line Java (L
- Extracting columns from text file using Perl one-l
- Problem with piping commands in C
- How to update command line output?
- How to execute another python script from your scr
- Makefile and use of $$
Use the "-y" option for full side by side output
diff -y file1 file2
Will give you output something like
You can also override the diff formatting behavior to get your desired behavior without using side-by-side mode:
This command will show you the full file as context and be closest in format to
diff -u file1 file2
The solution is to set a context size (-U argument) which is larger than the file itself: