From f92c83297e40f1c4bc43d2dca94a2bda39445056 Mon Sep 17 00:00:00 2001 From: Jose Date: Sat, 24 Sep 2022 14:34:31 -0300 Subject: [PATCH] Including notes about using 'diff' --- README.org | 3 ++- tutorial/diff.org | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 tutorial/diff.org diff --git a/README.org b/README.org index 66bb933..db26e9b 100644 --- a/README.org +++ b/README.org @@ -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]] diff --git a/tutorial/diff.org b/tutorial/diff.org new file mode 100644 index 0000000..592bc50 --- /dev/null +++ b/tutorial/diff.org @@ -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 + +