User Tools

Site Tools


утилиты_diff_и_patch

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
утилиты_diff_и_patch [2011/02/25 10:01]
val
утилиты_diff_и_patch [2013/05/22 13:50]
127.0.0.1 внешнее изменение
Line 1: Line 1:
 ====== Утилиты diff и patch ====== ====== Утилиты diff и patch ======
 +
 +[[http://​ru.wikipedia.org/​wiki/​Patch_(UNIX)]]
  
 ===== Сравнение каталогов ===== ===== Сравнение каталогов =====
  
 <​code>​ <​code>​
-$ diff каталог1 каталог2+$ diff /usr/share /​usr/​local/​share
 </​code>​ </​code>​
 +
 ===== Сравнение двоичных файлов ===== ===== Сравнение двоичных файлов =====
 <​code>​ <​code>​
-$ diff /bin/ls /usr/bin/lsvfs +$ diff /usr/bin/test /usr/bin/
 + ​или 
 +$ diff /bin/test /bin/[
  
-diff /bin/ls /usr/bin/lscpu +ls -i /usr/bin/test /usr/bin/[ 
- + или 
-Binary files /bin/ls and /usr/bin/ls... differ+$ ls -i /bin/test /bin/[
 </​code>​ </​code>​
 +
 ===== Сравнение текстовых файлов ===== ===== Сравнение текстовых файлов =====
 <​code>​ <​code>​
Line 38: Line 44:
 --- ---
 >       ​printf("​Hello World Again\n"​);​ >       ​printf("​Hello World Again\n"​);​
 +</​code><​code>​
 +diff -e hello.c.old hello.c
 +</​code><​code>​
 +3c
 +        printf("​Hello World Again\n"​);​
 +.
 </​code><​code>​ </​code><​code>​
 $ diff hello.c.old hello.c > hello.patch $ diff hello.c.old hello.c > hello.patch
утилиты_diff_и_patch.txt · Last modified: 2016/04/07 09:25 by val