我想为| grep
例如,例如能够写:
ps -axf G chrome
代替ps -axf | grep chrome
我在 oh-my-zsh 的别名文件中写了以下内容:
alias -g G= '| grep --color'
但是,这似乎不起作用。
知道为什么吗?
编辑
我写的时候出现以下错误ps -axf G chrome
error: must set personality to get -x option
Usage:
ps [options]
Try 'ps --help <simple|list|output|threads|misc|all>'
or 'ps --help <s|l|o|t|m|a>'
for additional help text.
For more details see ps(1).
似乎G
被解释为 ps 命令的一部分