Often use the CD command to switch directories, although there are CDs-, historical directory pop push operation, after all, not intuitive. Directly on the code and deployment:
I=1here= ' pwd ' valid_here=${here//\//\\\/}already_exist= ' grep ^${here}$ $1 ' declare -a godirswhile true; do [[ $2 = "a" ]] && [[ x${ already_exist} = "x" ]] && sed -i "/^eof/i\\${here}" $1 [[ $2 = "A" ]] && break [[ $2 = "D " ]] && [[ x${ALREADY_EXIST} != " x " ]] && sed -i "/^${valid_here}$/d" $1 [[ $2 = "D" ]] && break while true ; do read line if [ $? -ne 0 ] ; then break fi [[ -d $line ]] | | continue echo -e "\033[' expr 35 + $i % 3 ' m" $i: $line godirs[$i]= $line let i= $i +1 done <<- eof/usr/localeof# ===== end of here-document =====echo -e "\033[0m" Echo -n ' where to go? ' read -n1 -t30 necho[[ x${godirs[${n}]} != "X" ]] && cd ${godirs[${n}]}breakdone
Put this file in a directory, such as/path/ff
Add a row in ~/.BASHRC
Alias Ff= '. /path/ff Path/ff '
You can use it to log out again.
Here's how to use it:
# ff# FF a# FF D
Switch directories, add directory indexes, delete directory indexes, respectively
This article is from the "architecture Enthusiast-Growth" blog, please be sure to keep this source http://39372240.blog.51cto.com/2734479/1431628