linux - 使用 echo 命令将别名写入 bashrc 文件

标签 linux ubuntu alias

是否可以在终端中使用 echo 命令写入“.bashrc 的别名”文件以使别名永久化?

echo "别名 $NAME='$DEFINTION'">> ~/.bashrc

最佳答案

是的。只有在写入文件后启动的 bash 才会受到影响。要在当前 bash session 中定义别名,您需要在将别名添加到 bashrc 之前/之后在该 session 中运行 alias $NAME='$DEFINTION'

关于linux - 使用 echo 命令将别名写入 bashrc 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24970402/

相关文章:

ubuntu - 如何在 Ubuntu 中找到要降级的以前版本的软件包?

带有变量的 Git 别名无法按预期工作 : pathspec did not match any file(s) known to git

bash - 灵活的SCP别名

linux - 如何使用shell变量更改特定位置的字符

linux - scp 给出 "not a regular file"

php - Linux内存管理和大文件

ubuntu - Apache2限制下载速度

asp.net-mvc - linux 开发环境中.net MVC 的等价物是什么?

linux - 如何在没有 "Executing '/sbin/init' 且没有配置文件的情况下在 Ubuntu 14.04 上启动 lxc 容器可能会使主机崩溃”错误

android:允许创建一个 Activity 别名,其 targetActivity 在 aar/sdk 中