#
DIFF.BLOG
New
Following
Discover
Jobs
More
Top Writers
Suggest a blog
Upvotes plugin
Report bug
Contact
About
Privacy
Sign up
The home for great developer writing.
We surface the best developer writing from thousands of independent blogs, updated daily.
Join Diff.blog
TOPICS
Shell variable ~-
·
John Cook
·
March 1, 2026, 6:38 p.m.
Computing
Bash
command line
shell-scripting
Productivity Tips
Summary
The post discusses a lesser-known shortcut in bash, specifically the use of the ~- variable, which functions as a shortcut for the $OLDPWD variable, allowing users to easily return to their previous working directory.
Read full post on www.johndcook.com →
MORE POSTS LIKE THIS
Master Linux Bash History with historyctl, HISTFILE, and Shortcuts
Hayden James ·
Sep 3, 2026
Blog
Linux
Zsh: select files with arbitrary code in (e) or + glob qualifiers
Adamj ·
Aug 7, 2026
posts
zsh
🔗 Reply to: Shell tricks that actually make life easier (and save your sanity) | larvitz blog
Thiago Perrotta ·
Mar 29, 2026
Commentary
Dev
Working with file extensions in bash scripts
John Cook ·
Feb 28, 2026
Computing
LaTeX
lsgrep - rapid recursive file search
Brett Terpstra ·
Aug 16, 2025
Bash
regex
Uploading a large OpenTelemetry trace to a local OTLP/HTTP traces receiver
Jamie Tanna ·
Sep 30, 2026
Jaeger
renovate
Discover more posts →
AUTHOR
Advertise
Sponsor diff.blog
Put your product in front of developers who read and write about their craft. One exclusive sponsor at a time.
Become a sponsor →
BLOG POST FEATURED ON
Hacker News
3 points
Add this plugin to your blog
RECENT POSTS FROM THE AUTHOR
Choose how you want to continue.
Continue with GitHub
Continue with Google
By continuing, you agree to our
Privacy Policy
.