Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com Jun 18 '10 at 1:11

This question came from our site for professional and enthusiast programmers.

2 Answers 2

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`
}
share|improve this answer
    
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. –  suzukimilanpaak Jun 25 '10 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 –  suzukimilanpaak Jun 25 '10 at 14:22

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.