Find the answer to your Linux question:
Results 1 to 5 of 5
I need to diff two source code directories and compare only cpp and h files. I can use diff -x PATTERN to exclude files but what if I have too ...
  1. #1
    Just Joined!
    Join Date
    Oct 2006
    Posts
    27

    Diff directories, only on specific files

    I need to diff two source code directories and compare only cpp and h files. I can use diff -x PATTERN to exclude files but what if I have too many patterns to exclude? How can I specify what pattern to include?

  2. #2
    Linux Newbie
    Join Date
    Sep 2007
    Posts
    161
    hi jack,

    i believe that's what the -X FILE (capital x) option is for, which allows you to specify a whole file of patterns to exclude.

    kai

  3. #3
    Just Joined!
    Join Date
    Oct 2006
    Posts
    27
    Thanks but it's too much work creating a special file with patterns to exclude then passing it to diff. I'm looking for a quick way to specify which files to compare.

  4. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568

    Post

    If you are looking for easy GUI interface then check Kompare -- I'm really impressed by it Download Kompare 3.4 for Linux - Kompare is a utility for comparing files and viewing unified diff files (patches). - Softpedia
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  5. #5
    Just Joined!
    Join Date
    Oct 2006
    Posts
    27
    I use meld and kompare when I need GUI but I also use diff quite often when I need to review all changes at once.

Posting Permissions

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