autojump是什么

2024-04-20 14:38
文章标签 autojump

本文主要是介绍autojump是什么,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

autojump是什么

autojump是一个Linux命令行工具,它允许你通过模糊匹配就可以一步跳转到想要的目录,不管你在哪里(目录)!是不是很神奇?是不是比cd``````tab这些命令好用百倍?OK,下面介绍一下autojump的安装、配置及使用

通过yum安装基本安装不上,应该是yum源里没有,去网上看了下也没有找到autojump的yum源,这里通过git安装

第一步:下载autojump

git clone git://github.com/joelthelion/autojump.git

第二步:安装
2.1先跳转到autojump的根目录下 cd autojump/
2.2安装: ./install.py 或者 python install.py

还是把安装日志附上吧

[root@data3 autojump]# ./install.py
Installing autojump to /root/.autojump ...
creating directory: /root/.autojump/bin
creating directory: /root/.autojump/share/man/man1
creating directory: /root/.autojump/etc/profile.d
creating directory: /root/.autojump/share/autojump
copying file: ./bin/autojump -> /root/.autojump/bin
copying file: ./bin/autojump_argparse.py -> /root/.autojump/bin
copying file: ./bin/autojump_data.py -> /root/.autojump/bin
copying file: ./bin/autojump_match.py -> /root/.autojump/bin
copying file: ./bin/autojump_utils.py -> /root/.autojump/bin
copying file: ./bin/icon.png -> /root/.autojump/share/autojump
copying file: ./docs/autojump.1 -> /root/.autojump/share/man/man1
creating directory: /root/.autojump/etc/profile.d
creating directory: /root/.autojump/share/autojump
creating directory: /root/.autojump/functions
copying file: ./bin/autojump.sh -> /root/.autojump/etc/profile.d
copying file: ./bin/autojump.bash -> /root/.autojump/share/autojump
copying file: ./bin/autojump.fish -> /root/.autojump/share/autojump
copying file: ./bin/autojump.zsh -> /root/.autojump/share/autojump
copying file: ./bin/_j -> /root/.autojump/functionsPlease manually add the following line(s) to ~/.bashrc:[[ -s /root/.autojump/etc/profile.d/autojump.sh ]] && source  /root/.autojump/etc/profile.d/autojump.sh

第三步:配置
根据安装日志的提示,在.bashrc文件里添加下面的配置

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

第四步:使配置生效
source 一下就行了

source .bashrc

工作原理:
autojump会在你每次启动命令时记录你当前的位置,并把它添加到自身的数据库。
这样哪个目录使用的次数越多,表示这个目录越重要,权重越大,进行模糊跳转的时候输入得越简单。
使用方式

基本使用

autojump pattern

**autojump 也可以缩写为j **
pattern就是要跳转的目录的模糊匹配

不太明白?好,来个Demo
比如说你经常使用的一个目录为:/home/java/apache-tomcat-8.5.16-case/webapps/case/WEB-INF/classes/config
使用命令

j co

就可以直接跳转到该目录下
j是autojump的简写
co是config目录的简写
当然如果这个目录你使用得特别特别多的话使用j c也是可以的
如果使用得没有那么多的话j co可能匹配到其他的目录上,这个时候你可能就需要输入j config了

另外你刚刚安装好的时候是不能直接使用的,autojump不知道你经常使用哪个目录,怎么给你跳转?用一会儿就行了

你还可以查看一下当前多个目录的权重

j --stat

这篇关于autojump是什么的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/920531

相关文章

zshrc的修改主题 和autojump的安装

ZSHRC: 1.如果没有安装过git 的需要先安装git: sudo apt-get install git 2.安装zsh sudo apt-get install zsh 3.安装完后输入下面的命令 wget --no-check-certificate http://install.ohmyz.sh -O - | sh 这个时候出现PAM 输入 c