2
Contributors
1
Reply
2
Views
12 Years
Discussion Span
Last Post by alc6379
0

apparently, that's not possible with find. From the NetBSD manpage on find:

NAME
     find - walk a file hierarchy

SYNOPSIS
     find [-H | -L | -P] [-Xdhsx] [-f file] [file ...] expression

DESCRIPTION
     find [b]recursively[/b] descends the directory tree for each file listed, evalu-
     ating an expression (composed of the ``primaries'' and ``operands'' list-
     ed below) in terms of each file in the tree.

Its job is to be recursive. If there are subdirectories there, they're going to get searched. I'm at a loss to suggest another tool to help, though-- the best thing I could suggest is to use a quick shell script, or something:

for i in pattern ; do echo $i ; done

That will list all of the file names that match your pattern. Like, if I put *.gz in as the pattern, I'd get all of the files that have .gz at the end, one per line. This behavior works like the command, but only in the current directory.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.