I always hated working with regex but seems to be the best tool for the job in this case, or atleast it seems like it to me. Please correct me if I am wrong. I want to be able to search a directory(but not subdirectories) for avi, mp4 or mkv files. If I stick to basic regex and search only for a single file type, say avi, it works. The problem is searching for multiple file types.
Works fine.
These lines do not, but I am not sure why:
Code:
find . -prune -type f -regex '.*.avi'
These lines do not, but I am not sure why:
Code:
find . -prune -type f -regex (avi|mp4) find . -prune -type f -regex (avi|mp4|mkv) find . -prune -type f -regex (.*.avi|.*.mp4|.*.mkv)
Comment