|  |      1yangg      2014-11-07 13:58:52 +08:00 # enable sudo with aliases # If the last character of the alias value is a space or tab character, # then the next command word following the alias is also checked for alias expansion. # http://www.gnu.org/software/bash/manual/bashref.html#Aliases alias sudo='sudo ' | 
|  |      2calebx OP @yangg 不是很明白 这个命令中的sudo,可以不用 直接```su - -c 'll' other_user``` 或者```su -c 'll' other_user``` 也是一个意思,但是都不成功 | 
|  |      3yangg      2014-11-07 14:17:44 +08:00 试试,给你要执行的用户的bashrc里加上alais ll='ls -l' | 
|  |      4calebx OP 在other_user的bashrc里面已经有这个alias了。。。 | 
|  |      5extreme      2014-11-10 13:25:39 +08:00 不太明白楼主的意思。 不知道这种方式会不会导入另一个用户自己的.bashrc: sudo -u 用户名 bash -c "命令" 或者试试这种方式: echo "source ~/.bashrc ; source ~/.profile ; 你要执行的命令" | sudo -u 用户名 bash - |