A lightweight function to quickly navigate up the UNIX directory tree.
..() is a small function written for interactive bash session that lets you move up one or more directory levels with minimal effort.
No more cd ../../../. Not even .. 3 (although it provides this functionality).
When you're deep inside a nested directory ..() saves time and keystrokes by leveraging tab completion to help you select target directories.
Run this one-liner to test the function in your current shell session:
source <(curl -fsSL https://raw.githubusercontent.com/RVC2020/up-the-tree/main/up.bash)The function will be available immediately and will disappear when you close the terminal.
Clone the repository and add it to your shell configuration:
git clone https://github.com/RVC2020/up-the-tree.git
echo "source ${PWD@Q}/up-the-tree/up.bash" >> ~/.bashrc
source ~/.bashrcIf you use macOS, you may prefer
~/.bash_profileinstead of~/.bashrc.
Tab completion is available — start typing a directory name after .. and press [TAB][TAB] to complete.
.. -h #or --help provides information with examples on how it works.
To uninstall just remove the repo from your file system and delete the line inserted in your bash rc file.
If you put in your ~/.bashrc bind 'set show-all-if-ambiguous on' or in your ~/.inputrc set show-all-if-ambiguous on you will only have to hit [TAB] once.
MIT License
