thi*_*ary 5 command-line alias
因此,在我重新格式化(以摆脱 Windows)之前,我只是使用此命令通过将其放在~/.bashrc文件末尾来打开文档:
alias commandless= 'gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt'
Run Code Online (Sandbox Code Playgroud)
但是现在每次我启动终端时,它都会说:
bash: alias: gnome-open ./Documents/the-linux-command-line.pdf; gnome-open ./Documents/linux.odt: not found
Run Code Online (Sandbox Code Playgroud)
在输入任何内容之前,当我运行命令时什么也没有发生,甚至没有错误消息。
gle*_*man 25
=和开口之间有一个空间'。去掉它。
$ alias foo= 'bar baz'
bash: alias: bar baz: not found
Run Code Online (Sandbox Code Playgroud)
小智 -2
使用双引号代替单引号:
alias newcommand="full path of the binary to be executed"
Run Code Online (Sandbox Code Playgroud)
并不是:
alias newcommand='full path of the binary to be executed'
Run Code Online (Sandbox Code Playgroud)
左侧或右侧没有几乎相等的空间。