Search for file in a subfolder

Search for file in a subfolder

am 16.11.2007 18:09:22 von Tim

Dear all,

I'm a newbie to unix (although I'm familiar with MS-DOS)
and have the following problem:
I know that there is the file "abc123.txt" in a subdirectory
of my main directory. Now, we assume that we don't know which
subdirectory this file is located.

Since I don't want to look into each subdirectory separately
I'm after command to do this job for me.

According to this webpage
http://www.techonthenet.com/unix/basic/ls.php
the command is simply

ls -R abc*.*

But I'm getting the following message
/bin/ls: abc*.*: No such file or directory

which cannot be correct because I know that this file
exists.

Thank you,
Tim

Re: Search for file in a subfolder

am 16.11.2007 18:16:02 von Ed Morton

On 11/16/2007 11:09 AM, Tim wrote:
> Dear all,
>
> I'm a newbie to unix (although I'm familiar with MS-DOS)
> and have the following problem:
> I know that there is the file "abc123.txt" in a subdirectory
> of my main directory. Now, we assume that we don't know which
> subdirectory this file is located.
>
> Since I don't want to look into each subdirectory separately
> I'm after command to do this job for me.
>
> According to this webpage
> http://www.techonthenet.com/unix/basic/ls.php
> the command is simply
>
> ls -R abc*.*
>
> But I'm getting the following message
> /bin/ls: abc*.*: No such file or directory

You're telling it to look IN a directory named abc*.*.

> which cannot be correct because I know that this file
> exists.
>
> Thank you,
> Tim

ls */abc123.txt

Take a look at the "find" man page if you want general info on finding files.

Ed.

Re: Search for file in a subfolder

am 16.11.2007 18:16:22 von Tim

On 16 Nov, 17:09, Tim wrote:
> Dear all,
>
> I'm a newbie to unix (although I'm familiar with MS-DOS)
> and have the following problem:
> I know that there is the file "abc123.txt" in a subdirectory
> of my main directory. Now, we assume that we don't know which
> subdirectory this file is located.
>
> Since I don't want to look into each subdirectory separately
> I'm after command to do this job for me.
>
> According to this webpagehttp://www.techonthenet.com/unix/basic/ls.php
> the command is simply
>
> ls -R abc*.*
>
> But I'm getting the following message
> /bin/ls: abc*.*: No such file or directory
>
> which cannot be correct because I know that this file
> exists.
>
> Thank you,
> Tim

Sorry, I've forgotten to ask ;)

What would be the command to do the job?

Thank you!

Re: Search for file in a subfolder

am 16.11.2007 20:00:46 von Tim

On 16 Nov, 17:16, Ed Morton wrote:
> On 11/16/2007 11:09 AM, Tim wrote:
>
>
>
> > Dear all,
>
> > I'm a newbie to unix (although I'm familiar with MS-DOS)
> > and have the following problem:
> > I know that there is the file "abc123.txt" in a subdirectory
> > of my main directory. Now, we assume that we don't know which
> > subdirectory this file is located.
>
> > Since I don't want to look into each subdirectory separately
> > I'm after command to do this job for me.
>
> > According to this webpage
> >http://www.techonthenet.com/unix/basic/ls.php
> > the command is simply
>
> > ls -R abc*.*
>
> > But I'm getting the following message
> > /bin/ls: abc*.*: No such file or directory
>
> You're telling it to look IN a directory named abc*.*.
>
> > which cannot be correct because I know that this file
> > exists.
>
> > Thank you,
> > Tim
>
> ls */abc123.txt
>
> Take a look at the "find" man page if you want general info on finding files.
>
> Ed.

Thanks a lot! It's working!

Tim