BTW - this is a bit off-topic, but I got tired of typing and cd'ing to long path names, so I put this at the end of my .bashrc file...
Code:
fcd() {
if F_PTH=`locate -e -i -l 1 -r $1` ; then
cd `echo $F_PTH | awk '{print substr($0,1,match($0,"'$1'")-2)}'`
else
echo 'Nothing found for [$1]!'
fi
}
fvi() {
if F_PTH=`locate -e -i -l 1 -r $1` ; then
vi $F_PTH
else
echo 'Nothing found for [$1]!'
fi
}
They are bash shell functions (side effects included ) that let you do:
Code:
/user/home/$ fvi xorg.conf
..or...
/usr/home/$ fcd xorg.conf
/etc/X11$
Bookmarks