If you’re setting up your MacBook for development, having a well-configured terminal is essential. This guide will walk you through installing and configuring a powerful terminal setup using Homebrew, iTerm2, and Oh My Zsh, along with useful plugins.
1. Install Homebrew
Homebrew is a package manager that simplifies installing software on macOS.
Your terminal is now set up for an optimized development experience! With Homebrew, iTerm2, Oh My Zsh, and useful plugins, your workflow will be faster and more efficient.
For a senior backend engineer, Linux commands are more than tools for navigating directories.
They become a production debugging language.
When a Rails application is consuming too much memory, a log contains millions of lines, a deployment introduces unexpected configuration changes, or a background worker suddenly starts failing, knowing how to combine commands such as sed, awk, grep, find, xargs, sort, uniq, cut, tr, jq, and ps can save hours.
The real skill is not memorizing commands. It is understanding how to compose them into pipelines.
command1 | command2 | command3
This article focuses on commands and techniques that become particularly valuable at a senior engineering level.
1. grep – Search With Intent
Most developers know:
grep"ERROR" production.log
But grep becomes much more powerful with regular expressions and recursive searches.
Search recursively
grep-R"ActiveRecord::Deadlocked" log/
Useful when you don’t know which file contains the problem.
Ignore case
grep-Ri"timeout" .
Show line numbers
grep-n"connection refused" production.log
Search multiple patterns
grep-E"ERROR|FATAL|Exception" production.log
Show context around matches
grep-C5"NoMethodError" production.log
This is extremely useful for application logs because the surrounding lines often contain request IDs, parameters, stack traces, or timestamps.
When to use
Use grep when your primary operation is:
“Find lines matching this condition.”
2. sed – Stream Editing
sed is one of the most useful Linux commands for manipulating text without opening an editor.
The simplest example:
sed's/foo/bar/g' file.txt
Replace every foo with bar.
Delete lines
Delete empty lines:
sed'/^$/d' file.txt
Delete lines containing DEBUG:
sed'/DEBUG/d' production.log
Print specific lines
sed-n'100,150p' production.log
This displays lines 100 through 150.
Very useful when investigating a specific portion of a huge log file.
For Rails engineers especially, mastering these commands means you can diagnose the application, process, filesystem, network, and logs from the same shell instead of relying entirely on application-level tooling.