How do I distinguish between a command, utility, or builtin for getting documentation?
up vote
8
down vote
favorite
I'm running Bash scripting, but sometimes I get confused which of these commands I use belong to who. Sometimes man xxx works, sometimes doesn't, so I use --help or info, mostly one of these works to show description of the command. Can anyone tell me how I would know what command belongs to what? Bash builtin, GNU utility, etc.
command-line manpage documentation info
add a comment |
up vote
8
down vote
favorite
I'm running Bash scripting, but sometimes I get confused which of these commands I use belong to who. Sometimes man xxx works, sometimes doesn't, so I use --help or info, mostly one of these works to show description of the command. Can anyone tell me how I would know what command belongs to what? Bash builtin, GNU utility, etc.
command-line manpage documentation info
add a comment |
up vote
8
down vote
favorite
up vote
8
down vote
favorite
I'm running Bash scripting, but sometimes I get confused which of these commands I use belong to who. Sometimes man xxx works, sometimes doesn't, so I use --help or info, mostly one of these works to show description of the command. Can anyone tell me how I would know what command belongs to what? Bash builtin, GNU utility, etc.
command-line manpage documentation info
I'm running Bash scripting, but sometimes I get confused which of these commands I use belong to who. Sometimes man xxx works, sometimes doesn't, so I use --help or info, mostly one of these works to show description of the command. Can anyone tell me how I would know what command belongs to what? Bash builtin, GNU utility, etc.
command-line manpage documentation info
command-line manpage documentation info
edited Nov 21 at 5:43
muru
134k19282482
134k19282482
asked Oct 9 '13 at 20:42
user198436
7414
7414
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
You can use type to find out:
$ type echo
echo is a shell builtin
$ type sudo
sudo is /usr/bin/sudo
For bash builtins, use help, as in help echo.
add a comment |
up vote
2
down vote
Some builtin commands are included for efficiency sake and exist as external commands in the first place. For example:
$ type -a echo
echo is a shell builtin
echo is /bin/echo
$ type -a printf
printf is a shell builtin
printf is /usr/bin/printf
A detailed analysis of builtins and external commands can be found in Unix & Linux.
As far as getting help for dual builtins/external commands such as echo you have two choices. One method is by using man echo:
ECHO(1) User Commands ECHO(1)
NAME
echo - display a line of text
SYNOPSIS
echo [SHORT-OPTION]... [STRING]...
echo LONG-OPTION
DESCRIPTION
Echo the STRING(s) to standard output.
-n do not output the trailing newline
-e enable interpretation of backslash escapes
-E disable interpretation of backslash escapes (default)
--help display this help and exit
--version
output version information and exit
If -e is in effect, the following sequences are recognized:
\ backslash
a alert (BEL)
Manual page echo(1) line 1 (press h for help or q to quit)
And you can type:
$ help echo
echo: echo [-neE] [arg ...]
Write arguments to the standard output.
Display the ARGs, separated by a single space character and followed by a
newline, on the standard output.
Options:
-n do not append a newline
-e enable interpretation of the following backslash escapes
-E explicitly suppress interpretation of backslash escapes
`echo' interprets the following backslash-escaped characters:
a alert (bell)
b backspace
c suppress further output
e escape character
E escape character
f form feed
n new line
r carriage return
t horizontal tab
v vertical tab
\ backslash
nnn the character whose ASCII code is NNN (octal). NNN can be
0 to 3 octal digits
xHH the eight-bit character whose value is HH (hexadecimal). HH
can be one or two hex digits
Exit Status:
Returns success unless a write error occurs.
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
You can use type to find out:
$ type echo
echo is a shell builtin
$ type sudo
sudo is /usr/bin/sudo
For bash builtins, use help, as in help echo.
add a comment |
up vote
5
down vote
accepted
You can use type to find out:
$ type echo
echo is a shell builtin
$ type sudo
sudo is /usr/bin/sudo
For bash builtins, use help, as in help echo.
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
You can use type to find out:
$ type echo
echo is a shell builtin
$ type sudo
sudo is /usr/bin/sudo
For bash builtins, use help, as in help echo.
You can use type to find out:
$ type echo
echo is a shell builtin
$ type sudo
sudo is /usr/bin/sudo
For bash builtins, use help, as in help echo.
answered Oct 9 '13 at 21:58
choroba
6,56411730
6,56411730
add a comment |
add a comment |
up vote
2
down vote
Some builtin commands are included for efficiency sake and exist as external commands in the first place. For example:
$ type -a echo
echo is a shell builtin
echo is /bin/echo
$ type -a printf
printf is a shell builtin
printf is /usr/bin/printf
A detailed analysis of builtins and external commands can be found in Unix & Linux.
As far as getting help for dual builtins/external commands such as echo you have two choices. One method is by using man echo:
ECHO(1) User Commands ECHO(1)
NAME
echo - display a line of text
SYNOPSIS
echo [SHORT-OPTION]... [STRING]...
echo LONG-OPTION
DESCRIPTION
Echo the STRING(s) to standard output.
-n do not output the trailing newline
-e enable interpretation of backslash escapes
-E disable interpretation of backslash escapes (default)
--help display this help and exit
--version
output version information and exit
If -e is in effect, the following sequences are recognized:
\ backslash
a alert (BEL)
Manual page echo(1) line 1 (press h for help or q to quit)
And you can type:
$ help echo
echo: echo [-neE] [arg ...]
Write arguments to the standard output.
Display the ARGs, separated by a single space character and followed by a
newline, on the standard output.
Options:
-n do not append a newline
-e enable interpretation of the following backslash escapes
-E explicitly suppress interpretation of backslash escapes
`echo' interprets the following backslash-escaped characters:
a alert (bell)
b backspace
c suppress further output
e escape character
E escape character
f form feed
n new line
r carriage return
t horizontal tab
v vertical tab
\ backslash
nnn the character whose ASCII code is NNN (octal). NNN can be
0 to 3 octal digits
xHH the eight-bit character whose value is HH (hexadecimal). HH
can be one or two hex digits
Exit Status:
Returns success unless a write error occurs.
add a comment |
up vote
2
down vote
Some builtin commands are included for efficiency sake and exist as external commands in the first place. For example:
$ type -a echo
echo is a shell builtin
echo is /bin/echo
$ type -a printf
printf is a shell builtin
printf is /usr/bin/printf
A detailed analysis of builtins and external commands can be found in Unix & Linux.
As far as getting help for dual builtins/external commands such as echo you have two choices. One method is by using man echo:
ECHO(1) User Commands ECHO(1)
NAME
echo - display a line of text
SYNOPSIS
echo [SHORT-OPTION]... [STRING]...
echo LONG-OPTION
DESCRIPTION
Echo the STRING(s) to standard output.
-n do not output the trailing newline
-e enable interpretation of backslash escapes
-E disable interpretation of backslash escapes (default)
--help display this help and exit
--version
output version information and exit
If -e is in effect, the following sequences are recognized:
\ backslash
a alert (BEL)
Manual page echo(1) line 1 (press h for help or q to quit)
And you can type:
$ help echo
echo: echo [-neE] [arg ...]
Write arguments to the standard output.
Display the ARGs, separated by a single space character and followed by a
newline, on the standard output.
Options:
-n do not append a newline
-e enable interpretation of the following backslash escapes
-E explicitly suppress interpretation of backslash escapes
`echo' interprets the following backslash-escaped characters:
a alert (bell)
b backspace
c suppress further output
e escape character
E escape character
f form feed
n new line
r carriage return
t horizontal tab
v vertical tab
\ backslash
nnn the character whose ASCII code is NNN (octal). NNN can be
0 to 3 octal digits
xHH the eight-bit character whose value is HH (hexadecimal). HH
can be one or two hex digits
Exit Status:
Returns success unless a write error occurs.
add a comment |
up vote
2
down vote
up vote
2
down vote
Some builtin commands are included for efficiency sake and exist as external commands in the first place. For example:
$ type -a echo
echo is a shell builtin
echo is /bin/echo
$ type -a printf
printf is a shell builtin
printf is /usr/bin/printf
A detailed analysis of builtins and external commands can be found in Unix & Linux.
As far as getting help for dual builtins/external commands such as echo you have two choices. One method is by using man echo:
ECHO(1) User Commands ECHO(1)
NAME
echo - display a line of text
SYNOPSIS
echo [SHORT-OPTION]... [STRING]...
echo LONG-OPTION
DESCRIPTION
Echo the STRING(s) to standard output.
-n do not output the trailing newline
-e enable interpretation of backslash escapes
-E disable interpretation of backslash escapes (default)
--help display this help and exit
--version
output version information and exit
If -e is in effect, the following sequences are recognized:
\ backslash
a alert (BEL)
Manual page echo(1) line 1 (press h for help or q to quit)
And you can type:
$ help echo
echo: echo [-neE] [arg ...]
Write arguments to the standard output.
Display the ARGs, separated by a single space character and followed by a
newline, on the standard output.
Options:
-n do not append a newline
-e enable interpretation of the following backslash escapes
-E explicitly suppress interpretation of backslash escapes
`echo' interprets the following backslash-escaped characters:
a alert (bell)
b backspace
c suppress further output
e escape character
E escape character
f form feed
n new line
r carriage return
t horizontal tab
v vertical tab
\ backslash
nnn the character whose ASCII code is NNN (octal). NNN can be
0 to 3 octal digits
xHH the eight-bit character whose value is HH (hexadecimal). HH
can be one or two hex digits
Exit Status:
Returns success unless a write error occurs.
Some builtin commands are included for efficiency sake and exist as external commands in the first place. For example:
$ type -a echo
echo is a shell builtin
echo is /bin/echo
$ type -a printf
printf is a shell builtin
printf is /usr/bin/printf
A detailed analysis of builtins and external commands can be found in Unix & Linux.
As far as getting help for dual builtins/external commands such as echo you have two choices. One method is by using man echo:
ECHO(1) User Commands ECHO(1)
NAME
echo - display a line of text
SYNOPSIS
echo [SHORT-OPTION]... [STRING]...
echo LONG-OPTION
DESCRIPTION
Echo the STRING(s) to standard output.
-n do not output the trailing newline
-e enable interpretation of backslash escapes
-E disable interpretation of backslash escapes (default)
--help display this help and exit
--version
output version information and exit
If -e is in effect, the following sequences are recognized:
\ backslash
a alert (BEL)
Manual page echo(1) line 1 (press h for help or q to quit)
And you can type:
$ help echo
echo: echo [-neE] [arg ...]
Write arguments to the standard output.
Display the ARGs, separated by a single space character and followed by a
newline, on the standard output.
Options:
-n do not append a newline
-e enable interpretation of the following backslash escapes
-E explicitly suppress interpretation of backslash escapes
`echo' interprets the following backslash-escaped characters:
a alert (bell)
b backspace
c suppress further output
e escape character
E escape character
f form feed
n new line
r carriage return
t horizontal tab
v vertical tab
\ backslash
nnn the character whose ASCII code is NNN (octal). NNN can be
0 to 3 octal digits
xHH the eight-bit character whose value is HH (hexadecimal). HH
can be one or two hex digits
Exit Status:
Returns success unless a write error occurs.
edited Mar 19 at 10:27
answered Mar 19 at 1:22
WinEunuuchs2Unix
39.6k1065147
39.6k1065147
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f355983%2fhow-do-i-distinguish-between-a-command-utility-or-builtin-for-getting-document%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown