Last active
July 28, 2017 06:18
-
-
Save sobi3ch/ad72dc0a0965874f5831 to your computer and use it in GitHub Desktop.
Add this to your linux aliases file definition and use dots instead 'cd' command itself.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script production following aliases. | |
# | |
# alias ..='cd ../' | |
# alias ...='cd ../../' | |
# alias ....='cd ../../../' | |
# alias .....='cd ../../../../' | |
# alias ......='cd ../../../../../' | |
# alias .......='cd ../../../../../../' | |
# alias ........='cd ../../../../../../../' | |
# alias .........='cd ../../../../../../../../' | |
# alias ..........='cd ../../../../../../../../../' | |
# alias ...........='cd ../../../../../../../../../../' | |
# | |
# If you what even deeper `cd` then just change 10 in `seq 10` for number you like. | |
# You can use it in your `.bashrc` or `.bash_aliases` or wherever you loading your aliases. | |
# quick go up (cd ..) | |
for i in `seq 10` | |
do | |
cdpath='' | |
dots='.' | |
for p in `seq 1 $i` | |
do | |
cdpath=$cdpath'../' | |
dots=$dots. | |
done | |
alias ${dots}="cd ${cdpath}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pretty cool! 👍