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

If you are more confortable with “ls” and “grep”, you can do what you want using a regular expression in the grep command (the ending ‘$’ character indicates that .doc must be at the end of the line. That will exclude “file.doc.txt”):

ls -R |grep "\.doc$"

More information about using grep with regular expressions in the man.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)