I'm trying to get all files by mask in some directory without recursively searching in subdirs. There is no option
-maxdepth 0
in AIX for that.
I've heard about -prune
, but still can't get how it works.
I guess the command should look something like
find dir \( ! -name dir -prune -type f \) -a -name filemask
but it doesn't work.
Could you please write a correct command for me and explain how it will work?
**UPD**
It seems command
find dir ! -path dir -prune
prints all files and catalogs in dir
, but not files and catalogs in dir/*
, so I can use it for my case.
Asked by Vikora
(125 rep)
Jun 23, 2017, 03:04 PM
Last activity: Jun 5, 2025, 02:59 PM
Last activity: Jun 5, 2025, 02:59 PM