3

Is there any Linux command which remembers directories I changed, and shows its stack with interacting operation to choose a directory such as pushing an arrow key on keyboard? This must be different from the way pushd/popd/dirs do.

0

2 Answers 2

3

CDargs has the interface you described, although getting it to work automatically from a shell would require a little hacking. You need to call

cdargs -a `pwd`

every time you switch directories, and then just running cdargs will give you a list of the directories you've bookmarked that you can move through with the arrow keys. You'd probably want a temporary file for every terminal, both so multiple terminals don't run into each other and so the list is lost when the terminal is closed, so something like this in your shell's startup script would work:

export CDARGS_FILE=`mktemp /tmp/cdargs_XXXXXXXX`
function cd() {
    pushd $*
    cdargs -f $CDARGS_FILE -a `pwd`
}
2
  • I read through its introduction and am dabbling in the tool. It's fun to use it. Thanks a lot! I'm getting a essential problem that ENTER key doesn't let me change a directory but I will do the rest somewhere else. Commented Jun 25, 2010 at 13:36
  • I found that the author states Cdargs need cdargs-bash.sh to enalbe to enter a chosen directory in some environment. It kindly works. Thanks again Commented Jun 25, 2010 at 14:22
0

It would be easy to write a function that would use dialog or whiptail along with pushdir and popdir to do what you're asking.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .