【嵌入式开发 Linux 常用命令系列 3 目录任意跳转命令 -- autojump】


请阅读【嵌入式开发学习必备专栏 】


文章目录

上篇文章:嵌入式开发 Linux 常用命令系列 2-- tmux
下篇文章:嵌入式开发 Linux 常用命令系列 4 – git 常用配置及常用命令

autojump 使用方法

autojump 是一个类似于 cd 命令的工具,它可以快速定位到目录或者文件,其实现的基本原理是由于autojump维护了一个目录访问历史表,如果出现目录名同名的情况,autojump 会根据不同目录的访问频率来设置对应的权重,权重高的优先进入。

工具下载链如下:
git clone git@github.com:wting/autojump.git
在这里插入图片描述

用户可以按照下面命令进行安装:

  1. 工具下载
zhugong@ubuntu:~$ cd ~
zhugong@ubuntu:~$ git clone git@github.com:wting/autojump.git
Cloning into 'autojump'...
remote: Enumerating objects: 3289, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 3289 (delta 0), reused 4 (delta 0), pack-reused 3280
Receiving objects: 100% (3289/3289), 809.05 KiB | 873.00 KiB/s, done.
Resolving deltas: 100% (1985/1985), done.
  1. 安装
cd autojump
./install.py or ./uninstall.py
  1. 安装完成及 ~/.bashrc 配置:
Installing autojump to /home/zhugong/.autojump ...
creating directory: /home/zhugong/.autojump/bin
creating directory: /home/zhugong/.autojump/share/man/man1
creating directory: /home/zhugong/.autojump/etc/profile.d
creating directory: /home/zhugong/.autojump/share/autojump
copying file: ./bin/autojump -> /home/zhugong/.autojump/bin
copying file: ./bin/autojump_argparse.py -> /home/zhugong/.autojump/bin
copying file: ./bin/autojump_data.py -> /home/zhugong/.autojump/bin
copying file: ./bin/autojump_match.py -> /home/zhugong/.autojump/bin
copying file: ./bin/autojump_utils.py -> /home/zhugong/.autojump/bin
copying file: ./bin/icon.png -> /home/zhugong/.autojump/share/autojump
copying file: ./docs/autojump.1 -> /home/zhugong/.autojump/share/man/man1
creating directory: /home/zhugong/.autojump/etc/profile.d
creating directory: /home/zhugong/.autojump/share/autojump
creating directory: /home/zhugong/.autojump/functions
copying file: ./bin/autojump.sh -> /home/zhugong/.autojump/etc/profile.d
copying file: ./bin/autojump.bash -> /home/zhugong/.autojump/share/autojump
copying file: ./bin/autojump.fish -> /home/zhugong/.autojump/share/autojump
copying file: ./bin/autojump.zsh -> /home/zhugong/.autojump/share/autojump
copying file: ./bin/_j -> /home/zhugong/.autojump/functions

Please manually add the following line(s) to ~/.bashrc:

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

Please restart terminal(s) before running autojump.

使用方法
autojump 的使用很简单,通过 -h 可以看到其主要的功能,autojump 的别名是 j, 比如要进入 linux 目录,只需要 在 j 后面 输入前两个字符 li 然后再按 tab 键, 就会跳出相关的历史纪录(__xxx 的形式展现),

zhugong@ubuntu:~/linux/linux$ j li__
/home/zhugong/linux
zhugong@ubuntu:~/linux$ ls
linux
zhugong@ubuntu:~/linux$ 
zhugong@ubuntu:~/linux$ 
zhugong@ubuntu:~/linux$ pwd
/home/zhugong/linux
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

主公CodingCos

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值