08/10 — The Developer's Terminal Toolkit
A terminal is already a powerful tool.
But here's something many developers discover over time:
The real power of the terminal comes from combining small, specialized tools.
You can search thousands of files in seconds, navigate large projects interactively, inspect JSON responses, browse Git history, and manage files without constantly switching between graphical applications.
In this article, we'll explore eight useful command-line tools that can improve your daily development workflow.
We'll cover:
-
ripgrep— Search through code quickly. -
fd— Find files with a simpler interface. -
fzf— Interactive fuzzy finding. -
bat— A better way to read files. -
eza— A modern alternative tols. -
jq— Process JSON from the command line. -
delta— Make Git diffs easier to read. -
tldr— Learn commands through practical examples.
We'll also look at installation, practical workflows, and alternatives for Windows, macOS, and Linux.
Let's get started.
1. ripgrep: Search Through Code at Incredible Speed
If you've ever worked on a large project, you probably know how frustrating it can be to search through hundreds or thousands of files.
You could use grep, but there's another excellent tool:
ripgrep (rg).
Ripgrep is a fast recursive search tool designed for searching files and directories.
It respects common ignore rules, including .gitignore, by default.
Installation
On Windows with winget:
winget install BurntSushi.ripgrep.MSVC On macOS:
brew install ripgrep On Ubuntu or Debian:
sudo apt install ripgrep Search for Text
Imagine you have a React project and want to find every occurrence of useState.
Run:
rg "useState" Ripgrep searches files recursively from the current directory.
Search in a Specific Directory
rg "useState" src/ Search Without Case Sensitivity
rg -i "error" Search for a Specific File Type
For example, search only JavaScript and TypeScript files:
rg "useState" -g "*.js" -g "*.ts" -g "*.tsx" Show Matching Line Numbers
rg -n "useState" Search for a Regular Expression
Find function declarations:
rg "function\s+\w+" Search Including Ignored Files
By default, ripgrep respects ignore rules.
If you want to include ignored files:
rg --no-ignore "secret" Be careful with this option because it can search large directories such as node_modules and build outputs.
Why Developers Love ripgrep
Imagine searching for a component named UserProfile in a large application.
Instead of opening files one by one:
rg "UserProfile" src/ You immediately get matching files, line numbers, and matching content.
It's one of the most useful tools you can add to your development environment.
2. fd: Find Files Without Complicated Commands
Traditional find is powerful, but its syntax can become difficult to remember.
For example:
find . -type f -name "*.tsx" The fd utility provides a simpler and more intuitive interface for finding files and directories.
Installation
Windows:
winget install sharkdp.fd macOS:
brew install fd Ubuntu or Debian:
sudo apt install fd-find On some Debian-based distributions, the executable is named fdfind instead of fd.
You can check its availability with:
fdfind --version Find Files by Name
fd "App" This searches for files and directories whose names match App.
Find TypeScript Files
fd -e ts Find React Components
fd -e tsx src/ Find Only Directories
fd -t d Find Only Files
fd -t f Search Hidden Files
fd --hidden "config" Exclude a Directory
fd -E node_modules "App" This excludes node_modules from the search.
fd vs. find
| Task | Traditional find | fd |
|---|---|---|
| Find TypeScript files | find . -name "*.ts" | fd -e ts |
| Find directories | find . -type d | fd -t d |
| Find files | find . -type f | fd -t f |
| Find hidden files | Requires additional options | fd --hidden |
Both tools are useful.
find is widely available on Unix-like systems, while fd offers a more convenient interface for everyday searches.
3. fzf: Interactive Fuzzy Finding
Now let's explore something especially useful.
Have you ever wanted to search through a long list of files, commands, or Git branches interactively?
Meet fzf.
fzf is a general-purpose command-line fuzzy finder.
Instead of typing an exact filename, you can enter part of a name and interactively narrow down the results.
Installation
Windows:
winget install junegunn.fzf macOS:
brew install fzf Ubuntu or Debian:
sudo apt install fzf Start fzf
Run:
fzf It opens an interactive search interface using files from the current directory.
Start typing a few characters to filter the results.
Use the arrow keys to navigate and press Enter to select an item.
Press Escape or Ctrl+C to cancel.
Combine fzf with fd
This is where things become interesting.
fd -t f | fzf Here:
-
fd -t ffinds files. - The pipe sends the results to
fzf. -
fzflets you search through them interactively.
Search Through Command History
In supported shell integrations, press:
Ctrl + R This opens an interactive history search.
It is much more convenient than repeatedly pressing the up arrow.
The exact experience depends on your shell and whether the fzf key bindings have been installed and configured.
Search Git Branches
You can also use fzf to interactively select Git branches:
git branch --all | fzf This is a simple example of how flexible the tool can be.
Why fzf Is Powerful
fzf doesn't need to understand files, Git, or command history.
It simply filters input.
That means it can work with almost any command that produces a list of text items.
4. bat: A Better Way to Read Files
You've already learned how to use cat to display file contents.
But there's a more visually convenient alternative:
bat.
bat is a command-line file viewer with syntax highlighting, line numbers, and Git integration.
Installation
Windows:
winget install sharkdp.bat macOS:
brew install bat Ubuntu or Debian:
sudo apt install bat On some Debian-based distributions, the executable is named batcat.
Check its availability:
batcat --version Read a File
bat README.md Instead of displaying plain text, bat highlights Markdown syntax and adds line numbers.
Display Multiple Files
bat package.json tsconfig.json Display a Specific Range of Lines
bat --line-range 10:30 App.tsx This displays lines 10 through 30.
Disable Paging
For simple output without an interactive pager:
bat --paging=never README.md Why Use bat?
It makes reading source code and configuration files more comfortable.
It's particularly useful when inspecting:
- React components
- TypeScript files
- JSON configuration
- Markdown documentation
- Shell scripts
5. eza: A Modern Alternative to ls
The traditional ls command is available on Linux and macOS.
On Windows, PowerShell provides Get-ChildItem, while CMD uses dir.
But if you want a more informative directory listing, try eza.
eza is a modern replacement for ls, with features such as colors, icons, Git status, and tree views.
Installation
Windows:
winget install eza-community.eza macOS:
brew install eza Ubuntu or Debian:
sudo apt install eza Package availability depends on the Linux distribution and its repositories.
List Files
eza Show Hidden Files
eza --all Show Detailed Information
eza --long Display a Tree Structure
eza --tree You can also limit the depth:
eza --tree --level=2 Display Git Status
Inside a Git repository:
eza --long --git This can display Git-related information alongside directory entries.
Why eza Is Useful
When working with large projects, a visual directory structure can make navigation much easier.
For example:
eza --tree --level=2 You can quickly understand the structure of a project without opening your editor.
6. jq: Process JSON from the Terminal
This is one of the most valuable tools for web developers.
Modern applications work with JSON constantly.
APIs return JSON responses, configuration files use JSON, and many development tools communicate through JSON.
But reading large JSON documents in a terminal can be difficult.
That's where jq comes in.
jq is a command-line JSON processor.
Installation
Windows:
winget install jqlang.jq macOS:
brew install jq Ubuntu or Debian:
sudo apt install jq Pretty-Print JSON
Imagine you have a file named user.json:
{ "id": 1, "name": "Hamed", "role": "developer", "skills": ["React", "TypeScript", "Node.js"] } Run:
jq . user.json This formats the JSON in a readable way.
Extract a Property
To retrieve the user's name:
jq '.name' user.json Output:
"Hamed" Extract Multiple Properties
jq '{name, role}' user.json Output:
{ "name": "Hamed", "role": "developer" } Extract an Array
jq '.skills' user.json Get an Array Element
jq '.skills[0]' user.json Output:
"React" Remember: array indexes start at zero.
Filter an Array of Objects
Imagine you have:
{ "users": [ { "id": 1, "name": "Alex", "active": true }, { "id": 2, "name": "Sam", "active": false }, { "id": 3, "name": "Jordan", "active": true } ] } Find only active users:
jq '.users[] | select(.active == true)' users.json This is especially useful when inspecting API responses.
Combine curl and jq
Now let's combine two tools.
curl -s https://api.github.com/users/octocat | jq '.login, .public_repos' Here's what happens:
-
curlsends an HTTP request. -
-senables silent mode. - The pipe passes the response to
jq. -
jqextracts the requested properties.
This is a practical example of how small command-line tools work together.
Important: When testing authenticated APIs, avoid placing access tokens directly in shell history or sharing commands that contain credentials.
7. delta: Make Git Diffs Easier to Read
If you work with Git, you've probably used:
git diff It shows changes between versions of files.
But large diffs can become difficult to read.
delta is a syntax-highlighting pager for Git and other diff output.
It improves the visual presentation of changes.
Installation
Windows:
winget install dandavison.delta macOS:
brew install git-delta Ubuntu or Debian:
sudo apt install git-delta Run delta Directly
You can pipe diff output into delta:
git diff | delta Configure delta as Git's Pager
Run:
git config --global core.pager delta Now Git can use delta when displaying supported paged output.
You can inspect the configuration:
git config --global core.pager What Does delta Improve?
Depending on your configuration and terminal, delta can provide:
- Syntax highlighting
- Improved line formatting
- Better visual separation of changes
- Easier navigation through large diffs
It's particularly useful when reviewing pull requests and debugging changes.
8. tldr: Learn Commands Through Practical Examples
Traditional manual pages are comprehensive, but sometimes you just want a quick example.
For instance, you remember the command tar, but you don't remember how to extract an archive.
Instead of reading a long manual, you can use tldr.
tldr provides community-maintained practical examples for command-line tools.
Installation
On macOS:
brew install tldr On Ubuntu or Debian:
sudo apt install tldr On Windows, you can install a supported client through package managers or use the official project instructions.
View Examples
tldr tar Or:
tldr grep You get concise examples showing common ways to use each command.
Why Use tldr?
It's useful when:
- You know the command but forgot its syntax.
- You want a practical example quickly.
- You're learning a new utility.
- You don't want to search through a lengthy manual.
Remember that tldr is community-maintained. For authoritative behavior and advanced options, consult the command's official documentation or manual.
9. Combining Tools into Real Developer Workflows
Now let's combine several tools to solve practical problems.
Workflow 1: Find a Component in a Large React Project
Imagine you're searching for a component named UserProfile.
fd -e tsx src | fzf This lets you interactively search TypeScript React files.
Once you know which file you need, search for the component:
rg -n "UserProfile" src/ Then inspect the file:
bat src/components/UserProfile.tsx You've combined three tools:
-
fdfinds files. -
fzffilters them interactively. -
rgsearches their contents. -
batdisplays the source code.
Workflow 2: Inspect an API Response
curl -s https://api.github.com/users/octocat | jq . Extract only a few properties:
curl -s https://api.github.com/users/octocat | jq '{login, name, public_repos}' This makes API debugging much faster.
Workflow 3: Understand a Project's Structure
eza --tree --level=3 This provides a quick overview of the project directory.
Workflow 4: Review Your Git Changes
git diff | delta Review your changes with improved formatting.
10. Finding Installed Tools on Different Operating Systems
After installing new utilities, you may want to check whether they are available in your terminal.
Here are useful commands.
Linux and macOS
command -v rg Or:
which rg PowerShell
Get-Command rg Windows CMD
where.exe rg If a command isn't found immediately after installation, you may need to restart your terminal or update your PATH environment variable.
11. A Note About Windows, macOS, and Linux
Not every tool is installed by default.
Also, installation commands and executable names can vary between distributions.
Here are a few things to remember:
- Windows users can install many of these tools through WinGet or other package managers.
- macOS users commonly use Homebrew.
- Linux users can use their distribution's package manager.
- Some Linux distributions package a utility under a different executable name.
- PowerShell supports many Unix-inspired tools, but its native commands and pipelines have different behavior.
You don't need to install every tool immediately.
Start with the ones that solve problems you encounter regularly.
12. Practice Exercises
Let's put these tools into practice.
Exercise 1: Search a React Project
- Install
ripgrep. - Search for
useEffectin your project. - Display matching line numbers.
- Search only
.tsxfiles.
Exercise 2: Explore Files
- Install
fd. - Find all TypeScript files.
- Find all directories.
- Exclude
node_modules.
Exercise 3: Use Interactive Search
- Install
fzf. - Combine it with
fd. - Search through your project's files.
- Explore the interactive command-history integration.
Exercise 4: Inspect JSON
- Create a JSON file containing a list of users.
- Format it using
jq. - Extract one property.
- Filter active users.
Exercise 5: Improve Git Diffs
- Install
delta. - Configure it as your Git pager.
- Make a change in a Git repository.
- Compare the output of
git diffbefore and after configuration.
Exercise 6: Build Your Own Workflow
Combine at least three tools to:
- Find a file.
- Search its contents.
- Display the relevant source code.
Quick Reference
| Tool | Main purpose | Example |
|---|---|---|
rg | Search file contents | rg "useState" |
fd | Find files | fd -e tsx |
fzf | Interactive filtering | `fd -t f \ |
{% raw %}bat | Read files with highlighting | bat App.tsx |
eza | Improved directory listing | eza --tree |
jq | Process JSON | jq '.name' user.json |
delta | Improved Git diffs | `git diff \ |
{% raw %}tldr | Practical command examples | tldr tar |
What's Next?
You've now discovered a collection of tools that can make everyday development tasks faster, more convenient, and more efficient.
But there's one more step.
What if you could combine these commands into reusable programs?
What if you could automate repetitive tasks, process files in batches, and build your own development utilities?
That's exactly what we'll explore in the next article:
Automate Your Workflow with Shell Scripting.
We'll learn how to write scripts, use variables, work with conditions and loops, process arguments, and automate real development tasks using Bash and PowerShell.
See you in Article 09!