-   Linux - Newbie (
-   -   find directory (

chonk0 04-18-2013 09:17 PM

find directory

When searching for a directory using:

find / pr0n -type d

I always end up getting the "find: `pr0n': No such file or directory" even though I know the directory name is correct.

What am I doing wrong?

TobiSGD 04-18-2013 09:22 PM

you have to specify the name with the -name option:

find / -name pr0n -type d

chonk0 04-18-2013 09:25 PM


Originally Posted by TobiSGD (Post 4934455)
you have to specify the name with the -name option:

find / -name pr0n -type d

I found the pr0n!


David the H. 04-21-2013 01:16 PM

Please use ***[code][/code]*** tags around your code and data, to preserve the original formatting and to improve readability. Do not use quote tags, bolding, colors, "start/end" lines, or other creative techniques.

The basic syntax of find is this:


find <search dirs> <global opts> <test opts> <actions>
There can be multiple entries for any of these, and all of the options and actions start with '-'. So it thought you had given it two starting directories to search.

It's also a good idea to always give your command an explicit "-print" action. While this is the default anyway when no action is given, in more complex cases it can be necessary.

Here are a couple of good links about using find:

shivaa 04-21-2013 01:32 PM

Adding to David's reply, just follow the man page of find cmd here. It has all answers for your question.

All times are GMT -5. The time now is 12:05 PM.