小编Gag*_*gan的帖子

bash 中的多词别名

我正在尝试在 .bashrc 中添加多单词别名。更具体地说,我想apt update成为sudo apt update -y。但我不知道如何指定多单词别名。我尝试过以下方法,但没有一个有效:

alias 'apt update'='sudo apt update -y'
alias "apt update"='sudo apt update -y'
alias apt\ update='sudo apt update -y'
Run Code Online (Sandbox Code Playgroud)

有人知道解决这个问题的方法吗?

谢谢。

bash alias

10
推荐指数
1
解决办法
7790
查看次数

标签 统计

alias ×1

bash ×1