{"id":18985,"date":"2022-10-20T18:07:03","date_gmt":"2022-10-20T18:07:03","guid":{"rendered":"https:\/\/linuxways.net\/?p=18985"},"modified":"2022-11-04T02:22:38","modified_gmt":"2022-11-04T02:22:38","slug":"compare-difference-two-directories-linux-mint-21","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/mint\/compare-difference-two-directories-linux-mint-21\/","title":{"rendered":"How to Compare the Difference of Two Directories in Linux Mint 21?"},"content":{"rendered":"<p>\u201cDirectories in Linux or any other operating system provide a very nice way to organize your files. Most people like to create a directory of all similar files. However, you might sometimes have two directories with pretty much similar content. In this situation, it gets a bit difficult to differentiate between these directories. In this guide, we will discuss the method of comparing the difference of two directories in Linux Mint 21.\u201d<\/p>\n<h2><strong>Method of Comparing the Difference of Two Directories in Linux Mint 21<\/strong><\/h2>\n<p>To compare the difference of two directories on a Linux Mint 21 system, you have to perform the following steps:<\/p>\n<h2><strong>Method # 1: Visualize the Two Target Directories<\/strong><\/h2>\n<p>First, we would like to show you the two directories we will compare in this method. For displaying the structure of the first directory, we will execute the command shown below:<\/p>\n<pre>\r\n$ ls \u2013lR \/home\/system\/Dir1\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"423\" height=\"23\" class=\"wp-image-18994\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-1.png 423w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-1-300x16.png 300w\" sizes=\"auto, (max-width: 423px) 100vw, 423px\" \/><\/strong><\/p>\n<p>The contents of our first directory are shown in the following image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"474\" height=\"282\" class=\"wp-image-18995\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-2.png 474w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-2-300x178.png 300w\" sizes=\"auto, (max-width: 474px) 100vw, 474px\" \/><\/p>\n<p>To display the contents of the second directory, we have to run the command shown below:<\/p>\n<pre>\r\n$ ls \u2013lR \/home\/system\/Dir2\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"424\" height=\"22\" class=\"wp-image-18997\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-3.png 424w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-3-300x16.png 300w\" sizes=\"auto, (max-width: 424px) 100vw, 424px\" \/><\/strong><\/p>\n<p>The contents of our second directory are shown in the following image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"476\" height=\"285\" class=\"wp-image-18998\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-4.png 476w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-4-300x180.png 300w\" sizes=\"auto, (max-width: 476px) 100vw, 476px\" \/><\/p>\n<h2><strong>Method # 2: Compare the Difference of the Two Target Directories<\/strong><\/h2>\n<p>Now, to compare the difference of these two directories, we will use the command shown below:<\/p>\n<pre>\r\n$ diff --brief --recursive Dir1 Dir2\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"503\" height=\"26\" class=\"wp-image-19001\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-5.png 503w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-5-300x16.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-5-501x26.png 501w\" sizes=\"auto, (max-width: 503px) 100vw, 503px\" \/><\/strong><\/p>\n<p>The differences of our two directories are stated in the following image:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"510\" height=\"75\" class=\"wp-image-19004\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-6.png 510w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-6-300x44.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/10\/word-image-18985-6-501x75.png 501w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>With the help of the above method, you can easily compare any two directories of your choice from your Linux Mint 21 system. In this way, you will quickly be able to figure out all the differences between these two directories.<\/p>","protected":false},"excerpt":{"rendered":"<p>Sometimes, we have two directories with pretty much similar content. This article compares the difference of the two directories in Linux Mint 21.<\/p>","protected":false},"author":3,"featured_media":19054,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-18985","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mint"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/18985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=18985"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/18985\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/19054"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=18985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=18985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=18985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}