

It is similar to context mode but it doesn’t display any redundant information or it shows the information in concise form. u (unified) : To view differences in unified mode, use the -u option. Then it shows the contents of the second file.Ģ. Like in our case, it is needed to delete mv and comm from first file and add diff and comm to the first file to make both of them identical.Īfter that there are three dashes - followed by a line range from the second file (in our case lines 1 through 4, separated by a comma). (b) – : It indicates a line in the first file that needs to be deleted to make them identical. (a) + : It indicates a line in the second file that needs to be added to the first file to make them identical. (ii) If the line needs to be changed, it is prefixed by an symbol and a space. (i) If the line needs to be unchanged, it is prefixed by two spaces.

After that it shows the contents of the first file with the following indicators: The next line has three asterisks *** followed by a line range from the first file (in our case lines 1 through 4, separated by a comma). It lists the file name, modification date, and modification time of each of our files, one per line. The first two lines of this output show us information about file 1 and file 2. The line with *************** is just a separator. The first file is indicated by ***, and the second file is indicated by. Lets try to understand this with example, we have two files file1.txt and file2.txt: c (context) : To view differences in context mode, use the -c option. Linux system offers two different ways to view the diff command output i.e. Telangana so that both the files sync up at line 2. Here above output 3d2 means delete line 3rd of first file i.e. Now let’s see what it looks like when diff tells us that we need to delete a line. Jammu and Kashmir with line 5 of second file i.e. After that change line 5 of first file i.e.

Uttar Pradesh and Kolkata with line 3 of second file i.e.
