I'm learning bash and while trying the "type" command with an argument like "cd" (type cd)which should return
cd is a shell builtinbut it throws no such file or directory.
What could be the problem?
11 Answer
It depends in which shell you are. type itself is a shell buitin, hence if the shell has no builtin called type and there is no executable in $PATH it will throw the error no such file or directory.
For example in csh, there is no type command. Use the which command instead:
user@host:~$ csh
# which cd
cd: shell built-in command.
# exit
user@host:~$ 1