Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想为以下内容创建一个别名。你能告诉我如何设置吗?
mate \`find . -name <filename>\`
改用函数:mymate() { mate $(find . -name "$1"); }
mymate() { mate $(find . -name "$1"); }
这是一个间接的解决方案。将命令放在一个文件中(没有 .sh 说 cmdfile),~/bin然后将别名指定为alias myalias=cmdfile
~/bin
alias myalias=cmdfile