快速跳轉資料夾的工具

e.g.,
有個資料夾是 /a/b/c/d/e/f/g/h
原本要輸入

cd /a/b/c/d/e/f/g/h

可是現在有了 autojump,而且你也去過這個 h 資料夾,你就可以

j h

很方便吧!!!

安裝

cd /tmp
git clone https://github.com/joelthelion/autojump
cd autojump
chmod +x install.py
./install.py

然後把下面這行加入 shell 的設定檔 (e.g. ~/.bashrc , ~/.zshrc)

[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh

最後只要重開 shell 就完成了

使用

  • 最基本的功能當然就是跳轉囉
j word

如果有重複的名稱 (e.g. worda, wordb),就在打一次同樣的指令,就會跳到下一個

  • list 現在 autojump 可以跳到的資料夾
j -s
  • 刪除已經背改變路徑或刪除的紀錄
 j --purge

Reference

autojump readme

Share on: TwitterFacebookEmail

Comments

Do you like this article? What do your tink about it? Leave you comment below


Published

Read Time

1 min

Category

Tech

Tags

Keep In Touch