On Sat, Jan 20, 2018 at 5:19 AM, Jon Ingason <jon.ingason(a)telia.com> wrote:
Den 2018-01-20 kl. 10:34, skrev Tom H:
> On Sat, Jan 20, 2018 at 2:10 AM, Cameron Simpson <cs(a)cskk.id.au> wrote:
>> Also: "which rm" should show what executable is being used, and the
>> bash "which" IIRC also shows if an alias or function is involved
>> a zsh person myself).
> There's no "which" builtin in bash. IIRC, only tcsh and zsh have one.
> On Debuntu, "which" is an sh script (as it was a csh script in the
> past in Unix):
> th@sid ~ $ file /bin/which
> /bin/which: POSIX shell script, ASCII text executable
> th@sid ~ $
> It only shows a command with an absolute path and it only has a "-a"
> th@sid ~ $ which -a which
> th@sid ~ $
> In bash, "command -v", "command -V", "type -t" will
show what an executable is.
I get following results:
$ cat /etc/fedora-release
Fedora release 26 (Twenty Six)
$ uname -srvmo
Linux 4.14.13-200.fc26.x86_64 #1 SMP Thu Jan 11 05:43:34 UTC 2018 x86_64
$ $ which -a which
alias which='(alias; declare -f) | /usr/bin/which --tty-only
--read-alias --read-functions --show-tilde --show-dot'
$ file /usr/bin/which
/usr/bin/which: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for
I read out of this that there is only on which, /usr/bin/which, at least
in Fedora 26 :-)
On Fedora, of course! "which" on Fedora is a compiled executable whose
upstream is on gnu.org
I was responding to the suggestion of using "which" on Ubuntu.