Skip to content

ymzuiku/bash_path_history

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 

Repository files navigation

解决的问题

我们平时使用终端时,经常需要在不同的路径来回跳转,如何更便捷的添加、使用、移除快捷路径,并且在多个shell直接共享快捷路径,就是这个小项目需要解决的问题。

Install

$ cd ~
$ git clone https://github.com/ymzuiku/bash_path_history.git

在 .bash_profile 中添加以下内容, 引入文件

if [ -f ~/bash_path_history/.bash_path_history ];then
  source ~/bash_path_history/.bash_path_history
fi

重新加载.bash_profile

$ source ~/.bash_profile

Use

把当前路径添加到快捷路径:

$ pa pathName

cd到之前保存的快捷路径:

$ pc 0  (用编号跳转)
$ pc pathName (用名字跳转)

查看保存的快捷路径:

$ pl

删除某一个快捷路径:

$ pd 0  (用编号删除)
$ pd pathName (用名字删除)

清空快捷路径:

$ p-clear

整个项目很简单,只有130行shell代码,有兴趣的可以查看源码:

.bash_path_history 文件

About

给bash添加路径快速切换方法, 跨shell同步路径

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages