bash alias in scripts Posted on 2019-10-20 Edited on 2020-12-07 In GNU/Linux bash在非交互式模式下是不扩展alias定义的,除非明确指定shell选项expand_aliases 因此要在脚本中使用alias定义,可以这样: 123shopt -s expand_aliasessource ~/.bash_aliasesalias ll='ls -lht' References:[1]How to make alias command work in bash script or bashrc file[2]Why doesn’t my Bash script recognize aliases?