LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-29-2008, 12:58 AM   #1
dina3e
Member
 
Registered: Mar 2008
Location: Bangalore
Distribution: Enterprise Red Hat linux
Posts: 98

Rep: Reputation: 16
Smile Distingush between internal and external command


i am very much confussing which is internal command and which is external command in linux system.
and where both the command resides in the system..
 
Old 03-29-2008, 01:25 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
"internal command" most commonly means "built-into bash".
External are ones that aren't part of bash. E.g. echo.

There's a bash-built-in echo which will be used by default.
If you want to use the stand-alone one, use with the fully
qualified path, e.g. /bin/echo


Cheers,
Tink
 
Old 03-31-2008, 08:41 PM   #3
dina3e
Member
 
Registered: Mar 2008
Location: Bangalore
Distribution: Enterprise Red Hat linux
Posts: 98

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by Tinkster View Post
"internal command" most commonly means "built-into bash".
External are ones that aren't part of bash. E.g. echo.

There's a bash-built-in echo which will be used by default.
If you want to use the stand-alone one, use with the fully
qualified path, e.g. /bin/echo


Cheers,
Tink
can u go beyond that what exactly the shell does when it face incase of internal and external command.
also i want to distigush the command at a glance can any way???
 
Old 03-31-2008, 08:51 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,406

Rep: Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396Reputation: 2396
The shell will default to using the built-in, if it has one and you have not explicitly specified the external one.
There's no way to tell 'at a glance' but you could read the man pages/web eg
http://www.tldp.org/LDP/abs/html/
and you could use the 'find' cmd to see if there's an external (aka standalone) version of any cmd.

A similar case (this is actually to do with the PATH env var) is in crontab entries.
The cron daemon has a minimal env, so if you call a cmd that is not built-in, it will most likely not work unless:

1. you specify the complete/absolute path eg

OR

2. you have exported the cmd path into the env for your script.

Last edited by chrism01; 03-31-2008 at 08:52 PM.
 
  


Reply

Tags
command


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
1 internal 1 external nic neocontrol Linux - Networking 4 02-14-2007 12:53 PM
internal box to external IP's? TigZy Linux - Networking 4 09-29-2004 06:39 PM
linking to an internal ip via external ip rodb Linux - Networking 1 02-03-2004 04:02 AM
Internal or External Modem noclue_menew Linux - Hardware 15 09-02-2003 05:20 PM
Modems: internal vs. external? Zen Arcade Linux - Newbie 7 06-21-2003 05:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration