Boost Your Linux Navigation: How to Jump Up Directories Instantly with up.sh
Learn how to install and use the up.sh shell script to quickly jump to parent directories in Linux, supporting bash, zsh, and fish, with options for specifying levels, target names, and tab‑completion for faster workflow.
When working in deep directory structures on Linux, manually typing cd ../../../ becomes tedious. The up.sh script provides a shortcut to jump to any parent directory without traversing each level.
Installation
Download the script and source it in your shell configuration:
$ curl --create-dirs -o ~/.config/up/up.sh https://raw.githubusercontent.com/shannonmoeller/up/master/up.sh
$ echo 'source ~/.config/up/up.sh' >> ~/.bashrc # for bash
$ source ~/.bashrcFor zsh replace ~/.bashrc with ~/.zshrc, and for fish use the provided up.fish script:
$ curl --create-dirs -o ~/.config/up/up.fish https://raw.githubusercontent.com/shannonmoeller/up/master/up.fish
$ echo 'source ~/.config/up/up.fish' >> ~/.config/fish/config.fish
$ source ~/.config/fish/config.fishBasic Usage
After installation, the up command jumps one level up by default:
$ up
$ pwd # now in the parent directorySpecify a number to move multiple levels, e.g., up 3 goes up three directories.
Targeted Jump
You can jump directly to a directory by name, without counting levels. The script matches the first occurrence of the given name in the path:
$ up projects # jumps to the nearest "projects" directoryIf the directory name is long, provide only a unique prefix:
$ up pr # matches "projects"Tab Completion
Pressing the Tab key after up lists possible parent directories, making selection even faster.
Conclusion
The up.sh script is a lightweight, cross‑shell utility that dramatically speeds up directory navigation in Linux, especially when dealing with long paths.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
ITPUB
Official ITPUB account sharing technical insights, community news, and exciting events.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
