Grep l


#1



https://www.codecademy.com/courses/learn-the-command-line/lessons/redirection/exercises/grep-i?action=lesson_resume


I am stuck on section 10/13 on Grep l. There are two tasks the first one asks you to enter "grep -R Arctic /home/ccuser/workspace/geogrpahy". I can get that one ok. But the second one won't go through for me. It says to enter "grep -R1 Arctic /home/ccuser/workspace/geogrpahy". When I put that in it won't work. Then I get the "Keep Trying/Get Code" box and click get code, but it won't give me the code! What am I doing wrong? The only thing I notice is that the "1" in "-R1" that I type in looks different from the one "1" given in the task box. I can't copy and paste either, so I need to know how to type it in.


https://onedrive.live.com/?auth=1&cid=49EDBE2835C39EDB&id=49EDBE2835C39EDB%2135040&parId=49EDBE2835C39EDB%2135039&o=OneUp


#2

First Line: grep -R Arctic /home/ccuser/workspace/geography
[ ENTER ]
Second Line: grep -Rl Arctic /home/ccuser/workspace/geography
[ ENTER ]


#3

That's what I have been doing. How do you get your "1" to look like that in "grep -R1 Arctic". It's different from the "1" on my keyboard. I'm thinking that's where the problem is coming from.


#4

Just realized that's the letter "L" and not number "1". Thank God for YouTube lol.


#5

Yeah, you're right. That's where the problem is coming from.It is the small letter L that might look like a 1 in this font.

When you type man grep and scroll through it, you will see that the option -l is just a short version and you could also use --files-with-matches. Also you will see there are no numbers being used as a first argument.

Edit: Ah, you saw it already


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.