Supercharge your cd command with something like this:
function goto() { eval "$(~/bin/goto "$@")"; clear; ls; }
Then in ~/bin/goto you can put extended logic that will find where you want to go, for example
#!/bin/bash
GO() {
if test -d "$1" ; then
echo "builtin cd $1";
exit 0;
fi
}
case "$1" in
somehost) echo "ssh adf@somehost.somedomain.com" ; exit 0 ;;
work) echo "builtin cd /path/to/work/Projects"; exit 0 ;;
esac
GO "$HOME/$1"
GO "/d/dev/$1"
GO "/c/GAMES/$1"
exit 0
Finally, if you prefer to use cd rather than goto add an extra alias:
alias cd=goto
Example Usage:
cd somehost
cd myproject
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Supercharge your cd command with something like this:
Then in
~/bin/goto
you can put extended logic that will find where you want to go, for exampleFinally, if you prefer to use
cd
rather thangoto
add an extra alias:Example Usage: