0

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
  • what shell are you using? And you should post the exact command you ran.
    – Panther
    Feb 10, 2015 at 3:49

1 Answer 1

3

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
  • :-) Exactly what I was going to say, so an upvote! ;-)
    – Fabby
    Feb 10, 2015 at 9:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .