" diff command in linux problem"
Results 1 to 3 of 3

Thread: " diff command in linux problem"

  1. #1
    Join Date
    Nov 2001

    Question " diff command in linux problem"

    if we use the diff command which finds differences in the two files specified at the command prompt for example take a file named "text"
    which has the contents the following:->

    " this is a test file"

    and other file named "exam" which has the following contents:->

    "this is a exam file"
    then we execute the command at the shell prompt : diff test exam
    then we have the following result on the screen
    < this is a test file
    > this is a exam file

    i want to ask is that what does 1c1 stands for?

    thanks in advance

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Clue... count the lines.

    Now try it with a few more lines.

    BTW, why do I get the feeling like you're trying to get us to do your homework for you?
    \"Windows has detected that a gnat has farted in the general vicinity. You must reboot for changes to take affect. Reboot now?\"

  3. #3
    Senior Member roswell1329's Avatar
    Join Date
    Jan 2002
    Hehehe....good call draziw.

    hackmania -- here's a good explanation of the diff command from the WONDERFUL book O'Reilly Power Tools:


    But, basically, a diff report is usually in ed syntax, because if you use a diff -e, it will actually produce an ed script that when run would make file1 the same as file2. In your example, 1c1 (I think...I never use ed for anything) means line 1, change for line 1. Basically, change line 1 of the first file to be the same as line 1 of the second file.
    /* You are not expected to understand this. */

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts