List all the files in /usr/bin whose filenames contain lowercase English alphabet
characters only and also contain the word file as a (contiguous) substring.
For example, file and profiles are such files, but git-ls-files is not.
This is the exact question I have and I can only use grep, ls, cat and wc for it.
ls /usr/bin/ | grep '[^-]*file'
This is what I got so far and output is below. I dont know how to display for example just file since * is zero or more occurences. And no idea how to put lowercase thing in the regex as well..
check-binary-files
clean-binary-files
desktop-file-install
desktop-file-validate
ecryptfs-rewrite-file
file
filep
git-cat-file
git-diff-files
git-ls-files
git-merge-file
git-merge-one-file
git-unpack-file
lockfile
nsrfile
pamfile
pcprofiledump
pnmfile
ppufiles
profiles
The ^ and $ match the beginning and end of the string, respectively.