LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-30-2010, 04:38 AM   #1
mailkamlesh
LQ Newbie
 
Registered: Apr 2010
Posts: 10

Rep: Reputation: 0
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
 
Old 04-30-2010, 04:51 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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.
 
Old 04-30-2010, 04:59 AM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
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
 
Old 04-30-2010, 05:18 AM   #4
mailkamlesh
LQ Newbie
 
Registered: Apr 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Sorry got the Answer
Using "Locate filename"
 
Old 04-30-2010, 05:21 AM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
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
 
Old 04-30-2010, 06:28 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
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
..
 
Old 04-30-2010, 07:06 AM   #7
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
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.
 
Old 04-30-2010, 07:48 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by EricTRA View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me finding a file pinga123 Linux - Newbie 1 10-30-2009 07:02 AM
Finding an UNTARED file. swamprat Linux - Newbie 6 08-06-2009 08:24 PM
finding links to a file bigearsbilly Solaris / OpenSolaris 2 02-10-2006 02:42 AM
Finding the last in a file list .. hrafn Programming 1 03-21-2005 03:45 AM
finding a file pcdebb Linux - Newbie 8 10-21-2003 06:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration