List all the files in a folder that are owned by a the user "trinh", with permissions "-rw-r--r--"
1. The easiest way is to use ls command and chain filter with grep:
ls -lt . | grep trinh | grep '\-rw\-r\-\-r\-\-'
2. But, if you don't want to escape these permission characters, you can use awk to translate them into number. So, we will translate "-rw-r--r--" as following:
+ "-" : the first character indicates whether it is a file or a directory
So, "-rw-r--r--" is 644 in decimal system.
ls -lt . | grep
ls -lt . | grep trinh