Ever tried to copy a file with spaces in its name or pass a tricky string to a script, only to be met with a cryptic error? Welcome to the world of shell escaping! In zsh, mastering escapes and quotes is the secret to smooth, frustration-free command-line adventures.
'
): Everything inside is literal. No variable expansion, no special treatment. echo 'This $WILL_NOT be expanded!'
"
): Most things are literal, but variables and command substitutions do expand. echo "Hello, $USER!"
\
): Escape a single character. echo Space\ Invaders
prints Space Invaders
mv "My File.txt" ~/Documents/
or mv My\ File.txt ~/Documents/
$
, !
, &
, |
, and *
often need escaping. echo \$HOME
prints $HOME
instead of your home path.echo "It's a beautiful day!"
Pro Tip: If you ever get stuck, try using print -r --
instead of echo
for more predictable output in zsh!
Happy escaping—and may your commands always do exactly what you intend!
Insights, tips, and updates for terminal typists and code enthusiasts.
Stop storing API keys and secrets in plain text! Learn how to use GPG and the 'pass' password manager to securely manage credentials in your shell, following best practices for Zsh and Bash. A must-read for anyone who wants to keep their secrets safe and out of your dotfiles.
Read MoreIn 2022, a critical vulnerability in AWS's Instance Metadata Service (IMDSv1) was exploited through Server-Side Request Forgery (SSRF) attacks. Learn how attackers leveraged terminal-based tools to hijack AWS infrastructure and what you can do to protect your systems with IMDSv2.
ReadDiscover the playful side of your terminal with ASCII art! From colorful text with lolcat to animated matrix effects with cmatrix, learn how to transform your command line into a canvas for creative expression. Perfect for adding personality to your terminal or impressing your colleagues with some terminal-based fun.
ReadDiscover Speedtest CLI by Ookla—a powerful command-line tool for measuring your internet connection's download, upload, latency, and packet loss right from your terminal. Perfect for developers, sysadmins, and anyone who wants to automate or script network performance checks without a browser.
ReadWelcome to Terminal Typer, your new favorite playground for mastering terminal commands and coding snippets! Whether you're a seasoned developer looking to sharpen your skills or a newcomer eager to dive into the world of command-line interfaces, we've got something special for you.
ReadThink you're a Tetris master? Meet Bastet, the terminal game that turns the classic puzzle on its head by giving you the worst possible pieces! Bash your way to a high score in this open source, devilishly difficult twist on a retro favorite.
ReadMeet iTerm2: the Swiss Army knife of terminal emulators for macOS. From split panes to instant replay, discover why developers and power users everywhere swear by this feature-packed, endlessly customizable terminal.
ReadStruggling with spaces, quotes, or special characters in your zsh commands? Master the art of shell escaping with these practical tips and tricks for a frustration-free terminal experience!
ReadStay updated with the latest news and updates from Terminal Typer.
This is the official blog for Terminal Typer. Here you'll find tips, tutorials, updates, and stories from the world of code and terminal typing. Stay tuned for more!