neulab/tldr huggingface dataset:
Use this option to integrate changes from the upstream subproject with your submodule’s current HEAD. Alternatively, you can run git pull from the submodule, which is equivalent except for the remote branch name: update --remote uses the default upstream repository and submodule.<name>.branch, while git pull uses the submodule’s branch.<name>.merge. Prefer submodule.<name>.branch if you want to distribute the default upstream branch with the superproject and branch.<name>.merge if you want a more native feel while working in the submodule itself.
-N, --no-fetch This option is only valid for the update command. Don’t fetch new objects from the remote site.
--checkout This option is only valid for the update command. Checkout the commit recorded in the superproject on a detached HEAD in the submodule. This is the default behavior, the main use of this option is to override submodule.$name.update when set to a value other than checkout. If the key submodule.$name.update is either not explicitly set or set to checkout, this option is implicit.
--merge This option is only valid for the update command. Merge the commit recorded in the superproject into the current branch of the submodule. If this option is given, the submodule’s HEAD will not be detached. If a merge failure prevents this process, you will have to resolve the resulting conflicts within the submodule with the usual conflict resolution tools. If the key submodule.$name.update is set to merge, this option is implicit.
--rebase This option is only valid for the update command. Rebase the current branch onto the commit recorded in the superproject. If this option is given, the submodule’s HEAD will not be detached. If a merge failure prevents this process, you will have to resolve these failures with git-rebase(1). If the key submodule.$name.update is set to rebase, this option is implicit.
--init This option is only valid for the update command. Initialize all submodules for which "git submodule init" has not been called so far before updating.
--name This option is only valid for the add command. It sets the submodule’s name to the given string instead of defaulting to its path. The name must be valid as a directory name and may not end with a /.
--reference <repository> This option is only valid for add and update commands. These commands sometimes need to clone a remote repository. In this case, this option will be passed to the git-clone(1) command.
NOTE: Do not use this option unless you have read the note for git- clone(1)'s --reference, --shared, and --dissociate options carefully.
--dissociate This option is only valid for add and update commands. These commands sometimes need to clone a remote repository. In this case, this option will be passed to the git-clone(1) command.
NOTE: see the NOTE for the --reference option.
--recursive This option is only valid for foreach, update, status and sync commands. Traverse submodules recursively. The operation is performed not only in the submodules of the current repo, but also in any nested submodules inside those submodules (and so on).
--depth This option is valid for add and update commands. Create a shallow clone with a history truncated to the specified number of revisions. See git-clone(1)
--[no-]recommend-shallow This option is only valid for the update command. The initial clone of a submodule will use the recommended submodule.<name>.shallow as provided by the .gitmodules file by default. To ignore the suggestions use --no-recommend-shallow.
-j <n>, --jobs <n> This option is only valid for the update command. Clone new submodules in parallel with as many jobs. Defaults to the submodule.fetchJobs option.
--[no-]single-branch This option is only valid for the update command. Clone only one branch during update: HEAD or one specified by --branch.
<path>... Paths to submodule(s). When specified this will restrict the command to only operate on the submodules found at the specified paths. (This argument is required with add).
When initializing submodules, a .gitmodules file in the top-level directory of the containing repository is used to find the url of each submodule. This file should be formatted in the same way as $GIT_DIR/config. The key to each submodule url is "submodule.$name.url". See gitmodules(5) for details.
gitsubmodules(7), gitmodules(5).
DUMPE2FS(8)                  System Manager's Manual                 DUMPE2FS(8)
dumpe2fs - dump ext2/ext3/ext4 file system information
dumpe2fs [ -bfghixV ] [ -o superblock=superblock ] [ -o blocksize=blocksize ] device
dumpe2fs prints the super block and blocks group information for the file system present on device.
Note: When used with a mounted file system, the printed information may be old or inconsistent.
-b     print the blocks which are reserved as bad in the file system.
-o superblock=superblock use the block superblock when examining the file system.  This option is not usually needed except by a file system wizard who is examining the remains of a very badly corrupted file system.
-o blocksize=blocksize use blocks of blocksize bytes when examining the file system. This option is not usually needed except by a file system wizard who is examining the remains of a very badly corrupted file system.
-f     force dumpe2fs to display a file system even though it may have some file system feature flags which dumpe2fs may not understand (and which can cause some of dumpe2fs's display to be suspect).
-g     display the group descriptor information in a machine readable colon-separated value format.  The fields displayed are the group number; the number of the first block in the group; the superblock location (or -1 if not present); the range of blocks used by the group descriptors (or -1 if not present); the block bitmap location; the inode bitmap location; and the range of blocks used by the inode table.
-h     only display the superblock information and not any of the block group descriptor detail information.
-i     display the file system data from an image file created by e2image, using device as the pathname to the image file.
-m     If the mmp feature is enabled on the file system, check if device is in use by another node, see e2mmpstatus(8) for full details. If used together with the -i option, only the MMP block information is printed.
-x     print the detailed group information block numbers in hexadecimal format
-V     print the version number of dumpe2fs and exit.
dumpe2fs exits with a return code of 0 if the operation completed without errors.  It will exit with a non-zero return code if there are any errors, such as problems reading a valid superblock, bad checksums, or if the device is in use by another node and -m is specified.
You may need to know the physical file system structure to understand the output.
dumpe2fs was written by Remy Card <Remy.Card@linux.org>.  It is currently being maintained by Theodore Ts'o <tytso@alum.mit.edu>.
dumpe2fs is part of the e2fsprogs package and is available from http://e2fsprogs.sourceforge.net.
e2fsck(8), e2mmpstatus(8), mke2fs(8), tune2fs(8).  ext4(5)
phpstorm(1)                BSD General Commands Manual               phpstorm(1)
phpstorm â€” launch JetBrains PhpStorm Integrated Development Environment
phpstorm [jvm-args]
phpstorm starts up the JetBrains PhpStorm Integrated Development Environment.
The web site https://www.jetbrains.com/phpstorm/ .
ZGREP(1)                     General Commands Manual                    ZGREP(1)
zgrep - search possibly compressed files for a regular expression
zgrep [ grep_options ] [ -e ] pattern filename...
The zgrep command invokes grep on compressed or gzipped files.  All options specified are passed directly to grep.  If no file is specified, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
Exit status is 0 for a match, 1 for no matches, and 2 if trouble.
The following grep options are not supported: --dereference-recursive (-R), --directories (-d), --exclude, --exclude-from, --exclude-dir, --include, --null (-Z), --null-data (-z), and --recursive (-r).
Charles Levert (charles@comm.polymtl.ca)
grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)
IPTABLES(8)                      iptables 1.8.7                      IPTABLES(8)
iptables/ip6tables â€” administration tool for IPv4/IPv6 packet filtering and NAT
iptables [-t table] {-A|-C|-D} chain rule-specification
ip6tables [-t table] {-A|-C|-D} chain rule-specification
iptables [-t table] -I chain [rulenum] rule-specification
iptables [-t table] -R chain rulenum rule-specification
iptables [-t table] -D chain rulenum
iptables [-t table] -S [chain [rulenum]]
iptables [-t table] {-F|-L|-Z} [chain [rulenum]] [options...]
iptables [-t table] -N chain
iptables [-t table] -X [chain]
iptables [-t table] -P chain target
iptables [-t table] -E old-chain-name new-chain-name
rule-specification = [matches...] [target]
match = -m matchname [per-match-options]
target = -j targetname [per-target-options]
Iptables and ip6tables are used to set up, maintain, and inspect the tables of IPv4 and IPv6 packet filter rules in the Linux kernel.  Several different tables may be defined.  Each table contains a number of built- in chains and may also contain user-defined chains.
Each chain is a list of rules which can match a set of packets.  Each rule specifies what to do with a packet that matches.  This is called a `target', which may be a jump to a user-defined chain in the same table.
A firewall rule specifies criteria for a packet and a target.  If the packet does not match, the next rule in the chain is examined; if it does match, then the next rule is specified by the value of the target, which can be the name of a user-defined chain, one of the targets described in iptables-extensions(8), or one of the special values ACCEPT, DROP or RETURN.
ACCEPT means to let the packet through.  DROP means to drop the packet on the floor.  RETURN means stop traversing this chain and resume at the next rule in the previous (calling) chain.  If the end of a built-in chain is reached or a rule in a built-in chain with target RETURN is matched, the target specified by the chain policy determines the fate of the packet.
There are currently five independent tables (which tables are present at any time depends on the kernel configuration options and which modules are present).
-t, --table table This option specifies the packet matching table which the command should operate on.  If the kernel is configured with automatic module loading, an attempt will be made to load the appropriate module for that table if it is not already there.
The tables are as follows:
filter: This is the default table (if no -t option is passed). It contains the built-in chains INPUT (for packets destined to local sockets), FORWARD (for packets being routed through the box), and OUTPUT (for locally-generated packets).
nat: This table is consulted when a packet that creates a new connection is encountered.  It consists of four built-ins: PREROUTING (for altering packets as soon as they come in), INPUT (for altering packets destined for local sockets), OUTPUT (for altering locally-generated packets before routing), and POSTROUTING (for altering packets as they are about to go out).  IPv6 NAT support is available since kernel 3.7.
mangle: This table is used for specialized packet alteration.  Until kernel 2.4.17 it had two built-in chains: PREROUTING (for altering incoming packets before routing) and OUTPUT (for altering locally-generated packets before routing).  Since kernel 2.4.18, three other built-in chains are also supported: INPUT (for packets coming into the box itself), FORWARD (for altering packets being routed through the box), and POSTROUTING (for altering packets as they are about to go out).
raw: This table is used mainly for configuring exemptions from connection tracking in combination with the NOTRACK target. It registers at the netfilter hooks with higher priority and is thus called before ip_conntrack, or any other IP tables. It provides the following built-in chains: PREROUTING (for packets arriving via any network interface) OUTPUT (for packets generated by local processes)
security: This table is used for Mandatory Access Control (MAC) networking rules, such as those enabled by the SECMARK and CONNSECMARK targets.  Mandatory Access Control is implemented by Linux Security Modules such as SELinux.  The security table is called after the filter table, allowing any Discretionary Access Control (DAC) rules in the filter table to take effect before MAC rules.  This table provides the following built-in chains: INPUT (for packets coming into the box itself), OUTPUT (for altering locally-generated packets before routing), and FORWARD (for altering packets being routed through the box).
The options that are recognized by iptables and ip6tables can be divided into several different groups.
COMMANDS These options specify the desired action to perform. Only one of them can be specified on the command line unless otherwise stated below. For long versions of the command and option names, you need to use only enough letters to ensure that iptables can differentiate it from all other options.
-A, --append chain rule-specification Append one or more rules to the end of the selected chain.  When the source and/or destination names resolve to more than one address, a rule will be added for each possible address combination.
-C, --check chain rule-specification Check whether a rule matching the specification does exist in the selected chain. This command uses the same logic as -D to find a matching entry, but does not alter the existing iptables configuration and uses its exit code to indicate success or failure.
-D, --delete chain rule-specification -D, --delete chain rulenum Delete one or more rules from the selected chain.  There are two versions of this command: the rule can be specified as a number in the chain (starting at 1 for the first rule) or a rule to match.
-I, --insert chain [rulenum] rule-specification Insert one or more rules in the selected chain as the given rule number.  So, if the rule number is 1, the rule or rules are inserted at the head of the chain.  This is also the default if no rule number is specified.
-R, --replace chain rulenum rule-specification Replace a rule in the selected chain.  If the source and/or destination names resolve to multiple addresses, the command will fail.  Rules are numbered starting at 1.
-L, --list [chain] List all rules in the selected chain.  If no chain is selected, all chains are listed. Like every other iptables command, it applies to the specified table (filter is the default), so NAT rules get listed by iptables -t nat -n -L Please note that it is often used with the -n option, in order to avoid long reverse DNS lookups.  It is legal to specify the -Z (zero) option as well, in which case the chain(s) will be atomically listed and zeroed.  The exact output is affected by the other arguments given. The exact rules are suppressed until you use iptables -L -v or iptables-save(8).
-S, --list-rules [chain] Print all rules in the selected chain.  If no chain is selected, all chains are printed like iptables-save. Like every other iptables command, it applies to the specified table (filter is the default).
-F, --flush [chain] Flush the selected chain (all the chains in the table if none is given).  This is equivalent to deleting all the rules one by one.
-Z, --zero [chain [rulenum]] Zero the packet and byte counters in all chains, or only the given chain, or only the given rule in a chain. It is legal to specify the -L, --list (list) option as well, to see the counters immediately before they are cleared. (See above.)
-N, --new-chain chain Create a new user-defined chain by the given name.  There must be no target of that name already.
-X, --delete-chain [chain] Delete the optional user-defined chain specified.  There must be no references to the chain.  If there are, you must delete or replace the referring rules before the chain can be deleted.  The chain must be empty, i.e. not contain any rules.  If no argument is given, it will attempt to delete every non-builtin chain in the table.
-P, --policy chain target Set the policy for the built-in (non-user-defined) chain to the given target.  The policy target must be either ACCEPT or DROP.
-E, --rename-chain old-chain new-chain Rename the user specified chain to the user supplied name.  This is cosmetic, and has no effect on the structure of the table.
-h     Help.  Give a (currently very brief) description of the command syntax.
PARAMETERS The following parameters make up a rule specification (as used in the add, delete, insert, replace and append commands).
-4, --ipv4 This option has no effect in iptables and iptables-restore.  If a rule using the -4 option is inserted with (and only with) ip6tables-restore, it will be silently ignored. Any other uses will throw an error. This option allows IPv4 and IPv6 rules in a single rule file for use with both iptables-restore and ip6tables- restore.
-6, --ipv6 If a rule using the -6 option is inserted with (and only with) iptables-restore, it will be silently ignored. Any other uses will throw an error. This option allows IPv4 and IPv6 rules in a single rule file for use with both iptables-restore and ip6tables- restore.  This option has no effect in ip6tables and ip6tables- restore.
[!] -p, --protocol protocol The protocol of the rule or of the packet to check.  The specified protocol can be one of tcp, udp, udplite, icmp, icmpv6,esp, ah, sctp, mh or the special keyword "all", or it can be a numeric value, representing one of these protocols or a different one.  A protocol name from /etc/protocols is also allowed.  A "!" argument before the protocol inverts the test.  The number zero is equivalent to all. "all" will match with all protocols and is taken as default when this option is omitted.  Note that, in ip6tables, IPv6 extension headers except esp are not allowed.  esp and ipv6-nonext can be used with Kernel version 2.6.11 or later. The number zero is equivalent to all, which means that you cannot test the protocol field for the value 0 directly. To match on a HBH header, even if it were the last, you cannot use -p 0, but always need -m hbh.
[!] -s, --source address[/mask][,...] Source specification. Address can be either a network name, a hostname, a network IP address (with /mask), or a plain IP address. Hostnames will be resolved once only, before the rule is submitted to the kernel.  Please note that specifying any name to be resolved with a remote query such as DNS is a really bad idea. The mask can be either an ipv4 network mask (for iptables) or a plain number, specifying the number of 1's at the left side of the network mask.  Thus, an iptables mask of 24 is equivalent to 255.255.255.0.  A "!" argument before the address specification inverts the sense of the address. The flag --src is an alias for this option.  Multiple addresses can be specified, but this will expand to multiple rules (when adding with -A), or will cause multiple rules to be deleted (with -D).
[!] -d, --destination address[/mask][,...] Destination specification.  See the description of the -s (source) flag for a detailed description of the syntax.  The flag --dst is an alias for this option.
-m, --match match Specifies a match to use, that is, an extension module that tests for a specific property. The set of matches make up the condition under which a target is invoked. Matches are evaluated first to last as specified on the command line and work in short-circuit fashion, i.e. if one extension yields false, evaluation will stop.
-j, --jump target This specifies the target of the rule; i.e., what to do if the packet matches it.  The target can be a user-defined chain (other than the one this rule is in), one of the special builtin targets which decide the fate of the packet immediately, or an extension (see EXTENSIONS below).  If this option is omitted in a rule (and -g is not used), then matching the rule will have no effect on the packet's fate, but the counters on the rule will be incremented.
-g, --goto chain This specifies that the processing should continue in a user specified chain. Unlike the --jump option return will not continue processing in this chain but instead in the chain that called us via --jump.
[!] -i, --in-interface name Name of an interface via which a packet was received (only for packets entering the INPUT, FORWARD and PREROUTING chains).  When the "!" argument is used before the interface name, the sense is inverted.  If the interface name ends in a "+", then any interface which begins with this name will match.  If this option is omitted, any interface name will match.
[!] -o, --out-interface name Name of an interface via which a packet is going to be sent (for packets entering the FORWARD, OUTPUT and POSTROUTING chains). When the "!" argument is used before the interface name, the sense is inverted.  If the interface name ends in a "+", then any interface which begins with this name will match.  If this option is omitted, any interface name will match.
[!] -f, --fragment This means that the rule only refers to second and further IPv4 fragments of fragmented packets.  Since there is no way to tell the source or destination ports of such a packet (or ICMP type), such a packet will not match any rules which specify them.  When the "!" argument precedes the "-f" flag, the rule will only match head fragments, or unfragmented packets. This option is IPv4 specific, it is not available in ip6tables.
-c, --set-counters packets bytes This enables the administrator to initialize the packet and byte counters of a rule (during INSERT, APPEND, REPLACE operations).
OTHER OPTIONS The following additional options can be specified:
-v, --verbose Verbose output.  This option makes the list command show the interface name, the rule options (if any), and the TOS masks.  The packet and byte counters are also listed, with the suffix 'K', 'M' or 'G' for 1000, 1,000,000 and 1,000,000,000 multipliers respectively (but see the -x flag to change this).  For appending, insertion, deletion and replacement, this causes detailed information on the rule or rules to be printed. -v may be specified multiple times to possibly emit more detailed debug statements.
-w, --wait [seconds] Wait for the xtables lock.  To prevent multiple instances of the program from running concurrently, an attempt will be made to obtain an exclusive lock at launch.  By default, the program will exit if the lock cannot be obtained.  This option will make the program wait (indefinitely or for optional seconds) until the exclusive lock can be obtained.
-W, --wait-interval microseconds Interval to wait per each iteration.  When running latency sensitive applications, waiting for the xtables lock for extended durations may not be acceptable. This option will make each iteration take the amount of time specified. The default interval is 1 second. This option only works with -w.
-n, --numeric Numeric output.  IP addresses and port numbers will be printed in numeric format.  By default, the program will try to display them as host names, network names, or services (whenever applicable).
-x, --exact Expand numbers.  Display the exact value of the packet and byte counters, instead of only the rounded number in K's (multiples of 1000) M's (multiples of 1000K) or G's (multiples of 1000M).  This option is only relevant for the -L command.
--line-numbers When listing rules, add line numbers to the beginning of each rule, corresponding to that rule's position in the chain.
--modprobe=command When adding or inserting rules into a chain, use command to load any necessary modules (targets, match extensions, etc).
iptables uses the /run/xtables.lock file to take an exclusive lock at launch.
The XTABLES_LOCKFILE environment variable can be used to override the default setting.
iptables can use extended packet matching and target modules.  A list of these is available in the iptables-extensions(8) manpage.
Various error messages are printed to standard error.  The exit code is 0 for correct functioning.  Errors which appear to be caused by invalid or abused command line parameters cause an exit code of 2, and other errors cause an exit code of 1.
Bugs?  What's this? ;-) Well, you might want to have a look at http://bugzilla.netfilter.org/
This iptables is very similar to ipchains by Rusty Russell.  The main difference is that the chains INPUT and OUTPUT are only traversed for packets coming into the local host and originating from the local host respectively.  Hence every packet only passes through one of the three chains (except loopback traffic, which involves both INPUT and OUTPUT chains); previously a forwarded packet would pass through all three.
The other main difference is that -i refers to the input interface; -o refers to the output interface, and both are available for packets entering the FORWARD chain.
The various forms of NAT have been separated out; iptables is a pure packet filter when using the default `filter' table, with optional extension modules.  This should simplify much of the previous confusion over the combination of IP masquerading and packet filtering seen previously.  So the following options are handled differently: -j MASQ -M -S -M -L There are several other changes in iptables.
iptables-apply(8), iptables-save(8), iptables-restore(8), iptables-extensions(8),
The packet-filtering-HOWTO details iptables usage for packet filtering, the NAT-HOWTO details NAT, the netfilter-extensions-HOWTO details the extensions that are not in the standard distribution, and the netfilter- hacking-HOWTO details the netfilter internals. See http://www.netfilter.org/.
Rusty Russell originally wrote iptables, in early consultation with Michael Neuling.
Marc Boucher made Rusty abandon ipnatctl by lobbying for a generic packet selection framework in iptables, then wrote the mangle table, the owner match, the mark stuff, and ran around doing cool stuff everywhere.
James Morris wrote the TOS target, and tos match.
Jozsef Kadlecsik wrote the REJECT target.
Harald Welte wrote the ULOG and NFQUEUE target, the new libiptc, as well as the TTL, DSCP, ECN matches and targets.
The Netfilter Core Team is: Jozsef Kadlecsik, Pablo Neira Ayuso, Eric Leblond, Florian Westphal and  Arturo Borrero Gonzalez.  Emeritus Core Team members are: Marc Boucher, Martin Josefsson, Yasuyuki Kozakai, James Morris, Harald Welte and Rusty Russell.
Man page originally written by Herve Eychenne <rv@wallfire.org>.
This manual page applies to iptables/ip6tables 1.8.7.
EX(1)                             User Commands                            EX(1)
ex, edit - text editor
ex [-c command|+command] [-r [filename]] [-s|-] [-t tagstring] [-w size] [-lLRvV] [file ...]
edit [-c command|+command] [-r [filename]] [-s|-] [-t tagstring] [-w size] [-lLRvV] [file ...]
Ex is the root of a family of editors: edit, ex and vi.  Ex is a superset of ed, with the most notable extension being a display editing facility. Display based editing on CRT terminals is the focus of vi.
For those who have not used ed, or for casual users, the editor edit may be convenient.  It avoids some of the complexities of ex used mostly by systems programmers and persons very familiar with ed.
-v     Start in visual mode even if called as ex.
File manipulation Ex is normally editing the contents of a single file, whose name is recorded in the current file name.  Ex performs all editing actions in a buffer (actually a temporary file) into which the text of the file is initially read.  Changes made to the buffer have no effect on the file being edited unless and until the buffer contents are written out to the file with a write command.  After the buffer contents are written, the previous contents of the written file are no longer accessible.  When a file is edited, its name becomes the current file name, and its contents are read into the buffer.
The current file is almost always considered to be edited.  This means that the contents of the buffer are logically connected with the current file name, so that writing the current buffer contents onto that file, even if it exists, is a reasonable action.  If the current file is not edited then ex will not normally write on it if it already exists.
For saving blocks of text while editing, and especially when editing more than one file, ex has a group of named buffers.  These are similar to the normal buffer, except that only a limited number of operations are available on them.  The buffers have names a through z.
Exceptional Conditions When errors occur ex (optionally) rings the terminal bell and, in any case, prints an error diagnostic.  If the primary input is from a file, editor processing will terminate.  If an interrupt signal is received, ex prints “Interrupt” and returns to its command level.  If the primary input is a file, then ex will exit when this occurs.
If a hangup signal is received and the buffer has been modified since it was last written out, or if the system crashes, either the editor (in the first case) or the system (after it reboots in the second) will attempt to preserve the buffer.  The next time the user logs in he should be able to recover the work he was doing, losing at most a few lines of changes from the last point before the hangup or editor crash.  To recover a file one can use the -r option.  If one was editing the file resume, then he should change to the directory where he were when the crash occurred, giving the command
ex -r resume
After checking that the retrieved file is indeed ok, he can write it over the previous contents of that file.
The user will normally get mail from the system telling him when a file has been saved after a crash.  The command
ex -r
will print a list of the files which have been saved for the user.
Editing modes Ex has five distinct modes.  The primary mode is command mode.  Commands are entered in command mode when a `:' prompt is present, and are executed each time a complete line is sent.  In text input mode ex gathers input lines and places them in the file.  The append, insert, and change commands use text input mode.  No prompt is printed when in text input mode.  This mode is left by typing a `.' alone at the beginning of a line, and command mode resumes.
The last three modes are open and visual modes, entered by the commands of the same name, and, within open and visual modes text insertion mode. Open and visual modes allow local editing operations to be performed on the text in the file.  The open command displays one line at a time on any terminal while visual works on CRT terminals with random positioning cursors, using the screen as a (single) window for file editing changes. These modes are described (only) in An Introduction to Display Editing with Vi.
Command structure Most command names are English words, and initial prefixes of the words are acceptable abbreviations.  The ambiguity of abbreviations is resolved in favor of the more commonly used commands.
Most commands accept prefix addresses specifying the lines in the file upon which they are to have effect.  The forms of these addresses will be discussed below.  A number of commands also may take a trailing count specifying the number of lines to be involved in the command.  Thus the command “10p” will print the tenth line in the buffer while “delete 5” will delete five lines from the buffer, starting with the current line.
Some commands take other information or parameters, this information always being given after the command name.
A number of commands have two distinct variants.  The variant form of the command is invoked by placing an `!' immediately after the command name. Some of the default variants may be controlled by options; in this case, the `!' serves to toggle the default.
The characters `#', `p' and `l' may be placed after many commands (A `p' or `l' must be preceded by a blank or tab except in the single special case `dp').  In this case, the command abbreviated by these characters is executed after the command completes.  Since ex normally prints the new current line after each change, `p' is rarely necessary.  Any number of `+' or `-' characters may also be given with these flags.  If they appear, the specified offset is applied to the current line value before the printing command is executed.
It is possible to give editor commands which are ignored.  This is useful when making complex editor scripts for which comments are desired.  The comment character is the double quote: ".  Any command line beginning with " is ignored.  Comments beginning with " may also be placed at the ends of commands, except in cases where they could be confused as part of text (shell escapes and the substitute and map commands).
More than one command may be placed on a line by separating each pair of commands by a `|' character.  However the global commands, comments, and the shell escape `!'  must be the last command on a line, as they are not terminated by a `|'.
Command addressing .                   The current line.  Most commands leave the current line as the last line which they affect.  The default address for most commands is the current line, thus `.' is rarely used alone as an address.
n                   The nth line in the editor's buffer, lines being numbered sequentially from 1.
$                   The last line in the buffer.
%                   An abbreviation for “1,$”, the entire buffer.
+n -n               An offset relative to the current buffer line.  The forms `.+3' `+3' and `+++' are all equivalent; if the current line is line 100 they all address line 103.
/pat/ ?pat?         Scan forward and backward respectively for a line containing pat, a regular expression (as defined below).  The scans normally wrap around the end of the buffer.  If all that is desired is to print the next line containing pat, then the trailing / or ? may be omitted.  If pat is omitted or explicitly empty, then the last regular expression specified is located.  The forms \/ and \? scan using the last regular expression used in a scan; after a substitute // and ?? would scan using the substitute's regular expression.
´´ ´x               Before each non-relative motion of the current line `.', the previous current line is marked with a tag, subsequently referred to as `´´'.  This makes it easy to refer or return to this previous context.  Marks may also be established by the mark command, using single lower case letters x and the marked lines referred to as `´x'.
Addresses to commands consist of a series of addressing primitives, separated by `,' or `;'.  Such address lists are evaluated left-to-right. When addresses are separated by `;' the current line `.'  is set to the value of the previous addressing expression before the next address is interpreted.  If more addresses are given than the command requires, then all but the last one or two are ignored.  If the command takes two addresses, the first addressed line must precede the second in the buffer.
Null address specifications are permitted in a list of addresses, the default in this case is the current line `.'; thus `,100' is equivalent to `.,100'.  It is an error to give a prefix address to a command which expects none.
Command descriptions The following form is a prototype for all ex commands:
address command ! parameters count flags
All parts are optional; the degenerate case is the empty command which prints the next line in the file.  For sanity with use from within visual mode, ex ignores a “:” preceding any command.
In the following command descriptions, the default addresses are shown in parentheses, which are not, however, part of the command.
abbreviate word rhs abbr: ab Add the named abbreviation to the current list.  When in input mode in visual, if word is typed as a complete word, it will be changed to rhs .
( . ) append   abbr: a text . Reads the input text and places it after the specified line. After the command, `.'  addresses the last line input or the specified line if no lines were input.  If address `0' is given, text is placed at the beginning of the buffer.
a! text . The variant flag to append toggles the setting for the autoindent option during the input of text.
args   The members of the argument list are printed, with the current argument delimited by `[' and `]'.
cd directory The cd command is a synonym for chdir.
( . , . ) change count   abbr: c text . Replaces the specified lines with the input text.  The current line becomes the last line input; if no lines were input it is left as for a delete.
c! text . The variant toggles autoindent during the change.
chdir directory The specified directory becomes the current directory.  If no directory is specified, the current value of the home option is used as the target directory.  After a chdir the current file is not considered to have been edited so that write restrictions on pre-existing files apply.
( . , . )copy addr flags abbr: co A copy of the specified lines is placed after addr, which may be `0'.  The current line `.'  addresses the last line of the copy. The command t is a synonym for copy.
( . , . )delete buffer count flags abbr: d Removes the specified lines from the buffer.  The line after the last line deleted becomes the current line; if the lines deleted were originally at the end, the new last line becomes the current line.  If a named buffer is specified by giving a letter, then the specified lines are saved in that buffer, or appended to it if an upper case letter is used.
edit file abbr: e ex file Used to begin an editing session on a new file.  The editor first checks to see if the buffer has been modified since the last write command was issued.  If it has been, a warning is issued and the command is aborted.  The command otherwise deletes the entire contents of the editor buffer, makes the named file the current file and prints the new filename.  After insuring that this file is sensible (i.e., that it is not a binary file such as a directory, a block or character special file other than /dev/tty, a terminal, or a binary or executable file), the editor reads the file into its buffer.
If the read of the file completes without error, the number of lines and characters read is typed.  Any null characters in the file are discarded.  If none of these errors occurred, the file is considered edited.  If the last line of the input file is missing the trailing newline character, it will be supplied and a complaint will be issued.  This command leaves the current line `.' at the last line read.  If executed from within open or visual, the current line is initially the first line of the file.
e! file The variant form suppresses the complaint about modifications having been made and not written from the editor buffer, thus discarding all changes which have been made before editing the new file.
e +n file Causes the editor to begin at line n rather than at the last line; n may also be an editor command containing no spaces, e.g.: “+/pat”.
file abbr: f Prints the current file name, whether it has been `[Modified]' since the last write command, whether it is read only , the current line, the number of lines in the buffer, and the percentage of the way through the buffer of the current line.  In the rare case that the current file is `[Not edited]' this is noted also; in this case one has to use the form w! to write to the file, since the editor is not sure that a write will not destroy a file unrelated to the current contents of the buffer.
file file The current file name is changed to file which is considered `[Not edited]'.
( 1 , $ ) global /pat/ cmds   abbr: g First marks each line among those specified which matches the given regular expression.  Then the given command list is executed with `.' initially set to each marked line.
The command list consists of the remaining commands on the current input line and may continue to multiple lines by ending all but the last such line with a `\'.  If cmds (and possibly the trailing / delimiter) is omitted, each line matching pat is printed. Append, insert, and change commands and associated input are permitted; the `.' terminating input may be omitted if it would be on the last line of the command list.  Open and visual commands are permitted in the command list and take input from the terminal.
The global command itself may not appear in cmds.  The undo command is also not permitted there, as undo instead can be used to reverse the entire global command.  The options autoprint and autoindent are inhibited during a global, (and possibly the trailing / delimiter) and the value of the report option is temporarily infinite, in deference to a report for the entire global.  Finally, the context mark `´´' is set to the value of `.' before the global command begins and is not changed during a global command, except perhaps by an open or visual within the global.
g! /pat/ cmds  abbr: v The variant form of global runs cmds at each line not matching pat.
( . )insert    abbr: i text . Places the given text before the specified line.  The current line is left at the last line input; if there were none input it is left at the line before the addressed line.  This command differs from append only in the placement of text.
i! text . The variant toggles autoindent during the insert.
( . , .+1 ) join count flags  abbr: j Places the text from a specified range of lines together on one line.  White space is adjusted at each junction to provide at least one blank character, two if there was a `.' at the end of the line, or none if the first following character is a `)'.  If there is already white space at the end of the line, then the white space at the start of the next line will be discarded.
j!     The variant causes a simpler join with no white space processing; the characters in the lines are simply concatenated.
( . ) k x The k command is a synonym for mark.  It does not require a blank or tab before the following letter.
( . , . ) list count flags Prints the specified lines in a more unambiguous way: tabs are printed as `^I' and the end of each line is marked with a trailing `$'.  The current line is left at the last line printed.
map[!] lhs rhs The map command is used to define macros for use in visual command mode.  Lhs should be a single character, or the sequence “#n”, for n a digit, referring to function key n.  When this character or function key is typed in visual mode, it will be as though the corresponding rhs had been typed.  On terminals without function keys, the user can type “#n”.  If the `!' character follows the command name, the mapping is interpreted in input mode.  See section 6.9 of the “Introduction to Display Editing with Vi” for more details.
( . ) mark x Gives the specified line mark x, a single lower case letter.  The x must be preceded by a blank or a tab.  The addressing form `´x' then addresses this line.  The current line is not affected by this command.
( . , . ) move addr abbr: m The move command repositions the specified lines to be after addr .  The first of the moved lines becomes the current line.
next abbr: n The next file from the command line argument list is edited.
n!     The variant suppresses warnings about the modifications to the buffer not having been written out, discarding (irretrievably) any changes which may have been made.
n filelist n +command filelist The specified filelist is expanded and the resulting list replaces the current argument list; the first file in the new list is then edited.  If command is given (it must contain no spaces), then it is executed after editing the first such file.
( . , . ) number count flags  abbr: # or nu Prints each specified line preceded by its buffer line number. The current line is left at the last line printed.
( . ) open flags    abbr: o ( . ) open /pat/ flags Enters intraline editing open mode at each addressed line.  If pat is given, then the cursor will be placed initially at the beginning of the string matched by the pattern.  To exit this mode use Q.  See An Introduction to Display Editing with Vi for more details.
preserve The current editor buffer is saved as though the system had just crashed.  This command is for use only in emergencies when a write command has resulted in an error.
( . , . )print count     abbr: p or P Prints the specified lines with non-printing characters printed as control characters `^x'; delete (octal 177) is represented as `^?'.  The current line is left at the last line printed.
( . )put buffer     abbr: pu Puts back previously deleted or yanked lines.  Normally used with delete to effect movement of lines, or with yank to effect duplication of lines.  If no buffer is specified, then the last deleted or yanked text is restored.  But no modifying commands may intervene between the delete or yank and the put, nor may lines be moved between files without using a named buffer.  By using a named buffer, text may be restored that was saved there at any previous time.
quit abbr: q Causes ex to terminate.  No automatic write of the editor buffer to a file is performed.  However, ex issues a warning message if the file has changed since the last write command was issued, and does not quit.  Ex will also issue a diagnostic if there are more files in the argument list.  Normally, the user will wish to save his changes, and he should give a write command; if he wishes to discard them, he should the q! command variant.
q!     Quits from the editor, discarding changes to the buffer without complaint.
( . ) read file     abbr: r Places a copy of the text of the given file in the editing buffer after the specified line.  If no file is given the current file name is used.  The current file name is not changed unless there is none in which case file becomes the current name.  The sensibility restrictions for the edit command apply here also.  If the file buffer is empty and there is no current name then ex treats this as an edit command.
Address `0' is legal for this command and causes the file to be read at the beginning of the buffer.  Statistics are given as for the edit command when the read successfully terminates.  After a read the current line is the last line read.  Within open and visual the current line is set to the first line read rather than the last.
( . ) read  !command Reads the output of the command command into the buffer after the specified line.  This is not a variant form of the command, rather a read specifying a command rather than a filename; a blank or tab before the ! is mandatory.
recover file Recovers file from the system save area.  Used after a accidental hangup of the phone or a system crash or preserve command.  Except when preserve is used, the user will be notified by mail when a file is saved.
rewind    abbr: rew The argument list is rewound, and the first file in the list is edited.
rew!   Rewinds the argument list discarding any changes made to the current buffer.
set parameter With no arguments, prints those options whose values have been changed from their defaults; with parameter all it prints all of the option values.
Giving an option name followed by a `?'  causes the current value of that option to be printed.  The `?' is unnecessary unless the option is Boolean valued.  Boolean options are given values either by the form `set option' to turn them on or `set nooption' to turn them off; string and numeric options are assigned via the form `set option=value'.
More than one parameter may be given to set ; they are interpreted left-to-right.
A list of options can be found below.
shell     abbr: sh A new shell is created.  When it terminates, editing resumes.
source file    abbr: so Reads and executes commands from the specified file.  Source commands may be nested.
( . , . ) substitute /pat/repl/ options count flags abbr: s On each specified line, the first instance of pattern pat is replaced by replacement pattern repl.  If the global indicator option character `g' appears, then all instances are substituted; if the confirm indication character `c' appears, then before each substitution the line to be substituted is typed with the string to be substituted marked with `^' characters.  By typing an `y' one can cause the substitution to be performed, any other input causes no change to take place.  After a substitute the current line is the last line substituted.
Lines may be split by substituting new-line characters into them. The newline in repl must be escaped by preceding it with a `\'. Other metacharacters available in pat and repl are described below.