Skip to content

利用Alias 简化命令 #4

Open

Description

@cssoul

例如我就经常使用goagent,每次都要执行”python /Users/xhat/Downloads/goagent/local/proxy.py”,这是一个很痛苦的过程,往往cd半天,有时候甚至忘了路径。效率极低。那么通过alias现在可以这样改进:

1、编辑~/.bash_profile

可能这个文件是不存在的,那么新建它。如果有的话,我们就打开修改添加。

2、vim ~/.bash_profile 添加

alias go="python /Users/xhat/Downloads/goagent/local/proxy.py" ,这里需要注意的是,等号前后不能出现空格。

3、bash下执行

source ~/.bash_profile
此条命令是使bash重新载入配置令刚才命令生效。

4、以后需要使用上述复杂命令,只需在bash中输入“go”即可。

5、要查看自定义的alias命令,直接在bash中输入alias即可查看

demo

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions