From the course: LPI Linux Essentials (010-160) Cert Prep

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Data search and extraction

Data search and extraction - Linux Tutorial

From the course: LPI Linux Essentials (010-160) Cert Prep

Start my 1-month free trial

Data search and extraction

- [Instructor] In this lesson, we're going to learn how to use Grep to search for data within files. So what we're going to do first is I'm going to use a file that's sitting in my documents drive. So if I hit LS, you'll be able to see what files I have and I have one known as fruitstand.txt. Now, fruitstand.txt is simply a file that contains a list of names, fruit, and $1 amount. So if I want to display that to the screen, I can just type cat and then fruitstand.txt. Now one thing to note here is you'll notice how quickly I was able to type fruit stand. The way I did that is I used a feature known as auto complete. In Linux, when you're typing a command or a file name or a directory, if you hit the Tab key, if it knows what it is, it will guess and try to auto complete for you. So in this case, I only typed in cat and then f,r from fruit hit tab and it fully was able to display that to the screen for me. And now I…

Contents