autojump: 在命令行下快速更改目录

在命令行下,笔者通常使用 cd 命令来更改目录。不过,大多数情况下,cd 命令都需要使用者提供必要的路径信息方能达成目的。autojump 克服了这一点,它能够自动维护包含用户所使用目录的数据库,然后你只需输入 j 外加要更改目录名称的一部分便可快速跳转到该目录。

autojump

如果你不明白笔者在说什么,那么不妨看一看上面的截图。通过 jumpstat 可以查看数据库的具体内容。例如,当笔者想要将目录更改到 /home/xiaodong/bin/wog 时,只要执行 j wo 就可以了。

autojump 的源代码发布在 GPLv3 许可下,可由 git 取得。一般的 Linux 发行版用户可通过执行其中的 install.sh 脚本来安装 autojump,Archlinux 用户也可从 yaourt 安装。

autojump

Read More:

  • No related posts

21 Comments

  1. 1 Yao Commented @ 2009-02-16 19:04Reply to this comment

    有空试试

  2. 2 hehehaha Commented @ 2009-02-16 19:04Reply to this comment

    好,比自己写的脚本好用啊,呵呵

  3. 3 chisiyuan Commented @ 2009-02-16 19:32Reply to this comment

    好像不错……试试。

  4. 4 pc Commented @ 2009-02-16 21:22Reply to this comment

    很不错,速度快吗?

  5. 5 abcde Commented @ 2009-02-16 21:42Reply to this comment

    截圖中的 mono 字體是哪個阿? 蠻好看的! 能告知嗎?

  6. 6 zer4tul Commented @ 2009-02-16 21:47Reply to this comment

    monaco吧……

  7. 7 arithboy Commented @ 2009-02-16 21:50Reply to this comment

    类似的还有工具 cdargs

  8. 8 xxxyyy888666 Commented @ 2009-02-16 21:51Reply to this comment

    就是截图中的字体很好看,能够告知是啥字体嘛,谢谢!

  9. 9 portrayer Commented @ 2009-02-16 22:18Reply to this comment

    字体是monaco

  10. 10 wind Commented @ 2009-02-16 22:55Reply to this comment

    晕,我刚开始还以为可以tab看结果呢 结果tab了半天不行,敲个enter就跳过去了。

  11. 11 walkerxk Commented @ 2009-02-17 8:48Reply to this comment

    感觉还是自己写的脚本好。

  12. 12 ee Commented @ 2009-02-17 8:57Reply to this comment

    不处理中文目录不是。继续自己的方法。

  13. 13 hmy Commented @ 2009-02-17 10:41Reply to this comment

    还有个类似的软件cdargs ,debian 自带

  14. 14 kidfruit Commented @ 2009-02-17 11:50Reply to this comment

    那目录多了怎么办?很多名字类似却在不同路径的目录多了那不是输了还要选择?

  15. 15 eagle Commented @ 2009-02-17 19:16Reply to this comment

    开机怎是错误

  16. 16 eagle Commented @ 2009-02-17 19:16Reply to this comment

    ee怎处理

  17. 17 SamLowry Commented @ 2009-02-17 21:25Reply to this comment

    登录错误……:(

    “您的会话只持续了不到10秒钟”

    .xsession-errors中描述如下:

    /etc/gdm/Xsession: Beginning session setup... /etc/profile.d/autojump.sh: 6: Syntax error: "}" unexpected (expecting "fi")

  18. 18 SamLowry Commented @ 2009-02-17 21:30Reply to this comment

    http://wiki.github.com/joelthelion/autojump/bugs

    找到一个解决方法,删掉它……

  19. 19 wind Commented @ 2009-02-17 23:21Reply to this comment

    那个函数的排版真的让人受不了 汗。。。 重排了一下就好了: 话说很诡异,那个最后的fi在我的vim中就是不会高亮显示。。。。。

    if [ $SHELL = "/bin/bash" ] && [ -n "$PS1" ] then export PROMPTCOMMAND='autojump -a "$(pwd -P)";'"$PROMPTCOMMAND" alias jumpstat="autojump --stat" function j {
    newpath=$(autojump $@) if [ -n "$newpath" ] then echo -e "\33[31m${newpath}\33[0m" echo cd "$newpath" fi
    }
    fi

  20. 20 gogonkt Commented @ 2009-02-23 13:38Reply to this comment

    怎么不用zsh....直接输入目录名就可以到了...

  21. 21 xiooli Commented @ 2009-02-23 23:51Reply to this comment

    cd还好啦,关键是中文路径麻烦。。。