I need to list lines that consist of a single non-vowel character.
I got this:
ls | grep -nv '[aeiouy]' file
But this doesn't give me a single character. How do I get just a single character?
I need to list lines that consist of a single non-vowel character.
I got this:
ls | grep -nv '[aeiouy]' file
But this doesn't give me a single character. How do I get just a single character?
Just add x
to match the whole line:
grep -nvx '[aeiou]' file.txt
Or
grep -nv '^[aeiou]$' file.txt
Or
grep -nx '[^aeiou]' file.txt
Or
grep -n '^[^aeiou]$' file.txt
Note that, parsing ls
is not a good idea.
ls
togrep
AND givinggrep
a filename to process? – cas Mar 06 '16 at 06:33