Mac Mac 下如何设定一个目录的常量

shangrenzhidao · 2014年10月20日 · 最后由 huhongda 回复于 2014年10月24日 · 2308 次阅读

如题,比如 我想 设定一个路径 /workplace/rails/agile_web_dev_rails/dept 为一个常量,这样每次进入终端就不用敲很长的路径名了

在.bash_profile 里 export xx='/workplace/rails/agile_web_dev_rails/dept' 在终端 cd $xx

z - jump around DESCRIPTION Tracks your most used directories, based on 'frecency'.

After a short learning phase, z will take you to the most 'frecent' directory that matches ALL of the regexes given on the command line.

用 autojump

同上~ 用 autojump, 直接j your_favorite_dir 就可以到你想要的目录

#3 楼 @googya #4 楼 @huhongda j 命令怎么 command not found,是不是需要配置别名?

#4 楼 @huhongda #3 楼 @googya 我输入 j app(app 就是当前目录下) autojump: directory 'app' not found 是个什么原因?

alias ww='cd /workplace/rails/agile_web_dev_rails/dept'

#7 楼 @42thcoder 哈哈哈~你这个真好~

@shangrenzhidao brew install autojump

vim ~/.bashrc or vim ~/.zshrc [[ -sbrew --prefix/etc/autojump.sh ]] && .brew --prefix/etc/autojump.sh

使用: j your_directory

需要 登录 后方可回复, 如果你还没有账号请 注册新账号