type builtin

A bash builtin that tells you what a name would run: an alias, a keyword, a function, a builtin or a file on disk.

In more detail

Running type -a bash lists every bash along your PATH in search order, which is how you spot that the old /bin/bash still wins over a newer Homebrew one. Because type knows about aliases and functions, it answers more honestly than which, a separate program that only searches PATH.

Examples

type -a bash
type cd

Related terms

Taught in

References