M BUZZ CRAZE NEWS
// general

type command in bash

By Gabriel Cooper

I'm learning bash and while trying the "type" command with an argument like "cd" (type cd)which should return

cd is a shell builtin

but it throws no such file or directory.

What could be the problem?

1

1 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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy