Bash别名:找不到命令 [英] Bash alias: command not found

查看:116
本文介绍了Bash别名:找不到命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置一个简单的别名,以将我移动到计算机上的Developer文件夹中。但是,设置完之后,我得到一个奇怪的错误:

I'm trying to setup a simple alias to move me into my Developer folder on my machine. However, after setting it up, I get a weird error:

-bash: dv: command not found

我在.bashrc中设置别名,如下所示:

I setup my alias in .bashrc like so:

alias dv='cd Developer/'

我只是用它键入 dv ,然后得到该错误。是否有人看到任何语法错误或我在此处缺少别名?

I use it by just typing dv, and then get that error. Does anyone see any syntax errors or something I'm missing here for aliases?

推荐答案

运行 bash ,然后尝试执行命令。

Run bash and then try the command.

或者,将其放在〜/ .bash_profile 中应该会自动加载。

Alternatively, put it in ~/.bash_profile which should be loaded automatically.

这篇关于Bash别名:找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆