Risposte:
Penso che otterrai ciò che vuoi con l' -maxdepth 1opzione, in base alla tua attuale struttura di comando. Altrimenti, puoi provare a guardare la pagina man per find.
Voce pertinente (per comodità):
-maxdepth levels
Descend at most levels (a non-negative integer) levels of direc-
tories below the command line arguments. `-maxdepth 0' means
only apply the tests and actions to the command line arguments.
Le tue opzioni sono sostanzialmente:
find DirsRoot/* -maxdepth 0 -type f #This does not show hidden files
O:
find DirsRoot/ -maxdepth 1 -type f #This does show hidden files
1è probabilmente quello che vuole.
-maxdepth 0non mostra alcun file ma -maxdepth 1funziona come previsto, anche con i file nascosti visualizzati.
*in find DirsRoot/* -maxdepth 0 -type f. Se lo lasci fuori, non mostrerà alcun file.
Credo che tu stia cercando -maxdepth 1.
-maxdepth 1?
Se cerchi una soluzione conforme a POSIX:
cd DirsRoot && find . -type f -print -o -name . -o -prune
-maxdepth non è un'opzione conforme a POSIX.
find DirsRoot/* -type f -prune?
-prunebtw) La risposta è no, non può. Per comprendere appieno PERCHÉ non può essere semplificato, basta emettere il set -xcomando prima di emettere il find DirsRoot/* -type f -o -prunee lo vedrai immediatamente tu stesso. La causa principale sono i limiti dell'espansione della shell dell'espressione DirsRoot/*.
find . -name . -o -prune
-maxdepth 1?