2 ms·
zsh also supports the "alias anywhere" concept (their term is "global alias") by using the `-g` flag. alias -g ag='2>&1 | grep' some-command ag 'words' #
by sisk 2y ago
zsh also supports the "alias anywhere" concept (their term is "global alias") by using the `-g` flag.
alias -g ag='2>&1 | grep'
some-command ag 'words' # equivalent to: some-command 2>&1 | grep 'words'
- alkh 2y agoYeah, it's very convenient. Here are a few of mine(tested on OS X): alias -g L="| less" alias -g T="| tee" alias -g C="| pbcopy" alias -g @all="> /dev/null 2>&1" if command -v rg > /dev/null; then alias -g G="| rg" else alias -g G="| grep" fi