How can I check in bash and csh if commands are builtin? Is there a method compatible with most shells?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can try using
whichin csh ortypein bash. If something is a built-in command, it will say so; otherwise, you get the location of the command in your PATH.In csh:
In bash:
typemight also show something like this:…which means that it’s not a built-in, but that bash has stored its location in a hashtable to speed up access to it; (a little bit) more in this post on Unix & Linux.