문제

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

도움이 되었습니까?

해결책

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/
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top