⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0035-0036.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:
<HTML>

<HEAD>

<TITLE>Linux Complete Command Reference:User Commands:EarthWeb Inc.-</TITLE>

</HEAD>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311046 //-->

<!-- TITLE=Linux Complete Command Reference//-->

<!-- AUTHOR=Red Hat//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=01 //-->

<!-- PAGES=0001-0736 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->



<P><CENTER>

<a href="0034-0034.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0037-0038.html">Next</A></CENTER></P>







<A NAME="PAGENUM-35"><P>Page 35</P></A>







<B>

<P>SHELL BUILT-IN COMMANDS</P>

</B>



<TABLE>



<TR><TD>

: [arguments]

</TD><TD>

No effect; the command does nothing beyond expanding arguments and

performing any specified redirections. A zero exit code is returned.

</TD></TR><TR><TD>

. filename [arguments]

</TD><TD>

Read and execute commands from

filename in the current shell environment and

</TD></TR><TR><TD>

source filename [arguments]

</TD><TD>

return the exit status of the last command executed from

filename. If filename does not contain a slash, pathnames in

PATH are used to find the directory containing filename. The file searched for in

PATH need not be executable. The current directory is searched if no file is found in

PATH. If any arguments are supplied, they become

the positional parameters when file is executed. Otherwise, the positional

parameters are unchanged. The return status is the status of the last command exited within

the script (0 if no commands are executed), and

False if filename is not found.

</TD></TR><TR><TD>

alias [name[=value] ...]

</TD><TD>

alias with no arguments prints the list of aliases in the form

name=value on standard output. When arguments are supplied, an alias is defined for each name whose

value is given. A trailing space in value causes the next word to be checked for

alias substitution when the alias is expanded. For each name in the argument list

for which no value is supplied, the name and value of the alias is printed.

alias returns True unless a name is given for which no alias has been defined.

</TD></TR><TR><TD>

bg [jobspec]

</TD><TD>

Place jobspec in the background, as if it had been started with

&amp;. If jobspec is not present, the shell's notion of the current job is used.

bg jobspec returns 0 unless run when job control is disabled or, when run with job control enabled, if

jobspec was not found or started without job control.

</TD></TR><TR><TD>

bind [_m keymap][_lvd][-q name]

</TD><TD>

Display current

readline key and function bindings, or bind a key sequence to a

</TD></TR><TR><TD>

bind [_m keymap] -f filename

</TD><TD>

readline function or macro. The binding syntax accepted is identical to that of

</TD></TR><TR><TD>

bind [_m keymap]

</TD><TD>

.inputrc, but each binding must be passed as a separate argument; for example,

</TD></TR><TR><TD>

keyseq:function-name

</TD><TD>

&quot;\C-x\C-r&quot;:re_read_init_file. Options, if supplied, have the following meanings:

</TD></TR></TABLE>



<TABLE>



<TR><TD>

</TD><TD>

_m keymap

</TD><TD>

Use keymap as the keymap to be affected by the

subsequent bindings. Acceptable keymap names are

                  emacs, emacs-standard, emacs-meta, emacs-ctlx, vi,

vi-move, vi-command, and vi-insert. vi is equivalent to

vi-command; emacs is equivalent to emacs-standard.

</TD></TR><TR><TD>

</TD><TD>

_l

</TD><TD>

List the names of all readline functions.

</TD></TR><TR><TD>

</TD><TD>

_v

</TD><TD>

List current function names and bindings.

</TD></TR><TR><TD>

</TD><TD>

_d

</TD><TD>

Dump function names and bindings in such a way that

they can be reread.

</TD></TR><TR><TD>

</TD><TD>

_f filename

</TD><TD>

Read key bindings from filename.

</TD></TR><TR><TD>

</TD><TD>

_q function

</TD><TD>

Query about which keys invoke the named function.

</TD></TR></TABLE>



<TABLE>



<TR><TD>

</TD><TD>

The return value is 0 unless an unrecognized option is given or an error occurred.

</TD></TR><TR><TD>

break [n]

</TD><TD>

Exit from within a for, while, or

until loop. If n is specified, break n levels. n

must be 1. If n is greater than the number of enclosing loops, all enclosing loops

are exited. The return value is 0 unless the shell is not executing a loop when break

is executed.

</TD></TR><TR><TD>

builtin shell_builtin [arguments]

</TD><TD>

Execute the specified shell builtin, passing it arguments, and return its exit

status. This is useful when you wish to define a function whose name is the same as a

shell builtin, but need the functionality of the builtin within the function itself. The

cd builtin is commonly redefined this way. The return status is

False if shell_builtin is not a shell builtin command.

</TD></TR><TR><TD>

cd [dir]

</TD><TD>

Change the current directory to

dir. The variable HOME is the default dir. The variable

CDPATH defines the search path for the directory containing

dir. Alternative directory names are separated by a colon

(:). A null directory name in CDPATH is the same as the current directory, that is, (.). If

dir begins with a slash (/), then CDPATH is

</TD></TR></TABLE>







<A NAME="PAGENUM-36"><P>Page 36</P></A>





<TABLE>



<TR><TD>

</TD><TD>

not used. An argument of _ is equivalent to

$OLDPWD. The return value is True if the directory was successfully changed;

False otherwise.

</TD></TR><TR><TD>

command [-pVv] command [arg ...]

</TD><TD>

Run command

with args suppressing the normal shell function lookup. Only

built-in commands or commands found in the PATH are executed. If the

_p option is given, the search for command is performed using a default value for

PATH that is guaranteed to find all of the standard utilities. If either the

_V or _v option is supplied, a description of

command is printed. The _v option causes a single word indicating

the command or pathname used to invoke command to be printed; the

_V option produces a more verbose description. An argument of

&#151;disables option checking for the rest of the arguments. If the

_V or _v option is supplied, the exit status is 0

if command was found, and 1 if not. If neither option

is supplied and an error occurred or command cannot be found, the exit status is

127. Otherwise, the exit status of the command builtin is the exit status of

command.

</TD></TR><TR><TD>

continue [n]

</TD><TD>

Resume the next iteration of the enclosing

for, while, or until loop. If n is specified, resume at the nth enclosing loop.

n must be 1. If n is greater than the number of enclosing loops, the last enclosing loop (the top_level loop) is resumed. The

return value is 0 unless the shell is not executing a loop when

continue is executed.

</TD></TR><TR><TD>

declare [_frxi][name[=value]]

</TD><TD>

Declare variables and/or

give them attributes. If no names are given, then display the

</TD></TR><TR><TD>

typeset [_frxi][name[=value]]

</TD><TD>

values of variables instead. The options can be used to restrict output to

variables with the specified attribute.

</TD></TR></TABLE>



<TABLE>



<TR><TD>

</TD><TD>

_f

</TD><TD>

Use function names only.

</TD></TR><TR><TD>

</TD><TD>

-r

</TD><TD>

Make names read-only. These names cannot then be

assigned values by subsequent assignment statements.

</TD></TR><TR><TD>

</TD><TD>

_x

</TD><TD>

Mark names for export to subsequent commands via

the environment.

</TD></TR><TR><TD>

</TD><TD>

_i

</TD><TD>

The variable is treated as an integer; arithmetic evaluation

(see &quot;Arithmetic Evaluation&quot;) is performed when the variable

is assigned a value.

</TD></TR></TABLE>



<TABLE>



<TR><TD>

</TD><TD>

Using + instead of _ turns off the attribute instead. When used in a function,

makes names local, as with the local command. The return value is

0 unless an illegal option is encountered, an attempt is made to define a function using

&quot;-f foo=bar&quot;, one of the names is not a legal shell variable name, an attempt is made to turn

off read-only status for a read-only variable, or an attempt is made to display

a nonexistent function with -f.

</TD></TR><TR><TD>

dirs [-l][+/_n]

</TD><TD>

Display the list of currently remembered directories. Directories are added to the

list with the pushd command; the popd command moves back up through the list.

</TD></TR></TABLE>





<TABLE>



<TR><TD>

</TD><TD>

+n

</TD><TD>

Displays the nth entry counting from the left of the list

shown by dirs when invoked without options, starting with zero.

</TD></TR><TR><TD>

</TD><TD>

_n

</TD><TD>

Displays the nth entry counting from the right of the

list shown by dirs when invoked without options, starting

with zero.

</TD></TR><TR><TD>

</TD><TD>

_l

</TD><TD>

Produces a longer listing; the default listing format uses a

tilde to denote the home directory.

</TD></TR></TABLE>



<TABLE>



<TR><TD>

</TD><TD>

The return value is 0 unless an illegal option is supplied or

n indexes beyond the end of the directory stack.

</TD></TR><TR><TD>

echo [_neE][arg ...]

</TD><TD>

Output the args, separated by spaces. The return status is always

0. If _n is specified, the trailing newline is suppressed. If the

_e option is given, interpretation of the following backslash-escaped

characters is enabled. The _E option disables the interpretation of these escape characters, even on systems where they are

interpreted by default.

</TD></TR></TABLE>









<P><CENTER>

<a href="0034-0034.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0037-0038.html">Next</A></CENTER></P>







</td>
</tr>
</table>

<!-- begin footer information -->







</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -