10 Practical ZSH Aliases to Speed Up Your Dev Workflow

If you’re spending hours each day typing the same long commands, you’re wasting precious development time. While Zsh offers powerful features out of the box, the real productivity gains come from creating smart aliases that eliminate repetitive typing and streamline your daily workflow.
This article presents 10 carefully selected zsh aliases for developers that will save you hundreds of keystrokes every day. Each alias addresses a real pain point in modern development workflows, from Git operations to package management and project navigation.
Key Takeaways
- Start with 2-3 aliases that address your most frequent commands
- Use intuitive abbreviations that match your mental model
- Test aliases thoroughly across different project types and environments
- Share aliases with your team for consistent workflows
- Regularly review and remove unused aliases
Essential Git Aliases for Faster Version Control
1. Quick Git Status with Enhanced Output
alias gs='git status --short --branch'
The standard git status
command produces verbose output that clutters your terminal. This alias gives you a clean, concise view of your repository state with branch information. The --short
flag shows a compact format, while --branch
displays the current branch and tracking information.
Why it saves time: Instead of scrolling through lengthy status output, you get everything you need in 2-3 lines.
2. Smart Git Add and Commit
alias gac='git add -A && git commit -m'
This alias combines staging all changes and committing in one command. Use it like gac "Fix navigation bug"
to stage everything and commit with a message in a single step.
Why it saves time: Eliminates the two-step process of adding files and committing, perfect for quick fixes and iterative development.
3. Git Log with Visual Branch Graph
alias glog='git log --oneline --decorate --graph --all'
Standard git log is hard to read. This alias creates a visual representation of your commit history with branch relationships, making it easy to understand project evolution at a glance.
Why it saves time: Quickly visualize branch merges and commit relationships without external tools.
Development Server and Project Management
4. Instant Local Server
alias serve='python3 -m http.server 8000'
Need to quickly test static files or serve a directory? This alias starts a local HTTP server on port 8000 in your current directory without installing additional packages.
Why it saves time: No need to set up complex development servers for simple static file testing.
5. Smart Project Directory Creation
mkcd() {
mkdir -p "$1" && cd "$1"
}
This function creates a directory and immediately navigates into it. Use it like mkcd new-project
to create and enter a directory in one command.
Why it saves time: Combines two common operations that always happen together.
Package Management Shortcuts
6. NPM Install and Start
alias nstart='npm install && npm start'
When cloning repositories, you typically need to install dependencies and start the development server. This alias handles both steps automatically.
Why it saves time: Perfect for quickly spinning up new projects or switching between repositories.
7. Clean NPM Install
alias nclean='rm -rf node_modules package-lock.json && npm install'
When dependency issues arise, the nuclear option is often the fastest solution. This alias removes node_modules
and package-lock.json
, then reinstalls everything fresh.
Why it saves time: Fixes most dependency conflicts without manual cleanup steps.
Navigation and File Management
8. Quick Directory Navigation
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
These aliases provide quick shortcuts for moving up directory levels. Much faster than typing full cd
commands repeatedly.
Why it saves time: Reduces navigation commands from 7+ characters to 2-4 characters.
9. Enhanced File Listing
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
These aliases provide different views of directory contents: ll
for detailed listing with permissions, la
for all files including hidden ones, and l
for a compact columnar format.
Why it saves time: Quick access to different file listing formats without remembering flags.
Docker Development Workflow
10. Docker Compose Shortcuts
alias dcup='docker-compose up -d'
alias dcdown='docker-compose down'
alias dcbuild='docker-compose build'
alias dclogs='docker-compose logs -f'
Docker Compose commands are lengthy and used frequently in containerized development. These aliases cover the most common operations: starting services, stopping them, building images, and viewing logs.
Why it saves time: Reduces 15+ character commands to 5-7 characters, essential for container-heavy workflows.
Setting Up Your Zsh Aliases for Developers
Add these aliases to your ~/.zshrc
file, then reload your configuration:
source ~/.zshrc
For the mkcd
function, use this syntax in your .zshrc
:
mkcd() {
mkdir -p "$1" && cd "$1"
}
Conclusion
These zsh aliases for developers will significantly reduce your daily typing load and speed up common development tasks. The key is choosing aliases that match your specific workflow and gradually building muscle memory around them. Start with the aliases that address your most frequent pain points, then expand your collection as you identify new opportunities for automation.
FAQs
Copy your ~/.zshrc file to the new machine or maintain your aliases in a dotfiles repository that you can clone and symlink. Many developers use Git repositories to sync their shell configurations across multiple machines.
Yes, these aliases work perfectly with Oh My Zsh. Add them to your ~/.zshrc file just like you would with a standard Zsh installation. Oh My Zsh provides additional functionality but doesn't interfere with custom aliases.
Use the which command to check if an alias name conflicts with existing commands. For example, which ll will show if ll is already defined. If there's a conflict, choose a different alias name or use the full command path when needed.
Use the unalias command followed by the alias name, like unalias gs. This removes the alias for the current session only. To permanently disable it, comment out or remove the line from your ~/.zshrc file.
Focus on commands you type multiple times per day that are either long or hard to remember. Avoid creating aliases for simple, short commands as this can make your workflow less portable and harder for others to follow.