LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   finding a file (https://www.linuxquestions.org/questions/linux-newbie-8/finding-a-file-805127/)

mailkamlesh 04-30-2010 04:38 AM

finding a file
 
Hi all
I am total new to linux as I worked mostly on RTOS ( symbian )
My problem is , I need to find the file IOSTREAM.H
and I am following commands below

1) cd /
2) find . iostream.h ( finds the file / directory from the current path)

It shows No such File or Directory

catkin 04-30-2010 04:51 AM

Better find / -name iostream.h otherwise find will take iostream.h as a place to look -- that's what generates "No such File or Directory".

iostream.h does not exist on my Slackware 13.0 system.

EricTRA 04-30-2010 04:59 AM

Hello and welcome to LinuxQuestions,

In addition to the command provided by catkin I'd put it like this to avoid searching directory names:
Code:

find / -type f -name iostream.h
or even
Code:

find / -mount -type f -name iostream.h
to only look locally if you have other filesystems mounted.

Kind regards,

Eric

mailkamlesh 04-30-2010 05:18 AM

Sorry got the Answer
Using "Locate filename"

EricTRA 04-30-2010 05:21 AM

Hi,

That's another possibility of course. Well done.

If you consider your question/problem solved, then please mark it as such using the thread tools.

Kind regards,

Eric

knudfl 04-30-2010 06:28 AM

Examples ..
/usr/include/c++/4.1.3/backward/iostream.h
is an old c++ header from gcc-c++, libstdc++<version>-devel

'iostream' : /usr/include/c++/4.4.1/iostream
..

MTK358 04-30-2010 07:06 AM

Note that you can use wildcards in find. But you have to enclose them in single quotes to keep bash from interpreting them, and instead pass them to find.

catkin 04-30-2010 07:48 AM

Quote:

Originally Posted by EricTRA (Post 3952781)
or even
Code:

find / -mount -type f -name iostream.h
to only look locally if you have other filesystems mounted.

Worthwhile refinement :) When running find as a non-root user you can also add 2>/dev/null to suppress error messages caused by permissions that don't let the user search some directories.


All times are GMT -5. The time now is 11:23 PM.