Sample Header Ad - 728x90

Equivalent maxdepth for find in AIX

8 votes
4 answers
12756 views
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