linux - find command search pattern -
i have below 4 files
a_rollback2to3__test.sql, a_1to2__test.sql, a_2to3__test.sql, a_2to2__test.sql i want write find command return files a_1to2__test.sql, a_2to3__test.sql , a_2to2__test.sql, file a_rollback2to3__test.sql should not included in search.
my find command looks
find . -name "*_*to*__*.sql" but returns files don’t want a_rollback2to3__test.sql.
basically files rollback after first _ should not included..
can me write search pattern requirement?
thanks
simply filter results grep:
find . -name '*_*to*__*.sql' | grep -v rollback
or use , clause -a negation !:
find . -name '*_*to*__*.sql' -a ! -name '*rollback*'
Comments
Post a Comment