Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I want to know what exactly are Linux commands? & how to identify and locate them?

In other words what are different kind/type/category of commands? How to identify them and locate (source) it.

share|improve this question

marked as duplicate by Gilles command-line May 28 '14 at 23:05

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
You keep wanting this reopened yet are not offering up anything different than what's already been referenced in the duplicate. This is a duplicate of that question until you add more relevant details to the Q that make it different. Your A that you've accepted below is a complete facsimile of one of the A's even to the dup. You're getting hung up on the title of the other one. Read the actual body to the Q. They are dups! – slm Oct 5 '14 at 11:41
up vote 13 down vote accepted

Following is from from the book The Linux Command Line. The full PDF tutorial is also available here:

A command can be one of four different things:

  1. An executable program like all those files we saw in /usr/bin. Within this category, programs can be compiled binaries such as programs written in C and C++, or programs written in scripting languages such as the shell, perl, python, ruby, etc.

  2. A command built into the shell itself. bash supports a number of commands internally called shell builtins. The cd command, for example, is a shell builtin.

  3. A shell function. These are miniature shell scripts incorporated into the environ- ment. We will cover configuring the environment and writing shell functions in later chapters, but for now, just be aware that they exist.

  4. An alias. Commands that we can define ourselves, built from other commands.

To identify the type of command, you can use type:

NAME
    type - Display information about command type.

Example:

$ type ls
ls is aliased to `ls --color=auto'
$ type cd
cd is a shell builtin

To display the location of command, you can use which:

$ which info
/usr/bin/info
$ which init
/sbin/init

Hope this is helpful for new users to know basic about commands.

share|improve this answer
2  
This is pretty good. A suggestion - you might use command in place of both type and which - it's the portable way to do it. – mikeserv May 28 '14 at 12:46
4  
What's the source? This is obviously copied from a book/tutorial but I don't see any reference to it. – Creek May 28 '14 at 12:49
    
@mikeserv You mean command -v? – Hauke Laging May 28 '14 at 12:58
1  
@Pandya - always be sure to cite sources. It's perfectly fine to replicate here so long as the source materials are properly sourced. – slm May 28 '14 at 13:14
1  
@Pandya - NP, thanks for the good Q&A. – slm May 28 '14 at 13:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.