Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

GNU find (and others?) has a -true test along with the normal -name, -mode, -user and so on. From the man page:

-true Always true.

Every time I see the man page I notice this and wonder when it'd be useful. So, give me some examples of when it's useful :~)

share|improve this question

Might useful for debuging when you are ANDing or ORing statements. So if you have a long command with a complex chain of arguments with lots of AND / OR between the statements, and something that isn't working like you expect, you could replace parts of it with -true to check your logic.

However, I am not sure if this is why it is there, but seems like a legitimate use.

share|improve this answer

When you want to list all files in find format to pipe into another program ?

I guess it must be more efficient than using -name "*" or something similar.

share|improve this answer
find with no arguments at all does that. – Dennis Williamson Sep 22 '09 at 12:17
Sure, but it's more explicit and has the same syntax with -true – Julien Tartarin Sep 22 '09 at 12:55
How so? – Dennis Williamson Sep 22 '09 at 13:16

Consider find -delete -o -true -print. It's not too useful, but it's a pointer that you can think of -true or -false as means to override an in-expression result of some command with side effects.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.