News for hackers. Stuff that matters.
Re:How does `cd` work? by jwilk on Thursday March 01, 2018 @02:33PM (#16495357)
Instead of which(1), you could use type, which is aware of builtins and aliases:

  $ type cd
  cd is a shell builtin
Re:How does `cd` work? by chaosfox on Thursday March 01, 2018 @03:18PM (#16495816)
if you use zsh on the other hand..

  % which which
  which: shell built-in command
Re:How does `cd` work? by aidenn0 on Thursday March 01, 2018 @02:58PM (#16495616)
command is also useful for this sort of thing (with the -v and -V options). It can also be used to ignore shell functions and aliases (without options) so:

  $ alias cd=ls
  $ cd foo
   <lists contents of foo>
  $ command cd foo
   <changes to directory foo>