Monday, January 25, 2010

Difference between Unix Internal & External Commands

Internal Unix commands are built with the shell and hence it will run in the same shell.
eg: cd

External Unix commands will start a new shell and then it gets executed
eg: ls

Note: If you execute a shell script, it will create or fork a new shell and then execute the commands present in the script file. You can also execute the shell script in the same shell by using source or . infront of the shell script.

sujay@laptop:~/scripts$ cat
cd /
echo "Current dir is `pwd`"

Current dir is /
sujay@laptop:~/scripts$ pwd
sujay@laptop:~/scripts$ source
Current dir is /
sujay@laptop:/$ pwd


Cindy Dy said...

I love this site! I could find all the information I needed in a split second! It's rare that you stumble upon excellent sites like this! Now this website resides in my favorites! Great job guys.

forrest codilla said...

i'm impressed! an attention-grabbing blog post.

lee woo said...

Love it! Very interesting topics, I hope the incoming comments and suggestion are equally positive. Thank you for sharing this information that is actually helpful.

ERP said...

Oracle fusion HCM Training from ERPTREE gives you the best results to learn your dream course and maintains sufficient knowledge on oracle. It provides training by self-paced videos which are very helpful for the users to watch at any time according to their schedule. It is globally accepted and having many users undergoing training every day.