Skip to content

Instantly share code, notes, and snippets.

@gkop
Created December 2, 2011 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gkop/1424593 to your computer and use it in GitHub Desktop.
Save gkop/1424593 to your computer and use it in GitHub Desktop.
convoluted alternative to which which
# bash lies
$ time --version
--version: command not found
real 0m0.127s
user 0m0.120s
sys 0m0.020s
$ /usr/bin/time --version
GNU time 1.7
$ which time
/usr/bin/time
$ /usr/bin/which time
/usr/bin/time
# which which?
$ strace -f -o bash.trace -e trace=process bash
$
$ which time
/usr/bin/time
$ exit
exit
$ cat bash.trace | grep which
14775 execve("/usr/bin/which", ["which", "time"], [/* 60 vars */]) = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment