neulab/tldr huggingface dataset:
stop   Suspends the editor, returning control to the top level shell.  If autowrite is set and there are unsaved changes, a write is done first unless the form stop !  is used.  This commands is only available where supported by the teletype driver, shell and operating system.
( . , . ) substitute options count flags     abbr: s If pat and repl are omitted, then the last substitution is repeated.  This is a synonym for the & command.
( . , . ) t addr flags The t command is a synonym for copy .
ta tag The focus of editing switches to the location of tag, switching to a different line in the current file where it is defined, or if necessary to another file.
The tags file is normally created by a program such as ctags, and consists of a number of lines with three fields separated by blanks or tabs.  The first field gives the name of the tag, the second the name of the file where the tag resides, and the third gives an addressing form which can be used by the editor to find the tag; this field is usually a contextual scan using `/pat/' to be immune to minor changes in the file.  Such scans are always performed as if nomagic was set.
The tag names in the tags file must be sorted alphabetically.
unabbreviate word   abbr: una Delete word from the list of abbreviations.
undo abbr: u Reverses the changes made in the buffer by the last buffer editing command.  Note that global commands are considered a single command for the purpose of undo (as are open and visual.)  Also, the commands write and edit which interact with the file system cannot be undone.  Undo is its own inverse.
Undo always marks the previous value of the current line `.'  as `´´'.  After an undo the current line is the first line restored or the line before the first line deleted if no lines were restored.  For commands with more global effect such as global and visual the current line regains it's pre-command value after an undo.
unmap[!] lhs The macro expansion associated by map for lhs is removed.
( 1 , $ ) v /pat/ cmds A synonym for the global command variant g!, running the specified cmds on each line which does not match pat.
version   abbr: ve Prints the current version number of the editor as well as the date the editor was last changed.
( . ) visual type count flags abbr: vi Enters visual mode at the specified line.  Type is optional and may be `-' , `^' or `.'  as in the z command to specify the placement of the specified line on the screen.  By default, if type is omitted, the specified line is placed as the first on the screen.  A count specifies an initial window size; the default is the value of the option window.  See the document An Introduction to Display Editing with Vi for more details.  To exit this mode, type Q.
visual file visual +n file From visual mode, this command is the same as edit.
( 1 , $ ) write file     abbr: w Writes changes made back to file, printing the number of lines and characters written.  Normally file is omitted and the text goes back where it came from.  If a file is specified, then text will be written to that file.  If the file does not exist it is created.  The current file name is changed only if there is no current file name; the current line is never changed.
If an error occurs while writing the current and edited file, the editor considers that there has been “No write since last change” even if the buffer had not previously been modified.
( 1 , $ ) write>> file   abbr: w>> Writes the buffer contents at the end of an existing file.
w! name Overrides the checking of the normal write command, and will write to any file which the system permits.
( 1 , $ ) w  !command Writes the specified lines into command.  Note the difference between w! which overrides checks and w  ! which writes to a command.
wq name Like a write and then a quit command.
wq! name The variant overrides checking on the sensibility of the write command, as w! does.
xit name If any changes have been made and not written to any file, writes the buffer out.  Then, in any case, quits.
( . , . )yank buffer count    abbr: ya Places the specified lines in the named buffer, for later retrieval via put.  If no buffer name is specified, the lines go to a more volatile place; see the put command description.
( .+1 ) z count Print the next count lines, default window.
( . ) z type count Prints a window of text with the specified line at the top.  If type is `-' the line is placed at the bottom; a `.' causes the line to be placed in the center.  A count gives the number of lines to be displayed rather than double the number specified by the scroll option.  On a CRT the screen is cleared before display begins unless a count which is less than the screen size is given. The current line is left at the last line printed.  Forms `z=' and `z^' also exist; `z=' places the current line in the center, surrounds it with lines of `-' characters and leaves the current line at this line.  The form `z^' prints the window before `z-' would.  The characters `+', `^' and `-' may be repeated for cumulative effect.
! command The remainder of the line after the `!' character is sent to a shell to be executed.  Within the text of command the characters `%' and `#' are expanded as in filenames and the character `!' is replaced with the text of the previous command.  Thus, in particular, `!!' repeats the last such shell escape.  If any such expansion is performed, the expanded line will be echoed.  The current line is unchanged by this command.
If there has been “[No write]” of the buffer contents since the last change to the editing buffer, then a diagnostic will be printed before the command is executed as a warning.  A single `!' is printed when the command completes.
( addr , addr ) ! command Takes the specified address range and supplies it as standard input to command; the resulting output then replaces the input lines.
( $ ) = Prints the line number of the addressed line.  The current line is unchanged.
( . , . ) > count flags ( . , . ) < count flags Perform intelligent shifting on the specified lines; < shifts left and > shift right.  The quantity of shift is determined by the shiftwidth option and the repetition of the specification character.  Only white space (blanks and tabs) is shifted; no non- white characters are discarded in a left-shift.  The current line becomes the last line which changed due to the shifting.
^D     An end-of-file from a terminal input scrolls through the file. The scroll option specifies the size of the scroll, normally a half screen of text.
( .+1 , .+1 ) ( .+1 , .+1 ) | An address alone causes the addressed lines to be printed.  A blank line prints the next line in the file.
( . , . ) & options count flags Repeats the previous substitute command.
( . , . ) ~ options count flags Replaces the previous regular expression with the previous replacement pattern from a substitution.
Regular expressions A regular expression specifies a set of strings of characters.  A member of this set of strings is said to be matched by the regular expression. Ex remembers two previous regular expressions: the previous regular expression used in a substitute command and the previous regular expression used elsewhere (referred to as the previous scanning regular expression.)  The previous regular expression can always be referred to by a null re, e.g. `//' or `??'.
The following basic constructs are used to construct magic mode regular expressions.
char           An ordinary character matches itself.  The characters `^' at the beginning of a line, `$' at the end of line, `*' as any character other than the first, `.', `\', `[', and `~' are not ordinary characters and must be escaped (preceded) by `\' to be treated as such.
^              At the beginning of a pattern forces the match to succeed only at the beginning of a line.
$              At the end of a regular expression forces the match to succeed only at the end of the line.
.              Matches any single character except the new-line character.
\<             Forces the match to occur only at the beginning of a “variable” or “word”; that is, either at the beginning of a line, or just before a letter, digit, or underline and after a character not one of these.
\>             Similar to `\<', but matching the end of a “variable” or “word”, i.e. either the end of the line or before character which is neither a letter, nor a digit, nor the underline character.
[string]       Matches any (single) character in the class defined by string.  Most characters in string define themselves. A pair of characters separated by `-' in string defines the set of characters collating between the specified lower and upper bounds, thus `[a-z]' as a regular expression matches any (single) ASCII lower-case letter. If the sequence `[:class:]' appears in string, where class is one of `alnum', `alpha', `blank', `cntrl', `digit', `graph', `lower', `print', `punct', `space', `upper', `xdigit', or a locale-specific character class, all characters that belong to the given class are matched. Thus `[[:lower:]]' matches any lower-case letter, possibly including characters beyond the scope of ASCII. If the first character of string is an `^' then the construct matches those characters which it otherwise would not; thus `[^a-z]' matches anything but an ASCII lower-case letter (and of course a newline). Backslash `\' is interpreted as an escape character.  To place a `\' character in string, write it twice: `\\'; to place any of the characters `^', `[', or `-' in string, you escape them with a preceding `\'. Characters also lose their special meaning by position: `^' is an ordinary character unless immediately following the initial `[', `]' is an ordinary character if immediately following the initial `[' (or `^', if present), and `-' is an ordinary character if placed immediately behind `[' or `^', or before ']'.
The concatenation of two regular expressions matches the leftmost and then longest string which can be divided with the first piece matching the first regular expression and the second piece matching the second.
A regular expression may be enclosed between the sequences `\(' and `\)', which matches whatever the enclosed expression matches.
Any of the (single character matching) regular expressions mentioned above or a regular expression surrounded by `\(' and '\)' may be followed by the character `*' to form a regular expression which matches any number of adjacent occurrences (including 0) of characters matched by the regular expression it follows.
A single character regular expression or a regular expression surrounded by `\(' and '\)' followed by `\{m,n\}' matches a sequence of m through n occurences, inclusive, of the single character expression.  The values of m and n must be non-negative and smaller than 255.  The form `\{m\}' matches exactly m occurences, `\{m,\}' matches at least m occurences.
The character `~' may be used in a regular expression, and matches the text which defined the replacement part of the last substitute command.
The sequence `\n' matches the text that was matched by the n-th regular subexpression enclosed between `\(' and `\)' earlier in the expression.
Substitute replacement patterns The basic metacharacters for the replacement pattern are `&', `~', and `#'; the first two of them are given as `\&' and `\~' when nomagic is set.  Each instance of `&' is replaced by the characters which the regular expression matched.  The metacharacter `~' stands, in the replacement pattern, for the defining text of the previous replacement pattern.  If the entire replacement pattern is `#', the defining text of the previous replacement pattern is used.
Other metasequences possible in the replacement pattern are always introduced by the escaping character `\'.  The sequence `\n' is replaced by the text matched by the n-th regular subexpression enclosed between `\(' and `\)'.  When nested, parenthesized subexpressions are present, n is determined by counting occurrences of `\(' starting from the left. The sequences `\u' and `\l' cause the immediately following character in the replacement to be converted to upper- or lower-case respectively if this character is a letter.  The sequences `\U' and `\L' turn such conversion on, either until `\E' or `\e' is encountered, or until the end of the replacement pattern.
Option descriptions autoindent, ai default: noai Can be used to ease the preparation of structured program text. At the beginning of each append , change or insert command or when a new line is opened or created by an append , change , insert , or substitute operation within open or visual mode, ex looks at the line being appended after, the first line changed or the line inserted before and calculates the amount of white space at the start of the line.  It then aligns the cursor at the level of indentation so determined.
If the user then types lines of text in, they will continue to be justified at the displayed indenting level.  If more white space is typed at the beginning of a line, the following line will start aligned with the first non-white character of the previous line. To back the cursor up to the preceding tab stop one can hit ^D. The tab stops going backwards are defined at multiples of the shiftwidth option.  The user cannot backspace over the indent, except by sending an end-of-file with a ^D.
Specially processed in this mode is a line with no characters added to it, which turns into a completely blank line (the white space provided for the autoindent is discarded.)  Also specially processed in this mode are lines beginning with an `^' and immediately followed by a ^D.  This causes the input to be repositioned at the beginning of the line, but retaining the previous indent for the next line.  Similarly, a `0' followed by a ^D repositions at the beginning but without retaining the previous indent.
Autoindent doesn't happen in global commands or when the input is not a terminal.
autoprint, ap  default: ap Causes the current line to be printed after each delete , copy , join , move , substitute , t , undo or shift command.  This has the same effect as supplying a trailing `p' to each such command. Autoprint is suppressed in globals, and only applies to the last of many commands on a line.
autowrite, aw  default: noaw Causes the contents of the buffer to be written to the current file if the user has modified it and gives a next, rewind, stop, tag, or !  command, or a ^^ (switch files) or ^] (tag goto) command in visual.  Note, that the edit and ex commands do not autowrite.  In each case, there is an equivalent way of switching when autowrite is set to avoid the autowrite (edit for next , rewind!  for .I rewind , stop!  for stop , tag!  for tag , shell for ! , and :e # and a :ta! command from within visual).
beautify, bf   default: nobeautify Causes all control characters except tab, newline and form-feed to be discarded from the input.  A complaint is registered the first time a backspace character is discarded.  Beautify does not apply to command input.
directory, dir default: dir=/tmp Specifies the directory in which ex places its buffer file.  If this directory in not writable, then the editor will exit abruptly when it fails to be able to create its buffer there.
edcompatible   default: noedcompatible Causes the presence of absence of g and c suffixes on substitute commands to be remembered, and to be toggled by repeating the suffices.  The suffix r makes the substitution be as in the ~ command, instead of like &.
errorbells, eb default: noeb Error messages are preceded by a bell.  Bell ringing in open and visual on errors is not suppressed by setting noeb.  If possible the editor always places the error message in a standout mode of the terminal (such as inverse video) instead of ringing the bell.
exrc           default: noexrc If set, the current directory is searched for a .exrc file on startup.  If this file is found, its content is treated as ex commands and executed immediately after the contents of $HOME/.exrc on startup.
flash, fl default: flash If the terminal provides the “visual bell” capability, ex will use it instead of the audible bell if flash is set.
hardtabs, ht   default: ht=8 Gives the boundaries on which terminal hardware tabs are set (or on which the system expands tabs).
ignorecase, ic default: noic All upper case characters in the text are mapped to lower case in regular expression matching.  In addition, all upper case characters in regular expressions are mapped to lower case except in character class specifications.
lisp default: nolisp Autoindent indents appropriately for lisp code, and the ( ) { } [[ and ]] commands in open and visual are modified to have meaning for lisp.
list default: nolist All printed lines will be displayed (more) unambiguously, showing tabs and end-of-lines as in the list command.
magic     default: magic for ex and vi, Nomagic for edit. If nomagic is set, the number of regular expression metacharacters is greatly reduced, with only `^' and `$' having special effects. In addition the metacharacters `~' and `&' of the replacement pattern are treated as normal characters.  All the normal metacharacters may be made magic when nomagic is set by preceding them with a `\'.
mesg default: mesg Causes write permission to be turned off to the terminal while the user is in visual mode, if nomesg is set.
modelines, ml  default: nomodelines If modelines is set, then the first 5 lines and the last five lines of the file will be checked for ex command lines and the comands issued.  To be recognized as a command line, the line must have the string ex: or vi: in it.  This string may be anywhere in the line and anything after the : is interpeted as editor commands.  This option defaults to off because of unexpected behavior when editting files such as /etc/passwd.
number, nu     default: nonumber Causes all output lines to be printed with their line numbers.  In addition each input line will be prompted for by supplying the line number it will have.
open default: open If noopen, the commands open and visual are not permitted.
optimize, opt  default: optimize Throughput of text is expedited by setting the terminal to not do automatic carriage returns when printing more than one (logical) line of output, greatly speeding output on terminals without addressable cursors when text with leading white space is printed.
paragraphs, para    default: para=IPLPPPQPP LIbp Specifies the paragraphs for the { and } operations in open and visual.  The pairs of characters in the option's value are the names of the macros which start paragraphs.
prompt    default: prompt Command mode input is prompted for with a `:'.
redraw    default: noredraw The editor simulates (using great amounts of output), an intelligent terminal on a dumb terminal (e.g. during insertions in visual the characters to the right of the cursor position are refreshed as each input character is typed.)  Useful only at very high speed.
remap     default: remap If on, macros are repeatedly tried until they are unchanged.  For example, if o is mapped to O , and O is mapped to I , then if remap is set, o will map to I , but if noremap is set, it will map to O .
report    default: report=5, 2 for edit. Specifies a threshold for feedback from commands.  Any command which modifies more than the specified number of lines will provide feedback as to the scope of its changes.  For commands such as global , open , undo , and visual which have potentially more far reaching scope, the net change in the number of lines in the buffer is presented at the end of the command, subject to this same threshold.  Thus notification is suppressed during a global command on the individual commands performed.
scroll    default: scroll=½ window Determines the number of logical lines scrolled when an end-of- file is received from a terminal input in command mode, and the number of lines printed by a command mode z command (double the value of scroll ).
sections  default: sections=SHNHH HU Specifies the section macros for the [[ and ]] operations in open and visual.  The pairs of characters in the options's value are the names of the macros which start paragraphs.
shell, sh default: sh=/bin/sh Gives the path name of the shell forked for the shell escape command `!', and by the shell command.  The default is taken from SHELL in the environment, if present.
shiftwidth, sw default: sw=8 Gives the width a software tab stop, used in reverse tabbing with ^D when using autoindent to append text, and by the shift commands.
showmatch, sm  default: nosm In open and visual mode, when a ) or } is typed, move the cursor to the matching ( or { for one second if this matching character is on the screen.  Extremely useful with lisp.
showmode, smd  default: nosmd In visual mode, show a description of the current editing mode in the window's lower right corner.
slowopen, slow terminal dependent Affects the display algorithm used in visual mode, holding off display updating during input of new text to improve throughput when the terminal in use is both slow and unintelligent.  See An Introduction to Display Editing with Vi for more details.
tabstop, ts    default: ts=8 The editor expands tabs in the input file to be on tabstop boundaries for the purposes of display.
taglength, tl  default: tl=0 Tags are not significant beyond this many characters.  A value of zero (the default) means that all characters are significant.
tags default: tags=tags /usr/lib/tags A path of files to be used as tag files for the tag command.  A requested tag is searched for in the specified files, sequentially.  By default, files called tags are searched for in the current directory and in /usr/lib (a master file for the entire system).
term from environment TERM The terminal type of the output device.
terse     default: noterse Shorter error diagnostics are produced for the experienced user.
warn default: warn Warn if there has been `[No write since last change]' before a `!' command escape.
window    default: window=speed dependent The number of lines in a text window in the visual command.  The default is 8 at slow speeds (600 baud or less), 16 at medium speed (1200 baud), and the full screen (minus one line) at higher speeds.
w300, w1200, w9600 These are not true options but set window only if the speed is slow (300), medium (1200), or high (9600), respectively.  They are suitable for an EXINIT and make it easy to change the 8/16/full screen rule.
wrapscan, ws   default: ws Searches using the regular expressions in addressing will wrap around past the end of the file.
wrapmargin, wm default: wm=0 Defines a margin for automatic wrapover of text during input in open and visual modes.  See An Introduction to Text Editing with Vi for details.
writeany, wa   default: nowa
Inhibit the checks normally made before write commands, allowing a write to any file which the system protection mechanism will allow.
The following environment variables affect the behaviour of ex:
The document Edit: A tutorial (USD:14) provides a comprehensive introduction to edit assuming no previous knowledge of computers or the UNIX system.
The Ex Reference Manual – Version 3.7 (USD:16) is a comprehensive and complete manual for the command mode features of ex.  The USAGE section of this page is taken from the manual.  For an introduction to more advanced forms of editing using the command mode of ex see the editing documents written by Brian Kernighan for the editor ed; the material in the introductory and advanced documents works also with ex.
An Introduction to Display Editing with Vi (USD:15) introduces the display editor vi and provides reference material on vi.  (This reference now forms the vi(1) manual page).  In addition, the Vi Quick Reference card summarizes the commands of vi in a useful, functional way, and is useful with the Introduction.
awk(1), ed(1), grep(1), sed(1), grep(1), vi(1), catopen(3), termcap(5), environ(7), locale(7), regex(7)
Originally written by William Joy.
Mark Horton has maintained the editor since version 2.7, adding macros, support for many unusual terminals, and other features such as word abbreviation mode.
Undo never clears the buffer modified condition.
The z command prints a number of logical rather than physical lines. More than a screen full of output may result if long lines are present.
File input/output errors don't print a name if the command line `-' option is used.
The editor does not warn if text is placed in named buffers and not used before exiting the editor.
Null (00) characters are converted to 0200 characters when reading input files, and cannot appear in resultant files.
LC_COLLATE locales are ignored; collating symbols `[.c.]'  and equivalence classes `[=c=]' in bracket expressions are recognized but useless since `c' is restricted to a single character and is the only character matched; range expressions `[a-m]' are always evaluated in byte order.
PG_CTL(1)                 PostgreSQL 13.4 Documentation                PG_CTL(1)
pg_ctl - initialize, start, stop, or control a PostgreSQL server
pg_ctl init[db] [-D datadir] [-s] [-o initdb-options]
pg_ctl start [-D datadir] [-l filename] [-W] [-t seconds] [-s] [-o options] [-p path] [-c]
pg_ctl stop [-D datadir] [-m s[mart] | f[ast] | i[mmediate]] [-W] [-t seconds] [-s]
pg_ctl restart [-D datadir] [-m s[mart] | f[ast] | i[mmediate]] [-W] [-t seconds] [-s] [-o options] [-c]
pg_ctl reload [-D datadir] [-s]
pg_ctl status [-D datadir]
pg_ctl promote [-D datadir] [-W] [-t seconds] [-s]
pg_ctl logrotate [-D datadir] [-s]
pg_ctl kill signal_name process_id
On Microsoft Windows, also:
pg_ctl register [-D datadir] [-N servicename] [-U username] [-P password] [-S a[uto] | d[emand]] [-e source] [-W] [-t seconds] [-s] [-o options]
pg_ctl unregister [-N servicename]
pg_ctl is a utility for initializing a PostgreSQL database cluster, starting, stopping, or restarting the PostgreSQL database server (postgres(1)), or displaying the status of a running server. Although the server can be started manually, pg_ctl encapsulates tasks such as redirecting log output and properly detaching from the terminal and process group. It also provides convenient options for controlled shutdown.
The init or initdb mode creates a new PostgreSQL database cluster, that is, a collection of databases that will be managed by a single server instance. This mode invokes the initdb command. See initdb(1) for details.
start mode launches a new server. The server is started in the background, and its standard input is attached to /dev/null (or nul on Windows). On Unix-like systems, by default, the server's standard output and standard error are sent to pg_ctl's standard output (not standard error). The standard output of pg_ctl should then be redirected to a file or piped to another process such as a log rotating program like rotatelogs; otherwise postgres will write its output to the controlling terminal (from the background) and will not leave the shell's process group. On Windows, by default the server's standard output and standard error are sent to the terminal. These default behaviors can be changed by using -l to append the server's output to a log file. Use of either -l or output redirection is recommended.
stop mode shuts down the server that is running in the specified data directory. Three different shutdown methods can be selected with the -m option.  “Smart” mode disallows new connections, then waits for all existing clients to disconnect and any online backup to finish. If the server is in hot standby, recovery and streaming replication will be terminated once all clients have disconnected.  “Fast” mode (the default) does not wait for clients to disconnect and will terminate an online backup in progress. All active transactions are rolled back and clients are forcibly disconnected, then the server is shut down.  “Immediate” mode will abort all server processes immediately, without a clean shutdown. This choice will lead to a crash-recovery cycle during the next server start.
restart mode effectively executes a stop followed by a start. This allows changing the postgres command-line options, or changing configuration-file options that cannot be changed without restarting the server. If relative paths were used on the command line during server start, restart might fail unless pg_ctl is executed in the same current directory as it was during server start.
reload mode simply sends the postgres server process a SIGHUP signal, causing it to reread its configuration files (postgresql.conf, pg_hba.conf, etc.). This allows changing configuration-file options that do not require a full server restart to take effect.
status mode checks whether a server is running in the specified data directory. If it is, the server's PID and the command line options that were used to invoke it are displayed. If the server is not running, pg_ctl returns an exit status of 3. If an accessible data directory is not specified, pg_ctl returns an exit status of 4.
promote mode commands the standby server that is running in the specified data directory to end standby mode and begin read-write operations.
logrotate mode rotates the server log file. For details on how to use this mode with external log rotation tools, see Section 24.3.
kill mode sends a signal to a specified process. This is primarily valuable on Microsoft Windows which does not have a built-in kill command. Use --help to see a list of supported signal names.
register mode registers the PostgreSQL server as a system service on Microsoft Windows. The -S option allows selection of service start type, either “auto” (start service automatically on system startup) or “demand” (start service on demand).
unregister mode unregisters a system service on Microsoft Windows. This undoes the effects of the register command.
-c --core-files Attempt to allow server crashes to produce core files, on platforms where this is possible, by lifting any soft resource limit placed on core files. This is useful in debugging or diagnosing problems by allowing a stack trace to be obtained from a failed server process.
-D datadir --pgdata=datadir Specifies the file system location of the database configuration files. If this option is omitted, the environment variable PGDATA is used.
-l filename --log=filename Append the server log output to filename. If the file does not exist, it is created. The umask is set to 077, so access to the log file is disallowed to other users by default.
-m mode --mode=mode Specifies the shutdown mode.  mode can be smart, fast, or immediate, or the first letter of one of these three. If this option is omitted, fast is the default.
-o options --options=options Specifies options to be passed directly to the postgres command.  -o can be specified multiple times, with all the given options being passed through.
The options should usually be surrounded by single or double quotes to ensure that they are passed through as a group.
-o initdb-options --options=initdb-options Specifies options to be passed directly to the initdb command.  -o can be specified multiple times, with all the given options being passed through.
The initdb-options should usually be surrounded by single or double quotes to ensure that they are passed through as a group.
-p path Specifies the location of the postgres executable. By default the postgres executable is taken from the same directory as pg_ctl, or failing that, the hard-wired installation directory. It is not necessary to use this option unless you are doing something unusual and get errors that the postgres executable was not found.
In init mode, this option analogously specifies the location of the initdb executable.
-s --silent Print only errors, no informational messages.
-t seconds --timeout=seconds Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option -w). Defaults to the value of the PGCTLTIMEOUT environment variable or, if not set, to 60 seconds.
-V --version Print the pg_ctl version and exit.
-w --wait Wait for the operation to complete. This is supported for the modes start, stop, restart, promote, and register, and is the default for those modes.
When waiting, pg_ctl repeatedly checks the server's PID file, sleeping for a short amount of time between checks. Startup is considered complete when the PID file indicates that the server is ready to accept connections. Shutdown is considered complete when the server removes the PID file.  pg_ctl returns an exit code based on the success of the startup or shutdown.
If the operation does not complete within the timeout (see option -t), then pg_ctl exits with a nonzero exit status. But note that the operation might continue in the background and eventually succeed.
-W --no-wait Do not wait for the operation to complete. This is the opposite of the option -w.
If waiting is disabled, the requested action is triggered, but there is no feedback about its success. In that case, the server log file or an external monitoring system would have to be used to check the progress and success of the operation.
In prior releases of PostgreSQL, this was the default except for the stop mode.
-? --help Show help about pg_ctl command line arguments, and exit.
If an option is specified that is valid, but not relevant to the selected operating mode, pg_ctl ignores it.
Options for Windows -e source Name of the event source for pg_ctl to use for logging to the event log when running as a Windows service. The default is PostgreSQL. Note that this only controls messages sent from pg_ctl itself; once started, the server will use the event source specified by its event_source parameter. Should the server fail very early in startup, before that parameter has been set, it might also log using the default event source name PostgreSQL.
-N servicename Name of the system service to register. This name will be used as both the service name and the display name. The default is PostgreSQL.
-P password Password for the user to run the service as.
-S start-type Start type of the system service.  start-type can be auto, or demand, or the first letter of one of these two. If this option is omitted, auto is the default.
-U username User name for the user to run the service as. For domain users, use the format DOMAIN\username.
PGCTLTIMEOUT Default limit on the number of seconds to wait when waiting for startup or shutdown to complete. If not set, the default is 60 seconds.
PGDATA Default data directory location.
Most pg_ctl modes require knowing the data directory location; therefore, the -D option is required unless PGDATA is set.
pg_ctl, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see Section 33.14).
For additional variables that affect the server, see postgres(1).
postmaster.pid pg_ctl examines this file in the data directory to determine whether the server is currently running.
postmaster.opts If this file exists in the data directory, pg_ctl (in restart mode) will pass the contents of the file as options to postgres, unless overridden by the -o option. The contents of this file are also displayed in status mode.
Starting the Server To start the server, waiting until the server is accepting connections:
$ pg_ctl start
To start the server using port 5433, and running without fsync, use:
$ pg_ctl -o "-F -p 5433" start
Stopping the Server To stop the server, use:
$ pg_ctl stop
The -m option allows control over how the server shuts down:
$ pg_ctl stop -m smart
Restarting the Server Restarting the server is almost equivalent to stopping the server and starting it again, except that by default, pg_ctl saves and reuses the command line options that were passed to the previously-running instance. To restart the server using the same options as before, use:
$ pg_ctl restart
But if -o is specified, that replaces any previous options. To restart using port 5433, disabling fsync upon restart:
$ pg_ctl -o "-F -p 5433" restart
Showing the Server Status Here is sample status output from pg_ctl:
$ pg_ctl status
pg_ctl: server is running (PID: 13718) /usr/local/pgsql/bin/postgres "-D" "/usr/local/pgsql/data" "-p" "5433" "-B" "128"
The second line is the command that would be invoked in restart mode.
initdb(1), postgres(1)
scanimage(1)              SANE Scanner Access Now Easy              scanimage(1)
scanimage - scan an image
scanimage [-d|--device-name dev] [--format format] [-i|--icc-profile profile] [-L|--list-devices] [-f|--formatted-device-list format] [-b|--batch [=format]] [--batch-start start] [--batch-count count] [--batch-increment increment] [--batch-double] [--accept-md5-only] [-p|--progress] [-o|--output-file] [-n|--dont-scan] [-T|--test] [-A|--all-options] [-h|--help] [-v|--verbose] [-B|--buffer-size [=size]] [-V|--version] [device-specific-options]
scanimage is a command-line interface to control image acquisition devices such as flatbed scanners or cameras.  The device is controlled via command-line options.  After command-line processing, scanimage normally proceeds to acquire an image.  The image data is written to standard output in one of the PNM (portable aNyMaP) formats (PBM for black-and-white images, PGM for grayscale images, and PPM for color images), TIFF format (black-and-white, grayscale or color), PNG format, or JPEG format (compression level 75).  scanimage accesses image acquisition devices through the SANE (Scanner Access Now Easy) interface and can thus support any device for which there exists a SANE backend (try apropos sane- to get a list of available backends).
To get a list of devices:
scanimage -L
To scan with default settings to the file image.pnm:
scanimage >image.pnm
To scan 100x100 mm to the file image.tiff (-x and -y may not be available with all devices):
scanimage -x 100 -y 100 --format=tiff >image.tiff
To print all available options:
scanimage -h
Parameters are separated by a blank from single-character options (e.g. -d epson) and by a "=" from multi-character options (e.g. --device-name=epson).
The -d or --device-name options must be followed by a SANE device-name like `epson:/dev/sg0' or `hp:/dev/usbscanner0'.  A (partial) list of available devices can be obtained with the --list-devices option (see below).  If no device-name is specified explicitly, scanimage reads a device-name from the environment variable SANE_DEFAULT_DEVICE.  If this variable is not set, scanimage will attempt to open the first available device.
The --format format option selects how image data is written to standard output or the file specified by the --output-file option.  format can be pnm, tiff, png, or jpeg.  If --format is not specified, PNM is written by default.
The -i or --icc-profile option is used to include an ICC profile into a TIFF file.
The -L or --list-devices option requests a (partial) list of devices that are available.  The list is not complete since some devices may be available, but are not listed in any of the configuration files (which are typically stored in directory /etc/sane.d).  This is particularly the case when accessing scanners through the network.  If a device is not listed in a configuration file, the only way to access it is by its full device name.  You may need to consult your system administrator to find out the names of such devices.
The -f or --formatted-device-list option works similar to --list-devices, but requires a format string.  scanimage replaces the placeholders %d %v %m %t %i %n with the device name, vendor name, model name, scanner type, an index number and newline respectively. The command
scanimage -f “ scanner number %i device %d is a %t, model %m, produced by %v ”
will produce something like:
scanner number 0  device sharp:/dev/sg1 is  a  flatbed scanner, model JX250 SCSI, produced by SHARP
The --batch* options provide the features for scanning documents using document feeders.  --batch [format] is used to specify the format of the filename that each page will be written to.  Each page is written out to a single file.  If format is not specified, the default of out%d.pnm (or out%d.tif for --format tiff, out%d.png for --format png or out%d.jpg for --format jpeg) will be used.  This option is incompatible with the --output-path option.  format is given as a printf style string with one integer parameter.  --batch-start start selects the page number to start naming files with. If this option is not given, the counter will start at 1.  --batch-count count specifies the number of pages to attempt to scan. If not given, scanimage will continue scanning until the scanner returns a state other than OK.  Not all scanners with document feeders signal when the ADF is empty, use this command to work around them.  With --batch-increment increment you can change the amount that the number in the filename is incremented by.  Generally this is used when you are scanning double-sided documents on a single-sided document feeder.  A specific command is provided to aid this: --batch-double will automatically set the increment to 2.  --batch-prompt will ask for pressing RETURN before scanning a page. This can be used for scanning multiple pages without an automatic document feeder.
The --accept-md5-only option only accepts user authorization requests that support MD5 security. The SANE network daemon (saned) is capable of doing such requests. See saned(8).
The -p or --progress option requests that scanimage prints a progress counter. It shows how much image data of the current image has already been received by scanimage (in percent).
The -o or --output-file option requests that scanimage saves the scanning output to the given path. This option is incompatible with the --batch option. The program will try to guess --format from the file name. If that is not possible, it will print an error message and exit.
The -n or --dont-scan option requests that scanimage only sets the options provided by the user but doesn't actually perform a scan. This option can be used to e.g. turn off the scanner's lamp (if supported by the backend).
The -T or --test option requests that scanimage performs a few simple sanity tests to make sure the backend works as defined by the SANE API (in particular the sane_read() function is exercised by this test).
The -A or --all-options option requests that scanimage lists all available options exposed the backend, including button options.  The information is printed on standard output and no scan will be done.
The -h or --help options request help information.  The information is printed on standard output and in this case, no attempt will be made to acquire an image.
The -v or --verbose options increase the verbosity of the operation of scanimage.  The option may be specified repeatedly, each time increasing the verbosity level.
The -B option without argument changes the input buffer size from the default 32KB to 1MB.  For finer grained control, use --buffer-size= followed by the number of KB.
The -V or --version option requests that scanimage prints the program and package name, the version number of the SANE distribution that it came with and the version of the backend that it loads. Usually that's the dll backend. If more information about the version numbers of the backends are necessary, the DEBUG variable for the dll backend can be used. Example: SANE_DEBUG_DLL=3 scanimage -L .
As you might imagine, much of the power of scanimage comes from the fact that it can control any SANE backend.  Thus, the exact set of command- line options depends on the capabilities of the selected device.  To see the options for a device named dev, invoke scanimage via a command-line of the form:
scanimage --help --device-name dev
The documentation for the device-specific options printed by --help is best explained with a few examples:
-l 0..218mm [0] Top-left x position of scan area.
The description above shows that option -l expects an option value in the range from 0 to 218 mm.  The value in square brackets indicates that the current option value is 0 mm. Most backends provide similar geometry options for top-left y position (-t), width (-x) and height of scan-area (-y).
--brightness -100..100% [0] Controls the brightness of the acquired image.
The description above shows that option --brightness expects an option value in the range from -100 to 100 percent.  The value in square brackets indicates that the current option value is 0 percent.
--default-enhancements Set default values for enhancement controls.
The description above shows that option --default-enhancements has no option value.  It should be thought of as having an immediate effect at the point of the command-line at which it appears.  For example, since this option resets the --brightness option, the option-pair --brightness 50 --default-enhancements would effectively be a no-op.
--mode Lineart|Gray|Color [Gray] Selects the scan mode (e.g., lineart or color).
The description above shows that option --mode accepts an argument that must be one of the strings Lineart, Gray, or Color.  The value in the square bracket indicates that the option is currently set to Gray.  For convenience, it is legal to abbreviate the string values as long as they remain unique.  Also, the case of the spelling doesn't matter.  For example, option setting --mode col is identical to --mode Color.
--custom-gamma[=(yes|no)] [inactive] Determines whether a builtin or a custom gamma-table should be used.
The description above shows that option --custom-gamma expects either no option value, a "yes" string, or a "no" string. Specifying the option with no value is equivalent to specifying "yes".  The value in square-brackets indicates that the option is not currently active.  That is, attempting to set the option would result in an error message.  The set of available options typically depends on the settings of other options.  For example, the --custom-gamma table might be active only when a grayscale or color scan-mode has been requested.
Note that the --help option is processed only after all other options have been processed.  This makes it possible to see the option settings for a particular mode by specifying the appropriate mode-options along with the --help option.  For example, the command-line:
scanimage --help --mode color
would print the option settings that are in effect when the color- mode is selected.
--gamma-table 0..255,... Gamma-correction table.  In color mode this option equally affects the red, green, and blue channels simultaneously (i.e., it is an intensity gamma table).
The description above shows that option --gamma-table expects zero or more values in the range 0 to 255.  For example, a legal value for this option would be "3,4,5,6,7,8,9,10,11,12".  Since it's cumbersome to specify long vectors in this form, the same can be expressed by the abbreviated form "[0]3-[9]12".  What this means is that the first vector element is set to 3, the 9-th element is set to 12 and the values in between are interpolated linearly.  Of course, it is possible to specify multiple such linear segments. For example, "[0]3-[2]3-[6]7,[7]10-[9]6" is equivalent to "3,3,3,4,5,6,7,10,8,6".  The program gamma4scanimage can be used to generate such gamma tables (see gamma4scanimage(1) for details).
--filename <string> [/tmp/input.ppm] The filename of the image to be loaded.
The description above is an example of an option that takes an arbitrary string value (which happens to be a filename).  Again, the value in brackets show that the option is current set to the filename /tmp/input.ppm.
SANE_DEFAULT_DEVICE The default device-name.
/etc/sane.d This directory holds various configuration files.  For details, please refer to the manual pages listed below.
~/.sane/pass This file contains lines of the form
user:password:resource
scanimage uses this information to answer user authorization requests automatically. The file must have 0600 permissions or stricter. You should use this file in conjunction with the --accept-md5-only option to avoid server-side attacks. The resource may contain any character but is limited to 127 characters.
sane(7), gamma4scanimage(1), xscanimage(1), xcam(1), xsane(1), scanadf(1), sane-dll(5), sane-net(5), sane-"backendname"(5)
David Mosberger, Andreas Beck, Gordon Matzigkeit, Caskey Dickson, and many others.  For questions and comments contact the sane-devel mailinglist (see http://www.sane-project.org/mailing-lists.html).
For vector options, the help output currently has no indication as to how many elements a vector-value should have.
GIT-MERGETOOL(1)                   Git Manual                   GIT-MERGETOOL(1)
git-mergetool - Run merge conflict resolution tools to resolve merge conflicts
git mergetool [--tool=<tool>] [-y | --[no-]prompt] [<file>...]
Use git mergetool to run one of several merge utilities to resolve merge conflicts. It is typically run after git merge.