受到《autojump: 在命令行下快速更改目錄》的鼓動,決定試用下這個軟件。
但ubuntu下的源貌似有些問題,
sudo apt get install autojump
后,死活提示j命令無法找到。
無奈只能手動安裝。
官方的地址為
https://github.com/joelthelion/autojump
git clone https://github.com/joelthelion/autojump.git
進入clone的目錄,執行
./install.sh
其會在~/目錄下建立.autojump文件夾。
最后其會有提示
如果你是zsh,添加如下到 ~/.zshrc
[[ -s ~/.autojump/etc/profile.d/autojump.zsh ]] && . ~/.autojump/etc/profile.d/autojump.zsh
如果你是bash,則添加如下到 ~/.bashrc
[[ -s ~/.autojump/etc/profile.d/autojump.bash ]] && . ~/.autojump/etc/profile.d/autojump.bash
即可。
重新加載shell 配置文件
. ~/.zshrc 或者 ~/.bashrc
然后就可以輸入
j dst_dir 了
當然,由於autojump是基於數據庫記錄的,只有你敲擊有了記錄,才能正常使用。
要知道各個目錄的權重,可以輸入
j --stat