find in given path do not want to traverse to its sub-directories


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting find in given path do not want to traverse to its sub-directories
# 1  
Old 02-19-2009
Java find in given path do not want to traverse to its sub-directories

Hi All,

My UNIX Version is:
OS Name Release Version
AIX appma538 3 5

I want to find certain files with some criterias under the given path. At the same time i want to find the files which resides under the given directory, but normal find traverse to its sub-directories also.

-mount option is not there in 'find' for this version.

I want to restrict the find to search only the given path not to its sub-directories.
How can i proceed.
Please help.
# 2  
Old 02-19-2009
try using the -prune option
# 3  
Old 02-19-2009
Java

path:>find /home/sponna -name "*.txt" -size +536c
find: cannot chdir to </home/sponna/restore/ModelS> : Permission denied
/home/sponna/model_logs.txt
/home/sponna/park_log.txt
/home/sponna/recur_log.txt
/home/sponna/findtest/model_logs.txt

The above command traversed into sub-directories also. Listed files under the given path and also its sub-directories.

path:>find /home/sponna -prune -name "*.txt" -size +536c
After prune not given the output files which are present under the given directory itself.

Please guide me.
# 4  
Old 02-19-2009
find /home/sponna/*.txt -prune -size +536c
# 5  
Old 02-19-2009
Java

Thanks
but this option will give "arg list too long" error,
if many files satisfies the given find criteria.

I tried this option and got the "error", so as a better pratice i want to proceed like
find /path/ -name "*.txt".
Tried prune as i updated the output also, its not working.

Is any way i can approach to this.?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find a pattern and traverse left and pick something from another pattern

I have a Text like below , Detailed Table Information Table(tableName:a1, dbName:default, owner:eedc_hdp_s_d-itm-e, createTime:1520514151, lastAccessTime:0, retention:0, sd:StorageDescriptor(cols:, location:hdfs://DBDP-Dev/apps/hive/warehouse/a1,... (6 Replies)
Discussion started by: nv186000
6 Replies

2. Shell Programming and Scripting

Traverse through directories

Hi all, Require help in completing a shell script. i do have a total of 90 directories where in we have different sub-directories and one of the sub directory named logs I need to go inside the logs subdirectory and check if a particular log is present or not. for example below is the... (3 Replies)
Discussion started by: bhaskar t
3 Replies

3. OS X (Apple)

OS X 'find' nogroup/nouser doesn't traverse directories?

flamingo:~ joliver$ sudo find / -nogroup find: /dev/fd/4: No such file or directory find: /home: No such file or directory find: /Library: No such file or directory find: /net: No such file or directory find: /Network: No such file or directory find: /private: No such file or directory find:... (2 Replies)
Discussion started by: jnojr
2 Replies

4. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

5. UNIX for Dummies Questions & Answers

Using grep command to find the pattern of text in all directories and sub-directories.

Hi all, Using grep command, i want to find the pattern of text in all directories and sub-directories. e.g: if i want to search for a pattern named "parmeter", i used the command grep -i "param" ../* is this correct? (1 Reply)
Discussion started by: vinothrajan55
1 Replies

6. Shell Programming and Scripting

PERL - traverse sub directories and get test case results

Hello, I need help in creating a PERL script for parsing test result files to get the results (pass or fail). Each test case execution generates a directory with few files among which we are interested in .result file. Lets say Testing is home directory. If i executed 2 test cases. It will... (4 Replies)
Discussion started by: ravi.videla
4 Replies

7. Shell Programming and Scripting

How to find 777 permisson is there or not for Directories and sub-directories

Hi All, I am Oracle Apps Tech guy, I have a requirement to find 777 permission is there or not for all Folders and Sub-folders Under APPL_TOP (Folder/directory) with below conditions i) the directory names should start with xx..... (like xxau,xxcfi,xxcca...etc) and exclude the directory... (11 Replies)
Discussion started by: gagan4599
11 Replies

8. Shell Programming and Scripting

Recursive call to find files and directories in Shell script from current path.

################################################################ Copy this script to your path from where you want to search for all the files and directories in subdirectories recursively. ################################################################# code starts here... (2 Replies)
Discussion started by: Ramit_Gupta
2 Replies

9. Shell Programming and Scripting

Find a file in sub-directories.. o/p just the path

Hello All, I am somehow stumped with this ting. 'Find' will sure show me.. but I want only thepath of all the occurences of the file in any of the sub-dirs.. Any help will be sincerely appreciated. thanx! (3 Replies)
Discussion started by: pranavagarwal
3 Replies

10. UNIX for Dummies Questions & Answers

Fastest way to traverse through large directories

Hi! I have thousands of sub-directories, and hundreds of thousands of files in them. What is the fast way to find out which files are older than a certain date? Is the "find" command the fastest? Or is there some other way? Right now I have a C script that traverses through and checks... (5 Replies)
Discussion started by: sreedharange
5 Replies
Login or Register to Ask a Question