Quickly navigate your filesystem from the command line
jeroenjanssens.com
Quickly navigate your filesystem from the command line
1–10 of 148 posts
Re: Quickly navigate your filesystem from the command line
#2Re: Quickly navigate your filesystem from the command line
#3Re: Quickly navigate your filesystem from the command line
#4Here's what I have done :
function ccb ()
{
FOO=`pwd`;
echo >> ~/shortcuts.sh;
echo alias $1=\'pushd $FOO\' >> ~/shortcuts.sh;
echo >> ~/shortcuts.sh;
. ~/shortcuts.sh
}
simple but quite effective.Now, all I have to do is type ccb and give a shortcut name to register a shortcut. Then whenever i want to jump to that directory, I just have to type the shortcut.
Eg :
foo@bar deeply-nested-dir# ccb deepd
foo@bar deeply-nested-dir# cd
foo@bar ~# deepd
foo@bar deeply-nested-dir#
My method lacks the a) delete shortcut and b) list shortcut features that the above solution gives, though.Re: Quickly navigate your filesystem from the command line
#5Re: Quickly navigate your filesystem from the command line
#6cool! I'm a command-line junkie as well. So, I've been doing something similar for quite a while. Here's what I have done : function ccb () { FOO=`pwd`; echo >> ~/shortcuts.sh; echo alias $1=\'pushd $FOO\' >> ~/shortcuts.sh; echo >> ~/shortcuts.sh; . ~/shortcuts.sh } simple but quite effective. Now, all I have to do is type ccb and give a shortcut name to register a shortcut. Then whenever i want to jump to that dire…
function ccb ()
{
FOO=`pwd`;
echo >> ~/shortcuts.sh;
echo alias $1=\'pushd $FOO\' >> ~/shortcuts.sh;
echo >> ~/shortcuts.sh;
. ~/shortcuts.sh
}Re: Quickly navigate your filesystem from the command line
#7Re: Quickly navigate your filesystem from the command line
#8cool! I'm a command-line junkie as well. So, I've been doing something similar for quite a while. Here's what I have done : function ccb () { FOO=`pwd`; echo >> ~/shortcuts.sh; echo alias $1=\'pushd $FOO\' >> ~/shortcuts.sh; echo >> ~/shortcuts.sh; . ~/shortcuts.sh } simple but quite effective. Now, all I have to do is type ccb and give a shortcut name to register a shortcut. Then whenever i want to jump to that dire…
HN uses markdown, stick 4 spaces before each line in your code blocks to get them to indent properly, and drop the function ccb () { FOO=`pwd`; echo >> ~/shortcuts.sh; echo alias $1=\'pushd $FOO\' >> ~/shortcuts.sh; echo >> ~/shortcuts.sh; . ~/shortcuts.sh }
Re: Quickly navigate your filesystem from the command line
#9Re: Quickly navigate your filesystem from the command line
#10my method involves storing the bookmarks in a file but loading them into zshs directory hash. This means the directories are tab completable and if you have AUTO_CD set then you can change directory with simply: ~dir_name, otherwise: cd ~dir_name.