Select only words with a letter
Hi,
Can I select only words with the letter "a" for example? On a file txt. example: cat expre.txt | grep........ regards |
Grep will give you the entire line if it encounters a match.
Do you just want the specific word only that has an "a" in it? |
yeap,
I only want words with letters "a". I know than the documentos only has words with letters "a" and "b". |
The document is similar to:
aaa abbabba aaaabba aba aab bba baab .. .. .. .. |
Umm if you mean there are only words that consist of either a, b or both of them, and you want to print lines with only 'a's (which means: you don't want to print lines that have 'b's in them)? In that case:
Code:
grep -v b file.txt EDIT: the above works if there's one word per one line. If there are multiple, it will not work. |
PERFECT!!!!!!!!!!!
I have to use the next command: cat [name_fichero] | grep -v b It's perfect |
Quote:
Code:
grep -v b name_fichero |
All times are GMT -5. The time now is 01:19 PM. |