Unix / Linux - grep command quiz / questions
Level - basic and intermediate.
As i learnt on few sites, quiz / challenges are the best way of learning something new.
Answers are in link - http://shellandperl.blogspot.com/2014/06/unix-linux-grep-challenge-answers.html
1. Use grep to open a file like cat. ie, using grep, replicate "cat filename" task (try both versions - grep and egrep)
2. use grep to count the number of lines in a file(wc -l).
3. use grep to count the number of empty lines in a file
4. find out all capital words on a given file
5. find out all dollar values($50, $10, $1, etc) on a given file
6. find out all US cell numbers(123-456-7890, +1-123-456-7890) on a given file
7. use grep to count the number of words on a given file(wc -w).
8. grep only the full words
9. grep for ip addresses
10. take any command, for example wc, thru grep, read its man page and find out its AUTHOR
No comments:
Post a Comment