S
S
Sergey Burduzha2019-05-18 12:28:11
linux
Sergey Burduzha, 2019-05-18 12:28:11

How to combine type and depth in find command?

Good afternoon.
I want to see only the files at the first nesting level.
find -depth 0 -type f
But this command does not work, why?
Can you link to many examples of the find command?
Thanks in advance for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2019-05-18
@serii81

-depth Process each directory's contents before the directory itself.
The -delete action also implies -depth.

It's just not the setting you were looking for. The nesting levels are -maxdepth and -mindepth. I.e
find -maxdepth 1 -type f

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question