跳转到终端的文件夹很麻烦,需要输入很长的路径。alias别名不是很方便。它是通过将进入的目录记录到数据库中来实现的,所以必须是之前进入过的目录才能跳转。安装1.OSX推荐使用Homebrew安装autojump>brewinstallautojumpmacOS启动shell。自动读取的文件是/etc/profile~/.bash_profile~/.bash_login~/.profile所以只需要添加[[-s$(brew--prefix)/etc/profile.d/autojump.sh]]&&。$(brew--prefix)/etc/profile.d/autojump.sh但如果终端工具使用zsh,需要在~中添加[[-s`brew--prefix`/etc/autojump.sh]]&&/.zshrc。`brew--prefix`/etc/autojump.sh然后,运行source.2。Linux先下载autojump源码>gitclonegit://github.com/joelthelion/autojump.git然后安装或卸载>cdautojump>./install.pyor./uninstall.py因为linux下shell启动会自动读取~/.bashrc文件,因此将以下行添加到文件>[[-s~/.autojump/etc/profile.d/autojump.sh]]&&。~/.autojump/etc/profile.d/autojump.sh然后,运行source~/.bashrc。安装完成后,使用查看自动跳转版本。$autojump--versionautojumprelease-v21.1.22。使用只会记录在打开的目录下自动跳转,所以使用时间越长自动跳转越智能。可以使用autojump命令,也可以使用简写命令j.jump到指定目录>jdirectoryName如果不知道目录全名,直接输入一部分,按Tab键即可。打错也没关系,还能自动识别,很强大。>jrumenz/data/www/rumenzTab键效>pwd/home/vagrant>j--stat10.0:/etc/nginx/conf.d20.0:/home/vagrant/www/xxx/doc_api34.6:/home/vagrant/www/xxx40.0:/var/log/nginx总keyweight:104.存放dirs个数:4>jn__(Tab键自动带下划线)/var/log/nginx跳转到指定目录子目录(Mac下效果同j,Ubuntu下不好用)>jcdirectoryName使用系统工具(MacFinder、WindowsExplorer、GNOME等)打开目录,类似于MacOS终端下的open命令,但是open命令需要指定路径(在Mac中还是实用的,在Ubuntu中不好用)>jodirectoryName查看权重j--stat>j--stat10.0:/etc/nginx/conf.d10.0:/home/vagrant/www/rumenz/doc_api10.0:/var/log/nginx30.0:/home/vagrant/www/rumenz总key权重:59存储目录数:4权重越高,该目录的使用频率更高。感觉在Mac上显示效果更好,也可以自己调整权重值。>j--stat10.0:/Users/xxx/xxx/xxxx/xxxx/xxxx/vendor22.4:/Users/xxx/xxx/xxxx/xxxx/xxxx/log32:总权重2:条目数10.00:当前目录weightdata:/Users/xxx/Library/autojump/autojump.txt原文链接:https://rumenz.com/rumenbiji/...微信公众号:入门站