执行 "which" 绕过别名和函数

Perform "which" bypassing aliases and functions

$ command gs
GPL Ghostscript 8.70 (2009-07-31)
Copyright (C) 2009 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
GPL Ghostscript 8.70: Cannot open X display `(null)'.
**** Unable to open the initial device, quitting.

$ which gs
alias gs='git status'
        /opt/rh/rh-git29/root/usr/bin/git

如何为 ghostscript which 找到它的路径,有点像 which $(command gs)?

一种方法肯定是先取消别名 gs

$ unalias gs
$ which gs
/usr/bin/gs

有更好的方法吗?

type which 的输出:

$ type which
which is aliased to `alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'

我在公司机器上工作。 @Cyrus 的评论显示 whichalias 的别名。这样做应该有效果:

$ /usr/bin/which gs
/usr/bin/gs