External Commands in LInux

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anurag275125
    New Member
    • Aug 2009
    • 79

    External Commands in LInux

    Can anyone please tell me some external commands of Linux? Also explain type command in Linux?
    Thanks
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    You need to define "external commands"; Also define "type command". No one knows what you are talking about.

    Comment

    • shabinesh
      New Member
      • Jan 2007
      • 61

      #3
      To my understanding external commands are those which are not built-in to bash or think of these are hard-coded in to bash. Like, ifconfig, /bin/echo (mere echo is a built in command of bash). Assuming this is what you mean by external command, most of the commands we use are external commands. The internal command examples are 'if','while' etc..

      Am i right with my assumption? :D

      Comment

      • anurag275125
        New Member
        • Aug 2009
        • 79

        #4
        In my text book of Linux I have read that- There are two types of command in Linux namely Internal and external command. Internal commands are those commands that are automatically loaded into the system memory as soon as the system starts up. These commands will be available as long as the system is kept on like cp, mv, mkdir etc.

        External commands are those that are available on a floppy/hard drive and are loaded in the memory of the computer when specially asked for.

        my question was that can anyone tell me name of some external commands.

        My another question was related to type command. type command followed by the command tell you the type of the command. for example--
        $ type cat
        cat is hashed (/bin/cat)

        can anyone explain the output of this command as I found no manual entry for this command in ubuntu-9.0.4 system?

        thanks.

        Comment

        • RedSon
          Recognized Expert Expert
          • Jan 2007
          • 4980

          #5
          Your book is not very clear. There is only one type of command, it's a binary application. Those "commands" like "man", "cat", "type", "which", "more", "less" and others are just command line applications that people wrote. The reason you can use them easily is that the distributor of your Linux version (ubuntu) put those applications in a special directory that is "on the path".

          The "path" is a environment variable that tells the system what file/folder paths to search when trying to find the name of an application that you typed on the command line.

          When you type "cat" your shell knows that it should actually execute /bin/cat because /bin is on the path. When you type "type cat" the bash shell is telling you how each name (cat in this case) would be interpreted if used as a command name.

          If you want to use a command that is not on the path then you need to specify the full name of it. Example: /home/username/myapplication.b in or whatever it's called. This assumes that your permissions are set up properly.

          There is a difference between bash built-in commands and other commands but that is specific to bash. If you used zsh or some other shell you might have different built-in commands. This also changes given what distro you are running.

          Comment

          • AmberJain
            Recognized Expert Contributor
            • Jan 2008
            • 922

            #6
            1. Some people say: "In unix, Commands are programs and programs are commands". Classifying commands as internal/external doesnot appears much logical to me. This concept dates back to old DOS days which had internal and external commands. So, maybe someone tried putting this analogous to way commands are classified under DOS.

            2. man type: http://ss64.com/bash/type.html (?)

            Comment

            Working...