I want to find a specific file that doesn't start with a
,k
,G
or Q
and in which the third letter in the name is not a digit.
I have tried many links, but found nothing regarding to this composite problem.
I want to find a specific file that doesn't start with a
,k
,G
or Q
and in which the third letter in the name is not a digit.
I have tried many links, but found nothing regarding to this composite problem.
Assuming you mean third character as opposed to third letter;
find . -name '[!akGQ]?[!0-9]*'
In ksh you will have the negation file globbing pattern !( ... )
. So you could write
!([akGQ]?[0-9]*)
find . -name '[^akGQ]?[^0-9]*'
– jimmij Mar 11 '15 at 23:24