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.
-path
forfind
– Vikora Jun 23 '17 at 15:49(
/)
and thedir/dir
issue mentioned in my answer, it seems to me your answer should work at what I think you want to do (find files calledfilemask
indir
(anddir
only)). – Stéphane Chazelas Jun 23 '17 at 15:54