3

I search for two files that has changed recently in a folder, but it seems I invoke find incorrectly. In return I get only the results for the second file.

find /tmp -name 'twofirmscoop.so' -o -name 'twofirms.so' -exec ls -lt {} + 2>/dev/null

Krzysztof Voss
  • 1,766
  • 1
  • 13
  • 12

2 Answers2

2

The -exec argument only applies to the second match. To group them, do:

find /tmp \( -name 'twofirmscoop.so' -o -name 'twofirms.so' \) -exec ls -lt {} +
William Pursell
  • 204,365
  • 48
  • 270
  • 300
1

Try this:

find /tmp \( -name 'twofirmscoop.so' -o -name 'twofirms.so' \) -exec ls -lt {} + 2>/dev/null
yasu
  • 1,374
  • 8
  • 16