Including notes about using 'diff'

This commit is contained in:
Jose 2022-09-24 14:34:31 -03:00
parent 91bb37921f
commit f92c83297e
2 changed files with 35 additions and 1 deletions

View File

@ -17,7 +17,7 @@ opportunity to learn about computers, files, directories and programs.
** Appearance, screens
* [[./tutorial/i3wm_screens.org][~xrandr~: working with two screens in i3-wm]]
* [[./tutorial/i3wm_screens.org][xrandr: working with two screens in i3-wm]]
** Manuals, documentation
@ -33,6 +33,7 @@ opportunity to learn about computers, files, directories and programs.
* [[./tutorial/display_files.org][Display files: 'less', 'head' and 'tail' commands]]
* [[./tutorial/files_directories.org][Learning about files and directories]]
* [[./tutorial/search_files.org][Searching for files in the system]]
* [[./tutorial/diff.org][Comparing two files or directories]]
* [[./tutorial/dd_command_flash_usb.org][Using dd command to flash usb]]
* [[./tutorial/compress_pdf.org][Compress a pdf file]]
* [[./tutorial/luakit.org][Searching and editing configuration files]]

33
tutorial/diff.org Normal file
View File

@ -0,0 +1,33 @@
#+options: toc:nil num:nil
* Comparing the content of two files or directories
~diff~ is a command line utility used to compare two files or directories
** Compare files
To compare the content of two files use something like
#+begin_example bash
diff file1.txt file2.txt
#+end_example
You can redirect the output to a file and make a patch: a file containing the differences between both files
#+begin_example bash
diff file1.txt file2.txt patch.txt
#+end_example
** Comparing directories
Some arguments may be hepful to have an output showing the differences between two directories:
~--brief~ (show only the differences) and ~-r~ (compare the directories that are located within the main directory also)
#+begin_example bash
diff --brief -r directory1 directory2
#+end_example