I can list files with above extensions by
ls *[m,j,p][n,k,p][v,g]
But I want to list all files except these filetypes
You can use grep like this:
$ ls | grep -v '[\.jpg$|\.png$|\.mkv$]'
The grep
command, filters out text that match provided regular expression. If -v
flag is used, then it filters out text that do not match provided regular expression (reverse).