[Seek Help] 请问如何设置命令别名,多个用户都能使用呢?
Tofloor
poster avatar
young
deepin
2022-11-08 21:21
Author

写在/etc/profle的命令别名,需要source后才能使用,重启后在桌面打开终端无法使用

Reply Favorite View the author
All Replies
foxbcd
deepin
2022-11-08 21:44
#1

/etc/bashrc.bashrc 试试

Reply View the author
神末shenmo
deepin
Spark-App
Q&A Team
2022-11-08 21:46
#2

ln一个到/usr/bin吧

Reply View the author
lanxing0821
deepin
2022-11-08 23:02
#3

/etc/profle 是登录 shell 的初始化文件,你通过终端仿真器打开的 shell 是交互式的非登录 shell ,自然不会去读取 /etc/profle 。

两种解决办法:

  1. 如 1 楼所说的,写到 /etc/bash.bashrc(他好像写错文件名了)
  2. 通过如下命令之一来运行一个交互式的登录 shell:
bash -l                       # 或 bash --login
sudo -u $USER -i
Reply View the author
young
deepin
2022-11-08 23:29
#4
lanxing0821

/etc/profle 是登录 shell 的初始化文件,你通过终端仿真器打开的 shell 是交互式的非登录 shell ,自然不会去读取 /etc/profle 。

两种解决办法:

  1. 如 1 楼所说的,写到 /etc/bash.bashrc(他好像写错文件名了)
  2. 通过如下命令之一来运行一个交互式的登录 shell:
bash -l                       # 或 bash --login
sudo -u $USER -i

写在/etc/bash.bashrc的命令别名,多用户都能使用,谢谢

Reply View the author