Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

How can I use find command to find every type of the file (not just -type f but also specials such as sockets, device files etc.) but ommiting dirs?

share|improve this question
up vote 5 down vote accepted

Use negation.

find . ! -type d -print

Also see

share|improve this answer

You can have o look at find manual, but I doubt it is the proper way to find sockets and/or device files... I think the program to find such a device is a different one, don't remember what exactly right now, sorry!

share|improve this answer
I'm familiar with find's manual page. There is a way to get e.g. only sockets (e.g. myusql.sock) or only regular files, but not all at once. – bass Jun 5 '12 at 10:51

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.