@@richardgray8593 LOL! Don the Con is a sociopathic narcissist. He is, and will always be, the worst "president" to ever trespass in The White House. Good riddance to this parasite.
@@caitlingibbons2246 You are pathetically stupid to post something like this. Every day, Joe and the Ho are showing us what a great president Trump truly was.
6:35 $ grep -win -C 2 "find this string" ./* 8:05 $ grep -winr "Find that string even in subdirs" ./* 9:35 $ grep -wirl "List those files that contain this string in current directory dot" . 10:20 $ grep -wirc "List those files that contain this string and number of occurrences in current directory dot" . 11:10 $ history | grep "search for git commits in history" 12:00 $ history | grep "search for git commits" | grep "now narrow down to some string" 15:40 only for mac: $ brew install grep --with-default-names #to allow regular expressions based on perl, as shown in 17:56. 19:13 Homework!
Some folks are intelligent and smart but are horrible at teaching. Corey is smart, intelligent and born to be a teacher. While I am going to contribute on patreon right away, you have a gift that you can use to sell your videos at a small price to benefit and educate the population. Amazing
Mann....You are a legend...Only few people are out there like you..You really are a gemstone. Thank you soo much for this awesome tutorial brother ❤️ No wasting time, straight to the point. God bless you. Love from Kerala ❤️
So glad I looked at this tutorial. I've known how to kind of use grep for a while. Some of these options are going to be super helpful to me in the near future. I should have looked in the man pages a long time ago!
Coincidentially, I had just tried out grep yesterday after completing the "Terminus" game. Today my colleague was very impressed when in a matter of seconds, out of 7500 case files, I picked those 40 or so which contained one certain word. also you can export the results easily into a file (I use &>>filename.txt (.csv also works)), which might come in handy if your boss wants "all the contracts with the Miller Company ASAP", or if you want to quickly mail a list of relevant files. As always, great video!
Nice! Yeah, knowing the command line is a great way to do tasks like this and is a lot more time efficient than writing a complete program from scratch to do the same functionality.
I think back to the days where I literally let Windows XP search through "all .doc files, look for existence of expression Blabla" over the whole FRIGGIN WEEKEND! I think back in shame of course :) One day, I will make a video explaining how I turned an unsorted mess of 15 years unsorted .doc files into a searchable database over a weekend and I will refer a lot to you. Thanks man!
This is exactly what I'm looking for, a way to search for a certain word within 10-20K of case files, located on different drives. I usually use mdfind "word" but it doesn't always work on pdf files, do you mind sharing that method/command you used to find those files?
Thanks for creating this video, have been searching on how bash commands filter text files, can't find anything helpful, glad I searched it on RUclips.
Thanks for covering this. Man, do you make things understandable and simple. I wish that I would have just used RUclips to learn Linux, instead of doing a community college course.
Hi corey, well done like always 👍👍 thanks Nevertheless i would like to add a trick if you didn't already know that When you use history and grep you could wrap the g of grep in a square braquets in order to not get the command itself in the output of the matched results... History | [g]rep
searching for "regular" in the transcript pane of youtube desktop, go here: 12:18 > _"... more advanced searches using regular expressions now I'm not going to go into detail about how to write regular expressions in this video but if you're interested then I'll put a link to my regular expression videos in the description section below. So grep uses POSIX regular expressions by default now ..."_
Great video as always. Our company has switched from Windows to Mac, and I find all of these videos supremely helpful while transitioning. Also, I find it interesting that Gnu is pronounced Gah-new when referring to the software, but just "New" when referring to the animal; sort of like Dvorak the composer (pronounced: d(ə)-VOR-zha(h)k) vs Dvorak the professor/keyboard designer I guess. Thanks again!
Glad you find the videos helpful! As far as the pronunciation, if you're interested there's a short clip on this site with the author explaining how he came out with the pronunciation. Kind've humorous and interesting: www.gnu.org/gnu/pronunciation.en.html
@@coreyms Well that is really cool! Thank you for sharing it! Gnu has always been my favorite word choices when playing Hangman with folks for the first time. Almost always wins. :)
Homebrew UPDATE Aug 2020 If you're a mac user and want to use corey's homebrew trick, read on... At 16:07 Corey says to use this command: brew install grep --with--default-names I tried doing this and it doesn't work. Per a google search that optional argument is no longer allowed. Here's the work-around. 1. Inside terminal: *brew install grep* 2. inside your .bashrc file, put this line of code, preferably at the top so this path is checked first: *export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"* 3. open a new terminal window (command+n) and type in *grep -V* . Should say GNU grep.
In case any one is having issues with the --with-default-names flag on Mac - it is apparently not available anymore in the latest version of homebrew. One workaround that worked for me is to 1. install the package via "brew install grep"; 2. set up an alias pointing from grep to ggrep. You can do this by adding 'alias grep='ggrep' somewhere in your .bash_profile file. Steps: 1. brew install grep 2. nano ~/.bash_profile 3. (add 'alias grep='ggrep' somewhere in the file and then save it) 4. open new terminal for the change to become effective 5. check with grep -V (should display "ggrep (GNU grep) ...")
1. one can't use the "\d" for the digit in grep/egrep (if not use "-P") 2. to use "{3}" for "three times" one need to use 'egrep' instead of 'grep' (if not use "-P") 3. there is no option "--with-default-names" 4. => one need to install "brew install grep" and use 'ggrep/gegrep' instead of 'grep/egrep' 5. there is a very useful option "--color" to highlight found items (as well as filenames and row numbers when using GNU grep)
Hello Corey, when i enter the option --with-default-names. I have an error saying "Error : invalid option : --with-default-names". How i can fix it please ?
Unfortunately, it looks like homebrew has deprecated the --with-default-names option since the making of this video. Now in order to set gnugrep as the default grep you have to do some strange path manipulation in your bashrc/zshrc file. I don't fully understand how to do this, and was wondering if you might be able to explain the new method. I think you have to add a path to your gnubin in your rc file?
-B = before -A = after can you combine the -winBA (which is also C except B and A would let you specify the amount of lines before or after, which could be useful) ... also, are arguments considered boolean..?
I like that this guy just gets straight to the point and wastes no time. I like this man already!
I'd like it even better if he would take just a sec to give a shout-out to the Greatest President That Ever Was or Ever Will Be, Donald J. Trump.
@@richardgray8593 LOL! Don the Con is a sociopathic narcissist. He is, and will always be, the worst "president" to ever trespass in The White House. Good riddance to this parasite.
@@caitlingibbons2246 You are pathetically stupid to post something like this. Every day, Joe and the Ho are showing us what a great president Trump truly was.
6:35 $ grep -win -C 2 "find this string" ./*
8:05 $ grep -winr "Find that string even in subdirs" ./*
9:35 $ grep -wirl "List those files that contain this string in current directory dot" .
10:20 $ grep -wirc "List those files that contain this string and number of occurrences in current directory dot" .
11:10 $ history | grep "search for git commits in history"
12:00 $ history | grep "search for git commits" | grep "now narrow down to some string"
15:40 only for mac: $ brew install grep --with-default-names #to allow regular expressions based on perl, as shown in 17:56.
19:13 Homework!
Thank you ☺️😀
Thanks
Some folks are intelligent and smart but are horrible at teaching. Corey is smart, intelligent and born to be a teacher. While I am going to contribute on patreon right away, you have a gift that you can use to sell your videos at a small price to benefit and educate the population. Amazing
Wow your tutorial made grep SO much simpler. Thanks!
Mann....You are a legend...Only few people are out there like you..You really are a gemstone. Thank you soo much for this awesome tutorial brother ❤️ No wasting time, straight to the point. God bless you.
Love from Kerala ❤️
I just ended up watching your Python OOP series. and i randomly looked for some Linux tutorials, and i was SOOO happy to see your name!
very easy to understand :) thank you!!
There are very few tutorial which gets straight to the point, this is one of them. Really enjoyed learning, Extremely instructive.
Thank you.
After seeing one video, i am addicted to watch more. Thank you friend
awesome ...I really like your style in explanation Corey which i feel like i'm enjoying while watching your tutorials :)
So glad I looked at this tutorial. I've known how to kind of use grep for a while. Some of these options are going to be super helpful to me in the near future. I should have looked in the man pages a long time ago!
I like how this was explained. Straight to the point and simple, very easy to understand.
Great tutorial. Now I understand the grep command much better and I'm looking forward to understand more about regular expressions. Thank You !
outstanding !!!. Dear Corey, appreciate for your time posting your tutorials. I am enjoying teaching style. Thanks again!!
Coincidentially, I had just tried out grep yesterday after completing the "Terminus" game. Today my colleague was very impressed when in a matter of seconds, out of 7500 case files, I picked those 40 or so which contained one certain word. also you can export the results easily into a file (I use &>>filename.txt (.csv also works)), which might come in handy if your boss wants "all the contracts with the Miller Company ASAP", or if you want to quickly mail a list of relevant files. As always, great video!
Nice! Yeah, knowing the command line is a great way to do tasks like this and is a lot more time efficient than writing a complete program from scratch to do the same functionality.
I think back to the days where I literally let Windows XP search through "all .doc files, look for existence of expression Blabla" over the whole FRIGGIN WEEKEND! I think back in shame of course :) One day, I will make a video explaining how I turned an unsorted mess of 15 years unsorted .doc files into a searchable database over a weekend and I will refer a lot to you. Thanks man!
This is exactly what I'm looking for, a way to search for a certain word within 10-20K of case files, located on different drives. I usually use mdfind "word" but it doesn't always work on pdf files, do you mind sharing that method/command you used to find those files?
Excellent. Straight to the point. Concise and precise. Love it 🤩
Clearest most concise tutorial I have found! Thank you!
Great video ! Great explanation. I like that it goes beyond the basic use. Thank you for sharing.
Brilliant.
Thank you for taking the time to help me understand grep, I really appreciate your thoughtfulness Corey.
YOU ARE AMAZING ...... DO NOT EVER STOP
Thanks for creating this video, have been searching on how bash commands filter text files, can't find anything helpful, glad I searched it on RUclips.
These days I hit like as soon as I click on the video, I know it's going to be awesome anyway :)
You've made learning these commands so easy, great job and thank you!
Another awesome video from one of the greatest online tutors.. Hats off, corey. With lots of Love from India :)
Corey is simply the best.
Such a useful and straight forward video! Awesome!
the only youtuber to speak at playback speed 1.5 by default! :D
Man, you're awesome. You made everything sound so easy.
Thanks for covering this. Man, do you make things understandable and simple. I wish that I would have just used RUclips to learn Linux, instead of doing a community college course.
This video is definitely getting saved for future use
Hi corey, well done like always 👍👍 thanks
Nevertheless i would like to add a trick if you didn't already know that
When you use history and grep you could wrap the g of grep in a square braquets in order to not get the command itself in the output of the matched results...
History | [g]rep
searching for "regular" in the transcript pane of youtube desktop, go here:
12:18 > _"... more advanced searches using regular expressions now I'm not going to go into detail about how to write regular expressions in this video but if you're interested then I'll put a link to my regular expression videos in the description section below. So grep uses POSIX regular expressions by default now ..."_
Great video as always. Our company has switched from Windows to Mac, and I find all of these videos supremely helpful while transitioning.
Also, I find it interesting that Gnu is pronounced Gah-new when referring to the software, but just "New" when referring to the animal; sort of like Dvorak the composer (pronounced: d(ə)-VOR-zha(h)k) vs Dvorak the professor/keyboard designer I guess. Thanks again!
Glad you find the videos helpful! As far as the pronunciation, if you're interested there's a short clip on this site with the author explaining how he came out with the pronunciation. Kind've humorous and interesting:
www.gnu.org/gnu/pronunciation.en.html
@@coreyms Well that is really cool! Thank you for sharing it! Gnu has always been my favorite word choices when playing Hangman with folks for the first time. Almost always wins. :)
I love your tutorials. Really enjoyable. Thanks a bunch.
He's really an amazing guy. I watch this even I know this. So addicted.
Suggestion: put an xargs video :-)
Good suggestion! xargs is so useful!
Homebrew UPDATE Aug 2020
If you're a mac user and want to use corey's homebrew trick, read on...
At 16:07 Corey says to use this command: brew install grep --with--default-names
I tried doing this and it doesn't work. Per a google search that optional argument is no longer allowed. Here's the work-around.
1. Inside terminal: *brew install grep*
2. inside your .bashrc file, put this line of code, preferably at the top so this path is checked first: *export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"*
3. open a new terminal window (command+n) and type in *grep -V* . Should say GNU grep.
finally a nicely done video on this! Thanks
I really like your shells theme! Its also a great tutorial!
The video is excellent, very clear, I learned a lot
thank you so much for talking about the BSD grep and GNU grep!! i stuck there for so long ;-;
Simple and clear. Thank you!
In case any one is having issues with the --with-default-names flag on Mac - it is apparently not available anymore in the latest version of homebrew. One workaround that worked for me is to 1. install the package via "brew install grep"; 2. set up an alias pointing from grep to ggrep. You can do this by adding 'alias grep='ggrep' somewhere in your .bash_profile file.
Steps:
1. brew install grep
2. nano ~/.bash_profile
3. (add 'alias grep='ggrep' somewhere in the file and then save it)
4. open new terminal for the change to become effective
5. check with grep -V (should display "ggrep (GNU grep) ...")
excellent video, a good start for grep...much appreciated
Excellent tutorial.
For any youtube searches, If I see your video I would just open it
A video of pure perfection
Once I fell asleep on the keyboard typing grep arguments and it showed me the path to the 5th demension
Fantastic video. I learnt some great options today. Thank you very much!
Nicely explained. Thanks!
1. one can't use the "\d" for the digit in grep/egrep (if not use "-P")
2. to use "{3}" for "three times" one need to use 'egrep' instead of 'grep' (if not use "-P")
3. there is no option "--with-default-names"
4. => one need to install "brew install grep" and use 'ggrep/gegrep' instead of 'grep/egrep'
5. there is a very useful option "--color" to highlight found items (as well as filenames and row numbers when using GNU grep)
Very nice never bothered to learn it before but great video
Amazing video, exactly what I wanted
Very well explained! :D
Thank you!! This tutorial is super helpful!!
Finally a great explanation of GREP for Mac terminal nerds like me! GOLD!
Wonderfully explained
I'm really so happy beacause i found this channel
Ur the best wallh ... sorry for my bad english
awesome video and easy to understand! THANK YOU!
Continue adding courses, you are awesome man, watching your videos makes it both enjoying and learning
Excellent tutorial! Thanks a ton for sharing.
Nice tutorial, I see there''s also a find tutorial too. I'll check it out. I always am confused between both of them
Hi Corey, thanks for last bit on Mac BSD grep distinction!
I thinkl you forgot the -v option that matches everything but the pattern!
Anyway, I learn a lot! thanks for your nice video!
This was very informative. Thank you for the video.
best as always. your videos are superuseful
It was helpful for me. Thank you
great tutorial, thanks!
Not sure if you did it purposely but -win is an easy, useful flag to remember
it was rather helpful, great thanks for the contents.
you saved my day sir, thank you so much
awesome explanation tq sir
Crisp n clear , thanks 😊
Hello Corey, when i enter the option --with-default-names. I have an error saying "Error : invalid option : --with-default-names". How i can fix it please ?
Great video... You could have mentioned about grep -v option too.
Thank you great video!
You're the best! Thanks again.
This is very helpful, thank you very much!
awesome tutorial, full of details. Thanks for that ! Subscribed ;)
Great video ... thank you
Just AMAZING! Thank You!!
Brilliant, thank you!
Hey, thanks for the great tutorial, btw how did you create a custom zsh / bash session for theses tutorials?
This made so much sense :D
“Anotha one!” - DJ Khali 😄
really useful stuff
YOUR CONTENT IS SO UNDERRATED!! THANK YOU SO MUCH FOR YOUR HELP!!
great explanation
Unfortunately, it looks like homebrew has deprecated the --with-default-names option since the making of this video. Now in order to set gnugrep as the default grep you have to do some strange path manipulation in your bashrc/zshrc file. I don't fully understand how to do this, and was wondering if you might be able to explain the new method. I think you have to add a path to your gnubin in your rc file?
brew install grep
alias grep='ggrep -P' # in .zshrc
THANK YOU SO MUCH
That's a great video!
Thank you!
Corey bhaiya ki jai ho... :D
fantastic thanks . god bless man!!!
-B = before
-A = after
can you combine the -winBA (which is also C except B and A would let you specify the amount of lines before or after, which could be useful) ... also, are arguments considered boolean..?
for bash/command line how to match two different files and print results? I cannot find any example of this online
how did you colour your Mac terminal for text and directory, as mine is only dual colour one for background and one for text
i luv this guy
You are the best
your videos are great
thank you very well done
awesome,thank you! :)