📄 csh.g
字号:
variable is.DSpath (. /usr/ucb /bin /usr/bin).DEthe shell normally looks in the current directory, and then inthe standard system directories `/usr/ucb', `/bin' and `/usr/bin' for the namedcommand (2.2).If the command cannot be found the shell will print an error diagnostic.Scripts of shell commands will be executed using another shell to interpretthem if they have `execute' permission set.This is normally true because a command of the form.DSchmod 755 script.DEwas executed to turn this execute permission on (3.3).If you add new commands to a directory in the .I path , you should issuethe command .I rehash (2.2)..IP pathnameA list of names, separated by `/' characters, forms a.I pathname.Each.I component,between successive `/' characters, names a directoryin which the next .I component file resides..I Pathnames which begin with the character `/' are interpreted relativeto the.I rootdirectory in the filesystem.Other .I pathnames are interpreted relative to the current directoryas reported by.I pwd.The last component of a .I pathname may name a directory, butusually names a file..IP pipelineA group of commands which are connected together, the .I "standard output"of each connected to the .I "standard input" of the next,is called a.I pipeline.The.I pipemechanism used to connect these commands is indicated bythe shell metacharacter `|' (1.5, 2.3)..IP popdThe.I popdcommand changes the shell's.I "working directory"to the directory you most recently left using the.I pushdcommand. It returns to the directory without having to type its name,forgetting the name of the current.I "working directory"before doing so (2.7)..IP portThe part of a computer system to which each terminal isconnected is called a.I port .Usually the system has a fixed number of.I ports ,some of which are connected to telephone linesfor dial-up access, and some of which are permanentlywired directly to specific terminals..IP prThe.I prcommand is used to prepare listings of the contents of fileswith headers giving the name of the file and the date andtime at which the file was last modified (2.3)..IP printenvThe.I printenvcommand is usedto print the current setting of variables in the environment(2.8)..IP processAn instance of a running program is called a .I process (2.6).\s-2UNIX\s0 assigns each .I process a unique number when it is started \- called the.I "process number" ..I "Process numbers" can be used to stop individual .I processesusing the .I killor.I stopcommands when the.I processesare part of a detached.I backgroundjob..IP programUsually synonymous with.I command ;a binary file or shell command scriptwhich performs a useful function is oftencalled a .I program ..IP promptMany programs will print a .I prompt on the terminal when they expect input.Thus the editor`ex (1)' will print a `:' when it expects input.The shell .I promptsfor input with `% ' and occasionally with `? ' whenreading commands from the terminal (1.1).The shell has a variable.I promptwhich may be set to a different value to change the shell's main .I prompt .This is mostly used when debugging the shell (2.8)..IP pushdThe.I pushdcommand, which means `push directory', changes the shell's.I "working directory"and also remembers the current.I "working directory"before the change is made, allowing you to return to the samedirectory via the.I popdcommand later without retyping its name (2.7)..IP psThe.I pscommand is used to show the processes you are currently running.Each process is shown with its unique process number,an indication of the terminal name it is attached to,an indication of the state of the process (whether it is running,stopped, awaiting some event (sleeping), and whether it is swapped out),and the amount of \s-2CPU\s0 time it has used so far.The command is identified by printing some of the words usedwhen it was invoked (2.6).Shells, such as the.I cshyou use to run the .I ps command, are not normally shown in the output..IP pwdThe.I pwdcommand prints the full .I pathname of the current.I "working directory" \&.The.I dirsbuiltin command is usually a better and faster choice..IP quitThe.I quitsignal, generated by a control-\e,is used to terminate programs which are behaving unreasonably.It normally produces a core image file (1.8)..IP quotationThe process by which metacharacters are prevented their specialmeaning, usually by using the character `\' in pairs, or byusing the character `\e', is referred to as.I quotation(1.7)..IP redirectionThe routing of input or output from or to a file is knownas.I redirectionof input or output (1.3)..IP rehashThe.I rehashcommand tells the shell to rebuild its internal table of which commandsare found in which directories in your.I path .This is necessary when a new program is installed in one of thesedirectories (2.8)..IP "relative pathname".brA.I pathnamewhich does not begin with a `/' is called a.I "relative pathname"since it is interpreted.I relativeto the current .I "working directory" .The first.I componentof such a.I pathnamerefers to some file or directory in the.I "working directory" ,and subsequent.I componentsbetween `/' characters refer to directories below the.I "working directory" ..I Pathnamesthat are not.I relativeare called.I "absolute pathnames"(1.6)..IP repeatThe.I repeatcommand iterates another command a specified number of times..IP rootThe directorythat is at the top of the entire directory structure is called the.I rootdirectory since it is the `root' of the entire tree structure ofdirectories. The name used in.I pathnamesto indicate the.I rootis `/'. .I Pathnames starting with `/' are said to be.I absolutesince they start at the.I rootdirectory..I Rootis also used as the part of a .I pathname that is left after removingthe .I extension .See.I filenamefor a further explanation (1.6)..IP \s-2RUBOUT\s0The \s-2RUBOUT\s0 or \s-2DELETE\s0key is often used to erase the previously typed character; some usersprefer the \s-2BACKSPACE\s0 for this purpose. On older versions of \s-2UNIX\s0this key served as the \s-2INTR\s0 character..IP "scratch file"Files whose names begin with a `#' are referred to as .I "scratch files" ,since they are automatically removed by the system after a couple ofdays of non-use, or more frequently if disk space becomes tight (1.3)..IP scriptSequences of shell commands placed in a file are called shell command .I scripts .It is often possible to perform simple tasks using these .I scripts without writing a program in a language such as C, byusing the shell to selectively run other programs (3.3, 3.10)..IP setThe builtin.I setcommand is used to assign new values to shell variablesand to show the values of the current variables.Many shell variables have special meaning to the shell itself.Thus by using the .I set command the behavior of the shell can be affected (2.1)..IP setenvVariables in the environment `environ (5)'can be changed by using the.I setenvbuiltin command (2.8).The.I printenvcommand can be used to print the value of the variables in the environment..IP shellA .I shell is a command language interpreter.It is possible to write and run your own .I shell ,as .I shells are no different than any other programs as far as thesystem is concerned.This manual deals with the details of one particular .I shell ,called.I csh..IP "shell script"See.I script(3.3, 3.10)..IP signalA.I signalin \s-2UNIX\s0 is a short message that is sent to a running programwhich causes something to happen to that process..I Signalsare sent either by typing special.I controlcharacters on the keyboard or by using the.I killor.I stopcommands (1.8, 2.6)..IP sortThe.I sortprogram sorts a sequence of lines in ways that can be controlledby argument .I flags (1.5)..IP sourceThe.I sourcecommand causes the shell to read commands from a specified file.It is most useful for reading files such as.I \&.cshrcafter changing them (2.8)..IP "special character".brSee.I metacharactersand theappendix to this manual..IP standardWe refer often to the.I "standard input"and.I "standard output"of commands.See.I inputand.I output(1.3, 3.8)..IP statusA command normally returns a.I statuswhen it finishes.By convention a.I statusof zero indicates that the command succeeded.Commands may return non-zero .I status to indicate that some abnormal event has occurred.The shell variable.I statusis set to the .I status returned by the last command.It is most useful in shell commmand scripts (3.6)..IP stopThe.I stopcommand causes a.I background job to become .I suspended (2.6)..IP stringA sequential group of characters taken together is called a.I string \&..I Stringscan contain any printable characters (2.2)..IP sttyThe.I sttyprogram changes certain parameters inside \s-2UNIX\s0 which determinehow your terminal is handled. See `stty (1)' for a complete description (2.6)..IP substitutionThe shell implements a number of.I substitutionswhere sequences indicated by metacharacters are replaced by other sequences.Notable examples of this are history .I substitution keyed by themetacharacter `!' and variable .I substitution indicated by `$'.We also refer to .I substitutions as.I expansions(3.4)..IP suspendedA job becomes.I suspendedafter a \s-2STOP\s0 signal is sent to it, either by typing a.I control -zat the terminal (for.I foregroundjobs) or by using the.I stopcommand (for.I backgroundjobs). When.I suspended ,a job temporarily stops running until it is restarted by either the.I fgor.I bgcommand (2.6)..IP switchThe.I switchcommand of the shell allows the shellto select one of a number of sequences of commands based on anargument string.It is similar to the.I switchstatement in the language C (3.7)..IP terminationWhen a command which is being executed finishes we say it undergoes.I terminationor.I terminates.Commands normally terminate when they read an .I end\f1-\fPof\f1-\fPfilefrom their .I "standard input" .It is also possible to terminate commands by sending theman.I interruptor.I quitsignal (1.8).The.I killprogram terminates specified jobs (2.6)..IP thenThe.I thencommand is part of the shell's`if-then-else-endif' control construct used in command scripts (3.6)..IP timeThe.I timecommand can be used to measure the amount of \s-2CPU\s0and real time consumed by a specified command as wellas the amount of disk i/o, memory utilized, and numberof page faults and swaps taken by the command (2.1, 2.8)..IP tsetThe.I tsetprogram is used to set standard erase and kill charactersand to tell the system what kind of terminal you are using.It is often invoked in a.I \&.loginfile (2.1)..IP ttyThe word.I ttyis a historical abbreviation for `teletype' which is frequently usedin \s-2UNIX\s0 to indicate the.I portto which a given terminal is connected. The.I ttycommand will print the name of the.I ttyor.I portto which your terminal is presently connected..IP unaliasThe.I unaliascommand removes aliases (2.8)..IP \s-2UNIX\s0\s-2UNIX\s0 is an operating system on which.I cshruns.\s-2UNIX\s0 provides facilities which allow.I cshto invoke other programs such as editors and text formatters whichyou may wish to use..IP unsetThe.I unsetcommand removes the definitions of shell variables (2.2, 2.8)..IP "variable expansion".brSee.I variablesand.I expansion(2.2, 3.4)..IP variables.I Variables in.I cshhold one or more strings as value.The most common use of .I variables is in controlling the behaviorof the shell.See.I path ,.I noclobber ,and.I ignoreeoffor examples..I Variables such as.I argvare also used in writing shell programs (shell command scripts)(2.2)..IP verboseThe.I verboseshell variable can be set to cause commands to be echoedafter they are history expanded.This is often useful in debugging shell scripts.The.I verbosevariable is set by the shell's.I \-vcommand line option (3.10)..IP wcThe.I wcprogram calculates the number of characters, words, and lines in thefiles whose names are given as arguments (2.6)..IP whileThe.I whilebuiltin control construct is used in shell command scripts (3.7)..IP wordA sequence of characters which forms an argument to a command is calleda.I word .Many characters which are neither letters, digits, `\-', `.' nor `/'form .I words all by themselves even if they are not surroundedby blanks.Any sequence of characters may be made into a .I word by surrounding itwith `\'' charactersexcept for the characters `\'' and `!' which require special treatment(1.1).This process of placing special characters in .I words without their special meaning is called.I quoting ..IP "working directory".brAt any given time you are in one particular directory, calledyour .I "working directory" .This directory's name is printed by the.I pwdcommand and the files listed by.I lsare the ones in this directory.You can change .I "working directories" using.I chdir ..IP writeThe.I writecommand is an obsolete way of communicating with other users who are logged in to\s-2UNIX\s0 (you have to take turns typing). If you are both using display terminals, use \fItalk\fP(1), which is much more pleasant.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -