Home Blog Archive Software Compare files in Linux - how to

Compare files in Linux - how to

  • Sep 30, 2025
  • 581
  • 0

In the following practice tip you will learn how to compare Linux files.

To compare Linux files

First, you open with the key combination [Alt] + [Ctrl] + [T] to the console or type in the search bar the term "Terminal". You navigate using the cd command in the directory in which the texts are located. You do not know where the files are stored, we will show you in a further practical tip on how you can files in Linux search.
  • Linux compares in the console text - only files who is looking for more specialized applications, is in the software center to find it.
  • You want to know where the two files differ, use "diff Filename1 Filename2". The objects are the same, you will get no output. The two files are different you receive an error code such as "1c1". You know that the Files differ in the first line.
  • Who is not interested in the wrong rows, and only want to know whether the two files are equal or not type "diff-q Filename1 Filename2". Caution: In the case of the diff command, the file extensions in the console are necessary, otherwise you get an error message.
  • The error code that appears, if you omit the Parameter "-q", consists of three units. The first number up to the letter indicates the row of the first document, in which the difference occurs. The middle letter is either an "a" for "append", if a letter is missing. The counterpart to this is a "d" for "Delete", if too much is in the first file. A "c" says that two words differ, and you should change the place. The last number stands for the corresponding row in the second file.
  • You want to compare three files, type in "diff3 Filename1 Filename2 Dateiname3".
"diff" compares your files
You will need one of the files, you will learn, in a further practical tip, as you are on Linux, delete files.

YOU MAY ALSO LIKE

Gimp: image cropping - how to

  • Wed 01, 2025
  • 480
  • 0

FreeNAS install and configure

  • Thu 02, 2025
  • 614
  • 0

0 COMMENTS

LEAVE A COMMENT

Human?
1 + 3 =