What Does Command W Do
Alienware Command Center is a software program developed by Alienware. The most common release is 2.8.8.0, with over 98 of all installations currently using this version. During setup, the program creates a startup registration point in Windows in order to automatically start when any user boots the PC. The w command displays a list of all logged in to the server and what they are doing. This command is similar to who command, but ends up displaying more information about logged in users. Command: noun an order given. A signal that actuates a device (such as a control mechanism in a spacecraft or one step in a computer). The activation of a device by means of such a signal. A line of code (see 1code 5) instructing a computer to send such a signal. If you do have propane, make sure that your iN.Command system is updated. If issues persist, please see an RV service center for diagnosis. Does the iN.Command system work off of just a 12V battery?
W Command Unix
What Does Command W Do On A Mac
Alternatively referred to as Control+W and C-w , Ctrl+W is a keyboard shortcut most often used to close a program, window, tab, or document. How to use the Ctrl+W keyboard shortcut
To use this keyboard shortcut, press and hold either Ctrl key, and while continuing to hold, press W . Ctrl+W in an Internet browser
In all major Internet browsers (e.g., Chrome, Edge, Firefox, Opera), pressing Ctrl + W closes the current tab. If there aren't multiple tabs open, pressing Ctrl + W closes the browser. Ctrl+W in Excel
In Microsoft Excel and other spreadsheet programs, pressing Ctrl + W closes the current workbook. Note
If you're editing the contents of a cell and press Ctrl + W , nothing will happen. Ctrl+W in Microsoft PowerPoint
In Microsoft PowerPoint, the Ctrl + W keyboard shortcut closes the current presentation. Ctrl+W in Word and other word processors
In Microsoft Word and other word processors, pressing Ctrl + W closes the current document. Related keyboard shortcuts and keys
Below are links to related keyboard shortcuts and individual key pages. Related pages
Computer keyboard shortcuts.
Close, Ctrl, Keyboard shortcut, Keyboard terms, W Table of Contents UNIX Command Dictionaries
The UNIX manual is mostly on lineand the UNIX man' command is used to display parts of the manual.Typing
man [command] (CR) will yield information in an almost readable format during aIBM Telnet session. The problem is that you have both UNIX andCMS paging the output. You respond to the UNIX paging prompt :'with a (CR) ' return for a new page, d (CR) ' for a shortnew page, u (CR) ' for a shortpage up (back), or q (CR) ' to quit.For the CMS paging prompt holding', respond with the designated Clear-key'.If you are using IBM Telnet, then man [command]' usuallyproduces poor output for the head of the display. The version man -blou [command] (CR) ' should remove underscoring and otherbackspacing for printing at UIC, but does not work completely.For a quick overview of a command try the -q' quick option:
man -q command] (CR) Alternatively,
man [command] [file] (CR) is useful for redirecting the output to a file that can laterbe transfer back to CMS for printing (e.g. by printdoc'). TheUNIX no paging -r' option does not work in a CMS session, sothe CMS user has to press both the Return-key ' for a newUNIX man' page or the Clear-key ' for a new CMS pagedepending on the odd UNIX prompt or the CMS HOLDING' prompt,respectively.
This abridged UNIX dictionaryis only intended to be a short enough list to get you startedwithout being bewildered by the enormous UNIX manuals, butwith enough commands to be ableto do something useful. For more information use the man'command or refer to some of the UNIX texts.UNIX is a trademark of Bell Laboratories.
The format is [command] [generic operand] : [Definition.]
along with a carriage return (CR) ' for each command. DO NOT FORGET that almost all UNIX commands must be in lower case .Do not attempt to learn all of this at once, but read someof it and try it out at an actual computer session. Return to TABLE OF CONTENTS?
UNIX Log In and Out Commands:
login (CR) : Logon command.
logout (CR) : Logoff command. Return to TABLE OF CONTENTS?
UNIX Information Commands
man [-option] [command] (CR) : Manual or UNIX help command.The usual quit sequence q (CR) ' can be used to quit long UNIX man' listings, (CR) ' is used for new man' pages.During a IBM Telnet session the Clear-key ' is needed fornew CMS pages that are not the same as the man' pages.Otherwise d ', q ' or Ctrl-c 'should work for UNIX like access.
finger [user] (CR) : Displays system biography on user [user]'.
whereis [name] (CR) : Locates source for program or command; e.g. whereis kermit'.
which [name] (CR) : Tell which version of a program or command will be used in your session incase of multiple copies; e.g. which cc'.
whatis [command] (CR) : Describes the command [command].
who am i (CR) : Displays current user id and access.
who (CR) : Displays currently logged in users. Return to TABLE OF CONTENTS?
UNIX C Language Commands
cc -o run [file].c (CR) : Compiles source [file].c, using the standard C compiler scc2.0' andproducing an executable named run. In place of cc', use scc3.0'or scc' for the latest version of standard C or pcc' for portable C.
cc -c [file].c (CR) : Compiles source [file].c, using the standard C compiler scc2.0' andproducing an object file named [file].o.
cc -hnoopt -o run [file].c (CR) : Compiles source [file].c, using the standard C compiler scc3.0' andproducing an executable file named run without scalar optimization orvector optimization while hopt' enables scalar and vector optimization,Some other optimization related options are -hinline' for inlining while-hnone' is the default no inlining, -hnovector' for no vector (vectoris the default), and -h listing' for a pseudo-assembler (CAL) listing.Some standard C options are -htask3' for automatic parallelization(autotasking in crayese) and -hvector3' for more powerful vectorrestructuring.Other -h' suboptions are ivdep' for ignore vector dependence,-hreport=isvf'generates messages about inlining (i), scalar optimization (s) and vectoroptimization (v), and -hreport=isvf' writes same messages to [file].v'.A commonly used form will be
cc -o run -h report=isvf [file].c (CR)
See man cc' or docview' for more information.
define fortran : Form of C header statement to permit the call to a fortran subroutinefrom a C program. For example:
pragma _CRI [directive] : Form of C compiler directive placed within the C code, where someexample directives are ivdep' for ignoring vector dependence,novector' for turning off the default vectorization, vector' forturning it back on, inline' for procedure inline optimization,shortloop', noreduction', getcpus [p]',relcpus', parallel ........', and end parallel'. See vector directives'for instance in docview' for more information and examples. Return to TABLE OF CONTENTS?
UNIX makefile Commands
make [-options] [step-name] (CR) : Makes the files [files] according to the template in the makefile'.See the examples makefile *' on the getdisk hanson' disk in CMS,e.g., the file makefile.unicos_2': CAUTION: The commands, like segldr' or cft77', must be precededby a Tab-key ' tab as a delimiter, but the tab will not be visiblein the UNIX listing.
fmgen -m [make-name] -c cft77 -f[-flag] -o [executable] [source].f (CR) : Automatically generates a makefile forcompiling under the cft77 'compiler and loading up the executable file named [executable]'.Invoke with make -f [make-name] [executable](CR)' and the execute[executable]'. Also produces steps for profiling, flow-traces,performance traces, and clean-up, in the heavily documented makefile.For example, make -c cft77 -f -em -o run pgm.f (CR)' produces amakefile named makefile', executable named run ', an informationlisting named [name in program statement].l' with loops markedby optimization type, etc.; the making is done with make run (CR)'. Caution: the makefile only uses the source name only when thatcoincides with the name used in the Fortran program' statementand only one type of cft77 ' flag can be used . These flaws canbe corrected by editing the resulting makefile [make-name]'. Return to TABLE OF CONTENTS?
UNIX Directory Commands
mkdir [name] (CR) : Makes a directory or file group name [name];e.g. mkdir dirpgm (CR)' make the directory called dirpgm'.
pushd [name] (CR) : Pushes from the working directory to the directory [name]keeping the sequence of directories in a buffer for popd'.
popd (CR) Pops back up to the prior directory, if pushd' was used before.For this reason, pushd' and popd' are more useful than the regularchange directory command cd'.
cd [directory] (CR) : Changes the working directory to the directory [directory]; you canchange it back with cd(CR)' using your own login id; cd $HOME (CR)'returns the shell back to your home directory..' denotes the current directory and ..' denotes the root or parentdirectory.
cd [user] (CR) : Changes working directory to that of login id [user]'.
cd $TMP (CR) : changes to your temporary directory; same as cd $TMP (CR) '.
pwd (CR) : Displays working directory; echo $HOME (CR) ' displays the homedirectory.
ls [directory] (CR) : displays the contents of the directory [directory]'.
mv [file1] ... [fileN] [directory] (CR) : moves [file1]', ..., [fileN]' to directory [directory]';e.g. mv addtwo.* diradd' moves all files with prefix addtwo.'to the directory diradd' which must already exist from a prior'mkdir diradd' command. This format works for cp' also.
cp [file1] [directory]/[file2] (CR) : copies [file1] into [file2] in directory [directory]. cp [file] . (CR) ' copies a file to the current directory using theoriginal name. This format works for mv' also.
rmdir (CR) : Removes or erases empty directory. You must first use rm *' toempty the file. Return to TABLE OF CONTENTS?
UNIX File Commands
ls (CR) : Lists sets or files of current user id or current directory.
ls [user] (CR) : Lists files or directories under user/account id [user]'. Also ls /[directory] (CR) 'will list the contents of the directory [directory]'on the same account.
ls [string].* (CR) : Lists all current files with prefix [name]. Examples of other formsare ls *[string] (CR) ' or ls *[string]* (CR) 'or ls *[string1]*[string2]* '.
cat [file1] ... [fileN] (CR) : Lists content of N (N .le. 1) argument files catenated.Use cat [file1] ... [fileN] [fileM] (CR), 'to catenate and store the N files in [fileM]'.
more [file] (CR) : Displays file in half pages of 11 lines; use q (CR) ' for quitting;use d ' for 11 more lines or u ' to go back up 11 more lines; similarly, f ' and b ' produce full pages forward and backwards,respectively; while /[string]?[string]Caution: works poorly with TELNET from CMS.Use cat [file] (CR) ' with the CMS Clear-key instead.
cp [file1] [file2] (CR) : Copies file [file1]' into file [file2]'.
rm [file1] (CR) : Erases file [file1]'; can take several file arguments, with thesystem asking if you really want to do it, y 'for yes and n ' for notarget file [file2]' already exists to avoid unintentional.The query can be removed in any session by the command unalias rm (CR) 'or permanentlyby editing the C-shell resource configuration file .cshrc'.
mv [file1] [file2] (CR) : Renames file [file1'] as file [file2]',i.e., moves one file to another.
grep [str]' [file1] (CR) : Searches for string [str] in file [file1]. cat [file1] [file2] grep [string]' (CR) 'searches for the pattern [string]'in the catenated files. Note the different string pattern,with the standard single quote used within the command to enclosethe target string when it is more than one word .
diff [file1] [file2] (CR) : Displays the difference between files [file1]' and [file2]'.
chmod [mode] [file] (CR) : Changes the read, write and execute permissions forthe file (or files) [file]' according to the [mode]' which hasform [[who] [operator] [permission]]'; [who]' is u' for the user,g' for the defined group', o' for others and a' = ugo' for all;[operator]' is +' to add and -' for remove; [permission]' is r'for read, w' for write and x' for execute; current permissions aredisplayed with the defaultlong list command ls [file] (CR) ' in the firstfield or the sample forms drwxrwxr-x' or -rwxr--r--' with the firstcharacter denoting a directory if d' is present, a --' denotes nopermission, with each remaining subfield of three denoting theuser, group and others, respectively; for example chmod go-wx * 'removes write and execute permissions in the current directoryfor all but the user, chmod u+w [file] ' adds write permissionto only the user; the user may be queried about removing protectionfor his own files. Return to TABLE OF CONTENTS?
UNIX Pipe and Redirection Commands
The commands in this subsection embody some of the powerfuladvantages of UNIX.
alias [command nickname] [command definition]' (CR) : Makes alias for commands to save typing. The quotes around thedefinition are not required for single words, but only when thedefinition contains delimiters like blanks. If used a lot, putthe alias' in thegroup account .cshrc' file and execute by source .cshrc .csh' is the UNIX C-shell,one of the UNIX operating sub-systems, and rc' stands for resourceconfiguration.
[command] [file] (CR) : Redirects standard output of command [command] to file [file].E.g., cat [fn1] [fn2] [fn3] (CR)',catenating two files into a third file.
[command] [file] (CR) : Redirects standard and diagnostic or erroroutput of [command] to file [file].E.g., run [output] (CR) ',puts compiled listing and errorsinto the file pgm.l when pgm.f is compiled.
[command] [file] (CR) : Redirects standard output of [command]' and appends it to [file]'.E.g., run [data] [output] (CR) ',catenates the new output with the currentfile [output]'.
[cmd1] [cmd2] (CR) : Pipes output of command [cmd1]' to input of command [cmd2]'.E.g., ls -l grep Jan 31' (CR) ' lists only thosefiles last changed on January 31. Caution: the string Jan 31'must be enclosed in single quotes, but the quotes are optional forsingle words without delimiters.
[command] (CR) : Executes [command]' in the background, so you can work at somethingelse in your session.E.g., run [data] [output] (CR) ', execute run'and stores results into the file [output]'.
history (CR) : Lists the history of the most recent commands entered.
![number] (CR) : Repeats execution of the command numbered [number]' in the history'listing.
![string] (CR) : Repeats execution of the last command beginning with the pattern[string] in the history' listing.
![string]:p (CR) : Repeats listing of the last command beginning with the pattern[string]' in the history' listing, but does not execute it.You can return (CR) to execute or you can modify it by the commandthat follows immediately below.
[str1][str2] (CR) : Replaces string [str1]' with [str2]' in the previous command andexecutes the modified command. Return to TABLE OF CONTENTS?
UNIX Mail Commands
mail (CR) : Shows users mail; use the subcommand t [N](CR) ' to list message number [N]', s [N] mbox (CR) ' to append message [N]' to your mailbox mbox' file or s [N] [file](CR) ' to append [N]' to another file; e [N] (CR) ' to edit number [N] or look at a long file with ex'see Section on EX' below; v [N] (CR) ' to edit number [N] or look at a long file with vi'; d [N] (CR) ' deletes your own mail! [N]'; m [user] (CR) ' permits you to send mail to another account [user]';a m [N] (CR) ' inside the message after entering a subject,permits you to forward message [N]' to [user]', d (CR) ' to end the new message see the send formbelow; x ' quits mail' without deleting use this when yourun into problems; and q (CR) ' to quit.
mail [user] (CR) : Sends mail to user [user]';the text is entered immediately in thecurrent blank space; carriage return to enter each line;enter a file with a r[filename] (CR) ';route a copy to user [userid]' by c[userid] (CR) ';enter the ex' line editor with e (CR) 'or vi' visual editor with v (CR) '(see Sections on EX and on VI)to make changes on entered lines,exiting ex' with a wq (CR) ' or vi' with a :wq' (CR) ';exit mail' by entering d (CR) '. A bug in thecurrent version of Telnet does notallow you to send a copy using the cc:' entry.However, ending with the hack' d [user_cc] (CR) 'should get a copy to user [user_cc]'.UNIX users should not encounter IBM Telnet problems.
mail [userid]@uicvm.cc.uic.edu [filename] (CR) : Sends the UNIX file [filename]' to user [userid]' at UICVM,i.e., to [userid]'s CMS, as with CMS SENDFILE.
mail [name]@[machine].[dept].uic.edu [filename] (CR) : Sends the UNIX file [filename]' to user [name]' onsome UNIX or other machine.
from (CR) : Tells who the mail is from. Return to TABLE OF CONTENTS?
UNIX Control-Key Commands
Ctrl-h : Erase or backspace over character; note the CTRL-key and h-key must be simultaneously pressed.
Ctrl-c : Interrupt or break character; stops printing and returns toUNIX. Caution: for a IBM TELNET session, should use c (CR) , but this masked interrupt will notwork during long listings due to interference of the CMS Clear-key'in IBM Telnet sessions.
Ctrl-s : Stop character else or IBM Telnet use s (CR) '.
Ctrl-q : Quiet character else for IBM Telnet use q (CR) '.
Ctrl-u : Kill character else for IBM Telnet use u (CR) '.
Ctrl-w : Word erase character else for IBM Telnet use w (CR) '. Return to TABLE OF CONTENTS?
UNIX Terminal Environment Commands
printenv (CR) : Print out environment meta parameters such as defaults, terminal typesand key assignments, eg., SHELL, PATH, TERM, NCPUS, HOME, TMP, AFS, and AFSTMP.
setenv TERM vt100 (CR) : Sets TERM' variable to type vt100', which should be the default and can bechecked by using printenv', else use h19b' or your correct terminal emulation if recognizable by the remote host. The recognizable terminal type are in the alphabetized subdirectories of /usr/lib/terminfo', e.g., v' directory contains vt100 listings.Caution: YTERM' is ideal for PC to CMS communication, but doesnot have a terminal type that is recognizable by UNIX systems ('vt100'may sometimes work as a substitute, but unknown' type means a poorline edit session).
setenv TERMCAP vt100 (CR) : Sets TERMCAP' variable to type vt100', else use h19b' etc.You can put customized terminalconfiguration in the file .termcap' and enable it with thecommand setenv TERMCAP $HOME.termcap' either in your shell orin your '.login' file.
tset -m :h19b (CR) : Sets terminal type to Heathkit or Zenith type h19b'. WARNING: Several terminal commands are given here, because youmight have to try several before you find one that works. Note that one ofthe biggest problems in working with advanced, remote computers isCOMMUNICATION and that much of this local guide is intended to solvecommunication problems .
stty erase [key](CR) : Set or reset the terminal (tty') erase key to [key]'.
stty all (CR) : Display usual Control characters; with arguments can be use to setterminal communication variables; also try stty everything'. Return to TABLE OF CONTENTS?
UNIX Process Commands
jobs - l (CR) : Display a simple single line with currently active job status.
ps (CR) : Display current process ids (pid') needed for killing.
ps t[N] (CR) : Displays pid' for terminal or tty [N].
kill -9 [pid] (CR) : Means a sure kill' of pid' [pid]; this becomes necessarywhen you lose control of a process or have a session aborted. CAUTION: Aborted sessions are not uncommon so it is helpful to develop skills of a super process (program) killer . Return to TABLE OF CONTENTS?
UNIX Editor Commands
ex [file] (CR) : EX' line editor. This is the preferred editor for LINE EDIT MODEwith TELNET. :' is the ex' prompt. ex [file1] ... [fileN] (CR) 'is the form used for multiple files with the n' command used to goto the next file, rather than q' to quit.Ex can also be used in vi with':' as a prefix, when vi works. ed' is another line editor withless availability.More details on ex' are given in the next section.
vi [file] (CR) : Invokes the UNIX full screen editor vi' to edit file [file]; thisvisual editor has a large set of subcommands. Warning:the vi' commandwill NOT work properly with the LINE MODE of CMS TELNET and YOU WILL LIKELY GET IN A STUCK SESSION IF YOU TRY IT. (Try to get access to a UNIX system or PC Telnet systems, such as thosein the 2249f SEL PC Lab.)
vi -r [file] (CR) : Form of vi' used to recover [file]' after aborted session.Similarly, ex -r [file] (CR) ' is for an aborted ex' session.
view [file] (CR) : This is the read only form of vi'. Return to TABLE OF CONTENTS?
ex Editor
Ex' is the UNIX line editor (ed' is another UNIX line editor)and vi' is thefull screen editor that is disabled by IBM TELNET.The prompt is :', butthe user enters input at the bottom of the screen with IBM TELNETline mode.In ex' .' means the current line, $' means the last line,and ' means the whole range of lines 1,$'.[L1],[L2]' denotes the range from line [L1]' to line [L2]'.The user may want to do major editing on the CMS multi-line editor XEDITand send the file using the FTP file transfer protocol.Some students may have had experience with this editor (or the similared' editor) from EECS courses. These ex' commands can be used withinthe vi' editor by typing a colon :' in front of the ex' command,which is another reason for learning ex' with vi' when you havean account where vi' can be used.
0a (CR) : This form of the append subcommandputs you in input mode starting withline 1, new lines are entered following a (CR)', and input mode isended with a solitary or sole . ' on a line with an immediate(CR)', i.e., .(CR) '.This is not the usual method for opening a new file, but the usualway does not work correctly with the IBM Telnet and CMS pass through.
q! (CR) : Quit or abort ex' without saving. Use, especially, in an emergency when your edit session seemshopeless, and you want to start over at the beginning.
w [file] (CR) : Save (write) or resave into the newfile [file], but do not end. Ifno [file] is specified, then the current file is resaved.
w! [file] (CR) : Resave (rewrite) into an oldfile [file], but do not end. Ex' will not write over an existingnon-current file with the w' command without the !'.
wq (CR) : Save and quit ex.
wn (CR) : When ex' is used on more than one file, writes the current fileand makes ex' go to the next file. ' puts two ex' commandstogether.
nu (CR) : Number current line.
set number (CR) : Number all lines; line numbers are needed for effective use or ex';by putting this and other commands in your .exrc'Ex Resource Configuration file, the command will be operative untilit is changed.
set list (CR) : Show carriage control characters, such as End-Of-Line ($ = EOL).
/[string] (CR) : Search forward for pattern [string].
?[string] (CR) : Search backward for pattern [string].
[L1],[L2] p (CR) or [L1],[L2] l (CR) : Prints or lists (listing control characters) lines [L1] to [L2]. (CR)' lists the whole range of lines, and .,$ (CR)' lists thecurrent line to the last line.
$ (CR) : Prints last line.
d (CR) : Scrolls lines In UNIX, use Ctrl-d '.
[L1],[L1]+[N] p (CR) : Prints lines [L1] to [L1]+[N].
[L1],[L2] d (CR) : Deletes lines [L1] to [L2].
[L1] i (CR) : Insert at line [L1]. End with a lone .(CR) 'after the last inputline. Does not work on an empty file.
[L1] a (CR) : Append after line [L1].End with a lone .(CR) ' after the last inputline. Does not work on an empty file.
[L1] o (CR) : The UNIX open command does not work correctly with IBM TELNETbecause the usual end commands do not work properly.End with a line .(CR) '.
[L1] c (CR) : Change line [L1]; end with .(CR) alone.
[L1],[L2] co [L3] (CR) : Copy lines [L1] to [L2] to after line [L3].
[L1],[L2] m [L3] (CR) : Move lines [L1] to [L2] to after line [L3].
[L1],[L2] t [L3] (CR) : Take copy lines [L1] to [L2] to [L3]; destination[L3] can not be in ([L1] to [L2]-1).
[L1],[L2] g/[string]/[commands] (CR) : Globally search for all occurrences of pattern [string] inlines [L1] to [L2] (or current line only if no lines are given),and execute commands [commands] on matching lines.
[L1],[L2] s/[string1]/[string2]/g (CR) : Substitute [string2] for all [string1] inlines [L1] to [L2] (or current line only if no lines are given).If gp' is used in place of g' then print change(s).
[L1],[L2] (CR) : Repeat prior substitution command.
g/[string1]/s//[string2]/gp (CR) : Globally substitute [string2] for each[string1] in all lines and print changes; works globally; use ?'in place of /' if [string*] contains a /'.
[L] r [file] (CR) : Read in or append file [file] at line [L].
u (CR) : Undo most recent substitution.
[L1],[L2] ya [buffer] (CR) : Yank lines [L1] to [L2] to named buffer [buffer]. See pu '.
[L1],[L2] d [buffer] (CR) : Delete and yanklines [L1] to [L2] to named buffer [buffer]. See pu '.
[L3] pu [buffer] (CR) : Put lines from named buffer [buffer] after line [L3]. See ya '.
g/$/d (CR) : Delete all null lines.
s/A/B/A/C/g (CR) : Illustrates the use of ' to change a stringcontaining the /' delimiter to change A/B' to A/C' globally. Return to TABLE OF CONTENTS?
vi Editor
The UNIX full screen editor vi' is a tightly designed editingsystem in which almost every letter has a function and the function isstronger for upper than lower case. However, a letter and its actualfunction are usually closely related. It is important to remember thatthe (Esc) ' escape key ends most functions anda (Esc), (Esc) 'double application certainly ends the function with the ring of a bell.The subcommand u ' undoes the last function (presumably an error).Use :q! (CR) ' to end with out saving, especially in hopelesssituations. Use :wq (CR) ' to resave and end ZZ ' alsoresaves and ends, but will not resave if the file has been saved inanother file and no further changes have been made, or :w (CR) 'to only resave. The character :' prompts the UNIX line editor ex'which you can think of as being embedded in vi'. Some of the abovecritical vi' subcommands are repeated below with others. Most vi'subcommands are not displayed when used and do not take a carriagereturn (CR) '. The fact that most keys have a meaning both assingle characters and as concatenations of several characters has manybenefits, but has disadvantages in that mistakes can turnout to be catastrophic. Remember that (Esc), (Esc), u ' keysequence! WARNING: VI' is disabled during an IBM Telnetsession. W Command Unix
(Esc) : End a command; especially used with insert i', append a' or replace'R'.
(Esc), (Esc) : Ensured end of a command with bell; press the Escape-keytwice; use it.
u : Undoes last command; usually used after (Esc)' or(Esc), (Esc)'; if undoing isworse then repeat u' again to undo the undoing.
:set all (CR) : Display all vi options.Use this ex command when your initial vi session is poor.Customized options are placed in the.exrc' ex resource configuration profile.
:w (CR) : Save or resave the default file being edited, but do not end.
:w [file] (CR) : Save into a new file [file], but do not end.
:w! [file] (CR) : Save or resave into an existing file [file], but do not end.
:q (CR) : Quit vi without saving, provided no changes have been made since thelast save.
:q! (CR) : Quit vi without saving, living the file as it was in the last save.
:wq (CR) : Save the default file being edited, and quit.
ZZ : Save the edited file, provided not changes have been made since thelast save of the edited file to any file, and quit vi'. Warning: if you just saved the editedfile into any other file, the file will NOT be resaved. :wq (CR) is much safer to use.
h or j or k or l : The arrow keys, such thateach take a number prefix that moves the cursor that many times.
(CR) : moves cursor a line forward; + ' also does.
-- : Moves cursor a line backward.
[N] (CR) : Moves cursor [N] lines forwards.
[N]-- : Moves cursor [N] lines backwards.
Ctrl-f : Moves cursor a page forward.
Ctrl-b : Moves cursor a page backward.
Ctrl-d : Moves cursor a half page down.
Ctrl-u : Moves cursor a half page up.
[L]G : Go to line [L]. 1G ' moves the cursor to the beginning of thefile (BOF).
G : Go to the last line just before the end of file (EOF) mark. $G ' does the same thing.
0 : Go to beginning of the line (BOL).
: Go to beginning of the nonblank part of the line (BOL).
: Got to first nonblank character on a line.
$ : Go to end of the line (EOL).
[N] : Go to column [N] of the current line.
: Find the matching parenthesis.
/[string] (CR) : Find the next occurrence of [string]' forwards. Use n 'to repeat, or N ' to search backwards.
?[string] (CR) : Find the next occurrence of [string]' backwards.
n : Repeat last /[string] (CR) ' or ?[string] (CR) ';think of the fileas being wrapped around from end to beginning, so that when you returnto the start you know that you have found all occurrences.
N : Repeat last /[string] (CR) ' or ?[string] (CR) ',but in reverse.
. : Repeat last change. This is best used along with the repeat search n ' or N '.
i[string](Esc) : Insert a string [string]'before current character at the cursor; the subcommandi' itself and other subcommands are not displayed; a (CR) 'in the stringduring the insert is used to continue input on additional lines;end with the escape key (Esc)' or (Esc), (Esc)'.
o[string](Esc) : Opens a new line below the current line for insertion of string[string]'; end with (Esc)' or (Esc), (Esc)';use for POWER TYPING input for an old or new file; O[string](Esc) 'opens a new line above the current line for insertion.
I[string](Esc) : Insert a string at the beginning of the current line (BOL),else is like insert i';a (CR) ' in the stringduring the insert is used to continue input on additional lines;end with (Esc)' or (Esc), (Esc)'.
J : Joins next line to current line.
a[string](Esc) : Appends a string [string]'following the current character at the cursor,else it works like insert i'; use (CR) ' in the stringto continue inputonto new lines; end with (Esc)'; also use for POWER TYPING.
A[string](Esc) : Appends a string [string]'at the end of a line (EOL), works like i' or a'; use (CR) ' in the stringto continue input onto new lines; end with (Esc)';also use for POWER TYPING.
r[C](SPACE) : Replace a single character over the cursor by the singlecharacter [C]; finalize with the Space-bar .
R[string](Esc) : Replace a string of characters by [string]' in until (Esc)' istyped to end.
s[string](Esc) : Substitutes the string [string]' for the single character at thecursor. The multiple form [N]s[string](Esc) ' substitutes [string]' for the [N]'characters starting at the cursor.
x : Delete the current character at the cursor.
d(SPACE) : Deletes a single character. [N]d(SPACE) ' deletes [N]'characters.
dd : Deletes the current line. [N]dd ' deletes [N]' lines.
D : Deletes from the cursor to the end of line (EOL).
dw : Deletes the current word; [N]dw ' deletes [N]' words.
w : Move cursor to the beginning of the next word. [N]w 'moves the cursor [N]' words forward. [N]b ' moves it [N]' wordsbackward. [N]e ' moves it to the end of the word.
[N]y(SPACE) : Yanks [N]' characters starting at the cursor and puts them intothe default buffer. [N]yy ' yanks [N]' lines.
p : Puts the current contents of the default buffer after the cursorif characters or after the current line if lines.Helpful to use right after a characteryank y' or a character delete d' or a line yank yy' or a linedelete dd',along with a search /[string](CR) ' or repeat search n '.and a repeat change . '. P ' puts the contents of the default buffer before the currentline.
'b[N]Y : Yank [N] lines starting with the current line to the buffer labeled b;the double quote 'is used to avoid an id conflict with subcommand names;any letter other than x' can be used to name the buffer;safer than the lineyank yy ' because it is very easy to accidentallychange the default buffer.
'b[N]dd : Deletes [N] lines starting with the current line to the bufferlabeled b'.
'bp : Put back lines from the buffer labeled b'after or below the cursor;use after a yank or delete to a labeled bufferto move groups of lines from one location to another.
'bP : Put back lines from the buffer labeled b'before or above the cursor;use after a yank or delete to a labeled bufferto move groups of lines from one location to another. Some ex' editor commands that are useful in vi'follow the :' prompt. See the previous section on ex' for morecommands.
:nu (CR) : Number current line.
:[L1],[L2] d (CR) : Deletes lines [L1]' to [L2]'.
:[L1],[L2] m [L3] (CR) : Move lines [L1]' to [L2]' to after line [L3]'.
:[L1],[L2] t [L3] (CR) : Take [copy] lines [L1]' to [L2] to [L3]'; destination[L3]' can not be in [L1]' to [L2]-1'.
:[L1],[L2]s/[string1]/[string2]/g (CR) : Substitute [string2]' for all [string1]' in lines [L1]' to [L2]'only.
:s/[string1]/[string2]/gp (CR) : Substitute [string2]' for all [string1]' incurrent line only and print change(s).
:g/[string1]/s//[string2]/gp (CR) : Globally substitute [string2]' for each[string1]' in all lines and print changes; works globally; use ?'in place of /' if [string*]' contains a /'.
:[L]r [file] (CR) : Append file [file] at line [L]'. Return to TABLE OF CONTENTS?
Web Source: http://www.math.uic.edu/hanson/UNIX/UnixDictionary.html What Does Command W Do On A Mac
Email Comments or Questions tohanson@uic.edu
W Command Unix
What Does Command W Do On A Mac
Alternatively referred to as Control+W and C-w , Ctrl+W is a keyboard shortcut most often used to close a program, window, tab, or document. How to use the Ctrl+W keyboard shortcut
To use this keyboard shortcut, press and hold either Ctrl key, and while continuing to hold, press W . Ctrl+W in an Internet browser
In all major Internet browsers (e.g., Chrome, Edge, Firefox, Opera), pressing Ctrl + W closes the current tab. If there aren't multiple tabs open, pressing Ctrl + W closes the browser. Ctrl+W in Excel
In Microsoft Excel and other spreadsheet programs, pressing Ctrl + W closes the current workbook. Note
If you're editing the contents of a cell and press Ctrl + W , nothing will happen. Ctrl+W in Microsoft PowerPoint
In Microsoft PowerPoint, the Ctrl + W keyboard shortcut closes the current presentation. Ctrl+W in Word and other word processors
In Microsoft Word and other word processors, pressing Ctrl + W closes the current document. Related keyboard shortcuts and keys
Below are links to related keyboard shortcuts and individual key pages. Related pages
Computer keyboard shortcuts.
Close, Ctrl, Keyboard shortcut, Keyboard terms, W Table of Contents UNIX Command Dictionaries
The UNIX manual is mostly on lineand the UNIX man' command is used to display parts of the manual.Typing
man [command] (CR) will yield information in an almost readable format during aIBM Telnet session. The problem is that you have both UNIX andCMS paging the output. You respond to the UNIX paging prompt :'with a (CR) ' return for a new page, d (CR) ' for a shortnew page, u (CR) ' for a shortpage up (back), or q (CR) ' to quit.For the CMS paging prompt holding', respond with the designated Clear-key'.If you are using IBM Telnet, then man [command]' usuallyproduces poor output for the head of the display. The version man -blou [command] (CR) ' should remove underscoring and otherbackspacing for printing at UIC, but does not work completely.For a quick overview of a command try the -q' quick option:
man -q command] (CR) Alternatively,
man [command] [file] (CR) is useful for redirecting the output to a file that can laterbe transfer back to CMS for printing (e.g. by printdoc'). TheUNIX no paging -r' option does not work in a CMS session, sothe CMS user has to press both the Return-key ' for a newUNIX man' page or the Clear-key ' for a new CMS pagedepending on the odd UNIX prompt or the CMS HOLDING' prompt,respectively.
This abridged UNIX dictionaryis only intended to be a short enough list to get you startedwithout being bewildered by the enormous UNIX manuals, butwith enough commands to be ableto do something useful. For more information use the man'command or refer to some of the UNIX texts.UNIX is a trademark of Bell Laboratories.
The format is [command] [generic operand] : [Definition.]
along with a carriage return (CR) ' for each command. DO NOT FORGET that almost all UNIX commands must be in lower case .Do not attempt to learn all of this at once, but read someof it and try it out at an actual computer session. Return to TABLE OF CONTENTS?
UNIX Log In and Out Commands:
login (CR) : Logon command.
logout (CR) : Logoff command. Return to TABLE OF CONTENTS?
UNIX Information Commands
man [-option] [command] (CR) : Manual or UNIX help command.The usual quit sequence q (CR) ' can be used to quit long UNIX man' listings, (CR) ' is used for new man' pages.During a IBM Telnet session the Clear-key ' is needed fornew CMS pages that are not the same as the man' pages.Otherwise d ', q ' or Ctrl-c 'should work for UNIX like access.
finger [user] (CR) : Displays system biography on user [user]'.
whereis [name] (CR) : Locates source for program or command; e.g. whereis kermit'.
which [name] (CR) : Tell which version of a program or command will be used in your session incase of multiple copies; e.g. which cc'.
whatis [command] (CR) : Describes the command [command].
who am i (CR) : Displays current user id and access.
who (CR) : Displays currently logged in users. Return to TABLE OF CONTENTS?
UNIX C Language Commands
cc -o run [file].c (CR) : Compiles source [file].c, using the standard C compiler scc2.0' andproducing an executable named run. In place of cc', use scc3.0'or scc' for the latest version of standard C or pcc' for portable C.
cc -c [file].c (CR) : Compiles source [file].c, using the standard C compiler scc2.0' andproducing an object file named [file].o.
cc -hnoopt -o run [file].c (CR) : Compiles source [file].c, using the standard C compiler scc3.0' andproducing an executable file named run without scalar optimization orvector optimization while hopt' enables scalar and vector optimization,Some other optimization related options are -hinline' for inlining while-hnone' is the default no inlining, -hnovector' for no vector (vectoris the default), and -h listing' for a pseudo-assembler (CAL) listing.Some standard C options are -htask3' for automatic parallelization(autotasking in crayese) and -hvector3' for more powerful vectorrestructuring.Other -h' suboptions are ivdep' for ignore vector dependence,-hreport=isvf'generates messages about inlining (i), scalar optimization (s) and vectoroptimization (v), and -hreport=isvf' writes same messages to [file].v'.A commonly used form will be
cc -o run -h report=isvf [file].c (CR)
See man cc' or docview' for more information.
define fortran : Form of C header statement to permit the call to a fortran subroutinefrom a C program. For example:
pragma _CRI [directive] : Form of C compiler directive placed within the C code, where someexample directives are ivdep' for ignoring vector dependence,novector' for turning off the default vectorization, vector' forturning it back on, inline' for procedure inline optimization,shortloop', noreduction', getcpus [p]',relcpus', parallel ........', and end parallel'. See vector directives'for instance in docview' for more information and examples. Return to TABLE OF CONTENTS?
UNIX makefile Commands
make [-options] [step-name] (CR) : Makes the files [files] according to the template in the makefile'.See the examples makefile *' on the getdisk hanson' disk in CMS,e.g., the file makefile.unicos_2': CAUTION: The commands, like segldr' or cft77', must be precededby a Tab-key ' tab as a delimiter, but the tab will not be visiblein the UNIX listing.
fmgen -m [make-name] -c cft77 -f[-flag] -o [executable] [source].f (CR) : Automatically generates a makefile forcompiling under the cft77 'compiler and loading up the executable file named [executable]'.Invoke with make -f [make-name] [executable](CR)' and the execute[executable]'. Also produces steps for profiling, flow-traces,performance traces, and clean-up, in the heavily documented makefile.For example, make -c cft77 -f -em -o run pgm.f (CR)' produces amakefile named makefile', executable named run ', an informationlisting named [name in program statement].l' with loops markedby optimization type, etc.; the making is done with make run (CR)'. Caution: the makefile only uses the source name only when thatcoincides with the name used in the Fortran program' statementand only one type of cft77 ' flag can be used . These flaws canbe corrected by editing the resulting makefile [make-name]'. Return to TABLE OF CONTENTS?
UNIX Directory Commands
mkdir [name] (CR) : Makes a directory or file group name [name];e.g. mkdir dirpgm (CR)' make the directory called dirpgm'.
pushd [name] (CR) : Pushes from the working directory to the directory [name]keeping the sequence of directories in a buffer for popd'.
popd (CR) Pops back up to the prior directory, if pushd' was used before.For this reason, pushd' and popd' are more useful than the regularchange directory command cd'.
cd [directory] (CR) : Changes the working directory to the directory [directory]; you canchange it back with cd(CR)' using your own login id; cd $HOME (CR)'returns the shell back to your home directory..' denotes the current directory and ..' denotes the root or parentdirectory.
cd [user] (CR) : Changes working directory to that of login id [user]'.
cd $TMP (CR) : changes to your temporary directory; same as cd $TMP (CR) '.
pwd (CR) : Displays working directory; echo $HOME (CR) ' displays the homedirectory.
ls [directory] (CR) : displays the contents of the directory [directory]'.
mv [file1] ... [fileN] [directory] (CR) : moves [file1]', ..., [fileN]' to directory [directory]';e.g. mv addtwo.* diradd' moves all files with prefix addtwo.'to the directory diradd' which must already exist from a prior'mkdir diradd' command. This format works for cp' also.
cp [file1] [directory]/[file2] (CR) : copies [file1] into [file2] in directory [directory]. cp [file] . (CR) ' copies a file to the current directory using theoriginal name. This format works for mv' also.
rmdir (CR) : Removes or erases empty directory. You must first use rm *' toempty the file. Return to TABLE OF CONTENTS?
UNIX File Commands
ls (CR) : Lists sets or files of current user id or current directory.
ls [user] (CR) : Lists files or directories under user/account id [user]'. Also ls /[directory] (CR) 'will list the contents of the directory [directory]'on the same account.
ls [string].* (CR) : Lists all current files with prefix [name]. Examples of other formsare ls *[string] (CR) ' or ls *[string]* (CR) 'or ls *[string1]*[string2]* '.
cat [file1] ... [fileN] (CR) : Lists content of N (N .le. 1) argument files catenated.Use cat [file1] ... [fileN] [fileM] (CR), 'to catenate and store the N files in [fileM]'.
more [file] (CR) : Displays file in half pages of 11 lines; use q (CR) ' for quitting;use d ' for 11 more lines or u ' to go back up 11 more lines; similarly, f ' and b ' produce full pages forward and backwards,respectively; while /[string]?[string]Caution: works poorly with TELNET from CMS.Use cat [file] (CR) ' with the CMS Clear-key instead.
cp [file1] [file2] (CR) : Copies file [file1]' into file [file2]'.
rm [file1] (CR) : Erases file [file1]'; can take several file arguments, with thesystem asking if you really want to do it, y 'for yes and n ' for notarget file [file2]' already exists to avoid unintentional.The query can be removed in any session by the command unalias rm (CR) 'or permanentlyby editing the C-shell resource configuration file .cshrc'.
mv [file1] [file2] (CR) : Renames file [file1'] as file [file2]',i.e., moves one file to another.
grep [str]' [file1] (CR) : Searches for string [str] in file [file1]. cat [file1] [file2] grep [string]' (CR) 'searches for the pattern [string]'in the catenated files. Note the different string pattern,with the standard single quote used within the command to enclosethe target string when it is more than one word .
diff [file1] [file2] (CR) : Displays the difference between files [file1]' and [file2]'.
chmod [mode] [file] (CR) : Changes the read, write and execute permissions forthe file (or files) [file]' according to the [mode]' which hasform [[who] [operator] [permission]]'; [who]' is u' for the user,g' for the defined group', o' for others and a' = ugo' for all;[operator]' is +' to add and -' for remove; [permission]' is r'for read, w' for write and x' for execute; current permissions aredisplayed with the defaultlong list command ls [file] (CR) ' in the firstfield or the sample forms drwxrwxr-x' or -rwxr--r--' with the firstcharacter denoting a directory if d' is present, a --' denotes nopermission, with each remaining subfield of three denoting theuser, group and others, respectively; for example chmod go-wx * 'removes write and execute permissions in the current directoryfor all but the user, chmod u+w [file] ' adds write permissionto only the user; the user may be queried about removing protectionfor his own files. Return to TABLE OF CONTENTS?
UNIX Pipe and Redirection Commands
The commands in this subsection embody some of the powerfuladvantages of UNIX.
alias [command nickname] [command definition]' (CR) : Makes alias for commands to save typing. The quotes around thedefinition are not required for single words, but only when thedefinition contains delimiters like blanks. If used a lot, putthe alias' in thegroup account .cshrc' file and execute by source .cshrc .csh' is the UNIX C-shell,one of the UNIX operating sub-systems, and rc' stands for resourceconfiguration.
[command] [file] (CR) : Redirects standard output of command [command] to file [file].E.g., cat [fn1] [fn2] [fn3] (CR)',catenating two files into a third file.
[command] [file] (CR) : Redirects standard and diagnostic or erroroutput of [command] to file [file].E.g., run [output] (CR) ',puts compiled listing and errorsinto the file pgm.l when pgm.f is compiled.
[command] [file] (CR) : Redirects standard output of [command]' and appends it to [file]'.E.g., run [data] [output] (CR) ',catenates the new output with the currentfile [output]'.
[cmd1] [cmd2] (CR) : Pipes output of command [cmd1]' to input of command [cmd2]'.E.g., ls -l grep Jan 31' (CR) ' lists only thosefiles last changed on January 31. Caution: the string Jan 31'must be enclosed in single quotes, but the quotes are optional forsingle words without delimiters.
[command] (CR) : Executes [command]' in the background, so you can work at somethingelse in your session.E.g., run [data] [output] (CR) ', execute run'and stores results into the file [output]'.
history (CR) : Lists the history of the most recent commands entered.
![number] (CR) : Repeats execution of the command numbered [number]' in the history'listing.
![string] (CR) : Repeats execution of the last command beginning with the pattern[string] in the history' listing.
![string]:p (CR) : Repeats listing of the last command beginning with the pattern[string]' in the history' listing, but does not execute it.You can return (CR) to execute or you can modify it by the commandthat follows immediately below.
[str1][str2] (CR) : Replaces string [str1]' with [str2]' in the previous command andexecutes the modified command. Return to TABLE OF CONTENTS?
UNIX Mail Commands
mail (CR) : Shows users mail; use the subcommand t [N](CR) ' to list message number [N]', s [N] mbox (CR) ' to append message [N]' to your mailbox mbox' file or s [N] [file](CR) ' to append [N]' to another file; e [N] (CR) ' to edit number [N] or look at a long file with ex'see Section on EX' below; v [N] (CR) ' to edit number [N] or look at a long file with vi'; d [N] (CR) ' deletes your own mail! [N]'; m [user] (CR) ' permits you to send mail to another account [user]';a m [N] (CR) ' inside the message after entering a subject,permits you to forward message [N]' to [user]', d (CR) ' to end the new message see the send formbelow; x ' quits mail' without deleting use this when yourun into problems; and q (CR) ' to quit.
mail [user] (CR) : Sends mail to user [user]';the text is entered immediately in thecurrent blank space; carriage return to enter each line;enter a file with a r[filename] (CR) ';route a copy to user [userid]' by c[userid] (CR) ';enter the ex' line editor with e (CR) 'or vi' visual editor with v (CR) '(see Sections on EX and on VI)to make changes on entered lines,exiting ex' with a wq (CR) ' or vi' with a :wq' (CR) ';exit mail' by entering d (CR) '. A bug in thecurrent version of Telnet does notallow you to send a copy using the cc:' entry.However, ending with the hack' d [user_cc] (CR) 'should get a copy to user [user_cc]'.UNIX users should not encounter IBM Telnet problems.
mail [userid]@uicvm.cc.uic.edu [filename] (CR) : Sends the UNIX file [filename]' to user [userid]' at UICVM,i.e., to [userid]'s CMS, as with CMS SENDFILE.
mail [name]@[machine].[dept].uic.edu [filename] (CR) : Sends the UNIX file [filename]' to user [name]' onsome UNIX or other machine.
from (CR) : Tells who the mail is from. Return to TABLE OF CONTENTS?
UNIX Control-Key Commands
Ctrl-h : Erase or backspace over character; note the CTRL-key and h-key must be simultaneously pressed.
Ctrl-c : Interrupt or break character; stops printing and returns toUNIX. Caution: for a IBM TELNET session, should use c (CR) , but this masked interrupt will notwork during long listings due to interference of the CMS Clear-key'in IBM Telnet sessions.
Ctrl-s : Stop character else or IBM Telnet use s (CR) '.
Ctrl-q : Quiet character else for IBM Telnet use q (CR) '.
Ctrl-u : Kill character else for IBM Telnet use u (CR) '.
Ctrl-w : Word erase character else for IBM Telnet use w (CR) '. Return to TABLE OF CONTENTS?
UNIX Terminal Environment Commands
printenv (CR) : Print out environment meta parameters such as defaults, terminal typesand key assignments, eg., SHELL, PATH, TERM, NCPUS, HOME, TMP, AFS, and AFSTMP.
setenv TERM vt100 (CR) : Sets TERM' variable to type vt100', which should be the default and can bechecked by using printenv', else use h19b' or your correct terminal emulation if recognizable by the remote host. The recognizable terminal type are in the alphabetized subdirectories of /usr/lib/terminfo', e.g., v' directory contains vt100 listings.Caution: YTERM' is ideal for PC to CMS communication, but doesnot have a terminal type that is recognizable by UNIX systems ('vt100'may sometimes work as a substitute, but unknown' type means a poorline edit session).
setenv TERMCAP vt100 (CR) : Sets TERMCAP' variable to type vt100', else use h19b' etc.You can put customized terminalconfiguration in the file .termcap' and enable it with thecommand setenv TERMCAP $HOME.termcap' either in your shell orin your '.login' file.
tset -m :h19b (CR) : Sets terminal type to Heathkit or Zenith type h19b'. WARNING: Several terminal commands are given here, because youmight have to try several before you find one that works. Note that one ofthe biggest problems in working with advanced, remote computers isCOMMUNICATION and that much of this local guide is intended to solvecommunication problems .
stty erase [key](CR) : Set or reset the terminal (tty') erase key to [key]'.
stty all (CR) : Display usual Control characters; with arguments can be use to setterminal communication variables; also try stty everything'. Return to TABLE OF CONTENTS?
UNIX Process Commands
jobs - l (CR) : Display a simple single line with currently active job status.
ps (CR) : Display current process ids (pid') needed for killing.
ps t[N] (CR) : Displays pid' for terminal or tty [N].
kill -9 [pid] (CR) : Means a sure kill' of pid' [pid]; this becomes necessarywhen you lose control of a process or have a session aborted. CAUTION: Aborted sessions are not uncommon so it is helpful to develop skills of a super process (program) killer . Return to TABLE OF CONTENTS?
UNIX Editor Commands
ex [file] (CR) : EX' line editor. This is the preferred editor for LINE EDIT MODEwith TELNET. :' is the ex' prompt. ex [file1] ... [fileN] (CR) 'is the form used for multiple files with the n' command used to goto the next file, rather than q' to quit.Ex can also be used in vi with':' as a prefix, when vi works. ed' is another line editor withless availability.More details on ex' are given in the next section.
vi [file] (CR) : Invokes the UNIX full screen editor vi' to edit file [file]; thisvisual editor has a large set of subcommands. Warning:the vi' commandwill NOT work properly with the LINE MODE of CMS TELNET and YOU WILL LIKELY GET IN A STUCK SESSION IF YOU TRY IT. (Try to get access to a UNIX system or PC Telnet systems, such as thosein the 2249f SEL PC Lab.)
vi -r [file] (CR) : Form of vi' used to recover [file]' after aborted session.Similarly, ex -r [file] (CR) ' is for an aborted ex' session.
view [file] (CR) : This is the read only form of vi'. Return to TABLE OF CONTENTS?
ex Editor
Ex' is the UNIX line editor (ed' is another UNIX line editor)and vi' is thefull screen editor that is disabled by IBM TELNET.The prompt is :', butthe user enters input at the bottom of the screen with IBM TELNETline mode.In ex' .' means the current line, $' means the last line,and ' means the whole range of lines 1,$'.[L1],[L2]' denotes the range from line [L1]' to line [L2]'.The user may want to do major editing on the CMS multi-line editor XEDITand send the file using the FTP file transfer protocol.Some students may have had experience with this editor (or the similared' editor) from EECS courses. These ex' commands can be used withinthe vi' editor by typing a colon :' in front of the ex' command,which is another reason for learning ex' with vi' when you havean account where vi' can be used.
0a (CR) : This form of the append subcommandputs you in input mode starting withline 1, new lines are entered following a (CR)', and input mode isended with a solitary or sole . ' on a line with an immediate(CR)', i.e., .(CR) '.This is not the usual method for opening a new file, but the usualway does not work correctly with the IBM Telnet and CMS pass through.
q! (CR) : Quit or abort ex' without saving. Use, especially, in an emergency when your edit session seemshopeless, and you want to start over at the beginning.
w [file] (CR) : Save (write) or resave into the newfile [file], but do not end. Ifno [file] is specified, then the current file is resaved.
w! [file] (CR) : Resave (rewrite) into an oldfile [file], but do not end. Ex' will not write over an existingnon-current file with the w' command without the !'.
wq (CR) : Save and quit ex.
wn (CR) : When ex' is used on more than one file, writes the current fileand makes ex' go to the next file. ' puts two ex' commandstogether.
nu (CR) : Number current line.
set number (CR) : Number all lines; line numbers are needed for effective use or ex';by putting this and other commands in your .exrc'Ex Resource Configuration file, the command will be operative untilit is changed.
set list (CR) : Show carriage control characters, such as End-Of-Line ($ = EOL).
/[string] (CR) : Search forward for pattern [string].
?[string] (CR) : Search backward for pattern [string].
[L1],[L2] p (CR) or [L1],[L2] l (CR) : Prints or lists (listing control characters) lines [L1] to [L2]. (CR)' lists the whole range of lines, and .,$ (CR)' lists thecurrent line to the last line.
$ (CR) : Prints last line.
d (CR) : Scrolls lines In UNIX, use Ctrl-d '.
[L1],[L1]+[N] p (CR) : Prints lines [L1] to [L1]+[N].
[L1],[L2] d (CR) : Deletes lines [L1] to [L2].
[L1] i (CR) : Insert at line [L1]. End with a lone .(CR) 'after the last inputline. Does not work on an empty file.
[L1] a (CR) : Append after line [L1].End with a lone .(CR) ' after the last inputline. Does not work on an empty file.
[L1] o (CR) : The UNIX open command does not work correctly with IBM TELNETbecause the usual end commands do not work properly.End with a line .(CR) '.
[L1] c (CR) : Change line [L1]; end with .(CR) alone.
[L1],[L2] co [L3] (CR) : Copy lines [L1] to [L2] to after line [L3].
[L1],[L2] m [L3] (CR) : Move lines [L1] to [L2] to after line [L3].
[L1],[L2] t [L3] (CR) : Take copy lines [L1] to [L2] to [L3]; destination[L3] can not be in ([L1] to [L2]-1).
[L1],[L2] g/[string]/[commands] (CR) : Globally search for all occurrences of pattern [string] inlines [L1] to [L2] (or current line only if no lines are given),and execute commands [commands] on matching lines.
[L1],[L2] s/[string1]/[string2]/g (CR) : Substitute [string2] for all [string1] inlines [L1] to [L2] (or current line only if no lines are given).If gp' is used in place of g' then print change(s).
[L1],[L2] (CR) : Repeat prior substitution command.
g/[string1]/s//[string2]/gp (CR) : Globally substitute [string2] for each[string1] in all lines and print changes; works globally; use ?'in place of /' if [string*] contains a /'.
[L] r [file] (CR) : Read in or append file [file] at line [L].
u (CR) : Undo most recent substitution.
[L1],[L2] ya [buffer] (CR) : Yank lines [L1] to [L2] to named buffer [buffer]. See pu '.
[L1],[L2] d [buffer] (CR) : Delete and yanklines [L1] to [L2] to named buffer [buffer]. See pu '.
[L3] pu [buffer] (CR) : Put lines from named buffer [buffer] after line [L3]. See ya '.
g/$/d (CR) : Delete all null lines.
s/A/B/A/C/g (CR) : Illustrates the use of ' to change a stringcontaining the /' delimiter to change A/B' to A/C' globally. Return to TABLE OF CONTENTS?
vi Editor
The UNIX full screen editor vi' is a tightly designed editingsystem in which almost every letter has a function and the function isstronger for upper than lower case. However, a letter and its actualfunction are usually closely related. It is important to remember thatthe (Esc) ' escape key ends most functions anda (Esc), (Esc) 'double application certainly ends the function with the ring of a bell.The subcommand u ' undoes the last function (presumably an error).Use :q! (CR) ' to end with out saving, especially in hopelesssituations. Use :wq (CR) ' to resave and end ZZ ' alsoresaves and ends, but will not resave if the file has been saved inanother file and no further changes have been made, or :w (CR) 'to only resave. The character :' prompts the UNIX line editor ex'which you can think of as being embedded in vi'. Some of the abovecritical vi' subcommands are repeated below with others. Most vi'subcommands are not displayed when used and do not take a carriagereturn (CR) '. The fact that most keys have a meaning both assingle characters and as concatenations of several characters has manybenefits, but has disadvantages in that mistakes can turnout to be catastrophic. Remember that (Esc), (Esc), u ' keysequence! WARNING: VI' is disabled during an IBM Telnetsession. W Command Unix
(Esc) : End a command; especially used with insert i', append a' or replace'R'.
(Esc), (Esc) : Ensured end of a command with bell; press the Escape-keytwice; use it.
u : Undoes last command; usually used after (Esc)' or(Esc), (Esc)'; if undoing isworse then repeat u' again to undo the undoing.
:set all (CR) : Display all vi options.Use this ex command when your initial vi session is poor.Customized options are placed in the.exrc' ex resource configuration profile.
:w (CR) : Save or resave the default file being edited, but do not end.
:w [file] (CR) : Save into a new file [file], but do not end.
:w! [file] (CR) : Save or resave into an existing file [file], but do not end.
:q (CR) : Quit vi without saving, provided no changes have been made since thelast save.
:q! (CR) : Quit vi without saving, living the file as it was in the last save.
:wq (CR) : Save the default file being edited, and quit.
ZZ : Save the edited file, provided not changes have been made since thelast save of the edited file to any file, and quit vi'. Warning: if you just saved the editedfile into any other file, the file will NOT be resaved. :wq (CR) is much safer to use.
h or j or k or l : The arrow keys, such thateach take a number prefix that moves the cursor that many times.
(CR) : moves cursor a line forward; + ' also does.
-- : Moves cursor a line backward.
[N] (CR) : Moves cursor [N] lines forwards.
[N]-- : Moves cursor [N] lines backwards.
Ctrl-f : Moves cursor a page forward.
Ctrl-b : Moves cursor a page backward.
Ctrl-d : Moves cursor a half page down.
Ctrl-u : Moves cursor a half page up.
[L]G : Go to line [L]. 1G ' moves the cursor to the beginning of thefile (BOF).
G : Go to the last line just before the end of file (EOF) mark. $G ' does the same thing.
0 : Go to beginning of the line (BOL).
: Go to beginning of the nonblank part of the line (BOL).
: Got to first nonblank character on a line.
$ : Go to end of the line (EOL).
[N] : Go to column [N] of the current line.
: Find the matching parenthesis.
/[string] (CR) : Find the next occurrence of [string]' forwards. Use n 'to repeat, or N ' to search backwards.
?[string] (CR) : Find the next occurrence of [string]' backwards.
n : Repeat last /[string] (CR) ' or ?[string] (CR) ';think of the fileas being wrapped around from end to beginning, so that when you returnto the start you know that you have found all occurrences.
N : Repeat last /[string] (CR) ' or ?[string] (CR) ',but in reverse.
. : Repeat last change. This is best used along with the repeat search n ' or N '.
i[string](Esc) : Insert a string [string]'before current character at the cursor; the subcommandi' itself and other subcommands are not displayed; a (CR) 'in the stringduring the insert is used to continue input on additional lines;end with the escape key (Esc)' or (Esc), (Esc)'.
o[string](Esc) : Opens a new line below the current line for insertion of string[string]'; end with (Esc)' or (Esc), (Esc)';use for POWER TYPING input for an old or new file; O[string](Esc) 'opens a new line above the current line for insertion.
I[string](Esc) : Insert a string at the beginning of the current line (BOL),else is like insert i';a (CR) ' in the stringduring the insert is used to continue input on additional lines;end with (Esc)' or (Esc), (Esc)'.
J : Joins next line to current line.
a[string](Esc) : Appends a string [string]'following the current character at the cursor,else it works like insert i'; use (CR) ' in the stringto continue inputonto new lines; end with (Esc)'; also use for POWER TYPING.
A[string](Esc) : Appends a string [string]'at the end of a line (EOL), works like i' or a'; use (CR) ' in the stringto continue input onto new lines; end with (Esc)';also use for POWER TYPING.
r[C](SPACE) : Replace a single character over the cursor by the singlecharacter [C]; finalize with the Space-bar .
R[string](Esc) : Replace a string of characters by [string]' in until (Esc)' istyped to end.
s[string](Esc) : Substitutes the string [string]' for the single character at thecursor. The multiple form [N]s[string](Esc) ' substitutes [string]' for the [N]'characters starting at the cursor.
x : Delete the current character at the cursor.
d(SPACE) : Deletes a single character. [N]d(SPACE) ' deletes [N]'characters.
dd : Deletes the current line. [N]dd ' deletes [N]' lines.
D : Deletes from the cursor to the end of line (EOL).
dw : Deletes the current word; [N]dw ' deletes [N]' words.
w : Move cursor to the beginning of the next word. [N]w 'moves the cursor [N]' words forward. [N]b ' moves it [N]' wordsbackward. [N]e ' moves it to the end of the word.
[N]y(SPACE) : Yanks [N]' characters starting at the cursor and puts them intothe default buffer. [N]yy ' yanks [N]' lines.
p : Puts the current contents of the default buffer after the cursorif characters or after the current line if lines.Helpful to use right after a characteryank y' or a character delete d' or a line yank yy' or a linedelete dd',along with a search /[string](CR) ' or repeat search n '.and a repeat change . '. P ' puts the contents of the default buffer before the currentline.
'b[N]Y : Yank [N] lines starting with the current line to the buffer labeled b;the double quote 'is used to avoid an id conflict with subcommand names;any letter other than x' can be used to name the buffer;safer than the lineyank yy ' because it is very easy to accidentallychange the default buffer.
'b[N]dd : Deletes [N] lines starting with the current line to the bufferlabeled b'.
'bp : Put back lines from the buffer labeled b'after or below the cursor;use after a yank or delete to a labeled bufferto move groups of lines from one location to another.
'bP : Put back lines from the buffer labeled b'before or above the cursor;use after a yank or delete to a labeled bufferto move groups of lines from one location to another. Some ex' editor commands that are useful in vi'follow the :' prompt. See the previous section on ex' for morecommands.
:nu (CR) : Number current line.
:[L1],[L2] d (CR) : Deletes lines [L1]' to [L2]'.
:[L1],[L2] m [L3] (CR) : Move lines [L1]' to [L2]' to after line [L3]'.
:[L1],[L2] t [L3] (CR) : Take [copy] lines [L1]' to [L2] to [L3]'; destination[L3]' can not be in [L1]' to [L2]-1'.
:[L1],[L2]s/[string1]/[string2]/g (CR) : Substitute [string2]' for all [string1]' in lines [L1]' to [L2]'only.
:s/[string1]/[string2]/gp (CR) : Substitute [string2]' for all [string1]' incurrent line only and print change(s).
:g/[string1]/s//[string2]/gp (CR) : Globally substitute [string2]' for each[string1]' in all lines and print changes; works globally; use ?'in place of /' if [string*]' contains a /'.
:[L]r [file] (CR) : Append file [file] at line [L]'. Return to TABLE OF CONTENTS?
Web Source: http://www.math.uic.edu/hanson/UNIX/UnixDictionary.html What Does Command W Do On A Mac
Email Comments or Questions tohanson@uic.edu