That's no problem - the find command (depending on the Unix/Linux variant) normally has an option to say at what level you want to perform the search. On my Linux box (Redhat 8) the parameter is
-maxdepth
so in my case the command to restrict the search to the current directory is:
find top_level_directory -maxdepth 0 -type f -print .........
Under SCO, the command is different (-level from recollection, but I'm old so don't quote me on that!) - man pages should tell you.
There are other good usable features such as -newer (finds files / directories newer that the specified file) -mount (only look in the specified file system) -size (files larger than)....... take a look.
Good luck,
Steve
Quote:
Originally posted by RTAM
Hi,
Thanks for the prompt reply but both the find commands specified by you give a listing of files even of the subdirectory. That is the command gives files from main directory A as well as from the sub-dir B while i want to get files only from A and not look at the sub-directory at all.
Please suggest,
RTAM
|