neulab/tldr huggingface dataset:
Hostnames is a comma-separated list of patterns (‘*’ and ‘?’ act as wildcards); each pattern in turn is matched against the host name.  When sshd is authenticating a client, such as when using HostbasedAuthentication, this will be the canonical client host name.  When ssh(1) is authenticating a server, this will be the host name given by the user, the value of the ssh(1) HostkeyAlias if it was specified, or the canonical server hostname if the ssh(1) CanonicalizeHostname option was used.
A pattern may also be preceded by ‘!’ to indicate negation: if the host name matches a negated pattern, it is not accepted (by that line) even if it matched another pattern on the line.  A hostname or address may optionally be enclosed within ‘[’ and ‘]’ brackets then followed by ‘:’ and a non-standard port number.
Alternately, hostnames may be stored in a hashed form which hides host names and addresses should the file's contents be disclosed.  Hashed hostnames start with a ‘|’ character.  Only one hashed hostname may appear on a single line and none of the above negation or wildcard operators may be applied.
The keytype and base64-encoded key are taken directly from the host key; they can be obtained, for example, from /etc/ssh/ssh_host_rsa_key.pub.  The optional comment field continues to the end of the line, and is not used.
Lines starting with ‘#’ and empty lines are ignored as comments.
When performing host authentication, authentication is accepted if any matching line has the proper key; either one that matches exactly or, if the server has presented a certificate for authentication, the key of the certification authority that signed the certificate.  For a key to be trusted as a certification authority, it must use the “@cert-authority” marker described above.
The known hosts file also provides a facility to mark keys as revoked, for example when it is known that the associated private key has been stolen. Revoked keys are specified by including the “@revoked” marker at the beginning of the key line, and are never accepted for authentication or as certification authorities, but instead will produce a warning from ssh(1) when they are encountered.
It is permissible (but not recommended) to have several lines or different host keys for the same names.  This will inevitably happen when short forms of host names from different domains are put in the file.  It is possible that the files contain conflicting information; authentication is accepted if valid information can be found from either file.
Note that the lines in these files are typically hundreds of characters long, and you definitely don't want to type in the host keys by hand. Rather, generate them by a script, ssh-keyscan(1) or by taking, for example, /etc/ssh/ssh_host_rsa_key.pub and adding the host names at the front.  ssh-keygen(1) also offers some basic automated editing for ~/.ssh/known_hosts including removing hosts matching a host name and converting all host names to their hashed representations.
An example ssh_known_hosts file:
# Comments allowed at start of line closenet,...,192.0.2.53 1024 37 159...93 closenet.example.net cvs.example.net,192.0.2.10 ssh-rsa AAAA1234.....= # A hashed hostname |1|JfKTdBh7rNbXkVAQCRp4OQoPfmI=|USECr3SWf1JUPsms5AqfD5QfxkM= ssh-rsa AAAA1234.....= # A revoked key @revoked * ssh-rsa AAAAB5W... # A CA key, accepted for any host in *.mydomain.com or *.mydomain.org @cert-authority *.mydomain.org,*.mydomain.com ssh-rsa AAAAB5W...
~/.hushlogin This file is used to suppress printing the last login time and /etc/motd, if PrintLastLog and PrintMotd, respectively, are enabled.  It does not suppress printing of the banner specified by Banner.
~/.rhosts This file is used for host-based authentication (see ssh(1) for more information).  On some machines this file may need to be world-readable if the user's home directory is on an NFS partition, because sshd reads it as root.  Additionally, this file must be owned by the user, and must not have write permissions for anyone else.  The recommended permission for most machines is read/write for the user, and not accessible by others.
~/.ssh/authorized_keys Lists the public keys (DSA, ECDSA, Ed25519, RSA) that can be used for logging in as this user.  The format of this file is described above.  The content of the file is not highly sensitive, but the recommended permissions are read/write for the user, and not accessible by others.
If this file, the ~/.ssh directory, or the user's home directory are writable by other users, then the file could be modified or replaced by unauthorized users.  In this case, sshd will not allow it to be used unless the StrictModes option has been set to “no”.
~/.ssh/environment This file is read into the environment at login (if it exists).  It can only contain empty lines, comment lines (that start with ‘#’), and assignment lines of the form name=value.  The file should be writable only by the user; it need not be readable by anyone else. Environment processing is disabled by default and is controlled via the PermitUserEnvironment option.
~/.ssh/known_hosts Contains a list of host keys for all hosts the user has logged into that are not already in the systemwide list of known host keys. The format of this file is described above.  This file should be writable only by root/the owner and can, but need not be, world- readable.
~/.ssh/rc Contains initialization routines to be run before the user's home directory becomes accessible.  This file should be writable only by the user, and need not be readable by anyone else.
/etc/hosts.equiv This file is for host-based authentication (see ssh(1)).  It should only be writable by root.
/etc/ssh/moduli Contains Diffie-Hellman groups used for the "Diffie-Hellman Group Exchange" key exchange method.  The file format is described in moduli(5).  If no usable groups are found in this file then fixed internal groups will be used.
/etc/motd See motd(5).
/etc/nologin If this file exists, sshd refuses to let anyone except root log in. The contents of the file are displayed to anyone trying to log in, and non-root connections are refused.  The file should be world- readable.
/etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_ed25519_key /etc/ssh/ssh_host_rsa_key These files contain the private parts of the host keys.  These files should only be owned by root, readable only by root, and not accessible to others.  Note that sshd does not start if these files are group/world-accessible.
/etc/ssh/ssh_host_ecdsa_key.pub /etc/ssh/ssh_host_ed25519_key.pub /etc/ssh/ssh_host_rsa_key.pub These files contain the public parts of the host keys.  These files should be world-readable but writable only by root.  Their contents should match the respective private parts.  These files are not really used for anything; they are provided for the convenience of the user so their contents can be copied to known hosts files. These files are created using ssh-keygen(1).
/etc/ssh/ssh_known_hosts Systemwide list of known host keys.  This file should be prepared by the system administrator to contain the public host keys of all machines in the organization.  The format of this file is described above.  This file should be writable only by root/the owner and should be world-readable.
/etc/ssh/sshd_config Contains configuration data for sshd.  The file format and configuration options are described in sshd_config(5).
/etc/ssh/sshrc Similar to ~/.ssh/rc, it can be used to specify machine-specific login-time initializations globally.  This file should be writable only by root, and should be world-readable.
/var/empty chroot(2) directory used by sshd during privilege separation in the pre-authentication phase.  The directory should not contain any files and must be owned by root and not group or world-writable.
/run/sshd.pid Contains the process ID of the sshd listening for connections (if there are several daemons running concurrently for different ports, this contains the process ID of the one started last).  The content of this file is not sensitive; it can be world-readable.
scp(1), sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), ssh-keyscan(1), chroot(2), login.conf(5), moduli(5), sshd_config(5), inetd(8), sftp-server(8)
OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen.  Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt and Dug Song removed many bugs, re-added newer features and created OpenSSH.  Markus Friedl contributed the support for SSH protocol versions 1.5 and 2.0.  Niels Provos and Markus Friedl contributed support for privilege separation.
NIMBLE(1)                         User Commands                        NIMBLE(1)
nimble - Nim Package Installer
nimble [nimbleopts] COMMAND [cmdopts]
Commands: install [pkgname, ...]     Installs a list of packages.  [-d, --depsOnly] Installs only dependencies of the package.  [opts, ...] Passes options to the Nim compiler.
develop [pkgname, ...]     Clones a list of packages for development.
Symlinks the cloned packages or any package in the current working directory.
check  Verifies the validity of a package in the current working directory.
init   [pkgname]          Initializes a new Nimble project in the
current directory or if a name is provided a new directory of the same name.
[--git, --hg] Creates a git/hg repo in the new nimble project.
publish Publishes a package on nim-lang/packages.  The current working directory needs to be the toplevel directory of the Nimble package.
uninstall [pkgname, ...]     Uninstalls a list of packages.  [-i, --inclDeps]   Uninstalls package and dependent package(s).
build  [opts, ...] [bin]  Builds a package. Passes options to the Nim
compiler.
run    [opts, ...] [bin]  Builds and runs a package.
Binary needs to be specified after any compilation options if there are several binaries defined. Any flags after the binary or -- arg are passed to the binary when it is run.
c, cc, js [opts, ...] f.nim  Builds a file inside a package. Passes options
to the Nim compiler.
test   Compiles and executes tests.
[-c, --continue] Don't stop execution on a failed test.
[opts, ...] Passes options to the Nim compiler.
doc, doc2 [opts, ...] f.nim  Builds documentation for a file inside a
package. Passes options to the Nim compiler.
refresh [url]              Refreshes the package list. A package list URL
can be optionally specified.
search pkg/tag            Searches for a specified package. Search is
performed by tag and by name.
[--ver] Queries remote server for package version.
list   Lists all packages.
[-i, --installed] Lists all installed packages.
tasks  Lists the tasks specified in the Nimble package's Nimble file.
path   pkgname ...        Shows absolute path to the installed packages
specified.
dump   [pkgname]          Outputs Nimble package information for
external tools. The argument can be a .nimble file, a project directory or the name of an installed package.
[--ini, --json] Selects the output format (the default is --ini).
Nimble Options: -h, --help Print this help message.
-v, --version Print version information.
-y, --accept Accept all interactive prompts.
-n, --reject Reject all interactive prompts.
-l, --localdeps Run in project local dependency mode
--ver  Query remote server for package version information when searching or listing packages.
--nimbleDir:dirname Set the Nimble directory.
--nim:path Use specified path for Nim compiler
--silent Hide all Nimble and Nim output
--verbose Show all non-debug output.
--debug Show all output including debug messages.
--noColor Don't colorise output.
--noSSLCheck Don't check SSL certificates.
For more information read the Github readme: https://github.com/nim-lang/nimble#readme
https://github.com/nim-lang/Nim/issues
The nim-doc package.
GIT-VERIFY-COMMIT(1)               Git Manual               GIT-VERIFY-COMMIT(1)
git-verify-commit - Check the GPG signature of commits
git verify-commit <commit>...
Validates the GPG signature created by git commit -S.
-v, --verbose Print the contents of the commit object before validating it.
<commit>... SHA-1 identifiers of Git commit objects.
CD(1POSIX)                  POSIX Programmer's Manual                 CD(1POSIX)
cd — change the working directory
cd [−L|−P] [directory]
cd −
The cd utility shall change the working directory of the current shell execution environment (see Section 2.12, Shell Execution Environment) by executing the following steps in sequence. (In the following steps, the symbol curpath represents an intermediate value used to simplify the description of the algorithm used by cd.  There is no requirement that curpath be made visible to the application.)
1. If no directory operand is given and the HOME environment variable is empty or undefined, the default behavior is implementation-defined and no further steps shall be taken.
2. If no directory operand is given and the HOME environment variable is set to a non-empty value, the cd utility shall behave as if the directory named in the HOME environment variable was specified as the directory operand.
3. If the directory operand begins with a <slash> character, set curpath to the operand and proceed to step 7.
4. If the first component of the directory operand is dot or dot-dot, proceed to step 6.
5. Starting with the first pathname in the <colon>-separated pathnames of CDPATH (see the ENVIRONMENT VARIABLES section) if the pathname is non-null, test if the concatenation of that pathname, a <slash> character if that pathname did not end with a <slash> character, and the directory operand names a directory. If the pathname is null, test if the concatenation of dot, a <slash> character, and the operand names a directory. In either case, if the resulting string names an existing directory, set curpath to that string and proceed to step 7. Otherwise, repeat this step with the next pathname in CDPATH until all pathnames have been tested.
6. Set curpath to the directory operand.
7. If the −P option is in effect, proceed to step 10. If curpath does not begin with a <slash> character, set curpath to the string formed by the concatenation of the value of PWD, a <slash> character if the value of PWD did not end with a <slash> character, and curpath.
8. The curpath value shall then be converted to canonical form as follows, considering each component from beginning to end, in sequence:
a. Dot components and any <slash> characters that separate them from the next component shall be deleted.
b. For each dot-dot component, if there is a preceding component and it is neither root nor dot-dot, then:
i.  If the preceding component does not refer (in the context of pathname resolution with symbolic links followed) to a directory, then the cd utility shall display an appropriate error message and no further steps shall be taken.
ii.  The preceding component, all <slash> characters separating the preceding component from dot-dot, dot-dot, and all <slash> characters separating dot-dot from the following component (if any) shall be deleted.
c. An implementation may further simplify curpath by removing any trailing <slash> characters that are not also leading <slash> characters, replacing multiple non-leading consecutive <slash> characters with a single <slash>, and replacing three or more leading <slash> characters with a single <slash>.  If, as a result of this canonicalization, the curpath variable is null, no further steps shall be taken.
9. If curpath is longer than {PATH_MAX} bytes (including the terminating null) and the directory operand was not longer than {PATH_MAX} bytes (including the terminating null), then curpath shall be converted from an absolute pathname to an equivalent relative pathname if possible. This conversion shall always be considered possible if the value of PWD, with a trailing <slash> added if it does not already have one, is an initial substring of curpath.  Whether or not it is considered possible under other circumstances is unspecified. Implementations may also apply this conversion if curpath is not longer than {PATH_MAX} bytes or the directory operand was longer than {PATH_MAX} bytes.
10. The cd utility shall then perform actions equivalent to the chdir() function called with curpath as the path argument. If these actions fail for any reason, the cd utility shall display an appropriate error message and the remainder of this step shall not be executed. If the −P option is not in effect, the PWD environment variable shall be set to the value that curpath had on entry to step 9 (i.e., before conversion to a relative pathname). If the −P option is in effect, the PWD environment variable shall be set to the string that would be output by pwd −P.  If there is insufficient permission on the new directory, or on any parent of that directory, to determine the current working directory, the value of the PWD environment variable is unspecified.
If, during the execution of the above steps, the PWD environment variable is set, the OLDPWD environment variable shall also be set to the value of the old working directory (that is the current working directory immediately prior to the call to cd).
The cd utility shall conform to the Base Definitions volume of POSIX.1‐2008, Section 12.2, Utility Syntax Guidelines.
−L        Handle the operand dot-dot logically; symbolic link components shall not be resolved before dot-dot components are processed (see steps 8.  and 9. in the DESCRIPTION).
−P        Handle the operand dot-dot physically; symbolic link components shall be resolved before dot-dot components are processed (see step 7. in the DESCRIPTION).
If both −L and −P options are specified, the last of these options shall be used and all others ignored. If neither −L nor −P is specified, the operand shall be handled dot-dot logically; see the DESCRIPTION.
directory An absolute or relative pathname of the directory that shall become the new working directory. The interpretation of a relative pathname by cd depends on the −L option and the CDPATH and PWD environment variables. If directory is an empty string, the results are unspecified.
−         When a <hyphen> is used as the operand, this shall be equivalent to the command:
cd "$OLDPWD" && pwd
which changes to the previous working directory and then writes its name.
The following environment variables shall affect the execution of cd:
CDPATH    A <colon>-separated list of pathnames that refer to directories. The cd utility shall use this list in its attempt to change the directory, as described in the DESCRIPTION. An empty string in place of a directory pathname represents the current directory. If CDPATH is not set, it shall be treated as if it were an empty string.
HOME      The name of the directory, used when no directory operand is specified.
OLDPWD    A pathname of the previous working directory, used by cd −.
PWD       This variable shall be set as specified in the DESCRIPTION. If an application sets or unsets the value of PWD, the behavior of cd is unspecified.
If a non-empty directory name from CDPATH is used, or if cd − is used, an absolute pathname of the new working directory shall be written to the standard output as follows:
"%s\n", <new directory>
Otherwise, there shall be no output.
0    The directory was successfully changed.
The working directory shall remain unchanged.
Since cd affects the current shell execution environment, it is always provided as a shell regular built-in. If it is called in a subshell or separate utility execution environment, such as one of the following:
(cd /tmp) nohup cd find . −exec cd {} \;
it does not affect the working directory of the caller's environment.
The user must have execute (search) permission in directory in order to change to it.
The following template can be used to perform processing in the directory specified by location and end up in the current working directory in use before the first cd command was issued:
cd location if [ $? -ne 0 ] then print error message exit 1 fi ... do whatever is desired as long as the OLDPWD environment variable is not modified cd -
The use of the CDPATH was introduced in the System V shell. Its use is analogous to the use of the PATH variable in the shell. The BSD C shell used a shell parameter cdpath for this purpose.
A common extension when HOME is undefined is to get the login directory from the user database for the invoking user. This does not occur on System V implementations.
Some historical shells, such as the KornShell, took special actions when the directory name contained a dot-dot component, selecting the logical parent of the directory, rather than the actual parent directory; that is, it moved up one level toward the '/' in the pathname, remembering what the user typed, rather than performing the equivalent of:
chdir("..");
In such a shell, the following commands would not necessarily produce equivalent output for all directories:
cd .. && ls      ls ..
This behavior is now the default. It is not consistent with the definition of dot-dot in most historical practice; that is, while this behavior has been optionally available in the KornShell, other shells have historically not supported this functionality. The logical pathname is stored in the PWD environment variable when the cd utility completes and this value is used to construct the next directory name if cd is invoked with the −L option.
Section 2.12, Shell Execution Environment, pwd
The Base Definitions volume of POSIX.1‐2008, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines
The System Interfaces volume of POSIX.1‐2008, chdir()
BASTET(6)                         Games Manual                         BASTET(6)
bastet - Tetris(r) clone with "bastard" block-choosing AI
bastet
bastet (short for "bastard tetris") is a Tetris(r) clone which tries to give you the worst possible block. Playing bastet can be a painful experience, especially if you usually make "canyons" and wait for the long I-shaped block.
bastet tries to conform as much as possible to the tetris guidelines. We refer to those for the rules of the game. In the starting menu, you can configure the key bindings; the default ones are:
DOWN   moves the tetromino down (one single step)
LEFT   moves the tetromino left
RIGHT  moves the tetromino right
SPACE  rotates CW
UP     rotates CCW
ENTER  drops the tetromino as far down as possible (hard drop)
P      pauses the game
CTRL+C exits the game without any further prompt
The game includes two playing modes. In the second one (harder), you do not get the preview of the next tetromino, and the algorithm is modified to take advantage of this.
$(HOME)/.bastetrc User options
$(HOME)/.bastetscores User-specific high scores file (used only if the system high scores file is unavailable)
/var/games/bastet.scores2 System-wide high scores for bastet.
Federico Poloni <fph@ngi.it>
LOGWATCH(8)                       User Manuals                       LOGWATCH(8)
logwatch - system log analyzer and reporter
logwatch [--detail level ] [--logfile log-file-group ] [--service service-name ] [--mailto address ] [--archives] [--range range ] [--debug level ] [--filename file-name ] [--logdir directory ] [--hostlimit hosts ] [--hostname hostname ] [--html_wrap number of characters ] [--hostformat host based options ] [--output output-type ] [--format report format ] [--subject email subject ] [--encode encoding to use ] [--numeric] [--version] [--help|--usage]
Logwatch is a customizable, pluggable log-monitoring system.  It will go through your logs for a given period of time and make a report in the areas that you wish with the detail that you wish.  Logwatch is being used for Linux and many types of UNIX.
--detail level This is the detail level of the report.  level can be a positive integer, or high, med, low, which correspond to the integers 10, 5, and 0, respectively.
--logfile log-file-group This will force Logwatch to process only the set of logfiles defined by log-file-group (i.e. messages, xferlog, ...).  Logwatch will therefore process all services that use those logfiles.  This option can be specified more than once to specify multiple logfile-groups.
--service service-name This will force Logwatch to process only the service specified in service-name (i.e. login, pam, identd, ...).  Logwatch will therefore also process any log-file-groups necessary to process these services.  This option can be specified more than once to specify multiple services to process.  A useful service-name is All which will process all services (and logfile-groups) for which you have filters installed.
--mailto address Mail the results to the email address or user specified in address.
--range range You can specify a date-range to process. Common ranges are Yesterday, Today, All, and Help.  Additional options are listed when invoked with the Help parameter.
--archives Each log-file-group has basic logfiles (i.e. /var/log/messages) as well as archives (i.e. /var/log/messages.? or /var/log/messages.?.gz).  When used with "--range all", this option will make Logwatch search through the archives in addition to the regular logfiles.  For other values of --range, Logwatch will search the appropriate archived logs.
--debug level For debugging purposes.  level can range from 0 to 100.  This will really clutter up your output.  You probably don't want to use this.
--filename file-name Save the output to file-name instead of displaying or mailing it.
--logdir directory Look in directory for log subdirectories or log files first before looking in the default directories.
--hostlimit host1,host2 Limit report to hostname - host1, host2.
--hostname hostname Use hostname for the reports instead of this system's hostname. In addition, if HostLimit is set in the logwatch.conf configuration file (see MORE INFORMATION, below), then only logs from this hostname will be processed (where appropriate).
--html_wrap num-characters Number of characters that html output should be wrapped to. Default is 80.
--hostformat split Use split approach when formatting report for multiple hosts - none [default], split, splitmail.
--output output-type Report using output-type - stdout [default], mail, file.
--format format Format report using format - text [default], html.
--subject email-subject Customize the email subject sent by Logwatch.  Option --output must be set to mail.
--encode encoding Encode report using encoding - none [default], base64, 7bit, 8bit [same as 'none'].
--numeric Inhibits additional name lookups, displaying IP addresses numerically.
--usage Displays usage information
--help same as --usage.
/usr/share/logwatch/ This directory contains all the perl executables and configuration files shipped with the logwatch distribution.
/etc/logwatch This directory contains local configuration files that override the default configuration.  See MORE INFORMATION below for more information.
logwatch --service ftpd-xferlog --range all --detail high --archives This will print out all FTP transfers that are stored in all current and archived xferlogs. logwatch --service pam_pwdb --range yesterday --detail high This will print out login information for the previous day...
The directory /usr/share/doc/logwatch-* contains several files with additional documentation: HOWTO-Customize-LogWatch Documents the directory structure of Logwatch configuration and executable files, and describes how to customize Logwatch by overriding these default files. LICENSE Describes the License under which Logwatch is distributed. Additional clauses may be specified in individual files. README Describes how to install, where to find it, mailing lists, and other useful information.
Kirk Bauer <kirk@kaybee.org> http://sourceforge.net/projects/logwatch
UPTIME(1)                         User Commands                        UPTIME(1)
uptime - Tell how long the system has been running.
uptime [options]
uptime gives a one line display of the following information.  The current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.
This is the same information contained in the header line displayed by w(1).
System load averages is the average number of processes that are either in a runnable or uninterruptable state.  A process in a runnable state is either using the CPU or waiting to use the CPU.  A process in uninterruptable state is waiting for some I/O access, eg waiting for disk.  The averages are taken over the three time intervals.  Load averages are not normalized for the number of CPUs in a system, so a load average of 1 means a single CPU system is loaded all the time while on a 4 CPU system it means it was idle 75% of the time.
-p, --pretty show uptime in pretty format
-h, --help display this help text
-s, --since system up since, in yyyy-mm-dd HH:MM:SS format
uptime was written by Larry Greenfield ⟨greenfie@gauss.rutgers.edu⟩ and Michael K. Johnson ⟨johnsonm@sunsite.unc.edu⟩
ps(1), top(1), utmp(5), w(1)
VMSTAT(8)                     System Administration                    VMSTAT(8)
vmstat - Report virtual memory statistics
vmstat [options] [delay [count]]
vmstat reports information about processes, memory, paging, block IO, traps, disks and cpu activity.
The first report produced gives averages since the last reboot. Additional reports give information on a sampling period of length delay. The process and memory reports are instantaneous in either case.
delay  The delay between updates in seconds.  If no delay is specified, only one report is printed with the average values since boot.
count  Number of updates.  In absence of count, when delay is defined, default is infinite.
-a, --active Display active and  inactive memory, given a 2.5.41 kernel or better.
-f, --forks The -f switch displays the number of forks since boot.  This includes the fork, vfork, and clone system calls, and is equivalent to the total number of tasks created.  Each process is represented by one or more tasks, depending on thread usage.  This display does not repeat.
-m, --slabs Displays slabinfo.
-n, --one-header Display the header only once rather than periodically.
-s, --stats Displays a table of various event counters and memory statistics. This display does not repeat.
-d, --disk Report disk statistics (2.5.70 or above required).
-D, --disk-sum Report some summary statistics about disk activity.
-p, --partition device Detailed statistics about partition (2.5.70 or above required).
-S, --unit character Switches outputs between 1000 (k), 1024 (K), 1000000 (m), or 1048576 (M) bytes.  Note this does not change the block (bi/bo) fields, which are always measured in blocks.
-t, --timestamp Append timestamp to each line
-w, --wide Wide output mode (useful for systems with higher amount of memory, where the default output mode suffers from unwanted column breakage).  The output is wider than 80 characters per line.
Procs r: The number of runnable processes (running or waiting for run time). b: The number of processes blocked waiting for I/O to complete.
Memory These are affected by the --unit option. swpd: the amount of swap memory used. free: the amount of idle memory. buff: the amount of memory used as buffers. cache: the amount of memory used as cache. inact: the amount of inactive memory.  (-a option) active: the amount of active memory.  (-a option)
Swap These are affected by the --unit option. si: Amount of memory swapped in from disk (/s). so: Amount of memory swapped to disk (/s).
IO bi: Blocks received from a block device (blocks/s). bo: Blocks sent to a block device (blocks/s).
System in: The number of interrupts per second, including the clock. cs: The number of context switches per second.
CPU These are percentages of total CPU time. us: Time spent running non-kernel code.  (user time, including nice time) sy: Time spent running kernel code.  (system time) id: Time spent idle.  Prior to Linux 2.5.41, this includes IO-wait time. wa: Time spent waiting for IO.  Prior to Linux 2.5.41, included in idle. st: Time stolen from a virtual machine.  Prior to Linux 2.6.11, unknown.
Reads total: Total reads completed successfully merged: grouped reads (resulting in one I/O) sectors: Sectors read successfully ms: milliseconds spent reading
Writes total: Total writes completed successfully merged: grouped writes (resulting in one I/O) sectors: Sectors written successfully ms: milliseconds spent writing
IO cur: I/O in progress s: seconds spent for I/O
reads: Total number of reads issued to this partition read sectors: Total read sectors for partition writes : Total number of writes issued to this partition requested writes: Total number of write requests made for partition
cache: Cache name num: Number of currently active objects total: Total number of available objects size: Size of each object pages: Number of pages with at least one active object
vmstat does not require special permissions.
These reports are intended to help identify system bottlenecks.  Linux vmstat does not count itself as a running process.
All linux blocks are currently 1024 bytes.  Old kernels may report blocks as 512 bytes, 2048 bytes, or 4096 bytes.
Since procps 3.1.9, vmstat lets you choose units (k, K, m, M).  Default is K (1024 bytes) in the default mode.
vmstat uses slabinfo 1.1
/proc/meminfo /proc/stat /proc/*/stat
free(1), iostat(1), mpstat(1), ps(1), sar(1), top(1)
Does not tabulate the block io per device or count the number of system calls.
Written by Henry Ware ⟨al172@yfn.ysu.edu⟩. Fabian Frédérick ⟨ffrederick@users.sourceforge.net⟩ (diskstat, slab, partitions...)
PG_RESTORE(1)             PostgreSQL 13.4 Documentation            PG_RESTORE(1)
pg_restore - restore a PostgreSQL database from an archive file created by pg_dump
pg_restore [connection-option...] [option...] [filename]
pg_restore is a utility for restoring a PostgreSQL database from an archive created by pg_dump(1) in one of the non-plain-text formats. It will issue the commands necessary to reconstruct the database to the state it was in at the time it was saved. The archive files also allow pg_restore to be selective about what is restored, or even to reorder the items prior to being restored. The archive files are designed to be portable across architectures.
pg_restore can operate in two modes. If a database name is specified, pg_restore connects to that database and restores archive contents directly into the database. Otherwise, a script containing the SQL commands necessary to rebuild the database is created and written to a file or standard output. This script output is equivalent to the plain text output format of pg_dump. Some of the options controlling the output are therefore analogous to pg_dump options.
Obviously, pg_restore cannot restore information that is not present in the archive file. For instance, if the archive was made using the “dump data as INSERT commands” option, pg_restore will not be able to load the data using COPY statements.
pg_restore accepts the following command line arguments.
filename Specifies the location of the archive file (or directory, for a directory-format archive) to be restored. If not specified, the standard input is used.
-a --data-only Restore only the data, not the schema (data definitions). Table data, large objects, and sequence values are restored, if present in the archive.
-c --clean Clean (drop) database objects before recreating them. (Unless --if-exists is used, this might generate some harmless error messages, if any objects were not present in the destination database.)
-C --create Create the database before restoring into it. If --clean is also specified, drop and recreate the target database before connecting to it.
With --create, pg_restore also restores the database's comment if any, and any configuration variable settings that are specific to this database, that is, any ALTER DATABASE ... SET ...  and ALTER ROLE ... IN DATABASE ... SET ...  commands that mention this database. Access privileges for the database itself are also restored, unless --no-acl is specified.
When this option is used, the database named with -d is used only to issue the initial DROP DATABASE and CREATE DATABASE commands. All data is restored into the database name that appears in the archive.
-d dbname --dbname=dbname Connect to database dbname and restore directly into the database. The dbname can be a connection string. If so, connection string parameters will override any conflicting command line options.
-e --exit-on-error Exit if an error is encountered while sending SQL commands to the database. The default is to continue and to display a count of errors at the end of the restoration.
-f filename --file=filename Specify output file for generated script, or for the listing when used with -l. Use - for stdout.
-F format --format=format Specify format of the archive. It is not necessary to specify the format, since pg_restore will determine the format automatically. If specified, it can be one of the following:
c custom The archive is in the custom format of pg_dump.
d directory The archive is a directory archive.
t tar The archive is a tar archive.
-I index --index=index Restore definition of named index only. Multiple indexes may be specified with multiple -I switches.
-j number-of-jobs --jobs=number-of-jobs Run the most time-consuming steps of pg_restore — those that load data, create indexes, or create constraints — concurrently, using up to number-of-jobs concurrent sessions. This option can dramatically reduce the time to restore a large database to a server running on a multiprocessor machine. This option is ignored when emitting a script rather than connecting directly to a database server.
Each job is one process or one thread, depending on the operating system, and uses a separate connection to the server.
The optimal value for this option depends on the hardware setup of the server, of the client, and of the network. Factors include the number of CPU cores and the disk setup. A good place to start is the number of CPU cores on the server, but values larger than that can also lead to faster restore times in many cases. Of course, values that are too high will lead to decreased performance because of thrashing.
Only the custom and directory archive formats are supported with this option. The input must be a regular file or directory (not, for example, a pipe or standard input). Also, multiple jobs cannot be used together with the option --single-transaction.
-l --list List the table of contents of the archive. The output of this operation can be used as input to the -L option. Note that if filtering switches such as -n or -t are used with -l, they will restrict the items listed.
-L list-file --use-list=list-file Restore only those archive elements that are listed in list-file, and restore them in the order they appear in the file. Note that if filtering switches such as -n or -t are used with -L, they will further restrict the items restored.
list-file is normally created by editing the output of a previous -l operation. Lines can be moved or removed, and can also be commented out by placing a semicolon (;) at the start of the line. See below for examples.
-n schema --schema=schema Restore only objects that are in the named schema. Multiple schemas may be specified with multiple -n switches. This can be combined with the -t option to restore just a specific table.
-N schema --exclude-schema=schema Do not restore objects that are in the named schema. Multiple schemas to be excluded may be specified with multiple -N switches.
When both -n and -N are given for the same schema name, the -N switch wins and the schema is excluded.
-O --no-owner Do not output commands to set ownership of objects to match the original database. By default, pg_restore issues ALTER OWNER or SET SESSION AUTHORIZATION statements to set ownership of created schema elements. These statements will fail unless the initial connection to the database is made by a superuser (or the same user that owns all of the objects in the script). With -O, any user name can be used for the initial connection, and this user will own all the created objects.
-P function-name(argtype [, ...]) --function=function-name(argtype [, ...]) Restore the named function only. Be careful to spell the function name and arguments exactly as they appear in the dump file's table of contents. Multiple functions may be specified with multiple -P switches.
-s --schema-only Restore only the schema (data definitions), not data, to the extent that schema entries are present in the archive.
-S username --superuser=username Specify the superuser user name to use when disabling triggers. This is relevant only if --disable-triggers is used.
-t table --table=table Restore definition and/or data of only the named table. For this purpose, “table” includes views, materialized views, sequences, and foreign tables. Multiple tables can be selected by writing multiple -t switches. This option can be combined with the -n option to specify table(s) in a particular schema.
Note When -t is specified, pg_restore makes no attempt to restore any other database objects that the selected table(s) might depend upon. Therefore, there is no guarantee that a specific-table restore into a clean database will succeed.
Note This flag does not behave identically to the -t flag of pg_dump. There is not currently any provision for wild-card matching in pg_restore, nor can you include a schema name within its -t. And, while pg_dump's -t flag will also dump subsidiary objects (such as indexes) of the selected table(s), pg_restore's -t flag does not include such subsidiary objects.
Note In versions prior to PostgreSQL 9.6, this flag matched only tables, not any other type of relation.
-T trigger --trigger=trigger Restore named trigger only. Multiple triggers may be specified with multiple -T switches.
-v --verbose Specifies verbose mode.
-V --version Print the pg_restore version and exit.
-x --no-privileges --no-acl Prevent restoration of access privileges (grant/revoke commands).
-1 --single-transaction Execute the restore as a single transaction (that is, wrap the emitted commands in BEGIN/COMMIT). This ensures that either all the commands complete successfully, or no changes are applied. This option implies --exit-on-error.
--disable-triggers This option is relevant only when performing a data-only restore. It instructs pg_restore to execute commands to temporarily disable triggers on the target tables while the data is reloaded. Use this if you have referential integrity checks or other triggers on the tables that you do not want to invoke during data reload.
Presently, the commands emitted for --disable-triggers must be done as superuser. So you should also specify a superuser name with -S or, preferably, run pg_restore as a PostgreSQL superuser.
--enable-row-security This option is relevant only when restoring the contents of a table which has row security. By default, pg_restore will set row_security to off, to ensure that all data is restored in to the table. If the user does not have sufficient privileges to bypass row security, then an error is thrown. This parameter instructs pg_restore to set row_security to on instead, allowing the user to attempt to restore the contents of the table with row security enabled. This might still fail if the user does not have the right to insert the rows from the dump into the table.
Note that this option currently also requires the dump be in INSERT format, as COPY FROM does not support row security.
--if-exists Use conditional commands (i.e., add an IF EXISTS clause) to drop database objects. This option is not valid unless --clean is also specified.
--no-comments Do not output commands to restore comments, even if the archive contains them.
--no-data-for-failed-tables By default, table data is restored even if the creation command for the table failed (e.g., because it already exists). With this option, data for such a table is skipped. This behavior is useful if the target database already contains the desired table contents. For example, auxiliary tables for PostgreSQL extensions such as PostGIS might already be loaded in the target database; specifying this option prevents duplicate or obsolete data from being loaded into them.
This option is effective only when restoring directly into a database, not when producing SQL script output.
--no-publications Do not output commands to restore publications, even if the archive contains them.
--no-security-labels Do not output commands to restore security labels, even if the archive contains them.
--no-subscriptions Do not output commands to restore subscriptions, even if the archive contains them.
--section=sectionname Only restore the named section. The section name can be pre-data, data, or post-data. This option can be specified more than once to select multiple sections. The default is to restore all sections.
The data section contains actual table data as well as large-object definitions. Post-data items consist of definitions of indexes, triggers, rules and constraints other than validated check constraints. Pre-data items consist of all other data definition items.
--strict-names Require that each schema (-n/--schema) and table (-t/--table) qualifier match at least one schema/table in the backup file.
--use-set-session-authorization Output SQL-standard SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to determine object ownership. This makes the dump more standards-compatible, but depending on the history of the objects in the dump, might not restore properly.
-? --help Show help about pg_restore command line arguments, and exit.
pg_restore also accepts the following command line arguments for connection parameters:
-W --password Force pg_restore to prompt for a password before connecting to a database.
This option is never essential, since pg_restore will automatically prompt for a password if the server demands password authentication. However, pg_restore will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt.
--role=rolename Specifies a role name to be used to perform the restore. This option causes pg_restore to issue a SET ROLE rolename command after connecting to the database. It is useful when the authenticated user (specified by -U) lacks privileges needed by pg_restore, but can switch to a role with the required rights. Some installations have a policy against logging in directly as a superuser, and use of this option allows restores to be performed without violating the policy.
PGHOST PGOPTIONS PGPORT PGUSER Default connection parameters
This utility, like most other PostgreSQL utilities, also uses the environment variables supported by libpq (see Section 33.14). However, it does not read PGDATABASE when a database name is not supplied.
When a direct database connection is specified using the -d option, pg_restore internally executes SQL statements. If you have problems running pg_restore, make sure you are able to select information from the database using, for example, psql(1). Also, any default connection settings and environment variables used by the libpq front-end library will apply.
If your installation has any local additions to the template1 database, be careful to load the output of pg_restore into a truly empty database; otherwise you are likely to get errors due to duplicate definitions of the added objects. To make an empty database without any local additions, copy from template0 not template1, for example:
The limitations of pg_restore are detailed below.
•   When restoring data to a pre-existing table and the option --disable-triggers is used, pg_restore emits commands to disable triggers on user tables before inserting the data, then emits commands to re-enable them after the data has been inserted. If the restore is stopped in the middle, the system catalogs might be left in the wrong state.
•   pg_restore cannot restore large objects selectively; for instance, only those for a specific table. If an archive contains large objects, then all large objects will be restored, or none of them if they are excluded via -L, -t, or other options.
See also the pg_dump(1) documentation for details on limitations of pg_dump.
Once restored, it is wise to run ANALYZE on each restored table so the optimizer has useful statistics; see Section 24.1.3 and Section 24.1.6 for more information.
Assume we have dumped a database called mydb into a custom-format dump file:
To drop the database and recreate it from the dump:
$ dropdb mydb $ pg_restore -C -d postgres db.dump
The database named in the -d switch can be any database existing in the cluster; pg_restore only uses it to issue the CREATE DATABASE command for mydb. With -C, data is always restored into the database name that appears in the dump file.
To reload the dump into a new database called newdb: