ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

2021-09-09

2021-09-09 21:32:10  阅读:179  来源: 互联网

标签:bin copying autojump 09 share 2021 file root


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/functions

Please 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

标签:bin,copying,autojump,09,share,2021,file,root
来源: https://blog.csdn.net/To_North/article/details/120210300

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有