Frage

I tried the following command to list all the files which has /SL/src/ in its path

find * -type f -name '*/SL/src/*'

but it does not prints any thing even though there are files within the directory SL/src

War es hilfreich?

Lösung

You might use something like that:

find * -type d -exec sh -c '
for i do
  [ "$(basename $i)" = src ] &&
  [ "$(basename $(dirname $i))" = SL ] &&
  find "$i" -type f ; done
' sh {} + 

or simply:

find * -type f | grep /SL/src/
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top