There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply () below.
If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
You can also find further discussion and get answers to your questions over in Language Help.
Agree with a comment or answer? Like () to up-vote the contribution!
I encountered an issue when following the instructions for this exercise. Instruction #1 reads:
Use grep search through the working directory ( /home/ccuser/workspace/geography ) for anything that matches Island . We want the matching filenames and lines.
Problem is that doesn’t work and it prompts you to use Arctic instead, which works. Why is this a case? is it a bug?
HI I used the same grep function but it outputted blank on the second line so what do we do to get it to see if its successful?
I tried something like grep -R Arctic /home/ccuser/workspace/geography | sort > burned.txt
then I typed cat burned.txt
but it outputted blank
I was mistakenly using R1 when I should have been using Rl i.e. lower case L. The command did not find ant results with R or -R. But I have passed on to next.
I think there’s a bug on this lesson ( snow to rain lesson ). Changing instances of snow to rain works (the results are printed automatically without cat), but when cat is used, all the instances of rain have reverted back to snow
I know it’s a little late but I had the same problem and found that none of the files contained “Island” so nothing was output. I replaced “Island” with “Ocean” then it printed out all the lines with “Ocean”
You’d best check the man page for your version of grep but on the version I have to hand GNU grep 3.6 the difference is that -R follows symbolic links (in a very simple way you can think of them like shortcuts in windows, web search would explain difference) whereas -r does not follow symlinks. For these examples no it doesn’t matter but when in doubt use man grep and check what options you have.
Edit: Lesson seems to use GNU 3.1, try grep --help since man isn’t immediately available in this lesson.
The funny thing is the reason there’s no matches for Island is because in an earlier exercise (the one about piping) you clobber islands.txt with the output from wc . Think these lessons needs some better QA
I haven’t tried out the lowercase R thing myself but in my case a common error I was making was “using the wrong case”. Whether it’s A for Arctic or I for Island (in my case) or -R function, I used uppercase.
Hey, so on checking, it would appear that islands.txt only contains 17, 26, 204, and not the names of any islands - as a result of a previous exercise, which someone’s already mentioned above.
Because the search being carried out for both -R and -Rl is for ‘Island’ not ‘island’ (case sensitive), nothing will come up. Hope this helps!
I encountered an issue when following the instructions for this grep || exercise 10/12. Instruction #1 reads:
Use grep search through the working directory ( /home/ccuser/workspace/geography ) for anything that matches Island . We want the matching filenames and lines.
I followed the hint given:
grep -R Island
I also got the correct result:
islands.txt:Turks and Caicos Islands
islands.txt:Bermuda Islands
islands.txt:Canary Islands
islands.txt:Cayman Islands
islands.txt:Aegean Islands
islands.txt:Frisian Islands
islands.txt:Andaman Islands
islands.txt:Seychelles Islands
But on the left, under instructions checkbox, it shows X(wrong), instead of correct symbol. Is there a Bug?
I also am running into the problem with this specific exercise. I run ‘grep -R’ for Q1 in the exercise and it gives me the correct answer. However, on Q2 I am running ‘grep -R1’ and get the seemingly correct answer on the right, but don’t get the checkbox on the left.