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
Such a useful and straight forward video! Awesome!
I 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?
Thanks!
I am very new to bash and was wondering how you go back to the previous command once you run it. For Ex 1:50
grep -i "John Willims" names.txt
How can I pass a string variable instead of "John Williams"
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?
Thank you for this very amazing and concise tutorial. You have summarized everything perfectly! Does . and ./* mean the same thing if I do grep r?
lol, 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
Which font do you use in the terminal?
Could you please make video on DS by python
Corey is simply the best.
I like that this guy just gets straight to the point and wastes no time. I like this man already!
how grep "function" in php files that resides on remote server or localhost?
FYI – 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
Great video ! Great explanation. I like that it goes beyond the basic use. Thank you for sharing.
Great video … thank you
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!
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 Youtube.
This was very informative. Thank you for the video.
You should make an awk tutorial!