QuietShark.com
  • Articles
  • Tech Bites
  • Fitness
  • Finance
Home » Posts » How to search and replace quickly across directories
How To Search (And Replace) Quickly Across Directories

How To Search (And Replace) Quickly Across Directories

  • Jun 17, 2024
  • Command Line

To find things quickly - use the silver searcher.

brew install the_silver_searcher

To find things:

ag 'the thing to find'

To see the count:

ag 'the thing to find' --count

To see the list of files only and search on a literal string:

ag 'the thing to find' -Q -l

To then replace the occurrences of the found use:

ag 'thething' -Q -l|xargs sed -i 's/thething/bar/g'

About

Skip - Creator of QuietShark.com

Skip - Creator of QuietShark.com

Welcome! QuietShark.com …

Know More

Category

  • #ai (1)
  • #aws (1)
  • #back end development (1)
  • #batch processing (9)
  • #books (1)
  • #cloud storage (1)
  • #command line (2)
  • #database (2)
  • #databases (1)
  • #devops (2)
  • #distributed systems (1)
  • #finance (1)
  • #fitness (1)
  • #front end development (4)
  • #git (4)
  • #hatch (2)
  • #investing (1)
  • #java (5)
  • #javascript (1)
  • #jpa (1)
  • #kubernetes (6)
  • #machine learning (1)
  • #math (1)
  • #optimization (1)
  • #persistence (1)
  • #postgres (1)
  • #programming (5)
  • #python (4)
  • #security (2)
  • #software architecture (2)
  • #spring (2)
  • #taxes (1)
  • #tooling (1)

Recommended

  • Your Best Investment May Be a Tax Strategy

    Your Best Investment May Be a Tax Strategy

  • Designing Distributed Systems: The First Four Chapters

    Designing Distributed Systems: The First Four Chapters

  • The One-Kettlebell, One-Hour-a-Week Workout

    The One-Kettlebell, One-Hour-a-Week Workout

  • PostgreSQL vs ClickHouse: Filtering and Sorting

    PostgreSQL vs ClickHouse: Filtering and Sorting

  • Optuna - Hyperparameter Optimization

    Optuna - Hyperparameter Optimization

QuietShark.com
  • Home
  • About
  • Articles
  • Tech Bites
  • Fitness
  • Finance
Copyright by your company | Theme by GetHugoThemes