Finding text in a file is a common task for system administrators and developers. Explore the grep command, in this video.
- [Instructor] One of the main reasons we'd want…to take a look at text files is to find…some particular piece of information.…One tool you can use to do that is grep.…At its most basic, grep prints lines of text…that match a pattern.…Sounds simple, right?…Well a lot of the time it is.…The pattern can be either an explicit word…or a pattern called a regular expression.…We'll take a look at both briefly here.…But grep is a hugely powerful tool…and it's worth a course of its own.…So we'll take a look at the basics so you're prepared…to dive in deeper if you want to.…
Let's use the grep tool to look for some text…in our poem exercise file.…Let's have grep show us all the lines of our poems file…that have the letters T, H, and E.…To do this, I'll write grep, and then the search term…in quotes, T-H-E, and then the name…of the file I want to use.…And I can see in the results, my search term is highlighted.…And only the lines of the file…which contain the search term are shown on the screen.…To illustrate this a little better,…
- Recognize what the characters “-h” represent in the statement “df –h/home/alice/Documents”.
- Explain how to recall a previous command in Bash.
- Identify what the command “ls -l” will show.
- Recall what is needed to use the find command to look for files by name, size, and so on.
- List the two modes file permissions can be set to.
- Recall why many command line tools are intended to be used in pipes with other commands.
- Explain what the command “grep -E "" report.txt” will show.
- Identify what the “>” symbol is often used for.
Skill Level Beginner
Learning SQL Server Development on Linuxwith Joey D'Antoni1h 54m Intermediate
What you should know1m 51s
1. Setting Up Your Environment
2. Command-Line Basics
3. Files, Folders, and Permissions
4. Common Command-Line Tasks and Tools
5. A Peek at Some More Advanced Topics
Next steps1m 28s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.