• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Find with out recursive

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me how to find a file in the present working directory without recursively searcing the file in its sub directories
I want to search the file existance of current directory
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the name of the file is "xyz.txt", then "ls xyz.txt" will list it if it is in the current directory (and not if it is in a sub-directory). Is that what you want to do?
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ulf Dittmer:
If the name of the file is "xyz.txt", then "ls xyz.txt" will list it if it is in the current directory (and not if it is in a sub-directory). Is that what you want to do?


no

now i am workin in one directory and now i want to search some x directory which is palced in current directory.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something like
?

I guess I'm unclear what you mean by "search". Are you looking for a file, or do you want to find some content in the file, or ... ?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11914
209
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at the -maxdepth option?

I recommend looking at the man page for find - a lot of your questions will be answered that way.

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic