Tired of typing ../../..
to move up directories? Say hello to updir
!
This handy shell function lets you jump up directories with ease.
Why type ../../..
when you can do:
updir <steps>
Example
updir 1
The above command moves up one directory level from the current directory. Easy peasy!
- Download the updir.sh script and save it. For example, save it to /usr/local/bin/updir.sh.
curl -o /usr/local/bin/updir.sh https://raw.githubusercontent.com/poysa213/updir/master/updir.sh
- Make the Script Executable:
chmod +x /usr/local/bin/updir.sh
- Source the Script in Your Shell Configuration
For bash:
echo "source /usr/local/bin/updir.sh" >> ~/.bashrc
For zsh:
echo "source /usr/local/bin/updir.sh" >> ~/.zshrc
- Reload Your Shell Configuration
source ~/.bashrc
or
source ~/.zshrc