Usando sed
:
sed -n '/\(^\| \)\([A-Za-z]\)\($\| \)/p' file
Usando grep
:
grep '\(^\| \)\([A-Za-z]\)\($\| \)' file
-
\(^\| \)
: corresponde ao início da linha ou a;
-
\([A-Za-z]\)
: corresponde e agrupa qualquer caractere alfabético de letras maiúsculas ou minúsculas; -
: corresponde ao caractere agrupado anteriormente;
-
: corresponde ao caractere agrupado anteriormente;
-
\($\| \)
: corresponde ao final da linha ou a;
~$ cat file
aa word word
word wordaaaword word
aAa word word
aaa word word
word bbb word
word word ccc
aaaa word word
~$ sed -n '/\(^\| \)\([A-Za-z]\)\($\| \)/p' file
aaa word word
word bbb word
word word ccc
~$ grep '\(^\| \)\([A-Za-z]\)\($\| \)' file
aaa word word
word bbb word
word word ccc