Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    This is very easy with the specific examples you show, but can get extremely complicated for complex file names. Can your file names contain spaces? Can they contain newlines? Can your file names contain a :? Can they contain an and surrounded by spaces? Commented Oct 9, 2020 at 17:31
  • i can assume that my filenames contain none of things for this particular case Commented Oct 9, 2020 at 17:40
  • 1
    Then roaima's answer should be perfect for you. Do read his final note about using cmp though. Commented Oct 9, 2020 at 17:44
  • it doesn't work for me. Can you help me implement it? Commented Oct 9, 2020 at 22:47