In this Linux/Mac terminal tutorial, we will be learning how to use the grep command. The grep command allows us to search files and directories for patterns of text. You can also pipe the output of one command into grep to get certain matches. It’s extremely useful once you learn the ins and outs. Let’s get started…
The code from this video can be found at:
Regular Expressions Tutorial:
Regular Expressions Tutorial (Python):
✅ Support My Channel Through Patreon:
✅ Become a Channel Member:
✅ One-Time Contribution Through PayPal:
✅ Cryptocurrency Donations:
Bitcoin Wallet – 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet – 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet – MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
✅ Corey’s Public Amazon Wishlist
✅ Equipment I Use and Books I Recommend:
▶️ You Can Find Me On:
My Website –
My Second Channel –
Facebook –
Twitter –
Instagram –
#Linux #Mac
Nguồn: https://codeigniterbrasil.com
Xem thêm bài viết khác: https://codeigniterbrasil.com/lap-trinh-linux/
Xem thêm Bài Viết:
- Hướng dẫn sử dụng hệ điều hành linux siêu tốc – bài 25 Xem cấu hình hệ thống (cpu, ram, hdd)
- Linux cat command summary with examples
- Cài nhiều hệ điều hành Windows và Linux trên một máy tính
- Hướng dẫn tạo USB Boot DLC2019 (NTFS / UEFI) Trên windows 10 ( sử dụng USB 32 GB )
- Hướng dẫn gỡ bỏ Ubuntu sạch sẽ nhất bằng lệnh trên Windows theo chuẩn UEFI-GPT
PraiseHymnProject
April 16, 2020Such a useful and straight forward video! Awesome!
Matt Dooley
April 16, 2020I have this issue, can anyone help me? So, I sam searching for the word "Christmas" in a text file by doing the following:
grep "Christmas" filename.txt
And I got back the entire text of the file, printed out entirely in terminal! Unlike the video above, where simply got the number of the lines where the word appears, which is what I want for "Christmas" in my text file. What am I doing wrong?
Brendan Metcalfe
April 16, 2020Thanks!
Mathew Boyd
April 16, 2020I am very new to bash and was wondering how you go back to the previous command once you run it. For Ex 1:50
ramkiran55 devireddy
April 16, 2020grep -i "John Willims" names.txt
How can I pass a string variable instead of "John Williams"
Maxwell Wibert
April 16, 2020Unfortunately, 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?
Sana Ali
April 16, 2020Thank you for this very amazing and concise tutorial. You have summarized everything perfectly! Does . and ./* mean the same thing if I do grep r?
insanecbrotha
April 16, 2020lol, the BRE for the phone numbers would be: grep "([[:digit:]]{3}-){2}[[:digit:]]{4}" names.txt
Could be worse though: http://ergoemacs.org/misc/emacs_lisp_toothpick_syndrome.html
camelCase
April 16, 2020Which font do you use in the terminal?
Vineet gupta
April 16, 2020Could you please make video on DS by python
Ian Hopper
April 16, 2020Corey is simply the best.
MD Hossain
April 16, 2020I like that this guy just gets straight to the point and wastes no time. I like this man already!
o
April 16, 2020how grep "function" in php files that resides on remote server or localhost?
George Ford
April 16, 2020FYI – the "–with-default-names" option has been removed. For Mac users who still want to use GNU grep as grep, see this helpful link: https://stackoverflow.com/questions/59232089/how-to-install-gnu-grep-on-mac-os
Mickaël Riga
April 16, 2020Great video ! Great explanation. I like that it goes beyond the basic use. Thank you for sharing.
B R Pawan Kumar Iyengar
April 16, 2020Great video … thank you
CrushOfSiel
April 16, 2020So 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!
Khuen Lau
April 16, 2020Thanks for creating this video, have been searching on how bash commands filter text files, can't find anything helpful, glad I searched it on Youtube.
mehmet rasim inceoglu
April 16, 2020This was very informative. Thank you for the video.
Dielle
April 16, 2020You should make an awk tutorial!