- Linux
- OpenBSD
- FreeBSD
- Solaris
- bash/shell
- » ab
- » arp
- » arping
- » awk
- » bzip2, bunzip2, bzip2re...
- » chcase
- » chkconfig
- » chmod
- » chown
- » comm
- » convert
- » cat
- » cp
- » cpio
- » cryptsetup
- » curl
- » date
- » diff
- » dig
- » dumpe2fs
- » e2fsck(fsck.{ext2,ext3})
- » eval
- » exportfs
- » file
- » find
- » ftp
- » fuser
- » getfacl
- » grep, egrep, fgrep
- » grub
- » gzip, gunzip
- » hdparm
- » head
- » host
- » ifconfig
- » ifenslave
- » import
- » ionice
- » ip
- » ipcs, ipcrm
- » kill
- » ldconfig
- » ld
- » ldd
- » less
- » locale
- » locate
- » losetup
- » ls
- » lsmod
- » lsof
- » man
- » mke2fs(mkfs.{ext2,ext3})
- » mkinitrd
- » mknod
- » mkswap
- » modinfo
- » modprobe
- » mount
- » mtr
- » mv
- » mysql
- » mysqladmin
- » mysqldump
- » netstat
- » netstat-nat
- » nice
- » nc
- » nm
- » nslookup
- » objdump
- » openssl
- » parted
- » patch
- » perl
- » pg_dump
- » pidof
- » ping
- » pkg-config
- » ps
- » psql
- » rar
- » readelf
- » renice
- » rm
- » rmmod
- » route
- » rpcinfo
- » rpm
- » rsync
- » screen
- » sed
- » sendmail
- » seq
- » setfacl
- » sfdisk
- » showmount
- » shred
- » smartctl
- » smbclient
- » smbget
- » smbpasswd
- » socat
- » sort
- » sox
- » split
- » ssh
- » ssh-keygen
- » stat
- » stdbuf
- » strace
- » svn, svnadmin
- » systool
- » tail
- » tar
- » tcpdump
- » top
- » tr
- » tracepath
- » traceroute
- » tune2fs
- » udevcontrol, udevadm
- » unclutter
- » uniq
- » unzip
- » uuencode, uudecode
- » vim
- » vncviewer
- » vnstat
- » wc
- » wget
- » wput
- » xargs
- » xhost
- » xprop
- » xrandr
- » xwd
- » xxd
- » yum
- » zip, zip{cloak,note,split}
- KDE
- GTK
CONTENT
- CHANGES
Szukaj
#top diff¶
diff - find differences between two files
Powiązane:
comm, diff, patch,
SYNOPSIS
diff [options] from-file to-file
diff3 [options] mine older yours
sdiff -o outfile [options] from-file to-file
diff3 [options] mine older yours
sdiff -o outfile [options] from-file to-file
DESCRIPTION
OPTIONS
-lines
-a
-b
-B
--brief
-c
-C lines
--context[=lines]
--changed-group-format=format
-d
-D name
-e
--ed
--exclude=pattern
--exclude-from=file
--expand-tabs
-f
-F regexp
--forward-ed
-h
-H
--horizon-lines=lines
-i
-I regexp
--ifdef=name
--ignore-all-space
--ignore-blank-lines
--ignore-case
--ignore-matching-lines=regexp
--ignore-space-change
--initial-tab
-l
-L label
--label=label
--left-column
--line-format=format
--minimal
-n
-N
--new-file
--new-group-format=format
--new-line-format=format
--old-group-format=format
--old-line-format=format
-p
-P
--paginate
-q
-r
--rcs
--recursive
--report-identical-files
-s
-S file
--from-file=file
--to-file=file
--sdiff-merge-assist
--show-c-function
--show-function-line=regexp
--side-by-side
--speed-large-files
--starting-file=file
--suppress-common-lines
-t
-T
--text Treat
-u
--unchanged-group-format=format
--unchanged-line-format=format
--unidirectional-new-file
-U lines
--unified[=lines]
-v
--version
-w
-W columns
</divindent50>
-x pattern
-X file
-y
Show lines (an integer) lines of context. This option does not specify an output format by itself; it has no effect unless it is combined with -c or -u. This option is obsolete. For proper operation, patch typically needs at least two lines of context.
-a
Treat all files as text and compare them line-by-line, even if they do not seem to be text.
-b
Ignore changes in amount of white space.
-B
Ignore changes that just insert or delete blank lines.
--brief
Report only whether the files differ, not the details of the differences.
-c
Use the context output format.
-C lines
--context[=lines]
Use the context output format, showing lines (an integer) lines of context, or three if lines is not given. For proper opera- tion, patch typically needs at least two lines of context.
--changed-group-format=format
Use format to output a line group containing differing lines from both files in if-then-else format.
-d
Change the algorithm to perhaps find a smaller set of changes. This makes diff slower (sometimes much slower).
-D name
Make merged if-then-else format output, conditional on the pre- processor macro name.
-e
--ed
Make output that is a valid ed script.
--exclude=pattern
When comparing directories, ignore files and subdirectories whose basenames match pattern.
--exclude-from=file
When comparing directories, ignore files and subdirectories whose basenames match any pattern contained in file.
--expand-tabs
Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files.
-f
Make output that looks vaguely like an ed script but has changes in the order they appear in the file.
-F regexp
In context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp.
--forward-ed
Make output that looks vaguely like an ed script but has changes in the order they appear in the file.
-h
This option currently has no effect; it is present for Unix com- patibility.
-H
Use heuristics to speed handling of large files that have numer- ous scattered small changes.
--horizon-lines=lines
Do not discard the last lines lines of the common prefix and the first lines lines of the common suffix.
-i
Ignore changes in case; consider upper- and lower-case letters equivalent.
-I regexp
Ignore changes that just insert or delete lines that match regexp.
--ifdef=name
Make merged if-then-else format output, conditional on the preprocessor macro name.
--ignore-all-space
Ignore white space when comparing lines.
--ignore-blank-lines
Ignore changes that just insert or delete blank lines.
--ignore-case
Ignore changes in case; consider upper- and lower-case to be the same.
--ignore-matching-lines=regexp
Ignore changes that just insert or delete lines that match regexp.
--ignore-space-change
Ignore changes in amount of white space.
--initial-tab
Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal.
-l
Pass the output through pr to paginate it.
-L label
--label=label
Use label instead of the file name in the context format and unified format headers.
--left-column
Print only the left column of two common lines in side by side format.
--line-format=format
Use format to output all input lines in in-then-else format.
--minimal
Change the algorithm to perhaps find a smaller set of changes. This makes diff slower (sometimes much slower).
-n
Output RCS-format diffs; like -f except that each command specifies the number of lines affected.
-N
--new-file
In directory comparison, if a file is found in only one directory, treat it as present but empty in the other directory.
--new-group-format=format
Use format to output a group of lines taken from just the second file in if-then-else format.
--new-line-format=format
Use format to output a line taken from just the second file in if-then-else format.
--old-group-format=format
Use format to output a group of lines taken from just the first file in if-then-else format.
--old-line-format=format
Use format to output a line taken from just the first file in if-then-else format.
-p
Show which C function each change is in.
-P
When comparing directories, if a file appears only in the second directory of the two, treat it as present but empty in the other.
--paginate
Pass the output through pr to paginate it.
-q
Report only whether the files differ, not the details of the differences.
-r
When comparing directories, recursively compare any subdirectories found.
--rcs
Output RCS-format diffs; like -f except that each command specifies the number of lines affected.
--recursive
When comparing directories, recursively compare any subdirectories found.
--report-identical-files
-s
Report when two files are the same.
-S file
When comparing directories, start with the file file. This is used for resuming an aborted comparison.
--from-file=file
Compare file to all operands. file can be a directory.
--to-file=file
Compare all operands to file. file can be a directory.
--sdiff-merge-assist
Print extra information to help sdiff. sdiff uses this option when it runs diff. This option is not intended for users to use directly.
--show-c-function
Show which C function each change is in.
--show-function-line=regexp
In context and unified format, for each hunk of differences, show some of the last preceding line that matches regexp.
--side-by-side
Use the side by side output format.
--speed-large-files
Use heuristics to speed handling of large files that have numerous scattered small changes.
--starting-file=file
When comparing directories, start with the file file. This is used for resuming an aborted comparison.
--suppress-common-lines
Do not print common lines in side by side format.
-t
Expand tabs to spaces in the output, to preserve the alignment of tabs in the input files.
-T
Output a tab rather than a space before the text of a line in normal or context format. This causes the alignment of tabs in the line to look normal.
--text Treat
all files as text and compare them line-by-line, even if they do not appear to be text.
-u
Use the unified output format.
--unchanged-group-format=format
Use format to output a group of common lines taken from both files in if-then-else format.
--unchanged-line-format=format
Use format to output a line common to both files in if-then-else format.
--unidirectional-new-file
When comparing directories, if a file appears only in the second directory of the two, treat it as present but empty in the other.
-U lines
--unified[=lines]
Use the unified output format, showing lines (an integer) lines of context, or three if lines is not given. For proper opera- tion, patch typically needs at least two lines of context.
-v
--version
Output the version number of diff.
-w
Ignore white space when comparing lines.
-W columns
</divindent50>
--width=columns
<divindent50>
Use an output width of columns in side by side format.
<divindent50>
Use an output width of columns in side by side format.
-x pattern
When comparing directories, ignore files and subdirectories whose basenames match pattern.
-X file
When comparing directories, ignore files and subdirectories whose basenames match any pattern contained in file.
-y
Use the side by side output format.
EXAMPLES
diff
- porównaj pliki (generowanie pliku różnic)sdiff
- porównaj pliki na konsolidiff3
- porównaj 3 plikigenerate diff for patch
diff -Naur /path1 /path2
alternative syntax for input
diff <(sort file1) <(sort file2) # do not use spaces: bad syntax: bash: syntax error near unexpected token '(' diff < (sort file1) < (sort file2)
cat file1a | sort > file1 cat file2a | sort > file2 diff file1 file2
Zmodyfikowany ostatnio: 2014/06/23 23:40:32 (10 lat temu),
textsize: 12,2 kB,
htmlsize: 14,3 kB
Zapraszam do komentowania, zgłaszania sugestii, propozycji, własnych przykładów, ...
Dodaj komentarzKomentarze użytkowników