简体   繁体   English

如何使用Meld比较不同目录中的两个相同名称文件(不提供其路径)?

[英]How to compare two same name files in different directories using meld (without giving their path)?

I know commands: 我知道命令:

  1. To find path of file: 查找文件路径:

     find . -name filename 
  2. To compare two files: 比较两个文件:

     meld path_of_file_in_one_dir path_of_file_in_second_dir 

I have to compare so many files in different sub directories of a directory, every time I have to first search the path of that file and then use this path with meld , and this I have to for each file. 每次必须首先搜索该文件的路径,然后将该路径与meld一起使用时,我必须比较目录的不同子目录中的这么多文件,而我必须对每个文件使用此路径。

It would be very easy if i only give names and root directory of that files to meld . 如果仅将这些文件的名称和根目录提供给meld ,那将非常容易。

How can I combine meld and find commands so that I can apply it on each file? 如何结合使用meldfind命令,以便可以将其应用于每个文件?

  1. If your directory structure is like this say 如果您的目录结构是这样的话
    • test_folder test_folder
      • test1 测试1
        • file_to_cmp file_to_cmp
      • test2 测试2
        • file_to_cmp file_to_cmp
      • test3 测试3
        • file_to_cmp file_to_cmp

then you can run the following 然后您可以运行以下命令

meld find . -name "file*" meld find . -name "file*" or meld find . -name "file_to_cmp" meld find . -name "file*"meld find . -name "file_to_cmp" meld find . -name "file_to_cmp"
This will compare the 3 files for sure. 这将确保比较这3个文件。
About more than three file comparing, I doubt meld can do it. 关于三个以上的文件比较,我怀疑meld可以做到。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用find重命名具有相同名称的不同目录中的文件 - How to rename files in different directories with the same name using find 如何检查名称相同但扩展名不同的目录中的文件 - How to check files in different directories with same name but different extensions 比较Linux中两个不同目录中的文件 - Compare files in two different directories in Linux 如何从多个目录中提取多个文件,而不同目录中的不同文件可能具有相同的名称 - how to scp multiple files from multiple directories, while different files in different directories may have the same name 如何检查和删除python中两个不同目录中不相同的文件? - How to check and delete files that are not same in two different directories in python? 在两个主目录中查找具有相同名称和子目录但内容不同的文件 - Finding the Files with the Same Name and Sub-Directories But Different Contents in Two Main Directories 如何递归删除两个目录中的不同文件 - How to recursively remove different files in two directories 如何使用diff比较两个目录而忽略不存在的文件? - How to compare two directories using diff while ignoring non-existing files? 按数字升序组合同名但在不同目录中的文件 - Combine files of same name, but in different directories, in numerically ascending order 如何使用BASH比较两个文本文件的相同确切文本? - How to compare two text files for the same exact text using BASH?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM