David542
David542

Reputation: 110512

How to prune out two directories in find command

I have the following command:

$ find /mnt/DCS_01 /mnt/DCS_02  \
  -name Transit -prune -o .Trashes -prune -o -type f

I am trying to prune out the Transit and .Trashes directores, but am having some difficulty with the syntax. What would be the proper command here?

Upvotes: 0

Views: 638

Answers (1)

David542
David542

Reputation: 110512

You can use parentheses to specify multiple args --

$ find /mnt/DCS_01 /mnt/DCS_02  \
  \( -name Transit -o -name .Trashes \) -prune -o -type f

Upvotes: 1

Related Questions