How to list specific type of files in recursive directories in shell?

后端 未结 7 847
無奈伤痛
無奈伤痛 2021-01-31 15:26

How can we find specific type of files i.e. doc pdf files present in nested directories.

command I tried:

$ ls -R | grep .doc

but if th

7条回答
  •  无人共我
    2021-01-31 15:48

    Some of the other methods that can be used:

    echo *.{pdf,docx,jpeg}

    stat -c %n * | grep 'pdf\|docx\|jpeg'

提交回复
热议问题