[ug-bosug] 'find' -maxdepth alternate

Ananth Shrinivas Ananth.Shrinivas at Sun.COM
Mon Jan 22 09:55:57 PST 2007


If you are looking for only maxdepth = 1 then will "ls -l" not do the 
job (with awk/sed/grep) ?

For arbitrary depths, there ain't no mystery option. You need perl or 
python to do that job :(

Ananth

Anil Gulecha wrote:
> Hi list,
> 
> I'm working on the USB session manager for Belenix, and for a part of 
> the script I need to print out the files in the mentioned directory.
> 
> For Ex:
> # find /tmp/parentdir/
> /tmp/parentdir/
> /tmp/parentdir/childdir1
> /tmp/parentdir/childdir1/file
> /tmp/parentdir/childdir2
> /tmp/parentdir/childdir2/file
> /tmp/parentdir/childdir3
> /tmp/parentdir/childdir3/file
> /tmp/parentdir/file1
> /tmp/parentdir/file2
> /tmp/parentdir/file3
> # find /tmp/parentdir/ -type f
> /tmp/parentdir/childdir1/file
> /tmp/parentdir/childdir2/file
> /tmp/parentdir/childdir3/file
> /tmp/parentdir/file1
> /tmp/parentdir/file2
> /tmp/parentdir/file3
> 
> I'm trying to figureout somehting that'll only print out:
> # find <mystery options>
> /tmp/parentdir/file1
> /tmp/parentdir/file2
> /tmp/parentdir/file3
> 
> GNU find has the -maxdepth option, and I'm unable to find it on the 
> solaris find
> 
> Regards
> Anil
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> ug-bosug mailing list
> List-Unsubscribe: mailto:ug-bosug-unsubscribe at opensolaris.org
> List-Owner: mailto:ug-bosug-owner at opensolaris.org
> List-Archives: http://www.opensolaris.org/jive/forum.jspa?forumID=54



More information about the ug-bosug mailing list