Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

egghead.io

Use Grep for Fast Search from the Command Line

via egghead.io

Overview

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.

Syllabus

  • Search the contents of files using grep
  • Search directory contents recursively using grep
  • Use find to search for filename patterns
  • Search matching files by combining find and grep with xargs
  • Search the contents of a git repository with git grep
  • Show context around matches using grep
  • Search for basic patterns using grep
  • Use grep's extended regular expressions to find complex patterns
  • Search for optional patterns with grep OR
  • Specify line beginning and end in patterns using grep
  • Match classes of characters using bracket expressions with grep
  • Search with groups using grep
  • Find matches excluding a pattern with grep

Taught by

Bonnie Eisenman

Reviews

4.6 rating at egghead.io based on 86 ratings

Start your review of Use Grep for Fast Search from the Command Line

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.