Skip to main content
CF

Use Grep for Fast Search from the Command Line

24m 27s
English
Paid

CMD+F in your text editor can only get you so far! In this course, we will learn to use grep and find, two powerful command-line utilities, to search through and explore our codebase. Learn to search specific files and folders, using regular expressions to look for -- or ignore! -- particular phrases. We'll cover how to search recursively, get more context on your results, and some simple tricks to make your searches faster and more targeted.


Once you're familiar with grep and find, you'll be able to quickly answer questions such as: Do I use this function anywhere other than my tests? Where does this file get imported? Whether you're working on a new feature, reading a codebase for the first time, or refactoring existing code, grep and find can help you work faster and more effectively.

About the Author: egghead.io

egghead.io thumbnail

egghead.io is a US-based subscription video platform focused on short, focused screencasts on JavaScript ecosystem topics. Founded in 2012 by John Lindquist (a Google Developer Expert) and run by Joel Hooks, egghead pioneered the short-screencast format that most modern developer-education platforms now use — courses are typically broken into 2-5 minute lessons that each cover one specific concept or API.

The instructor roster includes many of the most cited names in the JavaScript ecosystem — Kent C. Dodds (whose Testing JavaScript launched on egghead before EpicWeb.dev), Andrew Del Prete, Hannah Davis, Lukas Ruebbelke, Tomasz Łakomy, Andy Van Slaars, and many others. Course material covers React, Next.js, TypeScript, Node.js, GraphQL, Vue, the testing tracks, RxJS / observables, and a long list of smaller libraries and tools.

The CourseFlix listing under this source carries over 20 egghead courses spanning that range. Material is paid; egghead itself runs on a monthly / annual subscription on the original platform. The bite-sized format suits developers learning incrementally during work hours rather than committing to multi-hour video sessions.

Watch Online 13 lessons

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 13 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Search the contents of files using grep
All Course Lessons (13)
#Lesson TitleDurationAccess
1
Search the contents of files using grep Demo
02:16
2
Search directory contents recursively using grep
01:42
3
Use find to search for filename patterns
01:34
4
Search matching files by combining find and grep with xargs
02:21
5
Search the contents of a git repository with git grep
01:47
6
Show context around matches using grep
02:00
7
Search for basic patterns using grep
02:10
8
Use grep's extended regular expressions to find complex patterns
02:36
9
Search for optional patterns with grep OR
01:08
10
Specify line beginning and end in patterns using grep
01:19
11
Match classes of characters using bracket expressions with grep
02:22
12
Search with groups using grep
02:13
13
Find matches excluding a pattern with grep
00:59
Unlock unlimited learning

Get instant access to all 12 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription

Frequently asked questions

What are the prerequisites for this course?
To benefit from this course, you should have a basic understanding of the command line interface. Familiarity with navigating directories and executing simple commands will be helpful, as the course focuses on using command-line utilities like grep and find. Previous experience with regular expressions will aid in understanding some lessons but is not strictly necessary.
What projects or tasks will I accomplish during the course?
Throughout the course, you will learn to efficiently search through codebases and directories using command-line tools. You will practice searching file contents with grep, recursively exploring directory contents, and combining grep with find and xargs to search for specific filename patterns. These tasks equip you with practical skills for managing and navigating large codebases.
Who is the target audience for this course?
This course is designed for developers and system administrators who frequently work with codebases and need efficient ways to search and manipulate files. It's also suitable for anyone interested in enhancing their command-line skills, particularly in using grep and find for more effective file searching.
How does this course compare in depth and scope to other courses on command-line tools?
This course specifically focuses on the grep and find utilities, two vital command-line tools for searching and exploring codebases. Unlike more general command-line courses, it delves deeply into the use of regular expressions with grep, searching recursively, and combining tools for advanced search capabilities. It's ideal for those looking to master these particular tools rather than gaining a broad overview of the command line.
What specific tools and platforms are covered in this course?
The course covers the use of grep and find, command-line utilities for file searching. It also includes lessons on using git grep to search within a git repository. These tools are widely available on Unix-like operating systems, making the skills you learn applicable across various platforms.
What topics are not covered in this course?
This course does not cover other command-line utilities outside of grep and find, nor does it address broader topics such as shell scripting or system administration. It focuses solely on the functionalities of grep and find for searching and exploring files and codebases.
How can the skills learned in this course be applied to other careers?
Mastering grep and find enhances your ability to manage and search through large datasets and codebases, which is valuable in software development, data analysis, and system administration. These skills improve efficiency in navigating and manipulating files, a crucial part of many technical roles.