regex - Regular Expression Differences Between ls and find to search for 1 string or another string -
I have a slight brain disturbance, I'm sure someone can respond quickly, I use cygwin in windows I am trying to open a bash (if any is freedom) and I am having trouble changing a regular expression between LS and finding.
I have a bunch of files that I need access, some that start EA_ and some that start FS_, so I can list them with LS like this
ls -l {ea, fs} _ * and it works fine with wc, but when I use it in a search If I try, regex does not look right: -
find -in "{EA, FS} _ *" I avoid {and} To the But it does not seem to be what I am doing -
Cheers
MH
It seems that you need a regular expression instead of the number of common names:
find -regenges' ./a (EA.F.FSFS) \) _. * ' Remember with this syntax you also have to match the directory. Your orders seem to be that you are not doing it in a directory (no depth), so what I have provided will work for you to get a more regex for more recursive searches.
Test run on Sigwin, 7 Windows:
$ find -regsx './\(RT\|ED\).*' | Head ./ED-AT-CK01-A01.xml./ED-AT-CK02-A01.xml./ED-AT-CL01-A01.xml./ED-AT-CL02-A01.xml./ED-AT -CL03-A01.xml ./ED-AT-CL04-A01.xml./ED-AT-IL001-A01.xml./ED-AT-IL01-A01.xml./ED-AT-IL02-A01.xml ./ED-AT-TB02-A01.xml
Comments
Post a Comment