Help answering questiosn I am using a non-gui red hat unix (Linux version 2.6.18
ID: 3847891 • Letter: H
Question
Help answering questiosn
I am using a non-gui red hat unix (Linux version 2.6.18-419.el5 (mockbuild@x86-027.build.eng.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-55)) #1 SMP Wed Feb 22 22:40:57 EST 2017)
1. Use egrep and a regular expression to find all the words in /usr/share/dict/words that consist entirely of lowercase letters.
2. Use egrep and a regular expression to find all the movies in /tmp/bette.txt that have at least one repeated uppercase letter, such as The Watcher in the Woods (1980). (Note the two occurrences of W.)
3. Use egrep and a regular expression to find the one word in /usr/share/dict/words that has ELEVEN consecutive consonants, regardless of case.
4. Use egrep and a regular expression to find the one word in /usr/share/dict/words that starts and ends with the same eight characters.
5. Use egrep and a regular expression to find all the all-vowel (regardless of case) words in /usr/share/dict/words.
6. Use egrep and a regular expression to find the one word in /usr/share/dict/words that is composed entirely of 8 consonants (regardless of case)
7. Use egrep and a regular expression to find all the entries in /etc/passwd for those users whose first name as listed (in the name field) begins with a V or v.
Explanation / Answer
1. grep -e ' "[[:lower:]] +" ' file
And grep [a-z] file
5. grep '[aeiouAEIOU]'
And
grep -vE '^([^a]*|[^e]|*[^i]*|[^o]*|[^u]*)$*' file
7. grep -i '^v' file
Or grep '^v' file
Or grep '^V' file
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.