Results 1 to 8 of 8

Thread: How compare content of directories and different files in kubuntu

  1. #1
    Join Date
    Aug 2019
    Beans
    58

    How compare content of directories and different files in kubuntu

    Hello,
    Under my Kubuntu 18 using Krusader I can compare content of directories and different files are in green :
    https://prnt.sc/tziijt

    If there is a possibility to compare content of 2 files and different places?
    Something like at left part 1 file and 2nd files at rigth part with different places selected?

    Are there in kubuntu some other tools/apps for this?
    Only in view mode...

    Thanks!

  2. #2
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: How compare content of directories and different files in kubuntu

    There are command line tools for this purpose. I use diff.

    Basic usage:

    Code:
    diff path1/file1 path2/file2
    More advanced usage (in a very wide command line window to avoid line wrapping)

    Code:
    diff -y -W200 path1/file1 path2/file2
    
    # or
    
    diff -y -W200 path1/file1 path2/file2 | less
    See man diff for more details.

  3. #3
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: How compare content of directories and different files in kubuntu

    Looking in my Krusader (in Ubuntu 18.04) I get this ..

    Hint: Krusader supports Kompare, KDiff3 and Xxdiff

    but also .. perhaps create a Useraction to take left and right panel locations
    into Meld?

  4. #4
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,763

    Re: How compare content of directories and different files in kubuntu

    If comparing two text files, I use meld.

  5. #5
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: How compare content of directories and different files in kubuntu

    I have just tried creating a Krusader useraction leveraging meld command line and this works nicely direct from Krusader, launching Meld and comparing left with right content. I use Krusader for controlling a number of interactions with other apps. I have added Meld to this list.

  6. #6
    Join Date
    Aug 2019
    Beans
    58

    Re: How compare content of directories and different files in kubuntu

    How did you set meld as option for Krusader ?

  7. #7
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: How compare content of directories and different files in kubuntu

    You can start by going to Krusader > Help > Krusader Handbook.

    Refer to 6. Menu Commands > Useractions menu

    Having read the above ...

    In Krusader go to top menu bar > Useractions > Manage User Actions

    Explore existing Useractions to get the idea of layout and variables to add to a new Useraction.

    Click on first top button > Create new useraction .. opens template

    Basic properties
    Identifier: Krusader
    Category: Meld
    Title: &Meld actions
    Tooltip: Meld
    Description: Meld compares left with right
    Command: meld %lCurrent% %rCurrent%


    Note that in creating variables in Command field you can click on + sign to inject different variables into the command. Variables are bounded by % signs.

    Of course you need to install meld and read its command line options.

    When applying this new Useraction highlight a file in Krusader left panel, then highlight a file in Krusader right panel then (with both highlighted) go to Useractions > Meld .. and the Meld window should open comparing right and left files.

    Footnote: Since you refer also to directory comparison you might need two Useractions

    One to compare files
    Another to compare directories.
    Last edited by dragonfly41; August 15th, 2020 at 03:53 PM. Reason: added note on final usage ...

  8. #8
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    21,084
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: How compare content of directories and different files in kubuntu

    I would use rsync in dry-run mode. From the rsync manpage:
    Code:
            -n, --dry-run               perform a trial run with no changes made

Bookmarks

Posting Permissions

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