Linux-Utility
stringlengths
1
30
Manual-Page
stringlengths
700
948k
TLDR-Summary
stringlengths
110
2.05k
tee
tee(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training tee(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON TEE(1) User Commands TEE(1) NAME top tee - read from standard input and write to standard output and files SYNOPSIS top tee [OPTION]... [FILE]... DESCRIPTION top Copy standard input to each FILE, and also to standard output. -a, --append append to the given FILEs, do not overwrite -i, --ignore-interrupts ignore interrupt signals -p operate in a more appropriate MODE with pipes. --output-error[=MODE] set behavior on write error. See MODE below --help display this help and exit --version output version information and exit MODE determines behavior with write errors on the outputs: warn diagnose errors writing to any output warn-nopipe diagnose errors writing to any output not a pipe exit exit on error writing to any output exit-nopipe exit on error writing to any output not a pipe The default MODE for the -p option is 'warn-nopipe'. With "nopipe" MODEs, exit immediately if all outputs become broken pipes. The default operation when --output-error is not specified, is to exit immediately on error writing to a pipe, and diagnose errors writing to non pipe outputs. AUTHOR top Written by Mike Parker, Richard M. Stallman, and David MacKenzie. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top Full documentation <https://www.gnu.org/software/coreutils/tee> or available locally via: info '(coreutils) tee invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 TEE(1) Pages that refer to this page: tee(2) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# tee\n\n> Read from `stdin` and write to `stdout` and files (or commands).\n> More information: <https://www.gnu.org/software/coreutils/tee>.\n\n- Copy `stdin` to each file, and also to `stdout`:\n\n`echo "example" | tee {{path/to/file}}`\n\n- Append to the given files, do not overwrite:\n\n`echo "example" | tee -a {{path/to/file}}`\n\n- Print `stdin` to the terminal, and also pipe it into another program for further processing:\n\n`echo "example" | tee {{/dev/tty}} | {{xargs printf "[%s]"}}`\n\n- Create a directory called "example", count the number of characters in "example" and write "example" to the terminal:\n\n`echo "example" | tee >(xargs mkdir) >(wc -c)`\n
telinit
telinit(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training telinit(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXIT STATUS | NOTES | SEE ALSO | COLOPHON TELINIT(8) telinit TELINIT(8) NAME top telinit - Change SysV runlevel SYNOPSIS top telinit [OPTIONS...] {COMMAND} DESCRIPTION top telinit may be used to change the SysV system runlevel. Since the concept of SysV runlevels is obsolete the runlevel requests will be transparently translated into systemd unit activation requests. OPTIONS top The following options are understood: --help Print a short help text and exit. --no-wall Do not send wall message before reboot/halt/power-off. The following commands are understood: 0 Power-off the machine. This is translated into an activation request for poweroff.target and is equivalent to systemctl poweroff. 6 Reboot the machine. This is translated into an activation request for reboot.target and is equivalent to systemctl reboot. 2, 3, 4, 5 Change the SysV runlevel. This is translated into an activation request for runlevel2.target, runlevel3.target, ... and is equivalent to systemctl isolate runlevel2.target, systemctl isolate runlevel3.target, ... 1, s, S Change into system rescue mode. This is translated into an activation request for rescue.target and is equivalent to systemctl rescue. q, Q Reload daemon configuration. This is equivalent to systemctl daemon-reload. u, U Serialize state, reexecute daemon and deserialize state again. This is equivalent to systemctl daemon-reexec. EXIT STATUS top On success, 0 is returned, a non-zero failure code otherwise. NOTES top This is a legacy command available for compatibility only. It should not be used anymore, as the concept of runlevels is obsolete. SEE ALSO top systemd(1), systemctl(1), wall(1) COLOPHON top This page is part of the systemd (systemd system and service manager) project. Information about the project can be found at http://www.freedesktop.org/wiki/Software/systemd. If you have a bug report for this manual page, see http://www.freedesktop.org/wiki/Software/systemd/#bugreports. This page was obtained from the project's upstream Git repository https://github.com/systemd/systemd.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-22.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] systemd 255 TELINIT(8) Pages that refer to this page: systemd(1), systemd.directives(7), systemd.index(7) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# telinit\n\n> Change SysV runlevel.\n> Since the concept SysV runlevels is obsolete the runlevel requests will be transparently translated into systemd unit activation requests.\n> More information: <https://manned.org/telinit>.\n\n- Power off the machine:\n\n`telinit 0`\n\n- Reboot the machine:\n\n`telinit 6`\n\n- Change SysV run level:\n\n`telinit {{2|3|4|5}}`\n\n- Change to rescue mode:\n\n`telinit 1`\n\n- Reload daemon configuration:\n\n`telinit q`\n\n- Do not send a wall message before reboot/power-off (6/0):\n\n`telinit --no-wall {{value}}`\n
test
test(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training test(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON TEST(1) User Commands TEST(1) NAME top test - check file types and compare values SYNOPSIS top test EXPRESSION test [ EXPRESSION ] [ ] [ OPTION DESCRIPTION top Exit with the status determined by EXPRESSION. --help display this help and exit --version output version information and exit An omitted EXPRESSION defaults to false. Otherwise, EXPRESSION is true or false and sets exit status. It is one of: ( EXPRESSION ) EXPRESSION is true ! EXPRESSION EXPRESSION is false EXPRESSION1 -a EXPRESSION2 both EXPRESSION1 and EXPRESSION2 are true EXPRESSION1 -o EXPRESSION2 either EXPRESSION1 or EXPRESSION2 is true -n STRING the length of STRING is nonzero STRING equivalent to -n STRING -z STRING the length of STRING is zero STRING1 = STRING2 the strings are equal STRING1 != STRING2 the strings are not equal INTEGER1 -eq INTEGER2 INTEGER1 is equal to INTEGER2 INTEGER1 -ge INTEGER2 INTEGER1 is greater than or equal to INTEGER2 INTEGER1 -gt INTEGER2 INTEGER1 is greater than INTEGER2 INTEGER1 -le INTEGER2 INTEGER1 is less than or equal to INTEGER2 INTEGER1 -lt INTEGER2 INTEGER1 is less than INTEGER2 INTEGER1 -ne INTEGER2 INTEGER1 is not equal to INTEGER2 FILE1 -ef FILE2 FILE1 and FILE2 have the same device and inode numbers FILE1 -nt FILE2 FILE1 is newer (modification date) than FILE2 FILE1 -ot FILE2 FILE1 is older than FILE2 -b FILE FILE exists and is block special -c FILE FILE exists and is character special -d FILE FILE exists and is a directory -e FILE FILE exists -f FILE FILE exists and is a regular file -g FILE FILE exists and is set-group-ID -G FILE FILE exists and is owned by the effective group ID -h FILE FILE exists and is a symbolic link (same as -L) -k FILE FILE exists and has its sticky bit set -L FILE FILE exists and is a symbolic link (same as -h) -N FILE FILE exists and has been modified since it was last read -O FILE FILE exists and is owned by the effective user ID -p FILE FILE exists and is a named pipe -r FILE FILE exists and the user has read access -s FILE FILE exists and has a size greater than zero -S FILE FILE exists and is a socket -t FD file descriptor FD is opened on a terminal -u FILE FILE exists and its set-user-ID bit is set -w FILE FILE exists and the user has write access -x FILE FILE exists and the user has execute (or search) access Except for -h and -L, all FILE-related tests dereference symbolic links. Beware that parentheses need to be escaped (e.g., by backslashes) for shells. INTEGER may also be -l STRING, which evaluates to the length of STRING. NOTE: Binary -a and -o are inherently ambiguous. Use 'test EXPR1 && test EXPR2' or 'test EXPR1 || test EXPR2' instead. NOTE: [ honors the --help and --version options, but test does not. test treats each of those as it treats any other nonempty STRING. NOTE: your shell may have its own version of test and/or [, which usually supersedes the version described here. Please refer to your shell's documentation for details about the options it supports. AUTHOR top Written by Kevin Braunsdorf and Matthew Bradburn. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top access(2) Full documentation <https://www.gnu.org/software/coreutils/test> or available locally via: info '(coreutils) test invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 TEST(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# test\n\n> Check file types and compare values.\n> Returns 0 if the condition evaluates to true, 1 if it evaluates to false.\n> More information: <https://www.gnu.org/software/coreutils/test>.\n\n- Test if a given variable is equal to a given string:\n\n`test "{{$MY_VAR}}" = "{{/bin/zsh}}"`\n\n- Test if a given variable is empty:\n\n`test -z "{{$GIT_BRANCH}}"`\n\n- Test if a file exists:\n\n`test -f "{{path/to/file_or_directory}}"`\n\n- Test if a directory does not exist:\n\n`test ! -d "{{path/to/directory}}"`\n\n- If A is true, then do B, or C in the case of an error (notice that C may run even if A fails):\n\n`test {{condition}} && {{echo "true"}} || {{echo "false"}}`\n
time
time(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training time(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXIT STATUS | ENVIRONMENT | GNU VERSION | BUGS | SEE ALSO time(1) General Commands Manual time(1) NAME top time - time a simple command or give resource usage SYNOPSIS top time [option ...] command [argument ...] DESCRIPTION top The time command runs the specified program command with the given arguments. When command finishes, time writes a message to standard error giving timing statistics about this program run. These statistics consist of (i) the elapsed real time between invocation and termination, (ii) the user CPU time (the sum of the tms_utime and tms_cutime values in a struct tms as returned by times(2)), and (iii) the system CPU time (the sum of the tms_stime and tms_cstime values in a struct tms as returned by times(2)). Note: some shells (e.g., bash(1)) have a built-in time command that provides similar information on the usage of time and possibly other resources. To access the real command, you may need to specify its pathname (something like /usr/bin/time). OPTIONS top -p When in the POSIX locale, use the precise traditional format "real %f\nuser %f\nsys %f\n" (with numbers in seconds) where the number of decimals in the output for %f is unspecified but is sufficient to express the clock tick accuracy, and at least one. EXIT STATUS top If command was invoked, the exit status is that of command. Otherwise, it is 127 if command could not be found, 126 if it could be found but could not be invoked, and some other nonzero value (1125) if something else went wrong. ENVIRONMENT top The variables LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, LC_NUMERIC, and NLSPATH are used for the text and formatting of the output. PATH is used to search for command. GNU VERSION top Below a description of the GNU 1.7 version of time. Disregarding the name of the utility, GNU makes it output lots of useful information, not only about time used, but also on other resources like memory, I/O and IPC calls (where available). The output is formatted using a format string that can be specified using the -f option or the TIME environment variable. The default format string is: %Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k %Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps When the -p option is given, the (portable) output format is used: real %e user %U sys %S The format string The format is interpreted in the usual printf-like way. Ordinary characters are directly copied, tab, newline, and backslash are escaped using \t, \n, and \\, a percent sign is represented by %%, and otherwise % indicates a conversion. The program time will always add a trailing newline itself. The conversions follow. All of those used by tcsh(1) are supported. Time %E Elapsed real time (in [hours:]minutes:seconds). %e (Not in tcsh(1).) Elapsed real time (in seconds). %S Total number of CPU-seconds that the process spent in kernel mode. %U Total number of CPU-seconds that the process spent in user mode. %P Percentage of the CPU that this job got, computed as (%U + %S) / %E. Memory %M Maximum resident set size of the process during its lifetime, in Kbytes. %t (Not in tcsh(1).) Average resident set size of the process, in Kbytes. %K Average total (data+stack+text) memory use of the process, in Kbytes. %D Average size of the process's unshared data area, in Kbytes. %p (Not in tcsh(1).) Average size of the process's unshared stack space, in Kbytes. %X Average size of the process's shared text space, in Kbytes. %Z (Not in tcsh(1).) System's page size, in bytes. This is a per-system constant, but varies between systems. %F Number of major page faults that occurred while the process was running. These are faults where the page has to be read in from disk. %R Number of minor, or recoverable, page faults. These are faults for pages that are not valid but which have not yet been claimed by other virtual pages. Thus the data in the page is still valid but the system tables must be updated. %W Number of times the process was swapped out of main memory. %c Number of times the process was context-switched involuntarily (because the time slice expired). %w Number of waits: times that the program was context- switched voluntarily, for instance while waiting for an I/O operation to complete. I/O %I Number of filesystem inputs by the process. %O Number of filesystem outputs by the process. %r Number of socket messages received by the process. %s Number of socket messages sent by the process. %k Number of signals delivered to the process. %C (Not in tcsh(1).) Name and command-line arguments of the command being timed. %x (Not in tcsh(1).) Exit status of the command. GNU options -f format, --format=format Specify output format, possibly overriding the format specified in the environment variable TIME. -p, --portability Use the portable output format. -o file, --output=file Do not send the results to stderr, but overwrite the specified file. -a, --append (Used together with -o.) Do not overwrite but append. -v, --verbose Give very verbose output about all the program knows about. -q, --quiet Don't report abnormal program termination (where command is terminated by a signal) or nonzero exit status. GNU standard options --help Print a usage message on standard output and exit successfully. -V, --version Print version information on standard output, then exit successfully. -- Terminate option list. BUGS top Not all resources are measured by all versions of UNIX, so some of the values might be reported as zero. The present selection was mostly inspired by the data provided by 4.2 or 4.3BSD. GNU time version 1.7 is not yet localized. Thus, it does not implement the POSIX requirements. The environment variable TIME was badly chosen. It is not unusual for systems like autoconf(1) or make(1) to use environment variables with the name of a utility to override the utility to be used. Uses like MORE or TIME for options to programs (instead of program pathnames) tend to lead to difficulties. It seems unfortunate that -o overwrites instead of appends. (That is, the -a option should be the default.) Mail suggestions and bug reports for GNU time to [email protected]. Please include the version of time, which you can get by running time --version and the operating system and C compiler you used. SEE ALSO top bash(1), tcsh(1), times(2), wait3(2) Linux man-pages (unreleased) (date) time(1) Pages that refer to this page: strace(1), times(2), time(7) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# time\n\n> Measure how long a command took to run.\n> Note: `time` can either exist as a shell builtin, a standalone program or both.\n> More information: <https://manned.org/time>.\n\n- Run the `command` and print the time measurements to `stdout`:\n\n`time {{command}}`\n
timedatectl
timedatectl(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training timedatectl(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COMMANDS | OPTIONS | EXIT STATUS | ENVIRONMENT | EXAMPLES | SEE ALSO | COLOPHON TIMEDATECTL(1) timedatectl TIMEDATECTL(1) NAME top timedatectl - Control the system time and date SYNOPSIS top timedatectl [OPTIONS...] {COMMAND} DESCRIPTION top timedatectl may be used to query and change the system clock and its settings, and enable or disable time synchronization services. Use systemd-firstboot(1) to initialize the system time zone for mounted (but not booted) system images. timedatectl may be used to show the current status of time synchronization services, for example systemd-timesyncd.service(8). COMMANDS top The following commands are understood: status Show current settings of the system clock and RTC, including whether network time synchronization is active. If no command is specified, this is the implied default. Added in version 195. show Show the same information as status, but in machine readable form. This command is intended to be used whenever computer-parsable output is required. Use status if you are looking for formatted human-readable output. By default, empty properties are suppressed. Use --all to show those too. To select specific properties to show, use --property=. Added in version 239. set-time [TIME] Set the system clock to the specified time. This will also update the RTC time accordingly. The time may be specified in the format "2012-10-30 18:17:16". Added in version 195. set-timezone [TIMEZONE] Set the system time zone to the specified value. Available timezones can be listed with list-timezones. If the RTC is configured to be in the local time, this will also update the RTC time. This call will alter the /etc/localtime symlink. See localtime(5) for more information. Added in version 195. list-timezones List available time zones, one per line. Entries from the list can be set as the system timezone with set-timezone. Added in version 195. set-local-rtc [BOOL] Takes a boolean argument. If "0", the system is configured to maintain the RTC in universal time. If "1", it will maintain the RTC in local time instead. Note that maintaining the RTC in the local timezone is not fully supported and will create various problems with time zone changes and daylight saving adjustments. If at all possible, keep the RTC in UTC mode. Note that invoking this will also synchronize the RTC from the system clock, unless --adjust-system-clock is passed (see above). This command will change the 3rd line of /etc/adjtime, as documented in hwclock(8). Added in version 195. set-ntp [BOOL] Takes a boolean argument. Controls whether network time synchronization is active and enabled (if available). If the argument is true, this enables and starts the first existing network synchronization service. If the argument is false, then this disables and stops the known network synchronization services. The way that the list of services is built is described in systemd-timedated.service(8). Added in version 195. systemd-timesyncd Commands The following commands are specific to systemd-timesyncd.service(8). timesync-status Show current status of systemd-timesyncd.service(8). If --monitor is specified, then this will monitor the status updates. Added in version 239. show-timesync Show the same information as timesync-status, but in machine readable form. This command is intended to be used whenever computer-parsable output is required. Use timesync-status if you are looking for formatted human-readable output. By default, empty properties are suppressed. Use --all to show those too. To select specific properties to show, use --property=. Added in version 239. ntp-servers INTERFACE SERVER... Set the interface specific NTP servers. This command can be used only when the interface is managed by systemd-networkd. Added in version 243. revert INTERFACE Revert the interface specific NTP servers. This command can be used only when the interface is managed by systemd-networkd. Added in version 243. OPTIONS top The following options are understood: --no-ask-password Do not query the user for authentication for privileged operations. Added in version 195. --adjust-system-clock If set-local-rtc is invoked and this option is passed, the system clock is synchronized from the RTC again, taking the new setting into account. Otherwise, the RTC is synchronized from the system clock. Added in version 195. --monitor If timesync-status is invoked and this option is passed, then timedatectl monitors the status of systemd-timesyncd.service(8) and updates the outputs. Use Ctrl+C to terminate the monitoring. Added in version 239. -a, --all When showing properties of systemd-timesyncd.service(8), show all properties regardless of whether they are set or not. Added in version 239. -p, --property= When showing properties of systemd-timesyncd.service(8), limit display to certain properties as specified as argument. If not specified, all set properties are shown. The argument should be a property name, such as "ServerName". If specified more than once, all properties with the specified names are shown. Added in version 239. --value When printing properties with show-timesync, only print the value, and skip the property name and "=". Added in version 239. -H, --host= Execute the operation remotely. Specify a hostname, or a username and hostname separated by "@", to connect to. The hostname may optionally be suffixed by a port ssh is listening on, separated by ":", and then a container name, separated by "/", which connects directly to a specific container on the specified host. This will use SSH to talk to the remote machine manager instance. Container names may be enumerated with machinectl -H HOST. Put IPv6 addresses in brackets. -M, --machine= Execute operation on a local container. Specify a container name to connect to, optionally prefixed by a user name to connect as and a separating "@" character. If the special string ".host" is used in place of the container name, a connection to the local system is made (which is useful to connect to a specific user's user bus: "--user [email protected]"). If the "@" syntax is not used, the connection is made as root user. If the "@" syntax is used either the left hand side or the right hand side may be omitted (but not both) in which case the local user name and ".host" are implied. -h, --help Print a short help text and exit. --version Print a short version string and exit. --no-pager Do not pipe output into a pager. EXIT STATUS top On success, 0 is returned, a non-zero failure code otherwise. ENVIRONMENT top $SYSTEMD_LOG_LEVEL The maximum log level of emitted messages (messages with a higher log level, i.e. less important ones, will be suppressed). Either one of (in order of decreasing importance) emerg, alert, crit, err, warning, notice, info, debug, or an integer in the range 0...7. See syslog(3) for more information. $SYSTEMD_LOG_COLOR A boolean. If true, messages written to the tty will be colored according to priority. This setting is only useful when messages are written directly to the terminal, because journalctl(1) and other tools that display logs will color messages based on the log level on their own. $SYSTEMD_LOG_TIME A boolean. If true, console log messages will be prefixed with a timestamp. This setting is only useful when messages are written directly to the terminal or a file, because journalctl(1) and other tools that display logs will attach timestamps based on the entry metadata on their own. $SYSTEMD_LOG_LOCATION A boolean. If true, messages will be prefixed with a filename and line number in the source code where the message originates. Note that the log location is often attached as metadata to journal entries anyway. Including it directly in the message text can nevertheless be convenient when debugging programs. $SYSTEMD_LOG_TID A boolean. If true, messages will be prefixed with the current numerical thread ID (TID). Note that the this information is attached as metadata to journal entries anyway. Including it directly in the message text can nevertheless be convenient when debugging programs. $SYSTEMD_LOG_TARGET The destination for log messages. One of console (log to the attached tty), console-prefixed (log to the attached tty but with prefixes encoding the log level and "facility", see syslog(3), kmsg (log to the kernel circular log buffer), journal (log to the journal), journal-or-kmsg (log to the journal if available, and to kmsg otherwise), auto (determine the appropriate log target automatically, the default), null (disable log output). $SYSTEMD_LOG_RATELIMIT_KMSG Whether to ratelimit kmsg or not. Takes a boolean. Defaults to "true". If disabled, systemd will not ratelimit messages written to kmsg. $SYSTEMD_PAGER Pager to use when --no-pager is not given; overrides $PAGER. If neither $SYSTEMD_PAGER nor $PAGER are set, a set of well-known pager implementations are tried in turn, including less(1) and more(1), until one is found. If no pager implementation is discovered no pager is invoked. Setting this environment variable to an empty string or the value "cat" is equivalent to passing --no-pager. Note: if $SYSTEMD_PAGERSECURE is not set, $SYSTEMD_PAGER (as well as $PAGER) will be silently ignored. $SYSTEMD_LESS Override the options passed to less (by default "FRSXMK"). Users might want to change two options in particular: K This option instructs the pager to exit immediately when Ctrl+C is pressed. To allow less to handle Ctrl+C itself to switch back to the pager command prompt, unset this option. If the value of $SYSTEMD_LESS does not include "K", and the pager that is invoked is less, Ctrl+C will be ignored by the executable, and needs to be handled by the pager. X This option instructs the pager to not send termcap initialization and deinitialization strings to the terminal. It is set by default to allow command output to remain visible in the terminal even after the pager exits. Nevertheless, this prevents some pager functionality from working, in particular paged output cannot be scrolled with the mouse. See less(1) for more discussion. $SYSTEMD_LESSCHARSET Override the charset passed to less (by default "utf-8", if the invoking terminal is determined to be UTF-8 compatible). $SYSTEMD_PAGERSECURE Takes a boolean argument. When true, the "secure" mode of the pager is enabled; if false, disabled. If $SYSTEMD_PAGERSECURE is not set at all, secure mode is enabled if the effective UID is not the same as the owner of the login session, see geteuid(2) and sd_pid_get_owner_uid(3). In secure mode, LESSSECURE=1 will be set when invoking the pager, and the pager shall disable commands that open or create new files or start new subprocesses. When $SYSTEMD_PAGERSECURE is not set at all, pagers which are not known to implement secure mode will not be used. (Currently only less(1) implements secure mode.) Note: when commands are invoked with elevated privileges, for example under sudo(8) or pkexec(1), care must be taken to ensure that unintended interactive features are not enabled. "Secure" mode for the pager may be enabled automatically as describe above. Setting SYSTEMD_PAGERSECURE=0 or not removing it from the inherited environment allows the user to invoke arbitrary commands. Note that if the $SYSTEMD_PAGER or $PAGER variables are to be honoured, $SYSTEMD_PAGERSECURE must be set too. It might be reasonable to completely disable the pager using --no-pager instead. $SYSTEMD_COLORS Takes a boolean argument. When true, systemd and related utilities will use colors in their output, otherwise the output will be monochrome. Additionally, the variable can take one of the following special values: "16", "256" to restrict the use of colors to the base 16 or 256 ANSI colors, respectively. This can be specified to override the automatic decision based on $TERM and what the console is connected to. $SYSTEMD_URLIFY The value must be a boolean. Controls whether clickable links should be generated in the output for terminal emulators supporting this. This can be specified to override the decision that systemd makes based on $TERM and other conditions. EXAMPLES top Show current settings: $ timedatectl Local time: Thu 2017-09-21 16:08:56 CEST Universal time: Thu 2017-09-21 14:08:56 UTC RTC time: Thu 2017-09-21 14:08:56 Time zone: Europe/Warsaw (CEST, +0200) System clock synchronized: yes NTP service: active RTC in local TZ: no Enable network time synchronization: $ timedatectl set-ntp true ==== AUTHENTICATING FOR org.freedesktop.timedate1.set-ntp === Authentication is required to control whether network time synchronization shall be enabled. Authenticating as: user Password: ******** ==== AUTHENTICATION COMPLETE === $ systemctl status systemd-timesyncd.service systemd-timesyncd.service - Network Time Synchronization Loaded: loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled) Active: active (running) since Mo 2015-03-30 14:20:38 CEST; 5s ago Docs: man:systemd-timesyncd.service(8) Main PID: 595 (systemd-timesyn) Status: "Using Time Server 216.239.38.15:123 (time4.google.com)." CGroup: /system.slice/systemd-timesyncd.service 595 /usr/lib/systemd/systemd-timesyncd ... Show current status of systemd-timesyncd.service(8): $ timedatectl timesync-status Server: 216.239.38.15 (time4.google.com) Poll interval: 1min 4s (min: 32s; max 34min 8s) Leap: normal Version: 4 Stratum: 1 Reference: GPS Precision: 1us (-20) Root distance: 335us (max: 5s) Offset: +316us Delay: 349us Jitter: 0 Packet count: 1 Frequency: -8.802ppm SEE ALSO top systemd(1), hwclock(8), date(1), localtime(5), systemctl(1), systemd-timedated.service(8), systemd-timesyncd.service(8), systemd-firstboot(1) COLOPHON top This page is part of the systemd (systemd system and service manager) project. Information about the project can be found at http://www.freedesktop.org/wiki/Software/systemd. If you have a bug report for this manual page, see http://www.freedesktop.org/wiki/Software/systemd/#bugreports. This page was obtained from the project's upstream Git repository https://github.com/systemd/systemd.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-22.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] systemd 255 TIMEDATECTL(1) Pages that refer to this page: systemd-firstboot(1), localtime(5), systemd.directives(7), systemd.index(7), systemd.time(7), systemd-machined.service(8), systemd-timedated.service(8), systemd-timesyncd.service(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# timedatectl\n\n> Control the system time and date.\n> More information: <https://manned.org/timedatectl>.\n\n- Check the current system clock time:\n\n`timedatectl`\n\n- Set the local time of the system clock directly:\n\n`timedatectl set-time "{{yyyy-MM-dd hh:mm:ss}}"`\n\n- List available timezones:\n\n`timedatectl list-timezones`\n\n- Set the system timezone:\n\n`timedatectl set-timezone {{timezone}}`\n\n- Enable Network Time Protocol (NTP) synchronization:\n\n`timedatectl set-ntp on`\n\n- Change the hardware clock time standard to localtime:\n\n`timedatectl set-local-rtc 1`\n
timeout
timeout(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training timeout(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | BUGS | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON TIMEOUT(1) User Commands TIMEOUT(1) NAME top timeout - run a command with a time limit SYNOPSIS top timeout [OPTION] DURATION COMMAND [ARG]... timeout [OPTION] DESCRIPTION top Start COMMAND, and kill it if still running after DURATION. Mandatory arguments to long options are mandatory for short options too. --preserve-status exit with the same status as COMMAND, even when the command times out --foreground when not running timeout directly from a shell prompt, allow COMMAND to read from the TTY and get TTY signals; in this mode, children of COMMAND will not be timed out -k, --kill-after=DURATION also send a KILL signal if COMMAND is still running this long after the initial signal was sent -s, --signal=SIGNAL specify the signal to be sent on timeout; SIGNAL may be a name like 'HUP' or a number; see 'kill -l' for a list of signals -v, --verbose diagnose to stderr any signal sent upon timeout --help display this help and exit --version output version information and exit DURATION is a floating point number with an optional suffix: 's' for seconds (the default), 'm' for minutes, 'h' for hours or 'd' for days. A duration of 0 disables the associated timeout. Upon timeout, send the TERM signal to COMMAND, if no other SIGNAL specified. The TERM signal kills any process that does not block or catch that signal. It may be necessary to use the KILL signal, since this signal can't be caught. Exit status: 124 if COMMAND times out, and --preserve-status is not specified 125 if the timeout command itself fails 126 if COMMAND is found but cannot be invoked 127 if COMMAND cannot be found 137 if COMMAND (or timeout itself) is sent the KILL (9) signal (128+9) - the exit status of COMMAND otherwise BUGS top Some platforms don't currently support timeouts beyond the year 2038. AUTHOR top Written by Padraig Brady. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top kill(1) Full documentation <https://www.gnu.org/software/coreutils/timeout> or available locally via: info '(coreutils) timeout invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 TIMEOUT(1) Pages that refer to this page: time(7) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# timeout\n\n> Run a command with a time limit.\n> More information: <https://www.gnu.org/software/coreutils/timeout>.\n\n- Run `sleep 10` and terminate it after 3 seconds:\n\n`timeout 3s sleep 10`\n\n- Send a signal to the command after the time limit expires (SIGTERM by default):\n\n`timeout --signal {{INT}} {{5s}} {{sleep 10}}`\n
tmux
tmux(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training tmux(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | DEFAULT KEY BINDINGS | COMMAND PARSING AND EXECUTION | PARSING SYNTAX | COMMANDS | CLIENTS AND SESSIONS | WINDOWS AND PANES | KEY BINDINGS | OPTIONS | HOOKS | MOUSE SUPPORT | FORMATS | STYLES | NAMES AND TITLES | GLOBAL AND SESSION ENVIRONMENT | STATUS LINE | BUFFERS | MISCELLANEOUS | EXIT MESSAGES | TERMINFO EXTENSIONS | CONTROL MODE | ENVIRONMENT | FILES | EXAMPLES | SEE ALSO | AUTHORS | COLOPHON TMUX(1) General Commands Manual TMUX(1) NAME top tmux terminal multiplexer SYNOPSIS top tmux [-2CDlNuVv] [-c shell-command] [-f file] [-L socket-name] [-S socket-path] [-T features] [command [flags]] DESCRIPTION top is a terminal multiplexer: it enables a number of terminals to be created, accessed, and controlled from a single screen. may be detached from a screen and continue running in the background, then later reattached. When is started, it creates a new session with a single window and displays it on screen. A status line at the bottom of the screen shows information on the current session and is used to enter interactive commands. A session is a single collection of pseudo terminals under the management of . Each session has one or more windows linked to it. A window occupies the entire screen and may be split into rectangular panes, each of which is a separate pseudo terminal (the pty(4) manual page documents the technical details of pseudo terminals). Any number of instances may connect to the same session, and any number of windows may be present in the same session. Once all sessions are killed, exits. Each session is persistent and will survive accidental disconnection (such as ssh(1) connection timeout) or intentional detaching (with the C-b d key strokes). may be reattached using: $ tmux attach In , a session is displayed on screen by a client and all sessions are managed by a single server. The server and each client are separate processes which communicate through a socket in /tmp. The options are as follows: -2 Force to assume the terminal supports 256 colours. This is equivalent to -T 256. -C Start in control mode (see the CONTROL MODE section). Given twice (-CC) disables echo. -c shell-command Execute shell-command using the default shell. If necessary, the server will be started to retrieve the default-shell option. This option is for compatibility with sh(1) when is used as a login shell. -D Do not start the server as a daemon. This also turns the exit-empty option off. With -D, command may not be specified. -f file Specify an alternative configuration file. By default, loads the system configuration file from @SYSCONFDIR@/tmux.conf, if present, then looks for a user configuration file at ~/.tmux.conf, $XDG_CONFIG_HOME/tmux/tmux.conf or ~/.config/tmux/tmux.conf. The configuration file is a set of commands which are executed in sequence when the server is first started. loads configuration files once when the server process has started. The source-file command may be used to load a file later. shows any error messages from commands in configuration files in the first session created, and continues to process the rest of the configuration file. -L socket-name stores the server socket in a directory under TMUX_TMPDIR or /tmp if it is unset. The default socket is named default. This option allows a different socket name to be specified, allowing several independent servers to be run. Unlike -S a full path is not necessary: the sockets are all created in a directory tmux-UID under the directory given by TMUX_TMPDIR or in /tmp. The tmux-UID directory is created by and must not be world readable, writable or executable. If the socket is accidentally removed, the SIGUSR1 signal may be sent to the server process to recreate it (note that this will fail if any parent directories are missing). -l Behave as a login shell. This flag currently has no effect and is for compatibility with other shells when using tmux as a login shell. -N Do not start the server even if the command would normally do so (for example new-session or start-server). -S socket-path Specify a full alternative path to the server socket. If -S is specified, the default socket directory is not used and any -L flag is ignored. -T features Set terminal features for the client. This is a comma-separated list of features. See the terminal-features option. -u Write UTF-8 output to the terminal even if the first environment variable of LC_ALL, LC_CTYPE, or LANG that is set does not contain "UTF-8" or "UTF8". -V Report the version. -v Request verbose logging. Log messages will be saved into tmux-client-PID.log and tmux-server-PID.log files in the current directory, where PID is the PID of the server or client process. If -v is specified twice, an additional tmux-out-PID.log file is generated with a copy of everything writes to the terminal. The SIGUSR2 signal may be sent to the server process to toggle logging between on (as if -v was given) and off. command [flags] This specifies one of a set of commands used to control , as described in the following sections. If no commands are specified, the new-session command is assumed. DEFAULT KEY BINDINGS top may be controlled from an attached client by using a key combination of a prefix key, C-b (Ctrl-b) by default, followed by a command key. The default command key bindings are: C-b Send the prefix key (C-b) through to the application. C-o Rotate the panes in the current window forwards. C-z Suspend the client. ! Break the current pane out of the window. " Split the current pane into two, top and bottom. # List all paste buffers. $ Rename the current session. % Split the current pane into two, left and right. & Kill the current window. ' Prompt for a window index to select. ( Switch the attached client to the previous session. ) Switch the attached client to the next session. , Rename the current window. - Delete the most recently copied buffer of text. . Prompt for an index to move the current window. 0 to 9 Select windows 0 to 9. : Enter the command prompt. ; Move to the previously active pane. = Choose which buffer to paste interactively from a list. ? List all key bindings. D Choose a client to detach. L Switch the attached client back to the last session. [ Enter copy mode to copy text or view the history. ] Paste the most recently copied buffer of text. c Create a new window. d Detach the current client. f Prompt to search for text in open windows. i Display some information about the current window. l Move to the previously selected window. m Mark the current pane (see select-pane -m). M Clear the marked pane. n Change to the next window. o Select the next pane in the current window. p Change to the previous window. q Briefly display pane indexes. r Force redraw of the attached client. s Select a new session for the attached client interactively. t Show the time. w Choose the current window interactively. x Kill the current pane. z Toggle zoom state of the current pane. { Swap the current pane with the previous pane. } Swap the current pane with the next pane. ~ Show previous messages from , if any. Page Up Enter copy mode and scroll one page up. Up, Down Left, Right Change to the pane above, below, to the left, or to the right of the current pane. M-1 to M-5 Arrange panes in one of the five preset layouts: even-horizontal, even-vertical, main- horizontal, main-vertical, or tiled. Space Arrange the current window in the next preset layout. M-n Move to the next window with a bell or activity marker. M-o Rotate the panes in the current window backwards. M-p Move to the previous window with a bell or activity marker. C-Up, C-Down C-Left, C-Right Resize the current pane in steps of one cell. M-Up, M-Down M-Left, M-Right Resize the current pane in steps of five cells. Key bindings may be changed with the bind-key and unbind-key commands. COMMAND PARSING AND EXECUTION top supports a large number of commands which can be used to control its behaviour. Each command is named and can accept zero or more flags and arguments. They may be bound to a key with the bind-key command or run from the shell prompt, a shell script, a configuration file or the command prompt. For example, the same set-option command run from the shell prompt, from ~/.tmux.conf and bound to a key may look like: $ tmux set-option -g status-style bg=cyan set-option -g status-style bg=cyan bind-key C set-option -g status-style bg=cyan Here, the command name is set-option, -g is a flag and status-style and bg=cyan are arguments. distinguishes between command parsing and execution. In order to execute a command, needs it to be split up into its name and arguments. This is command parsing. If a command is run from the shell, the shell parses it; from inside or from a configuration file, does. Examples of when parses commands are: - in a configuration file; - typed at the command prompt (see command-prompt); - given to bind-key; - passed as arguments to if-shell or confirm-before. To execute commands, each client has a command queue. A global command queue not attached to any client is used on startup for configuration files like ~/.tmux.conf. Parsed commands added to the queue are executed in order. Some commands, like if-shell and confirm-before, parse their argument to create a new command which is inserted immediately after themselves. This means that arguments can be parsed twice or more - once when the parent command (such as if-shell) is parsed and again when it parses and executes its command. Commands like if-shell, run-shell and display-panes stop execution of subsequent commands on the queue until something happens - if-shell and run-shell until a shell command finishes and display-panes until a key is pressed. For example, the following commands: new-session; new-window if-shell "true" "split-window" kill-session Will execute new-session, new-window, if-shell, the shell command true(1), split-window and kill-session in that order. The COMMANDS section lists the commands and their arguments. PARSING SYNTAX top This section describes the syntax of commands parsed by , for example in a configuration file or at the command prompt. Note that when commands are entered into the shell, they are parsed by the shell - see for example ksh(1) or csh(1). Each command is terminated by a newline or a semicolon (;). Commands separated by semicolons together form a command sequence - if a command in the sequence encounters an error, no subsequent commands are executed. It is recommended that a semicolon used as a command separator should be written as an individual token, for example from sh(1): $ tmux neww \; splitw Or: $ tmux neww ';' splitw Or from the tmux command prompt: neww ; splitw However, a trailing semicolon is also interpreted as a command separator, for example in these sh(1) commands: $ tmux neww\; splitw Or: $ tmux 'neww;' splitw As in these examples, when running tmux from the shell extra care must be taken to properly quote semicolons: 1. Semicolons that should be interpreted as a command separator should be escaped according to the shell conventions. For sh(1) this typically means quoted (such as neww ';' splitw) or escaped (such as neww \\\\; splitw). 2. Individual semicolons or trailing semicolons that should be interpreted as arguments should be escaped twice: once according to the shell conventions and a second time for ; for example: $ tmux neww 'foo\\;' bar $ tmux neww foo\\\\; bar 3. Semicolons that are not individual tokens or trailing another token should only be escaped once according to shell conventions; for example: $ tmux neww 'foo-;-bar' $ tmux neww foo-\\;-bar Comments are marked by the unquoted # character - any remaining text after a comment is ignored until the end of the line. If the last character of a line is \, the line is joined with the following line (the \ and the newline are completely removed). This is called line continuation and applies both inside and outside quoted strings and in comments, but not inside braces. Command arguments may be specified as strings surrounded by single (') quotes, double quotes (") or braces ({}). This is required when the argument contains any special character. Single and double quoted strings cannot span multiple lines except with line continuation. Braces can span multiple lines. Outside of quotes and inside double quotes, these replacements are performed: - Environment variables preceded by $ are replaced with their value from the global environment (see the GLOBAL AND SESSION ENVIRONMENT section). - A leading ~ or ~user is expanded to the home directory of the current or specified user. - \uXXXX or \uXXXXXXXX is replaced by the Unicode codepoint corresponding to the given four or eight digit hexadecimal number. - When preceded (escaped) by a \, the following characters are replaced: \e by the escape character; \r by a carriage return; \n by a newline; and \t by a tab. - \ooo is replaced by a character of the octal value ooo. Three octal digits are required, for example \001. The largest valid character is \377. - Any other characters preceded by \ are replaced by themselves (that is, the \ is removed) and are not treated as having any special meaning - so for example \; will not mark a command sequence and \$ will not expand an environment variable. Braces are parsed as a configuration file (so conditions such as %if are processed) and then converted into a string. They are designed to avoid the need for additional escaping when passing a group of commands as an argument (for example to if-shell). These two examples produce an identical command - note that no escaping is needed when using {}: if-shell true { display -p 'brace-dollar-foo: }$foo' } if-shell true "display -p 'brace-dollar-foo: }\$foo'" Braces may be enclosed inside braces, for example: bind x if-shell "true" { if-shell "true" { display "true!" } } Environment variables may be set by using the syntax name=value, for example HOME=/home/user. Variables set during parsing are added to the global environment. A hidden variable may be set with %hidden, for example: %hidden MYVAR=42 Hidden variables are not passed to the environment of processes created by tmux. See the GLOBAL AND SESSION ENVIRONMENT section. Commands may be parsed conditionally by surrounding them with %if, %elif, %else and %endif. The argument to %if and %elif is expanded as a format (see FORMATS) and if it evaluates to false (zero or empty), subsequent text is ignored until the closing %elif, %else or %endif. For example: %if "#{==:#{host},myhost}" set -g status-style bg=red %elif "#{==:#{host},myotherhost}" set -g status-style bg=green %else set -g status-style bg=blue %endif Will change the status line to red if running on myhost, green if running on myotherhost, or blue if running on another host. Conditionals may be given on one line, for example: %if #{==:#{host},myhost} set -g status-style bg=red %endif COMMANDS top This section describes the commands supported by . Most commands accept the optional -t (and sometimes -s) argument with one of target-client, target-session, target-window, or target-pane. These specify the client, session, window or pane which a command should affect. target-client should be the name of the client, typically the pty(4) file to which the client is connected, for example either of /dev/ttyp1 or ttyp1 for the client attached to /dev/ttyp1. If no client is specified, attempts to work out the client currently in use; if that fails, an error is reported. Clients may be listed with the list-clients command. target-session is tried as, in order: 1. A session ID prefixed with a $. 2. An exact name of a session (as listed by the list-sessions command). 3. The start of a session name, for example mysess would match a session named mysession. 4. An fnmatch(3) pattern which is matched against the session name. If the session name is prefixed with an =, only an exact match is accepted (so =mysess will only match exactly mysess, not mysession). If a single session is found, it is used as the target session; multiple matches produce an error. If a session is omitted, the current session is used if available; if no current session is available, the most recently used is chosen. target-window (or src-window or dst-window) specifies a window in the form session:window. session follows the same rules as for target-session, and window is looked for in order as: 1. A special token, listed below. 2. A window index, for example mysession:1 is window 1 in session mysession. 3. A window ID, such as @1. 4. An exact window name, such as mysession:mywindow. 5. The start of a window name, such as mysession:mywin. 6. As an fnmatch(3) pattern matched against the window name. Like sessions, a = prefix will do an exact match only. An empty window name specifies the next unused index if appropriate (for example the new-window and link-window commands) otherwise the current window in session is chosen. The following special tokens are available to indicate particular windows. Each has a single-character alternative form. Token Meaning {start} ^ The lowest-numbered window {end} $ The highest-numbered window {last} ! The last (previously current) window {next} + The next window by number {previous} - The previous window by number target-pane (or src-pane or dst-pane) may be a pane ID or takes a similar form to target-window but with the optional addition of a period followed by a pane index or pane ID, for example: mysession:mywindow.1. If the pane index is omitted, the currently active pane in the specified window is used. The following special tokens are available for the pane index: Token Meaning {last} ! The last (previously active) pane {next} + The next pane by number {previous} - The previous pane by number {top} The top pane {bottom} The bottom pane {left} The leftmost pane {right} The rightmost pane {top-left} The top-left pane {top-right} The top-right pane {bottom-left} The bottom-left pane {bottom-right} The bottom-right pane {up-of} The pane above the active pane {down-of} The pane below the active pane {left-of} The pane to the left of the active pane {right-of} The pane to the right of the active pane The tokens + and - may be followed by an offset, for example: select-window -t:+2 In addition, target-session, target-window or target-pane may consist entirely of the token {mouse} (alternative form =) to specify the session, window or pane where the most recent mouse event occurred (see the MOUSE SUPPORT section) or {marked} (alternative form ~) to specify the marked pane (see select-pane -m). Sessions, window and panes are each numbered with a unique ID; session IDs are prefixed with a $, windows with a @, and panes with a %. These are unique and are unchanged for the life of the session, window or pane in the server. The pane ID is passed to the child process of the pane in the TMUX_PANE environment variable. IDs may be displayed using the session_id, window_id, or pane_id formats (see the FORMATS section) and the display-message, list-sessions, list-windows or list-panes commands. shell-command arguments are sh(1) commands. This may be a single argument passed to the shell, for example: new-window 'vi ~/.tmux.conf' Will run: /bin/sh -c 'vi ~/.tmux.conf' Additionally, the new-window, new-session, split-window, respawn-window and respawn-pane commands allow shell-command to be given as multiple arguments and executed directly (without sh -c). This can avoid issues with shell quoting. For example: $ tmux new-window vi ~/.tmux.conf Will run vi(1) directly without invoking the shell. command [argument ...] refers to a command, either passed with the command and arguments separately, for example: bind-key F1 set-option status off Or passed as a single string argument in .tmux.conf, for example: bind-key F1 { set-option status off } Example commands include: refresh-client -t/dev/ttyp2 rename-session -tfirst newname set-option -wt:0 monitor-activity on new-window ; split-window -d bind-key R source-file ~/.tmux.conf \; \ display-message "source-file done" Or from sh(1): $ tmux kill-window -t :1 $ tmux new-window \; split-window -d $ tmux new-session -d 'vi ~/.tmux.conf' \; split-window -d \; attach CLIENTS AND SESSIONS top The server manages clients, sessions, windows and panes. Clients are attached to sessions to interact with them, either when they are created with the new-session command, or later with the attach-session command. Each session has one or more windows linked into it. Windows may be linked to multiple sessions and are made up of one or more panes, each of which contains a pseudo terminal. Commands for creating, linking and otherwise manipulating windows are covered in the WINDOWS AND PANES section. The following commands are available to manage clients and sessions: attach-session [-dErx] [-c working-directory] [-f flags] [-t target-session] (alias: attach) If run from outside , create a new client in the current terminal and attach it to target-session. If used from inside, switch the current client. If -d is specified, any other clients attached to the session are detached. If -x is given, send SIGHUP to the parent process of the client as well as detaching the client, typically causing it to exit. -f sets a comma-separated list of client flags. The flags are: active-pane the client has an independent active pane ignore-size the client does not affect the size of other clients no-output the client does not receive pane output in control mode pause-after=seconds output is paused once the pane is seconds behind in control mode read-only the client is read-only wait-exit wait for an empty line input before exiting in control mode A leading ! turns a flag off if the client is already attached. -r is an alias for -f read-only,ignore-size. When a client is read-only, only keys bound to the detach-client or switch-client commands have any effect. A client with the active-pane flag allows the active pane to be selected independently of the window's active pane used by clients without the flag. This only affects the cursor position and commands issued from the client; other features such as hooks and styles continue to use the window's active pane. If no server is started, attach-session will attempt to start it; this will fail unless sessions are created in the configuration file. The target-session rules for attach-session are slightly adjusted: if needs to select the most recently used session, it will prefer the most recently used unattached session. -c will set the session working directory (used for new windows) to working-directory. If -E is used, the update-environment option will not be applied. detach-client [-aP] [-E shell-command] [-s target-session] [-t target-client] (alias: detach) Detach the current client if bound to a key, the client specified with -t, or all clients currently attached to the session specified by -s. The -a option kills all but the client given with -t. If -P is given, send SIGHUP to the parent process of the client, typically causing it to exit. With -E, run shell-command to replace the client. has-session [-t target-session] (alias: has) Report an error and exit with 1 if the specified session does not exist. If it does exist, exit with 0. kill-server Kill the server and clients and destroy all sessions. kill-session [-aC] [-t target-session] Destroy the given session, closing any windows linked to it and no other sessions, and detaching all clients attached to it. If -a is given, all sessions but the specified one is killed. The -C flag clears alerts (bell, activity, or silence) in all windows linked to the session. list-clients [-F format] [-f filter] [-t target-session] (alias: lsc) List all clients attached to the server. -F specifies the format of each line and -f a filter. Only clients for which the filter is true are shown. See the FORMATS section. If target-session is specified, list only clients connected to that session. list-commands [-F format] [command] (alias: lscm) List the syntax of command or - if omitted - of all commands supported by . list-sessions [-F format] [-f filter] (alias: ls) List all sessions managed by the server. -F specifies the format of each line and -f a filter. Only sessions for which the filter is true are shown. See the FORMATS section. lock-client [-t target-client] (alias: lockc) Lock target-client, see the lock-server command. lock-session [-t target-session] (alias: locks) Lock all clients attached to target-session. new-session [-AdDEPX] [-c start-directory] [-e environment] [-f flags] [-F format] [-n window-name] [-s session-name] [-t group-name] [-x width] [-y height] [shell-command] (alias: new) Create a new session with name session-name. The new session is attached to the current terminal unless -d is given. window-name and shell-command are the name of and shell command to execute in the initial window. With -d, the initial size comes from the global default-size option; -x and -y can be used to specify a different size. - uses the size of the current client if any. If -x or -y is given, the default-size option is set for the session. -f sets a comma-separated list of client flags (see attach-session). If run from a terminal, any termios(4) special characters are saved and used for new windows in the new session. The -A flag makes new-session behave like attach-session if session-name already exists; if -A is given, -D behaves like -d to attach-session, and -X behaves like -x to attach-session. If -t is given, it specifies a session group. Sessions in the same group share the same set of windows - new windows are linked to all sessions in the group and any windows closed removed from all sessions. The current and previous window and any session options remain independent and any session in a group may be killed without affecting the others. The group-name argument may be: 1. the name of an existing group, in which case the new session is added to that group; 2. the name of an existing session - the new session is added to the same group as that session, creating a new group if necessary; 3. the name for a new group containing only the new session. -n and shell-command are invalid if -t is used. The -P option prints information about the new session after it has been created. By default, it uses the format #{session_name}: but a different format may be specified with -F. If -E is used, the update-environment option will not be applied. -e takes the form VARIABLE=value and sets an environment variable for the newly created session; it may be specified multiple times. refresh-client [-cDLRSU] [-A pane:state] [-B name:what:format] [-C size] [-f flags] [-l [target-pane]] [-t target-client] [adjustment] (alias: refresh) Refresh the current client if bound to a key, or a single client if one is given with -t. If -S is specified, only update the client's status line. The -U, -D, -L -R, and -c flags allow the visible portion of a window which is larger than the client to be changed. -U moves the visible part up by adjustment rows and -D down, -L left by adjustment columns and -R right. -c returns to tracking the cursor automatically. If adjustment is omitted, 1 is used. Note that the visible position is a property of the client not of the window, changing the current window in the attached session will reset it. -C sets the width and height of a control mode client or of a window for a control mode client, size must be one of widthxheight or window ID:widthxheight, for example 80x24 or @0:80x24. -A allows a control mode client to trigger actions on a pane. The argument is a pane ID (with leading %), a colon, then one of on, off, continue or pause. If off, will not send output from the pane to the client and if all clients have turned the pane off, will stop reading from the pane. If continue, will return to sending output to the pane if it was paused (manually or with the pause-after flag). If pause, will pause the pane. -A may be given multiple times for different panes. -B sets a subscription to a format for a control mode client. The argument is split into three items by colons: name is a name for the subscription; what is a type of item to subscribe to; format is the format. After a subscription is added, changes to the format are reported with the %subscription-changed notification, at most once a second. If only the name is given, the subscription is removed. what may be empty to check the format only for the attached session, or one of: a pane ID such as %0; %* for all panes in the attached session; a window ID such as @0; or @* for all windows in the attached session. -f sets a comma-separated list of client flags, see attach-session. -l requests the clipboard from the client using the xterm(1) escape sequence. If target-pane is given, the clipboard is sent (in encoded form), otherwise it is stored in a new paste buffer. -L, -R, -U and -D move the visible portion of the window left, right, up or down by adjustment, if the window is larger than the client. -c resets so that the position follows the cursor. See the window-size option. rename-session [-t target-session] new-name (alias: rename) Rename the session to new-name. server-access [-adlrw] [user] Change the access or read/write permission of user. The user running the server (its owner) and the root user cannot be changed and are always permitted access. -a and -d are used to give or revoke access for the specified user. If the user is already attached, the -d flag causes their clients to be detached. -r and -w change the permissions for user: -r makes their clients read-only and -w writable. -l lists current access permissions. By default, the access list is empty and creates sockets with file system permissions preventing access by any user other than the owner (and root). These permissions must be changed manually. Great care should be taken not to allow access to untrusted users even read-only. show-messages [-JT] [-t target-client] (alias: showmsgs) Show server messages or information. Messages are stored, up to a maximum of the limit set by the message-limit server option. -J and -T show debugging information about jobs and terminals. source-file [-Fnqv] [-t target-pane] path ... (alias: source) Execute commands from one or more files specified by path (which may be glob(7) patterns). If -F is present, then path is expanded as a format. If -q is given, no error will be returned if path does not exist. With -n, the file is parsed but no commands are executed. -v shows the parsed commands and line numbers if possible. start-server (alias: start) Start the server, if not already running, without creating any sessions. Note that as by default the server will exit with no sessions, this is only useful if a session is created in ~/.tmux.conf, exit-empty is turned off, or another command is run as part of the same command sequence. For example: $ tmux start \; show -g suspend-client [-t target-client] (alias: suspendc) Suspend a client by sending SIGTSTP (tty stop). switch-client [-ElnprZ] [-c target-client] [-t target-session] [-T key-table] (alias: switchc) Switch the current session for client target-client to target-session. As a special case, -t may refer to a pane (a target that contains :, . or %), to change session, window and pane. In that case, -Z keeps the window zoomed if it was zoomed. If -l, -n or -p is used, the client is moved to the last, next or previous session respectively. -r toggles the client read-only and ignore-size flags (see the attach-session command). If -E is used, update-environment option will not be applied. -T sets the client's key table; the next key from the client will be interpreted from key-table. This may be used to configure multiple prefix keys, or to bind commands to sequences of keys. For example, to make typing abc run the list-keys command: bind-key -Ttable2 c list-keys bind-key -Ttable1 b switch-client -Ttable2 bind-key -Troot a switch-client -Ttable1 WINDOWS AND PANES top Each window displayed by may be split into one or more panes; each pane takes up a certain area of the display and is a separate terminal. A window may be split into panes using the split-window command. Windows may be split horizontally (with the -h flag) or vertically. Panes may be resized with the resize-pane command (bound to C-Up, C-Down C-Left and C-Right by default), the current pane may be changed with the select-pane command and the rotate-window and swap-pane commands may be used to swap panes without changing their position. Panes are numbered beginning from zero in the order they are created. By default, a pane permits direct access to the terminal contained in the pane. A pane may also be put into one of several modes: - Copy mode, which permits a section of a window or its history to be copied to a paste buffer for later insertion into another window. This mode is entered with the copy-mode command, bound to [ by default. Copied text can be pasted with the paste-buffer command, bound to ]. - View mode, which is like copy mode but is entered when a command that produces output, such as list-keys, is executed from a key binding. - Choose mode, which allows an item to be chosen from a list. This may be a client, a session or window or pane, or a buffer. This mode is entered with the choose-buffer, choose-client and choose-tree commands. In copy mode an indicator is displayed in the top-right corner of the pane with the current position and the number of lines in the history. Commands are sent to copy mode using the -X flag to the send-keys command. When a key is pressed, copy mode automatically uses one of two key tables, depending on the mode-keys option: copy-mode for emacs, or copy-mode-vi for vi. Key tables may be viewed with the list-keys command. The following commands are supported in copy mode: append-selection Append the selection to the top paste buffer. append-selection-and-cancel (vi: A) Append the selection to the top paste buffer and exit copy mode. back-to-indentation (vi: ^) (emacs: M-m) Move the cursor back to the indentation. begin-selection (vi: Space) (emacs: C-Space) Begin selection. bottom-line (vi: L) Move to the bottom line. cancel (vi: q) (emacs: Escape) Exit copy mode. clear-selection (vi: Escape) (emacs: C-g) Clear the current selection. copy-end-of-line [prefix] Copy from the cursor position to the end of the line. prefix is used to name the new paste buffer. copy-end-of-line-and-cancel [prefix] Copy from the cursor position and exit copy mode. copy-line [prefix] Copy the entire line. copy-line-and-cancel [prefix] Copy the entire line and exit copy mode. copy-selection [prefix] Copies the current selection. copy-selection-and-cancel [prefix] (vi: Enter) (emacs: M-w) Copy the current selection and exit copy mode. cursor-down (vi: j) (emacs: Down) Move the cursor down. cursor-left (vi: h) (emacs: Left) Move the cursor left. cursor-right (vi: l) (emacs: Right) Move the cursor right. cursor-up (vi: k) (emacs: Up) Move the cursor up. end-of-line (vi: $) (emacs: C-e) Move the cursor to the end of the line. goto-line line (vi: :) (emacs: g) Move the cursor to a specific line. history-bottom (vi: G) (emacs: M->) Scroll to the bottom of the history. history-top (vi: g) (emacs: M-<) Scroll to the top of the history. jump-again (vi: ;) (emacs: ;) Repeat the last jump. jump-backward to (vi: F) (emacs: F) Jump backwards to the specified text. jump-forward to (vi: f) (emacs: f) Jump forward to the specified text. jump-to-mark (vi: M-x) (emacs: M-x) Jump to the last mark. middle-line (vi: M) (emacs: M-r) Move to the middle line. next-matching-bracket (vi: %) (emacs: M-C-f) Move to the next matching bracket. next-paragraph (vi: }) (emacs: M-}) Move to the next paragraph. next-prompt [-o] Move to the next prompt. next-word (vi: w) Move to the next word. page-down (vi: C-f) (emacs: PageDown) Scroll down by one page. page-up (vi: C-b) (emacs: PageUp) Scroll up by one page. previous-matching-bracket (emacs: M-C-b) Move to the previous matching bracket. previous-paragraph (vi: {) (emacs: M-{) Move to the previous paragraph. previous-prompt [-o] Move to the previous prompt. previous-word (vi: b) (emacs: M-b) Move to the previous word. rectangle-toggle (vi: v) (emacs: R) Toggle rectangle selection mode. refresh-from-pane (vi: r) (emacs: r) Refresh the content from the pane. search-again (vi: n) (emacs: n) Repeat the last search. search-backward text (vi: ?) Search backwards for the specified text. search-forward text (vi: /) Search forward for the specified text. select-line (vi: V) Select the current line. select-word Select the current word. start-of-line (vi: 0) (emacs: C-a) Move the cursor to the start of the line. top-line (vi: H) (emacs: M-R) Move to the top line. The search commands come in several varieties: search-forward and search-backward search for a regular expression; the -text variants search for a plain text string rather than a regular expression; -incremental perform an incremental search and expect to be used with the -i flag to the command-prompt command. search-again repeats the last search and search-reverse does the same but reverses the direction (forward becomes backward and backward becomes forward). The next-prompt and previous-prompt move between shell prompts, but require the shell to emit an escape sequence (\033]133;A\033\\) to tell where the prompts are located; if the shell does not do this, these commands will do nothing. The -o flag jumps to the beginning of the command output instead of the shell prompt. Copy commands may take an optional buffer prefix argument which is used to generate the buffer name (the default is buffer so buffers are named buffer0, buffer1 and so on). Pipe commands take a command argument which is the command to which the selected text is piped. copy-pipe variants also copy the selection. The -and-cancel variants of some commands exit copy mode after they have completed (for copy commands) or when the cursor reaches the bottom (for scrolling commands). -no-clear variants do not clear the selection. The next and previous word keys skip over whitespace and treat consecutive runs of either word separators or other letters as words. Word separators can be customized with the word-separators session option. Next word moves to the start of the next word, next word end to the end of the next word and previous word to the start of the previous word. The three next and previous space keys work similarly but use a space alone as the word separator. Setting word-separators to the empty string makes next/previous word equivalent to next/previous space. The jump commands enable quick movement within a line. For instance, typing f followed by / will move the cursor to the next / character on the current line. A ; will then jump to the next occurrence. Commands in copy mode may be prefaced by an optional repeat count. With vi key bindings, a prefix is entered using the number keys; with emacs, the Alt (meta) key and a number begins prefix entry. The synopsis for the copy-mode command is: copy-mode [-eHMqu] [-s src-pane] [-t target-pane] Enter copy mode. The -u option scrolls one page up. -M begins a mouse drag (only valid if bound to a mouse key binding, see MOUSE SUPPORT). -H hides the position indicator in the top right. -q cancels copy mode and any other modes. -s copies from src-pane instead of target-pane. -e specifies that scrolling to the bottom of the history (to the visible screen) should exit copy mode. While in copy mode, pressing a key other than those used for scrolling will disable this behaviour. This is intended to allow fast scrolling through a pane's history, for example with: bind PageUp copy-mode -eu A number of preset arrangements of panes are available, these are called layouts. These may be selected with the select-layout command or cycled with next-layout (bound to Space by default); once a layout is chosen, panes within it may be moved and resized as normal. The following layouts are supported: even-horizontal Panes are spread out evenly from left to right across the window. even-vertical Panes are spread evenly from top to bottom. main-horizontal A large (main) pane is shown at the top of the window and the remaining panes are spread from left to right in the leftover space at the bottom. Use the main-pane-height window option to specify the height of the top pane. main-vertical Similar to main-horizontal but the large pane is placed on the left and the others spread from top to bottom along the right. See the main-pane-width window option. tiled Panes are spread out as evenly as possible over the window in both rows and columns. In addition, select-layout may be used to apply a previously used layout - the list-windows command displays the layout of each window in a form suitable for use with select-layout. For example: $ tmux list-windows 0: ksh [159x48] layout: bb62,159x48,0,0{79x48,0,0,79x48,80,0} $ tmux select-layout 'bb62,159x48,0,0{79x48,0,0,79x48,80,0}' automatically adjusts the size of the layout for the current window size. Note that a layout cannot be applied to a window with more panes than that from which the layout was originally defined. Commands related to windows and panes are as follows: break-pane [-abdP] [-F format] [-n window-name] [-s src-pane] [-t dst-window] (alias: breakp) Break src-pane off from its containing window to make it the only pane in dst-window. With -a or -b, the window is moved to the next index after or before (existing windows are moved if necessary). If -d is given, the new window does not become the current window. The -P option prints information about the new window after it has been created. By default, it uses the format #{session_name}:#{window_index}.#{pane_index} but a different format may be specified with -F. capture-pane [-aAepPqCJN] [-b buffer-name] [-E end-line] [-S start-line] [-t target-pane] (alias: capturep) Capture the contents of a pane. If -p is given, the output goes to stdout, otherwise to the buffer specified with -b or a new buffer if omitted. If -a is given, the alternate screen is used, and the history is not accessible. If no alternate screen exists, an error will be returned unless -q is given. If -e is given, the output includes escape sequences for text and background attributes. -C also escapes non-printable characters as octal \xxx. -T ignores trailing positions that do not contain a character. -N preserves trailing spaces at each line's end and -J preserves trailing spaces and joins any wrapped lines; -J implies -T. -P captures only any output that the pane has received that is the beginning of an as-yet incomplete escape sequence. -S and -E specify the starting and ending line numbers, zero is the first line of the visible pane and negative numbers are lines in the history. - to -S is the start of the history and to -E the end of the visible pane. The default is to capture only the visible contents of the pane. choose-client [-NrZ] [-F format] [-f filter] [-K key-format] [-O sort-order] [-t target-pane] [template] Put a pane into client mode, allowing a client to be selected interactively from a list. Each client is shown on one line. A shortcut key is shown on the left in brackets allowing for immediate choice, or the list may be navigated and an item chosen or otherwise manipulated using the keys below. -Z zooms the pane. The following keys may be used in client mode: Key Function Enter Choose selected client Up Select previous client Down Select next client C-s Search by name n Repeat last search t Toggle if client is tagged T Tag no clients C-t Tag all clients d Detach selected client D Detach tagged clients x Detach and HUP selected client X Detach and HUP tagged clients z Suspend selected client Z Suspend tagged clients f Enter a format to filter items O Change sort field r Reverse sort order v Toggle preview q Exit mode After a client is chosen, %% is replaced by the client name in template and the result executed as a command. If template is not given, "detach-client -t '%%'" is used. -O specifies the initial sort field: one of name, size, creation (time), or activity (time). -r reverses the sort order. -f specifies an initial filter: the filter is a format - if it evaluates to zero, the item in the list is not shown, otherwise it is shown. If a filter would lead to an empty list, it is ignored. -F specifies the format for each item in the list and -K a format for each shortcut key; both are evaluated once for each line. -N starts without the preview. This command works only if at least one client is attached. choose-tree [-GNrswZ] [-F format] [-f filter] [-K key-format] [-O sort-order] [-t target-pane] [template] Put a pane into tree mode, where a session, window or pane may be chosen interactively from a tree. Each session, window or pane is shown on one line. A shortcut key is shown on the left in brackets allowing for immediate choice, or the tree may be navigated and an item chosen or otherwise manipulated using the keys below. -s starts with sessions collapsed and -w with windows collapsed. -Z zooms the pane. The following keys may be used in tree mode: Key Function Enter Choose selected item Up Select previous item Down Select next item + Expand selected item - Collapse selected item M-+ Expand all items M-- Collapse all items x Kill selected item X Kill tagged items < Scroll list of previews left > Scroll list of previews right C-s Search by name m Set the marked pane M Clear the marked pane n Repeat last search t Toggle if item is tagged T Tag no items C-t Tag all items : Run a command for each tagged item f Enter a format to filter items H Jump to the starting pane O Change sort field r Reverse sort order v Toggle preview q Exit mode After a session, window or pane is chosen, the first instance of %% and all instances of %1 are replaced by the target in template and the result executed as a command. If template is not given, "switch-client -t '%%'" is used. -O specifies the initial sort field: one of index, name, or time (activity). -r reverses the sort order. -f specifies an initial filter: the filter is a format - if it evaluates to zero, the item in the list is not shown, otherwise it is shown. If a filter would lead to an empty list, it is ignored. -F specifies the format for each item in the tree and -K a format for each shortcut key; both are evaluated once for each line. -N starts without the preview. -G includes all sessions in any session groups in the tree rather than only the first. This command works only if at least one client is attached. customize-mode [-NZ] [-F format] [-f filter] [-t target-pane] [template] Put a pane into customize mode, where options and key bindings may be browsed and modified from a list. Option values in the list are shown for the active pane in the current window. -Z zooms the pane. The following keys may be used in customize mode: Key Function Enter Set pane, window, session or global option value Up Select previous item Down Select next item + Expand selected item - Collapse selected item M-+ Expand all items M-- Collapse all items s Set option value or key attribute S Set global option value w Set window option value, if option is for pane and window d Set an option or key to the default D Set tagged options and tagged keys to the default u Unset an option (set to default value if global) or unbind a key U Unset tagged options and unbind tagged keys C-s Search by name n Repeat last search t Toggle if item is tagged T Tag no items C-t Tag all items f Enter a format to filter items v Toggle option information q Exit mode -f specifies an initial filter: the filter is a format - if it evaluates to zero, the item in the list is not shown, otherwise it is shown. If a filter would lead to an empty list, it is ignored. -F specifies the format for each item in the tree. -N starts without the option information. This command works only if at least one client is attached. display-panes [-bN] [-d duration] [-t target-client] [template] (alias: displayp) Display a visible indicator of each pane shown by target-client. See the display-panes-colour and display-panes-active-colour session options. The indicator is closed when a key is pressed (unless -N is given) or duration milliseconds have passed. If -d is not given, display-panes-time is used. A duration of zero means the indicator stays until a key is pressed. While the indicator is on screen, a pane may be chosen with the 0 to 9 keys, which will cause template to be executed as a command with %% substituted by the pane ID. The default template is "select-pane -t '%%'". With -b, other commands are not blocked from running until the indicator is closed. find-window [-iCNrTZ] [-t target-pane] match-string (alias: findw) Search for a fnmatch(3) pattern or, with -r, regular expression match-string in window names, titles, and visible content (but not history). The flags control matching behavior: -C matches only visible window contents, -N matches only the window name and -T matches only the window title. -i makes the search ignore case. The default is -CNT. -Z zooms the pane. This command works only if at least one client is attached. join-pane [-bdfhv] [-l size] [-s src-pane] [-t dst-pane] (alias: joinp) Like split-window, but instead of splitting dst-pane and creating a new pane, split it and move src-pane into the space. This can be used to reverse break-pane. The -b option causes src-pane to be joined to left of or above dst-pane. If -s is omitted and a marked pane is present (see select-pane -m), the marked pane is used rather than the current pane. kill-pane [-a] [-t target-pane] (alias: killp) Destroy the given pane. If no panes remain in the containing window, it is also destroyed. The -a option kills all but the pane given with -t. kill-window [-a] [-t target-window] (alias: killw) Kill the current window or the window at target-window, removing it from any sessions to which it is linked. The -a option kills all but the window given with -t. last-pane [-deZ] [-t target-window] (alias: lastp) Select the last (previously selected) pane. -Z keeps the window zoomed if it was zoomed. -e enables or -d disables input to the pane. last-window [-t target-session] (alias: last) Select the last (previously selected) window. If no target-session is specified, select the last window of the current session. link-window [-abdk] [-s src-window] [-t dst-window] (alias: linkw) Link the window at src-window to the specified dst-window. If dst-window is specified and no such window exists, the src-window is linked there. With -a or -b the window is moved to the next index after or before dst-window (existing windows are moved if necessary). If -k is given and dst-window exists, it is killed, otherwise an error is generated. If -d is given, the newly linked window is not selected. list-panes [-as] [-F format] [-f filter] [-t target] (alias: lsp) If -a is given, target is ignored and all panes on the server are listed. If -s is given, target is a session (or the current session). If neither is given, target is a window (or the current window). -F specifies the format of each line and -f a filter. Only panes for which the filter is true are shown. See the FORMATS section. list-windows [-a] [-F format] [-f filter] [-t target-session] (alias: lsw) If -a is given, list all windows on the server. Otherwise, list windows in the current session or in target-session. -F specifies the format of each line and -f a filter. Only windows for which the filter is true are shown. See the FORMATS section. move-pane [-bdfhv] [-l size] [-s src-pane] [-t dst-pane] (alias: movep) Does the same as join-pane. move-window [-abrdk] [-s src-window] [-t dst-window] (alias: movew) This is similar to link-window, except the window at src-window is moved to dst-window. With -r, all windows in the session are renumbered in sequential order, respecting the base-index option. new-window [-abdkPS] [-c start-directory] [-e environment] [-F format] [-n window-name] [-t target-window] [shell-command] (alias: neww) Create a new window. With -a or -b, the new window is inserted at the next index after or before the specified target-window, moving windows up if necessary; otherwise target-window is the new window location. If -d is given, the session does not make the new window the current window. target-window represents the window to be created; if the target already exists an error is shown, unless the -k flag is used, in which case it is destroyed. If -S is given and a window named window-name already exists, it is selected (unless -d is also given in which case the command does nothing). shell-command is the command to execute. If shell-command is not specified, the value of the default-command option is used. -c specifies the working directory in which the new window is created. When the shell command completes, the window closes. See the remain-on-exit option to change this behaviour. -e takes the form VARIABLE=value and sets an environment variable for the newly created window; it may be specified multiple times. The TERM environment variable must be set to screen or tmux for all programs running inside . New windows will automatically have TERM=screen added to their environment, but care must be taken not to reset this in shell start-up files or by the -e option. The -P option prints information about the new window after it has been created. By default, it uses the format #{session_name}:#{window_index} but a different format may be specified with -F. next-layout [-t target-window] (alias: nextl) Move a window to the next layout and rearrange the panes to fit. next-window [-a] [-t target-session] (alias: next) Move to the next window in the session. If -a is used, move to the next window with an alert. pipe-pane [-IOo] [-t target-pane] [shell-command] (alias: pipep) Pipe output sent by the program in target-pane to a shell command or vice versa. A pane may only be connected to one command at a time, any existing pipe is closed before shell-command is executed. The shell-command string may contain the special character sequences supported by the status-left option. If no shell-command is given, the current pipe (if any) is closed. -I and -O specify which of the shell-command output streams are connected to the pane: with -I stdout is connected (so anything shell-command prints is written to the pane as if it were typed); with -O stdin is connected (so any output in the pane is piped to shell-command). Both may be used together and if neither are specified, -O is used. The -o option only opens a new pipe if no previous pipe exists, allowing a pipe to be toggled with a single key, for example: bind-key C-p pipe-pane -o 'cat >>~/output.#I-#P' previous-layout [-t target-window] (alias: prevl) Move to the previous layout in the session. previous-window [-a] [-t target-session] (alias: prev) Move to the previous window in the session. With -a, move to the previous window with an alert. rename-window [-t target-window] new-name (alias: renamew) Rename the current window, or the window at target-window if specified, to new-name. resize-pane [-DLMRTUZ] [-t target-pane] [-x width] [-y height] [adjustment] (alias: resizep) Resize a pane, up, down, left or right by adjustment with -U, -D, -L or -R, or to an absolute size with -x or -y. The adjustment is given in lines or columns (the default is 1); -x and -y may be a given as a number of lines or columns or followed by % for a percentage of the window size (for example -x 10%). With -Z, the active pane is toggled between zoomed (occupying the whole of the window) and unzoomed (its normal position in the layout). -M begins mouse resizing (only valid if bound to a mouse key binding, see MOUSE SUPPORT). -T trims all lines below the current cursor position and moves lines out of the history to replace them. resize-window [-aADLRU] [-t target-window] [-x width] [-y height] [adjustment] (alias: resizew) Resize a window, up, down, left or right by adjustment with -U, -D, -L or -R, or to an absolute size with -x or -y. The adjustment is given in lines or cells (the default is 1). -A sets the size of the largest session containing the window; -a the size of the smallest. This command will automatically set window-size to manual in the window options. respawn-pane [-k] [-c start-directory] [-e environment] [-t target-pane] [shell-command] (alias: respawnp) Reactivate a pane in which the command has exited (see the remain-on-exit window option). If shell-command is not given, the command used when the pane was created or last respawned is executed. The pane must be already inactive, unless -k is given, in which case any existing command is killed. -c specifies a new working directory for the pane. The -e option has the same meaning as for the new-window command. respawn-window [-k] [-c start-directory] [-e environment] [-t target-window] [shell-command] (alias: respawnw) Reactivate a window in which the command has exited (see the remain-on-exit window option). If shell-command is not given, the command used when the window was created or last respawned is executed. The window must be already inactive, unless -k is given, in which case any existing command is killed. -c specifies a new working directory for the window. The -e option has the same meaning as for the new-window command. rotate-window [-DUZ] [-t target-window] (alias: rotatew) Rotate the positions of the panes within a window, either upward (numerically lower) with -U or downward (numerically higher). -Z keeps the window zoomed if it was zoomed. select-layout [-Enop] [-t target-pane] [layout-name] (alias: selectl) Choose a specific layout for a window. If layout-name is not given, the last preset layout used (if any) is reapplied. -n and -p are equivalent to the next-layout and previous-layout commands. -o applies the last set layout if possible (undoes the most recent layout change). -E spreads the current pane and any panes next to it out evenly. select-pane [-DdeLlMmRUZ] [-T title] [-t target-pane] (alias: selectp) Make pane target-pane the active pane in its window. If one of -D, -L, -R, or -U is used, respectively the pane below, to the left, to the right, or above the target pane is used. -Z keeps the window zoomed if it was zoomed. -l is the same as using the last-pane command. -e enables or -d disables input to the pane. -T sets the pane title. -m and -M are used to set and clear the marked pane. There is one marked pane at a time, setting a new marked pane clears the last. The marked pane is the default target for -s to join-pane, move-pane, swap-pane and swap-window. select-window [-lnpT] [-t target-window] (alias: selectw) Select the window at target-window. -l, -n and -p are equivalent to the last-window, next-window and previous-window commands. If -T is given and the selected window is already the current window, the command behaves like last-window. split-window [-bdfhIvPZ] [-c start-directory] [-e environment] [-l size] [-t target-pane] [shell-command] [-F format] (alias: splitw) Create a new pane by splitting target-pane: -h does a horizontal split and -v a vertical split; if neither is specified, -v is assumed. The -l option specifies the size of the new pane in lines (for vertical split) or in columns (for horizontal split); size may be followed by % to specify a percentage of the available space. The -b option causes the new pane to be created to the left of or above target-pane. The -f option creates a new pane spanning the full window height (with -h) or full window width (with -v), instead of splitting the active pane. -Z zooms if the window is not zoomed, or keeps it zoomed if already zoomed. An empty shell-command ('') will create a pane with no command running in it. Output can be sent to such a pane with the display-message command. The -I flag (if shell-command is not specified or empty) will create an empty pane and forward any output from stdin to it. For example: $ make 2>&1|tmux splitw -dI & All other options have the same meaning as for the new-window command. swap-pane [-dDUZ] [-s src-pane] [-t dst-pane] (alias: swapp) Swap two panes. If -U is used and no source pane is specified with -s, dst-pane is swapped with the previous pane (before it numerically); -D swaps with the next pane (after it numerically). -d instructs not to change the active pane and -Z keeps the window zoomed if it was zoomed. If -s is omitted and a marked pane is present (see select-pane -m), the marked pane is used rather than the current pane. swap-window [-d] [-s src-window] [-t dst-window] (alias: swapw) This is similar to link-window, except the source and destination windows are swapped. It is an error if no window exists at src-window. If -d is given, the new window does not become the current window. If -s is omitted and a marked pane is present (see select-pane -m), the window containing the marked pane is used rather than the current window. unlink-window [-k] [-t target-window] (alias: unlinkw) Unlink target-window. Unless -k is given, a window may be unlinked only if it is linked to multiple sessions - windows may not be linked to no sessions; if -k is specified and the window is linked to only one session, it is unlinked and destroyed. KEY BINDINGS top allows a command to be bound to most keys, with or without a prefix key. When specifying keys, most represent themselves (for example A to Z). Ctrl keys may be prefixed with C- or ^, Shift keys with S- and Alt (meta) with M-. In addition, the following special key names are accepted: Up, Down, Left, Right, BSpace, BTab, DC (Delete), End, Enter, Escape, F1 to F12, Home, IC (Insert), NPage/PageDown/PgDn, PPage/PageUp/PgUp, Space, and Tab. Note that to bind the " or ' keys, quotation marks are necessary, for example: bind-key '"' split-window bind-key "'" new-window A command bound to the Any key will execute for all keys which do not have a more specific binding. Commands related to key bindings are as follows: bind-key [-nr] [-N note] [-T key-table] key command [argument ...] (alias: bind) Bind key key to command. Keys are bound in a key table. By default (without -T), the key is bound in the prefix key table. This table is used for keys pressed after the prefix key (for example, by default c is bound to new-window in the prefix table, so C-b c creates a new window). The root table is used for keys pressed without the prefix key: binding c to new-window in the root table (not recommended) means a plain c will create a new window. -n is an alias for -T root. Keys may also be bound in custom key tables and the switch-client -T command used to switch to them from a key binding. The -r flag indicates this key may repeat, see the repeat-time option. -N attaches a note to the key (shown with list-keys -N). To view the default bindings and possible commands, see the list-keys command. list-keys [-1aN] [-P prefix-string -T key-table] [key] (alias: lsk) List key bindings. There are two forms: the default lists keys as bind-key commands; -N lists only keys with attached notes and shows only the key and note for each key. With the default form, all key tables are listed by default. -T lists only keys in key-table. With the -N form, only keys in the root and prefix key tables are listed by default; -T also lists only keys in key-table. -P specifies a prefix to print before each key and -1 lists only the first matching key. -a lists the command for keys that do not have a note rather than skipping them. send-keys [-FHKlMRX] [-c target-client] [-N repeat-count] [-t target-pane] key ... (alias: send) Send a key or keys to a window or client. Each argument key is the name of the key (such as C-a or NPage) to send; if the string is not recognised as a key, it is sent as a series of characters. If -K is given, keys are sent to target-client, so they are looked up in the client's key table, rather than to target-pane. All arguments are sent sequentially from first to last. If no keys are given and the command is bound to a key, then that key is used. The -l flag disables key name lookup and processes the keys as literal UTF-8 characters. The -H flag expects each key to be a hexadecimal number for an ASCII character. The -R flag causes the terminal state to be reset. -M passes through a mouse event (only valid if bound to a mouse key binding, see MOUSE SUPPORT). -X is used to send a command into copy mode - see the WINDOWS AND PANES section. -N specifies a repeat count and -F expands formats in arguments where appropriate. send-prefix [-2] [-t target-pane] Send the prefix key, or with -2 the secondary prefix key, to a window as if it was pressed. unbind-key [-anq] [-T key-table] key (alias: unbind) Unbind the command bound to key. -n and -T are the same as for bind-key. If -a is present, all key bindings are removed. The -q option prevents errors being returned. OPTIONS top The appearance and behaviour of may be modified by changing the value of various options. There are four types of option: server options, session options, window options, and pane options. The server has a set of global server options which do not apply to any particular window or session or pane. These are altered with the set-option -s command, or displayed with the show-options -s command. In addition, each individual session may have a set of session options, and there is a separate set of global session options. Sessions which do not have a particular option configured inherit the value from the global session options. Session options are set or unset with the set-option command and may be listed with the show-options command. The available server and session options are listed under the set-option command. Similarly, a set of window options is attached to each window and a set of pane options to each pane. Pane options inherit from window options. This means any pane option may be set as a window option to apply the option to all panes in the window without the option set, for example these commands will set the background colour to red for all panes except pane 0: set -w window-style bg=red set -pt:.0 window-style bg=blue There is also a set of global window options from which any unset window or pane options are inherited. Window and pane options are altered with set-option -w and -p commands and displayed with show-option -w and -p. also supports user options which are prefixed with a @. User options may have any name, so long as they are prefixed with @, and be set to any string. For example: $ tmux set -wq @foo "abc123" $ tmux show -wv @foo abc123 Commands which set options are as follows: set-option [-aFgopqsuUw] [-t target-pane] option value (alias: set) Set a pane option with -p, a window option with -w, a server option with -s, otherwise a session option. If the option is not a user option, -w or -s may be unnecessary - will infer the type from the option name, assuming -w for pane options. If -g is given, the global session or window option is set. -F expands formats in the option value. The -u flag unsets an option, so a session inherits the option from the global options (or with -g, restores a global option to the default). -U unsets an option (like -u) but if the option is a pane option also unsets the option on any panes in the window. value depends on the option and may be a number, a string, or a flag (on, off, or omitted to toggle). The -o flag prevents setting an option that is already set and the -q flag suppresses errors about unknown or ambiguous options. With -a, and if the option expects a string or a style, value is appended to the existing setting. For example: set -g status-left "foo" set -ag status-left "bar" Will result in foobar. And: set -g status-style "bg=red" set -ag status-style "fg=blue" Will result in a red background and blue foreground. Without -a, the result would be the default background and a blue foreground. show-options [-AgHpqsvw] [-t target-pane] [option] (alias: show) Show the pane options (or a single option if option is provided) with -p, the window options with -w, the server options with -s, otherwise the session options. If the option is not a user option, -w or -s may be unnecessary - will infer the type from the option name, assuming -w for pane options. Global session or window options are listed if -g is used. -v shows only the option value, not the name. If -q is set, no error will be returned if option is unset. -H includes hooks (omitted by default). -A includes options inherited from a parent set of options, such options are marked with an asterisk. Available server options are: backspace key Set the key sent by for backspace. buffer-limit number Set the number of buffers; as new buffers are added to the top of the stack, old ones are removed from the bottom if necessary to maintain this maximum length. command-alias[] name=value This is an array of custom aliases for commands. If an unknown command matches name, it is replaced with value. For example, after: set -s command-alias[100] zoom='resize-pane -Z' Using: zoom -t:.1 Is equivalent to: resize-pane -Z -t:.1 Note that aliases are expanded when a command is parsed rather than when it is executed, so binding an alias with bind-key will bind the expanded form. default-terminal terminal Set the default terminal for new windows created in this session - the default value of the TERM environment variable. For to work correctly, this must be set to screen, tmux or a derivative of them. copy-command shell-command Give the command to pipe to if the copy-pipe copy mode command is used without arguments. escape-time time Set the time in milliseconds for which waits after an escape is input to determine if it is part of a function or meta key sequences. The default is 500 milliseconds. editor shell-command Set the command used when runs an editor. exit-empty [on | off] If enabled (the default), the server will exit when there are no active sessions. exit-unattached [on | off] If enabled, the server will exit when there are no attached clients. extended-keys [on | off | always] When on or always, the escape sequence to enable extended keys is sent to the terminal, if knows that it is supported. always recognises extended keys itself. If this option is on, will only forward extended keys to applications when they request them; if always, will always forward the keys. focus-events [on | off] When enabled, focus events are requested from the terminal if supported and passed through to applications running in . Attached clients should be detached and attached again after changing this option. history-file path If not empty, a file to which will write command prompt history on exit and load it from on start. message-limit number Set the number of error or information messages to save in the message log for each client. prompt-history-limit number Set the number of history items to save in the history file for each type of command prompt. set-clipboard [on | external | off] Attempt to set the terminal clipboard content using the xterm(1) escape sequence, if there is an Ms entry in the terminfo(5) description (see the TERMINFO EXTENSIONS section). If set to on, will both accept the escape sequence to create a buffer and attempt to set the terminal clipboard. If set to external, will attempt to set the terminal clipboard but ignore attempts by applications to set buffers. If off, will neither accept the clipboard escape sequence nor attempt to set the clipboard. Note that this feature needs to be enabled in xterm(1) by setting the resource: disallowedWindowOps: 20,21,SetXprop Or changing this property from the xterm(1) interactive menu when required. terminal-features[] string Set terminal features for terminal types read from terminfo(5). has a set of named terminal features. Each will apply appropriate changes to the terminfo(5) entry in use. can detect features for a few common terminals; this option can be used to easily tell tmux about features supported by terminals it cannot detect. The terminal-overrides option allows individual terminfo(5) capabilities to be set instead, terminal-features is intended for classes of functionality supported in a standard way but not reported by terminfo(5). Care must be taken to configure this only with features the terminal actually supports. This is an array option where each entry is a colon- separated string made up of a terminal type pattern (matched using fnmatch(3)) followed by a list of terminal features. The available features are: 256 Supports 256 colours with the SGR escape sequences. clipboard Allows setting the system clipboard. ccolour Allows setting the cursor colour. cstyle Allows setting the cursor style. extkeys Supports extended keys. focus Supports focus reporting. hyperlinks Supports OSC 8 hyperlinks. ignorefkeys Ignore function keys from terminfo(5) and use the internal set only. margins Supports DECSLRM margins. mouse Supports xterm(1) mouse sequences. osc7 Supports the OSC 7 working directory extension. overline Supports the overline SGR attribute. rectfill Supports the DECFRA rectangle fill escape sequence. RGB Supports RGB colour with the SGR escape sequences. sixel Supports SIXEL graphics. strikethrough Supports the strikethrough SGR escape sequence. sync Supports synchronized updates. title Supports xterm(1) title setting. usstyle Allows underscore style and colour to be set. terminal-overrides[] string Allow terminal descriptions read using terminfo(5) to be overridden. Each entry is a colon-separated string made up of a terminal type pattern (matched using fnmatch(3)) and a set of name=value entries. For example, to set the clear terminfo(5) entry to \e[H\e[2J for all terminal types matching rxvt*: rxvt*:clear=\e[H\e[2J The terminal entry value is passed through strunvis(3) before interpretation. user-keys[] key Set list of user-defined key escape sequences. Each item is associated with a key named User0, User1, and so on. For example: set -s user-keys[0] "\e[5;30012~" bind User0 resize-pane -L 3 Available session options are: activity-action [any | none | current | other] Set action on window activity when monitor-activity is on. any means activity in any window linked to a session causes a bell or message (depending on visual-activity) in the current window of that session, none means all activity is ignored (equivalent to monitor-activity being off), current means only activity in windows other than the current window are ignored and other means activity in the current window is ignored but not those in other windows. assume-paste-time milliseconds If keys are entered faster than one in milliseconds, they are assumed to have been pasted rather than typed and key bindings are not processed. The default is one millisecond and zero disables. base-index index Set the base index from which an unused index should be searched when a new window is created. The default is zero. bell-action [any | none | current | other] Set action on a bell in a window when monitor-bell is on. The values are the same as those for activity-action. default-command shell-command Set the command used for new windows (if not specified when the window is created) to shell-command, which may be any sh(1) command. The default is an empty string, which instructs to create a login shell using the value of the default-shell option. default-shell path Specify the default shell. This is used as the login shell for new windows when the default-command option is set to empty, and must be the full path of the executable. When started tries to set a default value from the first suitable of the SHELL environment variable, the shell returned by getpwuid(3), or /bin/sh. This option should be configured when is used as a login shell. default-size XxY Set the default size of new windows when the window-size option is set to manual or when a session is created with new-session -d. The value is the width and height separated by an x character. The default is 80x24. destroy-unattached [on | off] If enabled and the session is no longer attached to any clients, it is destroyed. detach-on-destroy [off | on | no-detached | previous | next] If on (the default), the client is detached when the session it is attached to is destroyed. If off, the client is switched to the most recently active of the remaining sessions. If no-detached, the client is detached only if there are no detached sessions; if detached sessions exist, the client is switched to the most recently active. If previous or next, the client is switched to the previous or next session in alphabetical order. display-panes-active-colour colour Set the colour used by the display-panes command to show the indicator for the active pane. display-panes-colour colour Set the colour used by the display-panes command to show the indicators for inactive panes. display-panes-time time Set the time in milliseconds for which the indicators shown by the display-panes command appear. display-time time Set the amount of time for which status line messages and other on-screen indicators are displayed. If set to 0, messages and indicators are displayed until a key is pressed. time is in milliseconds. history-limit lines Set the maximum number of lines held in window history. This setting applies only to new windows - existing window histories are not resized and retain the limit at the point they were created. key-table key-table Set the default key table to key-table instead of root. lock-after-time number Lock the session (like the lock-session command) after number seconds of inactivity. The default is not to lock (set to 0). lock-command shell-command Command to run when locking each client. The default is to run lock(1) with -np. menu-style style Set the menu style. See the STYLES section on how to specify style. Attributes are ignored. menu-selected-style style Set the selected menu item style. See the STYLES section on how to specify style. Attributes are ignored. menu-border-style style Set the menu border style. See the STYLES section on how to specify style. Attributes are ignored. menu-border-lines type Set the type of characters used for drawing menu borders. See popup-border-lines for possible values for border-lines. message-command-style style Set status line message command style. This is used for the command prompt with vi(1) keys when in command mode. For how to specify style, see the STYLES section. message-line [0 | 1 | 2 | 3 | 4] Set line on which status line messages and the command prompt are shown. message-style style Set status line message style. This is used for messages and for the command prompt. For how to specify style, see the STYLES section. mouse [on | off] If on, captures the mouse and allows mouse events to be bound as key bindings. See the MOUSE SUPPORT section for details. prefix key Set the key accepted as a prefix key. In addition to the standard keys described under KEY BINDINGS, prefix can be set to the special key None to set no prefix. prefix2 key Set a secondary key accepted as a prefix key. Like prefix, prefix2 can be set to None. renumber-windows [on | off] If on, when a window is closed in a session, automatically renumber the other windows in numerical order. This respects the base-index option if it has been set. If off, do not renumber the windows. repeat-time time Allow multiple commands to be entered without pressing the prefix-key again in the specified time milliseconds (the default is 500). Whether a key repeats may be set when it is bound using the -r flag to bind-key. Repeat is enabled for the default keys bound to the resize-pane command. set-titles [on | off] Attempt to set the client terminal title using the tsl and fsl terminfo(5) entries if they exist. automatically sets these to the \e]0;...\007 sequence if the terminal appears to be xterm(1). This option is off by default. set-titles-string string String used to set the client terminal title if set-titles is on. Formats are expanded, see the FORMATS section. silence-action [any | none | current | other] Set action on window silence when monitor-silence is on. The values are the same as those for activity-action. status [off | on | 2 | 3 | 4 | 5] Show or hide the status line or specify its size. Using on gives a status line one row in height; 2, 3, 4 or 5 more rows. status-format[] format Specify the format to be used for each line of the status line. The default builds the top status line from the various individual status options below. status-interval interval Update the status line every interval seconds. By default, updates will occur every 15 seconds. A setting of zero disables redrawing at interval. status-justify [left | centre | right | absolute-centre] Set the position of the window list in the status line: left, centre or right. centre puts the window list in the relative centre of the available free space; absolute-centre uses the centre of the entire horizontal space. status-keys [vi | emacs] Use vi or emacs-style key bindings in the status line, for example at the command prompt. The default is emacs, unless the VISUAL or EDITOR environment variables are set and contain the string vi. status-left string Display string (by default the session name) to the left of the status line. string will be passed through strftime(3). Also see the FORMATS and STYLES sections. For details on how the names and titles can be set see the NAMES AND TITLES section. Examples are: #(sysctl vm.loadavg) #[fg=yellow,bold]#(apm -l)%%#[default] [#S] The default is [#S] . status-left-length length Set the maximum length of the left component of the status line. The default is 10. status-left-style style Set the style of the left part of the status line. For how to specify style, see the STYLES section. status-position [top | bottom] Set the position of the status line. status-right string Display string to the right of the status line. By default, the current pane title in double quotes, the date and the time are shown. As with status-left, string will be passed to strftime(3) and character pairs are replaced. status-right-length length Set the maximum length of the right component of the status line. The default is 40. status-right-style style Set the style of the right part of the status line. For how to specify style, see the STYLES section. status-style style Set status line style. For how to specify style, see the STYLES section. update-environment[] variable Set list of environment variables to be copied into the session environment when a new session is created or an existing session is attached. Any variables that do not exist in the source environment are set to be removed from the session environment (as if -r was given to the set-environment command). visual-activity [on | off | both] If on, display a message instead of sending a bell when activity occurs in a window for which the monitor-activity window option is enabled. If set to both, a bell and a message are produced. visual-bell [on | off | both] If on, a message is shown on a bell in a window for which the monitor-bell window option is enabled instead of it being passed through to the terminal (which normally makes a sound). If set to both, a bell and a message are produced. Also see the bell-action option. visual-silence [on | off | both] If monitor-silence is enabled, prints a message after the interval has expired on a given window instead of sending a bell. If set to both, a bell and a message are produced. word-separators string Sets the session's conception of what characters are considered word separators, for the purposes of the next and previous word commands in copy mode. Available window options are: aggressive-resize [on | off] Aggressively resize the chosen window. This means that will resize the window to the size of the smallest or largest session (see the window-size option) for which it is the current window, rather than the session to which it is attached. The window may resize when the current window is changed on another session; this option is good for full-screen programs which support SIGWINCH and poor for interactive programs such as shells. automatic-rename [on | off] Control automatic window renaming. When this setting is enabled, will rename the window automatically using the format specified by automatic-rename-format. This flag is automatically disabled for an individual window when a name is specified at creation with new-window or new-session, or later with rename-window, or with a terminal escape sequence. It may be switched off globally with: set-option -wg automatic-rename off automatic-rename-format format The format (see FORMATS) used when the automatic-rename option is enabled. clock-mode-colour colour Set clock colour. clock-mode-style [12 | 24] Set clock hour format. fill-character character Set the character used to fill areas of the terminal unused by a window. main-pane-height height main-pane-width width Set the width or height of the main (left or top) pane in the main-horizontal or main-vertical layouts. If suffixed by %, this is a percentage of the window size. copy-mode-match-style style Set the style of search matches in copy mode. For how to specify style, see the STYLES section. copy-mode-mark-style style Set the style of the line containing the mark in copy mode. For how to specify style, see the STYLES section. copy-mode-current-match-style style Set the style of the current search match in copy mode. For how to specify style, see the STYLES section. mode-keys [vi | emacs] Use vi or emacs-style key bindings in copy mode. The default is emacs, unless VISUAL or EDITOR contains vi. mode-style style Set window modes style. For how to specify style, see the STYLES section. monitor-activity [on | off] Monitor for activity in the window. Windows with activity are highlighted in the status line. monitor-bell [on | off] Monitor for a bell in the window. Windows with a bell are highlighted in the status line. monitor-silence [interval] Monitor for silence (no activity) in the window within interval seconds. Windows that have been silent for the interval are highlighted in the status line. An interval of zero disables the monitoring. other-pane-height height Set the height of the other panes (not the main pane) in the main-horizontal layout. If this option is set to 0 (the default), it will have no effect. If both the main-pane-height and other-pane-height options are set, the main pane will grow taller to make the other panes the specified height, but will never shrink to do so. If suffixed by %, this is a percentage of the window size. other-pane-width width Like other-pane-height, but set the width of other panes in the main-vertical layout. pane-active-border-style style Set the pane border style for the currently active pane. For how to specify style, see the STYLES section. Attributes are ignored. pane-base-index index Like base-index, but set the starting index for pane numbers. pane-border-format format Set the text shown in pane border status lines. pane-border-indicators [off | colour | arrows | both] Indicate active pane by colouring only half of the border in windows with exactly two panes, by displaying arrow markers, by drawing both or neither. pane-border-lines type Set the type of characters used for drawing pane borders. type may be one of: single single lines using ACS or UTF-8 characters double double lines using UTF-8 characters heavy heavy lines using UTF-8 characters simple simple ASCII characters number the pane number double and heavy will fall back to standard ACS line drawing when UTF-8 is not supported. pane-border-status [off | top | bottom] Turn pane border status lines off or set their position. pane-border-style style Set the pane border style for panes aside from the active pane. For how to specify style, see the STYLES section. Attributes are ignored. popup-style style Set the popup style. See the STYLES section on how to specify style. Attributes are ignored. popup-border-style style Set the popup border style. See the STYLES section on how to specify style. Attributes are ignored. popup-border-lines type Set the type of characters used for drawing popup borders. type may be one of: single single lines using ACS or UTF-8 characters (default) rounded variation of single with rounded corners using UTF-8 characters double double lines using UTF-8 characters heavy heavy lines using UTF-8 characters simple simple ASCII characters padded simple ASCII space character none no border double and heavy will fall back to standard ACS line drawing when UTF-8 is not supported. window-status-activity-style style Set status line style for windows with an activity alert. For how to specify style, see the STYLES section. window-status-bell-style style Set status line style for windows with a bell alert. For how to specify style, see the STYLES section. window-status-current-format string Like window-status-format, but is the format used when the window is the current window. window-status-current-style style Set status line style for the currently active window. For how to specify style, see the STYLES section. window-status-format string Set the format in which the window is displayed in the status line window list. See the FORMATS and STYLES sections. window-status-last-style style Set status line style for the last active window. For how to specify style, see the STYLES section. window-status-separator string Sets the separator drawn between windows in the status line. The default is a single space character. window-status-style style Set status line style for a single window. For how to specify style, see the STYLES section. window-size largest | smallest | manual | latest Configure how determines the window size. If set to largest, the size of the largest attached session is used; if smallest, the size of the smallest. If manual, the size of a new window is set from the default-size option and windows are resized automatically. With latest, uses the size of the client that had the most recent activity. See also the resize-window command and the aggressive-resize option. wrap-search [on | off] If this option is set, searches will wrap around the end of the pane contents. The default is on. Available pane options are: allow-passthrough [on | off | all] Allow programs in the pane to bypass using a terminal escape sequence (\ePtmux;...\e\\). If set to on, passthrough sequences will be allowed only if the pane is visible. If set to all, they will be allowed even if the pane is invisible. allow-rename [on | off] Allow programs in the pane to change the window name using a terminal escape sequence (\ek...\e\\). alternate-screen [on | off] This option configures whether programs running inside the pane may use the terminal alternate screen feature, which allows the smcup and rmcup terminfo(5) capabilities. The alternate screen feature preserves the contents of the window when an interactive application starts and restores it on exit, so that any output visible before the application starts reappears unchanged after it exits. cursor-colour colour Set the colour of the cursor. pane-colours[] colour The default colour palette. Each entry in the array defines the colour uses when the colour with that index is requested. The index may be from zero to 255. cursor-style style Set the style of the cursor. Available styles are: default, blinking-block, block, blinking-underline, underline, blinking-bar, bar. remain-on-exit [on | off | failed] A pane with this flag set is not destroyed when the program running in it exits. If set to failed, then only when the program exit status is not zero. The pane may be reactivated with the respawn-pane command. remain-on-exit-format string Set the text shown at the bottom of exited panes when remain-on-exit is enabled. scroll-on-clear [on | off] When the entire screen is cleared and this option is on, scroll the contents of the screen into history before clearing it. synchronize-panes [on | off] Duplicate input to all other panes in the same window where this option is also on (only for panes that are not in any mode). window-active-style style Set the pane style when it is the active pane. For how to specify style, see the STYLES section. window-style style Set the pane style. For how to specify style, see the STYLES section. HOOKS top allows commands to run on various triggers, called hooks. Most commands have an after hook and there are a number of hooks not associated with commands. Hooks are stored as array options, members of the array are executed in order when the hook is triggered. Like options different hooks may be global or belong to a session, window or pane. Hooks may be configured with the set-hook or set-option commands and displayed with show-hooks or show-options -H. The following two commands are equivalent: set-hook -g pane-mode-changed[42] 'set -g status-left-style bg=red' set-option -g pane-mode-changed[42] 'set -g status-left-style bg=red' Setting a hook without specifying an array index clears the hook and sets the first member of the array. A command's after hook is run after it completes, except when the command is run as part of a hook itself. They are named with an after- prefix. For example, the following command adds a hook to select the even-vertical layout after every split-window: set-hook -g after-split-window "selectl even-vertical" All the notifications listed in the CONTROL MODE section are hooks (without any arguments), except %exit. The following additional hooks are available: alert-activity Run when a window has activity. See monitor-activity. alert-bell Run when a window has received a bell. See monitor-bell. alert-silence Run when a window has been silent. See monitor-silence. client-active Run when a client becomes the latest active client of its session. client-attached Run when a client is attached. client-detached Run when a client is detached client-focus-in Run when focus enters a client client-focus-out Run when focus exits a client client-resized Run when a client is resized. client-session-changed Run when a client's attached session is changed. pane-died Run when the program running in a pane exits, but remain-on-exit is on so the pane has not closed. pane-exited Run when the program running in a pane exits. pane-focus-in Run when the focus enters a pane, if the focus-events option is on. pane-focus-out Run when the focus exits a pane, if the focus-events option is on. pane-set-clipboard Run when the terminal clipboard is set using the xterm(1) escape sequence. session-created Run when a new session created. session-closed Run when a session closed. session-renamed Run when a session is renamed. window-linked Run when a window is linked into a session. window-renamed Run when a window is renamed. window-resized Run when a window is resized. This may be after the client-resized hook is run. window-unlinked Run when a window is unlinked from a session. Hooks are managed with these commands: set-hook [-agpRuw] [-t target-pane] hook-name command Without -R, sets (or with -u unsets) hook hook-name to command. The flags are the same as for set-option. With -R, run hook-name immediately. show-hooks [-gpw] [-t target-pane] Shows hooks. The flags are the same as for show-options. MOUSE SUPPORT top If the mouse option is on (the default is off), allows mouse events to be bound as keys. The name of each key is made up of a mouse event (such as MouseUp1) and a location suffix, one of the following: Pane the contents of a pane Border a pane border Status the status line window list StatusLeft the left part of the status line StatusRight the right part of the status line StatusDefault any other part of the status line The following mouse events are available: WheelUp WheelDown MouseDown1 MouseUp1 MouseDrag1 MouseDragEnd1 MouseDown2 MouseUp2 MouseDrag2 MouseDragEnd2 MouseDown3 MouseUp3 MouseDrag3 MouseDragEnd3 SecondClick1 SecondClick2 SecondClick3 DoubleClick1 DoubleClick2 DoubleClick3 TripleClick1 TripleClick2 TripleClick3 The SecondClick events are fired for the second click of a double click, even if there may be a third click which will fire TripleClick instead of DoubleClick. Each should be suffixed with a location, for example MouseDown1Status. The special token {mouse} or = may be used as target-window or target-pane in commands bound to mouse key bindings. It resolves to the window or pane over which the mouse event took place (for example, the window in the status line over which button 1 was released for a MouseUp1Status binding, or the pane over which the wheel was scrolled for a WheelDownPane binding). The send-keys -M flag may be used to forward a mouse event to a pane. The default key bindings allow the mouse to be used to select and resize panes, to copy text and to change window using the status line. These take effect if the mouse option is turned on. FORMATS top Certain commands accept the -F flag with a format argument. This is a string which controls the output format of the command. Format variables are enclosed in #{ and }, for example #{session_name}. The possible variables are listed in the table below, or the name of a option may be used for an option's value. Some variables have a shorter alias such as #S; ## is replaced by a single #, #, by a , and #} by a }. Conditionals are available by prefixing with ? and separating two alternatives with a comma; if the specified variable exists and is not zero, the first alternative is chosen, otherwise the second is used. For example #{?session_attached,attached,not attached} will include the string attached if the session is attached and the string not attached if it is unattached, or #{?automatic-rename,yes,no} will include yes if automatic-rename is enabled, or no if not. Conditionals can be nested arbitrarily. Inside a conditional, , and } must be escaped as #, and #}, unless they are part of a #{...} replacement. For example: #{?pane_in_mode,#[fg=white#,bg=red],#[fg=red#,bg=white]}#W . String comparisons may be expressed by prefixing two comma- separated alternatives by ==, !=, <, >, <= or >= and a colon. For example #{==:#{host},myhost} will be replaced by 1 if running on myhost, otherwise by 0. || and && evaluate to true if either or both of two comma-separated alternatives are true, for example #{||:#{pane_in_mode},#{alternate_on}}. An m specifies an fnmatch(3) or regular expression comparison. The first argument is the pattern and the second the string to compare. An optional argument specifies flags: r means the pattern is a regular expression instead of the default fnmatch(3) pattern, and i means to ignore case. For example: #{m:*foo*,#{host}} or #{m/ri:^A,MYVAR}. A C performs a search for an fnmatch(3) pattern or regular expression in the pane content and evaluates to zero if not found, or a line number if found. Like m, an r flag means search for a regular expression and i ignores case. For example: #{C/r:^Start} Numeric operators may be performed by prefixing two comma- separated alternatives with an e and an operator. An optional f flag may be given after the operator to use floating point numbers, otherwise integers are used. This may be followed by a number giving the number of decimal places to use for the result. The available operators are: addition +, subtraction -, multiplication *, division /, modulus m or % (note that % must be escaped as %% in formats which are also expanded by strftime(3)) and numeric comparison operators ==, !=, <, <=, > and >=. For example, #{e|*|f|4:5.5,3} multiplies 5.5 by 3 for a result with four decimal places and #{e|%%:7,3} returns the modulus of 7 and 3. a replaces a numeric argument by its ASCII equivalent, so #{a:98} results in b. c replaces a colour by its six-digit hexadecimal RGB value. A limit may be placed on the length of the resultant string by prefixing it by an =, a number and a colon. Positive numbers count from the start of the string and negative from the end, so #{=5:pane_title} will include at most the first five characters of the pane title, or #{=-5:pane_title} the last five characters. A suffix or prefix may be given as a second argument - if provided then it is appended or prepended to the string if the length has been trimmed, for example #{=/5/...:pane_title} will append ... if the pane title is more than five characters. Similarly, p pads the string to a given width, for example #{p10:pane_title} will result in a width of at least 10 characters. A positive width pads on the left, a negative on the right. n expands to the length of the variable and w to its width when displayed, for example #{n:window_name}. Prefixing a time variable with t: will convert it to a string, so if #{window_activity} gives 1445765102, #{t:window_activity} gives Sun Oct 25 09:25:02 2015. Adding p ( `t/p`) will use shorter but less accurate time format for times in the past. A custom format may be given using an f suffix (note that % must be escaped as %% if the format is separately being passed through strftime(3), for example in the status-left option): #{t/f/%%H#:%%M:window_activity}, see strftime(3). The b: and d: prefixes are basename(3) and dirname(3) of the variable respectively. q: will escape sh(1) special characters or with a h suffix, escape hash characters (so # becomes ##). E: will expand the format twice, for example #{E:status-left} is the result of expanding the content of the status-left option rather than the option itself. T: is like E: but also expands strftime(3) specifiers. S:, W:, P: or L: will loop over each session, window, pane or client and insert the format once for each. For windows and panes, two comma-separated formats may be given: the second is used for the current window or active pane. For example, to get a list of windows formatted like the status line: #{W:#{E:window-status-format} ,#{E:window-status-current-format} } N: checks if a window (without any suffix or with the w suffix) or a session (with the s suffix) name exists, for example `N/w:foo` is replaced with 1 if a window named foo exists. A prefix of the form s/foo/bar/: will substitute foo with bar throughout. The first argument may be an extended regular expression and a final argument may be i to ignore case, for example s/a(.)/\1x/i: would change abABab into bxBxbx. A different delimiter character may also be used, to avoid collisions with literal slashes in the pattern. For example, s|foo/|bar/|: will substitute foo/ with bar/ throughout. In addition, the last line of a shell command's output may be inserted using #(). For example, #(uptime) will insert the system's uptime. When constructing formats, does not wait for #() commands to finish; instead, the previous result from running the same command is used, or a placeholder if the command has not been run before. If the command hasn't exited, the most recent line of output will be used, but the status line will not be updated more than once a second. Commands are executed using /bin/sh and with the global environment set (see the GLOBAL AND SESSION ENVIRONMENT section). An l specifies that a string should be interpreted literally and not expanded. For example #{l:#{?pane_in_mode,yes,no}} will be replaced by #{?pane_in_mode,yes,no}. The following variables are available, where appropriate: Variable name Alias Replaced with active_window_index Index of active window in session alternate_on 1 if pane is in alternate screen alternate_saved_x Saved cursor X in alternate screen alternate_saved_y Saved cursor Y in alternate screen buffer_created Time buffer created buffer_name Name of buffer buffer_sample Sample of start of buffer buffer_size Size of the specified buffer in bytes client_activity Time client last had activity client_cell_height Height of each client cell in pixels client_cell_width Width of each client cell in pixels client_control_mode 1 if client is in control mode client_created Time client created client_discarded Bytes discarded when client behind client_flags List of client flags client_height Height of client client_key_table Current key table client_last_session Name of the client's last session client_name Name of client client_pid PID of client process client_prefix 1 if prefix key has been pressed client_readonly 1 if client is read-only client_session Name of the client's session client_termfeatures Terminal features of client, if any client_termname Terminal name of client client_termtype Terminal type of client, if available client_tty Pseudo terminal of client client_uid UID of client process client_user User of client process client_utf8 1 if client supports UTF-8 client_width Width of client client_written Bytes written to client command Name of command in use, if any command_list_alias Command alias if listing commands command_list_name Command name if listing commands command_list_usage Command usage if listing commands config_files List of configuration files loaded copy_cursor_line Line the cursor is on in copy mode copy_cursor_word Word under cursor in copy mode copy_cursor_x Cursor X position in copy mode copy_cursor_y Cursor Y position in copy mode current_file Current configuration file cursor_character Character at cursor in pane cursor_flag Pane cursor flag cursor_x Cursor X position in pane cursor_y Cursor Y position in pane history_bytes Number of bytes in window history history_limit Maximum window history lines history_size Size of history in lines hook Name of running hook, if any hook_client Name of client where hook was run, if any hook_pane ID of pane where hook was run, if any hook_session ID of session where hook was run, if any hook_session_name Name of session where hook was run, if any hook_window ID of window where hook was run, if any hook_window_name Name of window where hook was run, if any host #H Hostname of local host host_short #h Hostname of local host (no domain name) insert_flag Pane insert flag keypad_cursor_flag Pane keypad cursor flag keypad_flag Pane keypad flag last_window_index Index of last window in session line Line number in the list mouse_all_flag Pane mouse all flag mouse_any_flag Pane mouse any flag mouse_button_flag Pane mouse button flag mouse_hyperlink Hyperlink under mouse, if any mouse_line Line under mouse, if any mouse_sgr_flag Pane mouse SGR flag mouse_standard_flag Pane mouse standard flag mouse_status_line Status line on which mouse event took place mouse_status_range Range type or argument of mouse event on status line mouse_utf8_flag Pane mouse UTF-8 flag mouse_word Word under mouse, if any mouse_x Mouse X position, if any mouse_y Mouse Y position, if any next_session_id Unique session ID for next new session origin_flag Pane origin flag pane_active 1 if active pane pane_at_bottom 1 if pane is at the bottom of window pane_at_left 1 if pane is at the left of window pane_at_right 1 if pane is at the right of window pane_at_top 1 if pane is at the top of window pane_bg Pane background colour pane_bottom Bottom of pane pane_current_command Current command if available pane_current_path Current path if available pane_dead 1 if pane is dead pane_dead_signal Exit signal of process in dead pane pane_dead_status Exit status of process in dead pane pane_dead_time Exit time of process in dead pane pane_fg Pane foreground colour pane_format 1 if format is for a pane pane_height Height of pane pane_id #D Unique pane ID pane_in_mode 1 if pane is in a mode pane_index #P Index of pane pane_input_off 1 if input to pane is disabled pane_last 1 if last pane pane_left Left of pane pane_marked 1 if this is the marked pane pane_marked_set 1 if a marked pane is set pane_mode Name of pane mode, if any pane_path Path of pane (can be set by application) pane_pid PID of first process in pane pane_pipe 1 if pane is being piped pane_right Right of pane pane_search_string Last search string in copy mode pane_start_command Command pane started with pane_start_path Path pane started with pane_synchronized 1 if pane is synchronized pane_tabs Pane tab positions pane_title #T Title of pane (can be set by application) pane_top Top of pane pane_tty Pseudo terminal of pane pane_unseen_changes 1 if there were changes in pane while in mode pane_width Width of pane pid Server PID rectangle_toggle 1 if rectangle selection is activated scroll_position Scroll position in copy mode scroll_region_lower Bottom of scroll region in pane scroll_region_upper Top of scroll region in pane search_match Search match if any search_present 1 if search started in copy mode selection_active 1 if selection started and changes with the cursor in copy mode selection_end_x X position of the end of the selection selection_end_y Y position of the end of the selection selection_present 1 if selection started in copy mode selection_start_x X position of the start of the selection selection_start_y Y position of the start of the selection server_sessions Number of sessions session_activity Time of session last activity session_alerts List of window indexes with alerts session_attached Number of clients session is attached to session_attached_list List of clients session is attached to session_created Time session created session_format 1 if format is for a session session_group Name of session group session_group_attached Number of clients sessions in group are attached to session_group_attached_list List of clients sessions in group are attached to session_group_list List of sessions in group session_group_many_attached 1 if multiple clients attached to sessions in group session_group_size Size of session group session_grouped 1 if session in a group session_id Unique session ID session_last_attached Time session last attached session_many_attached 1 if multiple clients attached session_marked 1 if this session contains the marked pane session_name #S Name of session session_path Working directory of session session_stack Window indexes in most recent order session_windows Number of windows in session socket_path Server socket path start_time Server start time uid Server UID user Server user version Server version window_active 1 if window active window_active_clients Number of clients viewing this window window_active_clients_list List of clients viewing this window window_active_sessions Number of sessions on which this window is active window_active_sessions_list List of sessions on which this window is active window_activity Time of window last activity window_activity_flag 1 if window has activity window_bell_flag 1 if window has bell window_bigger 1 if window is larger than client window_cell_height Height of each cell in pixels window_cell_width Width of each cell in pixels window_end_flag 1 if window has the highest index window_flags #F Window flags with # escaped as ## window_format 1 if format is for a window window_height Height of window window_id Unique window ID window_index #I Index of window window_last_flag 1 if window is the last used window_layout Window layout description, ignoring zoomed window panes window_linked 1 if window is linked across sessions window_linked_sessions Number of sessions this window is linked to window_linked_sessions_list List of sessions this window is linked to window_marked_flag 1 if window contains the marked pane window_name #W Name of window window_offset_x X offset into window if larger than client window_offset_y Y offset into window if larger than client window_panes Number of panes in window window_raw_flags Window flags with nothing escaped window_silence_flag 1 if window has silence alert window_stack_index Index in session most recent stack window_start_flag 1 if window has the lowest index window_visible_layout Window layout description, respecting zoomed window panes window_width Width of window window_zoomed_flag 1 if window is zoomed wrap_flag Pane wrap flag STYLES top offers various options to specify the colour and attributes of aspects of the interface, for example status-style for the status line. In addition, embedded styles may be specified in format options, such as status-left, by enclosing them in #[ and ]. A style may be the single term default to specify the default style (which may come from an option, for example status-style in the status line) or a space or comma separated list of the following: fg=colour Set the foreground colour. The colour is one of: black, red, green, yellow, blue, magenta, cyan, white; if supported the bright variants brightred, brightgreen, brightyellow; colour0 to colour255 from the 256-colour set; default for the default colour; terminal for the terminal default colour; or a hexadecimal RGB string such as #ffffff. bg=colour Set the background colour. us=colour Set the underscore colour. none Set no attributes (turn off any active attributes). acs, bright (or bold), dim, underscore, blink, reverse, hidden, italics, overline, strikethrough, double-underscore, curly-underscore, dotted-underscore, dashed-underscore Set an attribute. Any of the attributes may be prefixed with no to unset. acs is the terminal alternate character set. align=left (or noalign), align=centre, align=right Align text to the left, centre or right of the available space if appropriate. fill=colour Fill the available space with a background colour if appropriate. list=on, list=focus, list=left-marker, list=right-marker, nolist Mark the position of the various window list components in the status-format option: list=on marks the start of the list; list=focus is the part of the list that should be kept in focus if the entire list won't fit in the available space (typically the current window); list=left-marker and list=right-marker mark the text to be used to mark that text has been trimmed from the left or right of the list if there is not enough space. push-default, pop-default Store the current colours and attributes as the default or reset to the previous default. A push-default affects any subsequent use of the default term until a pop-default. Only one default may be pushed (each push-default replaces the previous saved default). range=left, range=right, range=session|X, range=window|X, range=pane|X, range=user|X, norange Mark a range for mouse events in the status-format option. When a mouse event occurs in the range=left or range=right range, the StatusLeft and StatusRight key bindings are triggered. range=session|X, range=window|X and range=pane|X are ranges for a session, window or pane. These trigger the Status mouse key with the target session, window or pane given by the X argument. X is a session ID, window index in the current session or a pane ID. For these, the mouse_status_range format variable will be set to session, window or pane. range=user|X is a user-defined range; it triggers the Status mouse key. The argument X will be available in the mouse_status_range format variable. X must be at most 15 bytes in length. Examples are: fg=yellow bold underscore blink bg=black,fg=default,noreverse NAMES AND TITLES top distinguishes between names and titles. Windows and sessions have names, which may be used to specify them in targets and are displayed in the status line and various lists: the name is the identifier for a window or session. Only panes have titles. A pane's title is typically set by the program running inside the pane using an escape sequence (like it would set the xterm(1) window title in X(7)). Windows themselves do not have titles - a window's title is the title of its active pane. itself may set the title of the terminal in which the client is running, see the set-titles option. A session's name is set with the new-session and rename-session commands. A window's name is set with one of: 1. A command argument (such as -n for new-window or new-session). 2. An escape sequence (if the allow-rename option is turned on): $ printf '\033kWINDOW_NAME\033\\' 3. Automatic renaming, which sets the name to the active command in the window's active pane. See the automatic-rename option. When a pane is first created, its title is the hostname. A pane's title can be set via the title setting escape sequence, for example: $ printf '\033]2;My Title\033\\' It can also be modified with the select-pane -T command. GLOBAL AND SESSION ENVIRONMENT top When the server is started, copies the environment into the global environment; in addition, each session has a session environment. When a window is created, the session and global environments are merged. If a variable exists in both, the value from the session environment is used. The result is the initial environment passed to the new process. The update-environment session option may be used to update the session environment from the client when a new session is created or an old reattached. also initialises the TMUX variable with some internal information to allow commands to be executed from inside, and the TERM variable with the correct terminal setting of screen. Variables in both session and global environments may be marked as hidden. Hidden variables are not passed into the environment of new processes and instead can only be used by tmux itself (for example in formats, see the FORMATS section). Commands to alter and view the environment are: set-environment [-Fhgru] [-t target-session] name [value] (alias: setenv) Set or unset an environment variable. If -g is used, the change is made in the global environment; otherwise, it is applied to the session environment for target-session. If -F is present, then value is expanded as a format. The -u flag unsets a variable. -r indicates the variable is to be removed from the environment before starting a new process. -h marks the variable as hidden. show-environment [-hgs] [-t target-session] [variable] (alias: showenv) Display the environment for target-session or the global environment with -g. If variable is omitted, all variables are shown. Variables removed from the environment are prefixed with -. If -s is used, the output is formatted as a set of Bourne shell commands. -h shows hidden variables (omitted by default). STATUS LINE top includes an optional status line which is displayed in the bottom line of each terminal. By default, the status line is enabled and one line in height (it may be disabled or made multiple lines with the status session option) and contains, from left-to-right: the name of the current session in square brackets; the window list; the title of the active pane in double quotes; and the time and date. Each line of the status line is configured with the status-format option. The default is made of three parts: configurable left and right sections (which may contain dynamic content such as the time or output from a shell command, see the status-left, status-left-length, status-right, and status-right-length options below), and a central window list. By default, the window list shows the index, name and (if any) flag of the windows present in the current session in ascending numerical order. It may be customised with the window-status-format and window-status-current-format options. The flag is one of the following symbols appended to the window name: Symbol Meaning * Denotes the current window. - Marks the last window (previously selected). # Window activity is monitored and activity has been detected. ! Window bells are monitored and a bell has occurred in the window. ~ The window has been silent for the monitor- silence interval. M The window contains the marked pane. Z The window's active pane is zoomed. The # symbol relates to the monitor-activity window option. The window name is printed in inverted colours if an alert (bell, activity or silence) is present. The colour and attributes of the status line may be configured, the entire status line using the status-style session option and individual windows using the window-status-style window option. The status line is automatically refreshed at interval if it has changed, the interval may be controlled with the status-interval session option. Commands related to the status line are as follows: clear-prompt-history [-T prompt-type] (alias: clearphist) Clear status prompt history for prompt type prompt-type. If -T is omitted, then clear history for all types. See command-prompt for possible values for prompt-type. command-prompt [-1bFikN] [-I inputs] [-p prompts] [-t target-client] [-T prompt-type] [template] Open the command prompt in a client. This may be used from inside to execute commands interactively. If template is specified, it is used as the command. With -F, template is expanded as a format. If present, -I is a comma-separated list of the initial text for each prompt. If -p is given, prompts is a comma-separated list of prompts which are displayed in order; otherwise a single prompt is displayed, constructed from template if it is present, or : if not. Before the command is executed, the first occurrence of the string %% and all occurrences of %1 are replaced by the response to the first prompt, all %2 are replaced with the response to the second prompt, and so on for further prompts. Up to nine prompt responses may be replaced (%1 to %9). %%% is like %% but any quotation marks are escaped. -1 makes the prompt only accept one key press, in this case the resulting input is a single character. -k is like -1 but the key press is translated to a key name. -N makes the prompt only accept numeric key presses. -i executes the command every time the prompt input changes instead of when the user exits the command prompt. -T tells the prompt type. This affects what completions are offered when Tab is pressed. Available types are: command, search, target and window-target. The following keys have a special meaning in the command prompt, depending on the value of the status-keys option: Function vi emacs Cancel command prompt q Escape Delete from cursor to start of word C-w Delete entire command d C-u Delete from cursor to end D C-k Execute command Enter Enter Get next command from history Down Get previous command from history Up Insert top paste buffer p C-y Look for completions Tab Tab Move cursor left h Left Move cursor right l Right Move cursor to end $ C-e Move cursor to next word w M-f Move cursor to previous word b M-b Move cursor to start 0 C-a Transpose characters C-t With -b, the prompt is shown in the background and the invoking client does not exit until it is dismissed. confirm-before [-by] [-c confirm-key] [-p prompt] [-t target-client] command (alias: confirm) Ask for confirmation before executing command. If -p is given, prompt is the prompt to display; otherwise a prompt is constructed from command. It may contain the special character sequences supported by the status-left option. With -b, the prompt is shown in the background and the invoking client does not exit until it is dismissed. -y changes the default behaviour (if Enter alone is pressed) of the prompt to run the command. -c changes the confirmation key to confirm-key; the default is y. display-menu [-O] [-b border-lines] [-c target-client] [-C starting-choice] [-H selected-style] [-s style] [-S border-style] [-t target-pane] [-T title] [-x position] [-y position] name key command [argument ...] (alias: menu) Display a menu on target-client. target-pane gives the target for any commands run from the menu. A menu is passed as a series of arguments: first the menu item name, second the key shortcut (or empty for none) and third the command to run when the menu item is chosen. The name and command are formats, see the FORMATS and STYLES sections. If the name begins with a hyphen (-), then the item is disabled (shown dim) and may not be chosen. The name may be empty for a separator line, in which case both the key and command should be omitted. -b sets the type of characters used for drawing menu borders. See popup-border-lines for possible values for border-lines. -H sets the style for the selected menu item (see STYLES). -s sets the style for the menu and -S sets the style for the menu border (see STYLES). -T is a format for the menu title (see FORMATS). -C sets the menu item selected by default, if the menu is not bound to a mouse key binding. -x and -y give the position of the menu. Both may be a row or column number, or one of the following special values: Value Flag Meaning C Both The centre of the terminal R -x The right side of the terminal P Both The bottom left of the pane M Both The mouse position W Both The window position on the status line S -y The line above or below the status line Or a format, which is expanded including the following additional variables: Variable name Replaced with popup_centre_x Centered in the client popup_centre_y Centered in the client popup_height Height of menu or popup popup_mouse_bottom Bottom of at the mouse popup_mouse_centre_x Horizontal centre at the mouse popup_mouse_centre_y Vertical centre at the mouse popup_mouse_top Top at the mouse popup_mouse_x Mouse X position popup_mouse_y Mouse Y position popup_pane_bottom Bottom of the pane popup_pane_left Left of the pane popup_pane_right Right of the pane popup_pane_top Top of the pane popup_status_line_y Above or below the status line popup_width Width of menu or popup popup_window_status_line_x At the window position in status line popup_window_status_line_y At the status line showing the window Each menu consists of items followed by a key shortcut shown in brackets. If the menu is too large to fit on the terminal, it is not displayed. Pressing the key shortcut chooses the corresponding item. If the mouse is enabled and the menu is opened from a mouse key binding, releasing the mouse button with an item selected chooses that item and releasing the mouse button without an item selected closes the menu. -O changes this behaviour so that the menu does not close when the mouse button is released without an item selected the menu is not closed and a mouse button must be clicked to choose an item. The following keys are also available: Key Function Enter Choose selected item Up Select previous item Down Select next item q Exit menu display-message [-aIlNpv] [-c target-client] [-d delay] [-t target-pane] [message] (alias: display) Display a message. If -p is given, the output is printed to stdout, otherwise it is displayed in the target-client status line for up to delay milliseconds. If delay is not given, the display-time option is used; a delay of zero waits for a key press. N ignores key presses and closes only after the delay expires. If -l is given, message is printed unchanged. Otherwise, the format of message is described in the FORMATS section; information is taken from target-pane if -t is given, otherwise the active pane. -v prints verbose logging as the format is parsed and -a lists the format variables and their values. -I forwards any input read from stdin to the empty pane given by target-pane. display-popup [-BCE] [-b border-lines] [-c target-client] [-d start-directory] [-e environment] [-h height] [-s border-style] [-S style] [-t target-pane] [-T title] [-w width] [-x position] [-y position] [shell-command] (alias: popup) Display a popup running shell-command on target-client. A popup is a rectangular box drawn over the top of any panes. Panes are not updated while a popup is present. -E closes the popup automatically when shell-command exits. Two -E closes the popup only if shell-command exited with success. -x and -y give the position of the popup, they have the same meaning as for the display-menu command. -w and -h give the width and height - both may be a percentage (followed by %). If omitted, half of the terminal size is used. -B does not surround the popup by a border. -b sets the type of characters used for drawing popup borders. When -B is specified, the -b option is ignored. See popup-border-lines for possible values for border-lines. -s sets the style for the popup and -S sets the style for the popup border (see STYLES). -e takes the form VARIABLE=value and sets an environment variable for the popup; it may be specified multiple times. -T is a format for the popup title (see FORMATS). The -C flag closes any popup on the client. show-prompt-history [-T prompt-type] (alias: showphist) Display status prompt history for prompt type prompt-type. If -T is omitted, then show history for all types. See command-prompt for possible values for prompt-type. BUFFERS top maintains a set of named paste buffers. Each buffer may be either explicitly or automatically named. Explicitly named buffers are named when created with the set-buffer or load-buffer commands, or by renaming an automatically named buffer with set-buffer -n. Automatically named buffers are given a name such as buffer0001, buffer0002 and so on. When the buffer-limit option is reached, the oldest automatically named buffer is deleted. Explicitly named buffers are not subject to buffer-limit and may be deleted with the delete-buffer command. Buffers may be added using copy-mode or the set-buffer and load-buffer commands, and pasted into a window using the paste-buffer command. If a buffer command is used and no buffer is specified, the most recently added automatically named buffer is assumed. A configurable history buffer is also maintained for each window. By default, up to 2000 lines are kept; this can be altered with the history-limit option (see the set-option command above). The buffer commands are as follows: choose-buffer [-NZr] [-F format] [-f filter] [-K key-format] [-O sort-order] [-t target-pane] [template] Put a pane into buffer mode, where a buffer may be chosen interactively from a list. Each buffer is shown on one line. A shortcut key is shown on the left in brackets allowing for immediate choice, or the list may be navigated and an item chosen or otherwise manipulated using the keys below. -Z zooms the pane. The following keys may be used in buffer mode: Key Function Enter Paste selected buffer Up Select previous buffer Down Select next buffer C-s Search by name or content n Repeat last search t Toggle if buffer is tagged T Tag no buffers C-t Tag all buffers p Paste selected buffer P Paste tagged buffers d Delete selected buffer D Delete tagged buffers e Open the buffer in an editor f Enter a format to filter items O Change sort field r Reverse sort order v Toggle preview q Exit mode After a buffer is chosen, %% is replaced by the buffer name in template and the result executed as a command. If template is not given, "paste-buffer -b '%%'" is used. -O specifies the initial sort field: one of time (creation), name or size. -r reverses the sort order. -f specifies an initial filter: the filter is a format - if it evaluates to zero, the item in the list is not shown, otherwise it is shown. If a filter would lead to an empty list, it is ignored. -F specifies the format for each item in the list and -K a format for each shortcut key; both are evaluated once for each line. -N starts without the preview. This command works only if at least one client is attached. clear-history [-H] [-t target-pane] (alias: clearhist) Remove and free the history for the specified pane. -H also removes all hyperlinks. delete-buffer [-b buffer-name] (alias: deleteb) Delete the buffer named buffer-name, or the most recently added automatically named buffer if not specified. list-buffers [-F format] [-f filter] (alias: lsb) List the global buffers. -F specifies the format of each line and -f a filter. Only buffers for which the filter is true are shown. See the FORMATS section. load-buffer [-w] [-b buffer-name] [-t target-client] path (alias: loadb) Load the contents of the specified paste buffer from path. If -w is given, the buffer is also sent to the clipboard for target-client using the xterm(1) escape sequence, if possible. paste-buffer [-dpr] [-b buffer-name] [-s separator] [-t target-pane] (alias: pasteb) Insert the contents of a paste buffer into the specified pane. If not specified, paste into the current one. With -d, also delete the paste buffer. When output, any linefeed (LF) characters in the paste buffer are replaced with a separator, by default carriage return (CR). A custom separator may be specified using the -s flag. The -r flag means to do no replacement (equivalent to a separator of LF). If -p is specified, paste bracket control codes are inserted around the buffer if the application has requested bracketed paste mode. save-buffer [-a] [-b buffer-name] path (alias: saveb) Save the contents of the specified paste buffer to path. The -a option appends to rather than overwriting the file. set-buffer [-aw] [-b buffer-name] [-t target-client] [-n new-buffer-name] data (alias: setb) Set the contents of the specified buffer to data. If -w is given, the buffer is also sent to the clipboard for target-client using the xterm(1) escape sequence, if possible. The -a option appends to rather than overwriting the buffer. The -n option renames the buffer to new-buffer-name. show-buffer [-b buffer-name] (alias: showb) Display the contents of the specified buffer. MISCELLANEOUS top Miscellaneous commands are as follows: clock-mode [-t target-pane] Display a large clock. if-shell [-bF] [-t target-pane] shell-command command [command] (alias: if) Execute the first command if shell-command (run with /bin/sh) returns success or the second command otherwise. Before being executed, shell-command is expanded using the rules specified in the FORMATS section, including those relevant to target-pane. With -b, shell-command is run in the background. If -F is given, shell-command is not executed but considered success if neither empty nor zero (after formats are expanded). lock-server (alias: lock) Lock each client individually by running the command specified by the lock-command option. run-shell [-bC] [-c start-directory] [-d delay] [-t target-pane] [shell-command] (alias: run) Execute shell-command using /bin/sh or (with -C) a command in the background without creating a window. Before being executed, shell-command is expanded using the rules specified in the FORMATS section. With -b, the command is run in the background. -d waits for delay seconds before starting the command. If -c is given, the current working directory is set to start-directory. If -C is not given, any output to stdout is displayed in view mode (in the pane specified by -t or the current pane if omitted) after the command finishes. If the command fails, the exit status is also displayed. wait-for [-L | -S | -U] channel (alias: wait) When used without options, prevents the client from exiting until woken using wait-for -S with the same channel. When -L is used, the channel is locked and any clients that try to lock the same channel are made to wait until the channel is unlocked with wait-for -U. EXIT MESSAGES top When a client detaches, it prints a message. This may be one of: detached (from session ...) The client was detached normally. detached and SIGHUP The client was detached and its parent sent the SIGHUP signal (for example with detach-client -P). lost tty The client's tty(4) or pty(4) was unexpectedly destroyed. terminated The client was killed with SIGTERM. too far behind The client is in control mode and became unable to keep up with the data from . exited The server exited when it had no sessions. server exited The server exited when it received SIGTERM. server exited unexpectedly The server crashed or otherwise exited without telling the client the reason. TERMINFO EXTENSIONS top understands some unofficial extensions to terminfo(5). It is not normally necessary to set these manually, instead the terminal-features option should be used. AX An existing extension that tells the terminal supports default colours. Bidi Tell that the terminal supports the VTE bidirectional text extensions. Cs, Cr Set the cursor colour. The first takes a single string argument and is used to set the colour; the second takes no arguments and restores the default cursor colour. If set, a sequence such as this may be used to change the cursor colour from inside : $ printf '\033]12;red\033\\' The colour is an X(7) colour, see XParseColor(3). Cmg, Clmg, Dsmg, Enmg Set, clear, disable or enable DECSLRM margins. These are set automatically if the terminal reports it is VT420 compatible. Dsbp, Enbp Disable and enable bracketed paste. These are set automatically if the XT capability is present. Dseks, Eneks Disable and enable extended keys. Dsfcs, Enfcs Disable and enable focus reporting. These are set automatically if the XT capability is present. Hls Set or clear a hyperlink annotation. Nobr Tell that the terminal does not use bright colors for bold display. Rect Tell that the terminal supports rectangle operations. Smol Enable the overline attribute. Smulx Set a styled underscore. The single parameter is one of: 0 for no underscore, 1 for normal underscore, 2 for double underscore, 3 for curly underscore, 4 for dotted underscore and 5 for dashed underscore. Setulc, Setulc1, ol Set the underscore colour or reset to the default. Setulc is for RGB colours and Setulc1 for ANSI or 256 colours. The Setulc argument is (red * 65536) + (green * 256) + blue where each is between 0 and 255. Ss, Se Set or reset the cursor style. If set, a sequence such as this may be used to change the cursor to an underline: $ printf '\033[4 q' If Se is not set, Ss with argument 0 will be used to reset the cursor style instead. Swd Set the opening sequence for the working directory notification. The sequence is terminated using the standard fsl capability. Sxl Indicates that the terminal supports SIXEL. Sync Start (parameter is 1) or end (parameter is 2) a synchronized update. Tc Indicate that the terminal supports the direct colour RGB escape sequence (for example, \e[38;2;255;255;255m). If supported, this is used for the initialize colour escape sequence (which may be enabled by adding the initc and ccc capabilities to the terminfo(5) entry). This is equivalent to the RGB terminfo(5) capability. Ms Store the current buffer in the host terminal's selection (clipboard). See the set-clipboard option above and the xterm(1) man page. XT This is an existing extension capability that tmux uses to mean that the terminal supports the xterm(1) title set sequences and to automatically set some of the capabilities above. CONTROL MODE top offers a textual interface called control mode. This allows applications to communicate with using a simple text-only protocol. In control mode, a client sends commands or command sequences terminated by newlines on standard input. Each command will produce one block of output on standard output. An output block consists of a %begin line followed by the output (which may be empty). The output block ends with a %end or %error. %begin and matching %end or %error have three arguments: an integer time (as seconds from epoch), command number and flags (currently not used). For example: %begin 1363006971 2 1 0: ksh* (1 panes) [80x24] [layout b25f,80x24,0,0,2] @2 (active) %end 1363006971 2 1 The refresh-client -C command may be used to set the size of a client in control mode. In control mode, outputs notifications. A notification will never occur inside an output block. The following notifications are defined: %client-detached client The client has detached. %client-session-changed client session-id name The client is now attached to the session with ID session-id, which is named name. %config-error error An error has happened in a configuration file. %continue pane-id The pane has been continued after being paused (if the pause-after flag is set, see refresh-client -A). %exit [reason] The client is exiting immediately, either because it is not attached to any session or an error occurred. If present, reason describes why the client exited. %extended-output pane-id age ... : value New form of %output sent when the pause-after flag is set. age is the time in milliseconds for which tmux had buffered the output before it was sent. Any subsequent arguments up until a single : are for future use and should be ignored. %layout-change window-id window-layout window-visible-layout window-flags The layout of a window with ID window-id changed. The new layout is window-layout. The window's visible layout is window-visible-layout and the window flags are window-flags. %message message A message sent with the display-message command. %output pane-id value A window pane produced output. value escapes non- printable characters and backslash as octal \xxx. %pane-mode-changed pane-id The pane with ID pane-id has changed mode. %paste-buffer-changed name Paste buffer name has been changed. %paste-buffer-deleted name Paste buffer name has been deleted. %pause pane-id The pane has been paused (if the pause-after flag is set). %session-changed session-id name The client is now attached to the session with ID session-id, which is named name. %session-renamed name The current session was renamed to name. %session-window-changed session-id window-id The session with ID session-id changed its active window to the window with ID window-id. %sessions-changed A session was created or destroyed. %subscription-changed name session-id window-id window-index pane-id ... : value The value of the format associated with subscription name has changed to value. See refresh-client -B. Any arguments after pane-id up until a single : are for future use and should be ignored. %unlinked-window-add window-id The window with ID window-id was created but is not linked to the current session. %unlinked-window-close window-id The window with ID window-id, which is not linked to the current session, was closed. %unlinked-window-renamed window-id The window with ID window-id, which is not linked to the current session, was renamed. %window-add window-id The window with ID window-id was linked to the current session. %window-close window-id The window with ID window-id closed. %window-pane-changed window-id pane-id The active pane in the window with ID window-id changed to the pane with ID pane-id. %window-renamed window-id name The window with ID window-id was renamed to name. ENVIRONMENT top When is started, it inspects the following environment variables: EDITOR If the command specified in this variable contains the string vi and VISUAL is unset, use vi-style key bindings. Overridden by the mode-keys and status-keys options. HOME The user's login directory. If unset, the passwd(5) database is consulted. LC_CTYPE The character encoding locale(1). It is used for two separate purposes. For output to the terminal, UTF-8 is used if the -u option is given or if LC_CTYPE contains "UTF-8" or "UTF8". Otherwise, only ASCII characters are written and non-ASCII characters are replaced with underscores (_). For input, always runs with a UTF-8 locale. If en_US.UTF-8 is provided by the operating system, it is used and LC_CTYPE is ignored for input. Otherwise, LC_CTYPE tells what the UTF-8 locale is called on the current system. If the locale specified by LC_CTYPE is not available or is not a UTF-8 locale, exits with an error message. LC_TIME The date and time format locale(1). It is used for locale-dependent strftime(3) format specifiers. PWD The current working directory to be set in the global environment. This may be useful if it contains symbolic links. If the value of the variable does not match the current working directory, the variable is ignored and the result of getcwd(3) is used instead. SHELL The absolute path to the default shell for new windows. See the default-shell option for details. TMUX_TMPDIR The parent directory of the directory containing the server sockets. See the -L option for details. VISUAL If the command specified in this variable contains the string vi, use vi-style key bindings. Overridden by the mode-keys and status-keys options. FILES top ~/.tmux.conf $XDG_CONFIG_HOME/tmux/tmux.conf ~/.config/tmux/tmux.conf Default configuration file. @SYSCONFDIR@/tmux.conf System-wide configuration file. EXAMPLES top To create a new session running vi(1): $ tmux new-session vi Most commands have a shorter form, known as an alias. For new- session, this is new: $ tmux new vi Alternatively, the shortest unambiguous form of a command is accepted. If there are several options, they are listed: $ tmux n ambiguous command: n, could be: new-session, new-window, next-window Within an active session, a new window may be created by typing C-b c (Ctrl followed by the b key followed by the c key). Windows may be navigated with: C-b 0 (to select window 0), C-b 1 (to select window 1), and so on; C-b n to select the next window; and C-b p to select the previous window. A session may be detached using C-b d (or by an external event such as ssh(1) disconnection) and reattached with: $ tmux attach-session Typing C-b ? lists the current key bindings in the current window; up and down may be used to navigate the list or q to exit from it. Commands to be run when the server is started may be placed in the ~/.tmux.conf configuration file. Common examples include: Changing the default prefix key: set-option -g prefix C-a unbind-key C-b bind-key C-a send-prefix Turning the status line off, or changing its colour: set-option -g status off set-option -g status-style bg=blue Setting other options, such as the default command, or locking after 30 minutes of inactivity: set-option -g default-command "exec /bin/ksh" set-option -g lock-after-time 1800 Creating new key bindings: bind-key b set-option status bind-key / command-prompt "split-window 'exec man %%'" bind-key S command-prompt "new-window -n %1 'ssh %1'" SEE ALSO top pty(4) AUTHORS top Nicholas Marriott <[email protected]> COLOPHON top This page is part of the tmux (terminal multiplexer) project. Information about the project can be found at https://tmux.github.io/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository https://github.com/tmux/tmux.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-11-14.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU $Mdocdate$ TMUX(1) Pages that refer to this page: logind.conf(5), user_caps(5), pty(7) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# tmux\n\n> Terminal multiplexer.\n> It allows multiple sessions with windows, panes, and more.\n> See also: `zellij`, `screen`.\n> More information: <https://github.com/tmux/tmux>.\n\n- Start a new session:\n\n`tmux`\n\n- Start a new named session:\n\n`tmux new -s {{name}}`\n\n- List existing sessions:\n\n`tmux ls`\n\n- Attach to the most recently used session:\n\n`tmux attach`\n\n- Detach from the current session (inside a tmux session):\n\n`<Ctrl>-B d`\n\n- Create a new window (inside a tmux session):\n\n`<Ctrl>-B c`\n\n- Switch between sessions and windows (inside a tmux session):\n\n`<Ctrl>-B w`\n\n- Kill a session by name:\n\n`tmux kill-session -t {{name}}`\n
top
top(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training top(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OVERVIEW | 1. COMMAND-LINE Options | 2. SUMMARY Display | 3. FIELDS / Columns | 4. INTERACTIVE Commands | 5. ALTERNATE-DISPLAY Provisions | 6. FILES | 7. ENVIRONMENT VARIABLE(S) | 8. STUPID TRICKS Sampler | 9. BUGS | 10. SEE Also | COLOPHON TOP(1) User Commands TOP(1) NAME top top - display Linux processes SYNOPSIS top top [options] DESCRIPTION top The top program provides a dynamic real-time view of a running system. It can display system summary information as well as a list of processes or threads currently being managed by the Linux kernel. The types of system summary information shown and the types, order and size of information displayed for processes are all user configurable and that configuration can be made persistent across restarts. The program provides a limited interactive interface for process manipulation as well as a much more extensive interface for personal configuration -- encompassing every aspect of its operation. And while top is referred to throughout this document, you are free to name the program anything you wish. That new name, possibly an alias, will then be reflected on top's display and used when reading and writing a configuration file. OVERVIEW top Documentation The remaining Table of Contents OVERVIEW Operation Linux Memory Types 1. COMMAND-LINE Options 2. SUMMARY Display a. UPTIME and LOAD Averages b. TASK and CPU States c. MEMORY Usage 3. FIELDS / Columns Display a. DESCRIPTIONS of Fields b. MANAGING Fields 4. INTERACTIVE Commands a. GLOBAL Commands b. SUMMARY AREA Commands c. TASK AREA Commands 1. Appearance 2. Content 3. Size 4. Sorting d. COLOR Mapping 5. ALTERNATE-DISPLAY Provisions a. WINDOWS Overview b. COMMANDS for Windows c. SCROLLING a Window d. SEARCHING in a Window e. FILTERING in a Window 6. FILES a. PERSONAL Configuration File b. ADDING INSPECT Entries c. SYSTEM Configuration File d. SYSTEM Restrictions File 7. ENVIRONMENT VARIABLE(S) 8. STUPID TRICKS Sampler a. Kernel Magic b. Bouncing Windows c. The Big Bird Window d. The Ol' Switcheroo 9. BUGS, 10. SEE Also Operation When operating top, the two most important keys are the help (h or ?) key and quit (`q') key. Alternatively, you could simply use the traditional interrupt key (^C) when you're done. When started for the first time, you'll be presented with these traditional elements on the main top screen: 1) Summary Area; 2) Fields/Columns Header; 3) Task Area. Each of these will be explored in the sections that follow. There is also an Input/Message line between the Summary Area and Columns Header which needs no further explanation. The main top screen is generally quite adaptive to changes in terminal dimensions under X-Windows. Other top screens may be less so, especially those with static text. It ultimately depends, however, on your particular window manager and terminal emulator. There may be occasions when their view of terminal size and current contents differs from top's view, which is always based on operating system calls. Following any re-size operation, if a top screen is corrupted, appears incomplete or disordered, simply typing something innocuous like a punctuation character or cursor motion key will usually restore it. In extreme cases, the following sequence almost certainly will: key/cmd objective ^Z suspend top fg resume top <Left> force a screen redraw (if necessary) But if the display is still corrupted, there is one more step you could try. Insert this command after top has been suspended but before resuming it. key/cmd objective reset restore your terminal settings Note: the width of top's display will be limited to 512 positions. Displaying all fields requires approximately 250 characters. Remaining screen width is usually allocated to any variable width columns currently visible. The variable width columns, such as COMMAND, are noted in topic 3a. DESCRIPTIONS of Fields. Actual output width may also be influenced by the -w switch, which is discussed in topic 1. COMMAND-LINE Options. Lastly, some of top's screens or functions require the use of cursor motion keys like the standard arrow keys plus the Home, End, PgUp and PgDn keys. If your terminal or emulator does not provide those keys, the following combinations are accepted as alternatives: key equivalent-keys Left alt + h Down alt + j Up alt + k Right alt + l Home alt + ctrl + h PgDn alt + ctrl + j PgUp alt + ctrl + k End alt + ctrl + l The Up and Down arrow keys have special significance when prompted for line input terminated with the <Enter> key. Those keys, or their aliases, can be used to retrieve previous input lines which can then be edited and re-input. And there are four additional keys available with line oriented input. key special-significance Up recall older strings for re-editing Down recall newer strings or erase entire line Insert toggle between insert and overtype modes Delete character removed at cursor, moving others left Home jump to beginning of input line End jump to end of input line Linux Memory Types For our purposes there are three types of memory, and one is optional. First is physical memory, a limited resource where code and data must reside when executed or referenced. Next is the optional swap file, where modified (dirty) memory can be saved and later retrieved if too many demands are made on physical memory. Lastly we have virtual memory, a nearly unlimited resource serving the following goals: 1. abstraction, free from physical memory addresses/limits 2. isolation, every process in a separate address space 3. sharing, a single mapping can serve multiple needs 4. flexibility, assign a virtual address to a file Regardless of which of these forms memory may take, all are managed as pages (typically 4096 bytes) but expressed by default in top as KiB (kibibyte). The memory discussed under topic `2c. MEMORY Usage' deals with physical memory and the swap file for the system as a whole. The memory reviewed in topic `3. FIELDS / Columns Display' embraces all three memory types, but for individual processes. For each such process, every memory page is restricted to a single quadrant from the table below. Both physical memory and virtual memory can include any of the four, while the swap file only includes #1 through #3. The memory in quadrant #4, when modified, acts as its own dedicated swap file. Private | Shared 1 | 2 Anonymous . stack | . malloc() | . brk()/sbrk() | . POSIX shm* . mmap(PRIVATE, ANON) | . mmap(SHARED, ANON) -----------------------+---------------------- . mmap(PRIVATE, fd) | . mmap(SHARED, fd) File-backed . pgms/shared libs | 3 | 4 The following may help in interpreting process level memory values displayed as scalable columns and discussed under topic `3a. DESCRIPTIONS of Fields'. %MEM - simply RES divided by total physical memory CODE - the `pgms' portion of quadrant 3 DATA - the entire quadrant 1 portion of VIRT plus all explicit mmap file-backed pages of quadrant 3 RES - anything occupying physical memory which, beginning with Linux-4.5, is the sum of the following three fields: RSan - quadrant 1 pages, which include any former quadrant 3 pages if modified RSfd - quadrant 3 and quadrant 4 pages RSsh - quadrant 2 pages RSlk - subset of RES which cannot be swapped out (any quadrant) SHR - subset of RES (excludes 1, includes all 2 & 4, some 3) SWAP - potentially any quadrant except 4 USED - simply the sum of RES and SWAP VIRT - everything in-use and/or reserved (all quadrants) Note: Even though program images and shared libraries are considered private to a process, they will be accounted for as shared (SHR) by the kernel. 1. COMMAND-LINE Options top Mandatory arguments to long options are mandatory for short options too. Although not required, the equals sign can be used with either option form and whitespace before and/or after the `=' is permitted. -b, --batch Starts top in Batch mode, which could be useful for sending output from top to other programs or to a file. In this mode, top will not accept input and runs until the iterations limit you've set with the `-n' command-line option or until killed. -c, --cmdline-toggle Starts top with the last remembered `c' state reversed. Thus, if top was displaying command lines, now that field will show program names, and vice versa. See the `c' interactive command for additional information. -d, --delay = SECS [.TENTHS] Specifies the delay between screen updates, and overrides the corresponding value in one's personal configuration file or the startup default. Later this can be changed with the `d' or `s' interactive commands. Fractional seconds are honored, but a negative number is not allowed. In all cases, however, such changes are prohibited if top is running in Secure mode, except for root (unless the `s' command-line option was used). For additional information on Secure mode see topic 6d. SYSTEM Restrictions File. -E, --scale-summary-mem = k | m | g | t | p | e Instructs top to force summary area memory to be scaled as: k - kibibytes m - mebibytes g - gibibytes t - tebibytes p - pebibytes e - exbibytes Later this can be changed with the `E' command toggle. -e, --scale-task-mem = k | m | g | t | p Instructs top to force task area memory to be scaled as: k - kibibytes m - mebibytes g - gibibytes t - tebibytes p - pebibytes Later this can be changed with the `e' command toggle. -H, --threads-show Instructs top to display individual threads. Without this command-line option a summation of all threads in each process is shown. Later this can be changed with the `H' interactive command. -h, --help Display usage help text, then quit. -i, --idle-toggle Starts top with the last remembered `i' state reversed. When this toggle is Off, tasks that have not used any CPU since the last update will not be displayed. For additional information regarding this toggle see topic 4c. TASK AREA Commands, SIZE. -n, --iterations = NUMBER Specifies the maximum number of iterations, or frames, top should produce before ending. -O, --list-fields This option acts as a form of help for the -o option shown below. It will cause top to print each of the available field names on a separate line, then quit. Such names are subject to NLS (National Language Support) translation. -o, --sort-override = FIELDNAME Specifies the name of the field on which tasks will be sorted, independent of what is reflected in the configuration file. You can prepend a `+' or `-' to the field name to also override the sort direction. A leading `+' will force sorting high to low, whereas a `-' will ensure a low to high ordering. This option exists primarily to support automated/scripted batch mode operation. -p, --pid = PIDLIST (as: 1,2,3, ... or -p1 -p2 -p3 ...) Monitor only processes with specified process IDs. However, when combined with Threads mode (`H'), all processes in the thread group (see TGID) of each monitored PID will also be shown. This option can be given up to 20 times, or you can provide a comma delimited list with up to 20 pids. Co-mingling both approaches is permitted. A pid value of zero will be treated as the process id of the top program itself once it is running. This is a command-line option only and should you wish to return to normal operation, it is not necessary to quit and restart top -- just issue any of these interactive commands: `=', `u' or `U'. The `p', `u' and `U' command-line options are mutually exclusive. -S, --accum-time-toggle Starts top with the last remembered `S' state reversed. When Cumulative time mode is On, each process is listed with the cpu time that it and its dead children have used. See the `S' interactive command for additional information regarding this mode. -s, --secure-mode Starts top with secure mode forced, even for root. This mode is far better controlled through a system configuration file (see topic 6. FILES). -U, --filter-any-user = USER (as: number or name) Display only processes with a user id or user name matching that given. This option matches on any user (real, effective, saved, or filesystem). Prepending an exclamation point (`!') to the user id or name instructs top to display only processes with users not matching the one provided. The `p', `U' and `u' command-line options are mutually exclusive. -u, --filter-only-euser = USER (as: number or name) Display only processes with a user id or user name matching that given. This option matches on the effective user id only. Prepending an exclamation point (`!') to the user id or name instructs top to display only processes with users not matching the one provided. The `p', `U' and `u' command-line options are mutually exclusive. -V, --version Display version information, then quit. -w, --width [=COLUMNS] In Batch mode, when used without an argument top will format output using the COLUMNS= and LINES= environment variables, if set. Otherwise, width will be fixed at the maximum 512 columns. With an argument, output width can be decreased or increased (up to 512) but the number of rows is considered unlimited. In normal display mode, when used without an argument top will attempt to format output using the COLUMNS= and LINES= environment variables, if set. With an argument, output width can only be decreased, not increased. Whether using environment variables or an argument with -w, when not in Batch mode actual terminal dimensions can never be exceeded. Note: Without the use of this command-line option, output width is always based on the terminal at which top was invoked whether or not in Batch mode. -1, --single-cpu-toggle Starts top with the last remembered Cpu States portion of the summary area reversed. Either all cpu information will be displayed in a single line or each cpu will be displayed separately, depending on the state of the NUMA Node command toggle (`2'). See the `1' and `2' interactive commands for additional information. 2. SUMMARY Display top Each of the following three areas are individually controlled through one or more interactive commands. See topic 4b. SUMMARY AREA Commands for additional information regarding these provisions. 2a. UPTIME and LOAD Averages This portion consists of a single line containing: program or window name, depending on display mode current time and length of time since last boot total number of users system load avg over the last 1, 5 and 15 minutes 2b. TASK and CPU States This portion consists of a minimum of two lines. In an SMP environment, additional lines can reflect individual CPU state percentages. Line 1 shows total tasks or threads, depending on the state of the Threads-mode toggle. That total is further classified as: running; sleeping; stopped; zombie Line 2 shows CPU state percentages based on the interval since the last refresh. As a default, percentages for these individual categories are displayed. Depending on your kernel version, the st field may not be shown. us : time running un-niced user processes sy : time running kernel processes ni : time running niced user processes id : time spent in the kernel idle handler wa : time waiting for I/O completion hi : time spent servicing hardware interrupts si : time spent servicing software interrupts st : time stolen from this vm by the hypervisor The `sy' value above also reflects the time running a virtual cpu for guest operating systems, including those that have been niced. Beyond the first tasks/threads line, there are alternate CPU display modes available via the 4-way `t' command toggle. They show an abbreviated summary consisting of these elements: a b c d %Cpu(s): 75.0/25.0 100[ ... ] Where: a) is the `user' (us + ni) percentage; b) is the `system' (sy + hi + si + guests) percentage; c) is the total percentage; and d) is one of two visual graphs of those representations. Such graphs also reflect separate `user' and `system' portions. If the `4' command toggle is used to yield more than two cpus per line, results will be further abridged eliminating the a) and b) elements. However, that information is still reflected in the graph itself assuming color is active or, if not, bars vs. blocks are being shown. See topic 4b. SUMMARY AREA Commands for additional information on the `t' and `4' command toggles. 2c. MEMORY Usage This portion consists of two lines which may express values in kibibytes (KiB) through exbibytes (EiB) depending on the scaling factor enforced with the `E' interactive command. The /proc/meminfo source fields are shown in parenthesis. Line 1 reflects physical memory, classified as: total ( MemTotal ) free ( MemFree ) used ( MemTotal - MemAvailable ) buff/cache ( Buffers + Cached + SReclaimable ) Line 2 reflects mostly virtual memory, classified as: total ( SwapTotal ) free ( SwapFree ) used ( SwapTotal - SwapFree ) avail ( MemAvailable, which is physical memory ) The avail number on line 2 is an estimation of physical memory available for starting new applications, without swapping. Unlike the free field, it attempts to account for readily reclaimable page cache and memory slabs. It is available on kernels 3.14, emulated on kernels 2.6.27+, otherwise the same as free. In the alternate memory display modes, two abbreviated summary lines are shown consisting of these elements: a b c GiB Mem : 18.7/15.738 [ ... ] GiB Swap: 0.0/7.999 [ ... ] Where: a) is the percentage used; b) is the total available; and c) is one of two visual graphs of those representations. In the case of physical memory, the percentage represents the total minus the estimated avail noted above. The `Mem' graph itself is divided between the non-cached portion of used and any remaining memory not otherwise accounted for by avail. See topic 4b. SUMMARY AREA Commands and the `m' command for additional information on that special 4-way toggle. This table may help in interpreting the scaled values displayed: KiB = kibibyte = 1024 bytes MiB = mebibyte = 1024 KiB = 1,048,576 bytes GiB = gibibyte = 1024 MiB = 1,073,741,824 bytes TiB = tebibyte = 1024 GiB = 1,099,511,627,776 bytes PiB = pebibyte = 1024 TiB = 1,125,899,906,842,624 bytes EiB = exbibyte = 1024 PiB = 1,152,921,504,606,846,976 bytes 3. FIELDS / Columns top 3a. DESCRIPTIONS of Fields Listed below are top's available process fields (columns). They are shown in strict ascii alphabetical order. You may customize their position and whether or not they are displayable with the `f' (Fields Management) interactive command. Any field is selectable as the sort field, and you control whether they are sorted high-to-low or low-to-high. For additional information on sort provisions see topic 4c. TASK AREA Commands, SORTING. The fields related to physical memory or virtual memory reference `(KiB)' which is the unsuffixed display mode. Such fields may, however, be scaled from KiB through PiB. That scaling is influenced via the `e' interactive command or established for startup through a build option. %CPU -- CPU Usage The task's share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time. In a true SMP environment, if a process is multi-threaded and top is not operating in Threads mode, amounts greater than 100% may be reported. You toggle Threads mode with the `H' interactive command. Also for multi-processor environments, if Irix mode is Off, top will operate in Solaris mode where a task's cpu usage will be divided by the total number of CPUs. You toggle Irix/Solaris modes with the `I' interactive command. Note: When running in forest view mode (`V') with children collapsed (`v'), this field will also include the CPU time of those unseen children. See topic 4c. TASK AREA Commands, CONTENT for more information regarding the `V' and `v' toggles. %CUC -- CPU Utilization This field is identical to %CUU below, except the percentage also reflects reaped child processes. %CUU -- CPU Utilization A task's total CPU usage divided by its elapsed running time, expressed as a percentage. If a process currently displays high CPU usage, this field can help determine if such behavior is normal. Conversely, if a process has low CPU usage currently, %CUU may reflect historically higher demands over its lifetime. %MEM -- Memory Usage (RES) A task's currently resident share of available physical memory. See `OVERVIEW, Linux Memory Types' for additional details. AGID -- Autogroup Identifier The autogroup identifier associated with a process. This feature operates in conjunction with the CFS scheduler to improve interactive desktop performance. When /proc/sys/kernel/sched_autogroup_enabled is set, a new autogroup is created with each new session (see SID). All subsequently forked processes in that session inherit membership in this autogroup. The kernel then attempts to equalize distribution of CPU cycles across such groups. Thus, an autogroup with many CPU intensive processes (e.g make -j) will not dominate an autogroup with only one or two processes. When -1 is displayed it means this information is not available. AGNI -- Autogroup Nice Value The autogroup nice value which affects scheduling of all processes in that group. A negative nice value means higher priority, whereas a positive nice value means lower priority. CGNAME -- Control Group Name The name of the control group to which a process belongs, or `-' if not applicable for that process. This will typically be the last entry in the full list of control groups as shown under the next heading (CGROUPS). And as is true there, this field is also variable width. CGROUPS -- Control Groups The names of the control group(s) to which a process belongs, or `-' if not applicable for that process. Control Groups provide for allocating resources (cpu, memory, network bandwidth, etc.) among installation-defined groups of processes. They enable fine-grained control over allocating, denying, prioritizing, managing and monitoring those resources. Many different hierarchies of cgroups can exist simultaneously on a system and each hierarchy is attached to one or more subsystems. A subsystem represents a single resource. Note: The CGROUPS field, unlike most columns, is not fixed- width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum 512 characters). Even so, such variable width fields could still suffer truncation. See topic 5c. SCROLLING a Window for additional information on accessing any truncated data. CODE -- Code Size (KiB) The amount of physical memory currently devoted to executable code, also known as the Text Resident Set size or TRS. See `OVERVIEW, Linux Memory Types' for additional details. COMMAND -- Command Name or Command Line Display the command line used to start a task or the name of the associated program. You toggle between command line and name with `c', which is both a command-line option and an interactive command. When you've chosen to display command lines, processes without a command line (like kernel threads) will be shown with only the program name in brackets, as in this example: [kthreadd] This field may also be impacted by the forest view display mode. See the `V' interactive command for additional information regarding that mode. Note: The COMMAND field, unlike most columns, is not fixed- width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum 512 characters). Even so, such variable width fields could still suffer truncation. This is especially true for this field when command lines are being displayed (the `c' interactive command.) See topic 5c. SCROLLING a Window for additional information on accessing any truncated data. DATA -- Data + Stack Size (KiB) The amount of private memory reserved by a process. It is also known as the Data Resident Set or DRS. Such memory may not yet be mapped to physical memory (RES) but will always be included in the virtual memory (VIRT) amount. See `OVERVIEW, Linux Memory Types' for additional details. ELAPSED -- Elapsed Running Time The length of time since a process was started. Thus, the most recently started task will display the smallest time interval. The value will be expressed as `HH,MM' (hours,minutes) but is subject to additional scaling if the interval becomes too great to fit column width. At that point it will be scaled to `DD+HH' (days+hours) and possibly beyond. ENVIRON -- Environment variables Display all of the environment variables, if any, as seen by the respective processes. These variables will be displayed in their raw native order, not the sorted order you are accustomed to seeing with an unqualified `set'. Note: The ENVIRON field, unlike most columns, is not fixed- width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum 512 characters). Even so, such variable width fields could still suffer truncation. This is especially true for this field. See topic 5c. SCROLLING a Window for additional information on accessing any truncated data. EXE -- Executable Path Where available, this is the full path to the executable, including the program name. Note: The EXE field, unlike most columns, is not fixed-width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum 512 characters). Flags -- Task Flags This column represents the task's current scheduling flags which are expressed in hexadecimal notation and with zeros suppressed. These flags are officially documented in <linux/sched.h>. GID -- Group Id The effective group ID. GROUP -- Group Name The effective group name. LOGID -- Login User Id The user ID used at login. When -1 is displayed it means this information is not available. LXC -- Lxc Container Name The name of the lxc container within which a task is running. If a process is not running inside a container, a dash (`-') will be shown. NI -- Nice Value The nice value of the task. A negative nice value means higher priority, whereas a positive nice value means lower priority. Zero in this field simply means priority will not be adjusted in determining a task's dispatch-ability. Note: This value only affects scheduling priority relative to other processes in the same autogroup. See the `AGID' and `AGNI' fields for additional information on autogroups. NU -- Last known NUMA node A number representing the NUMA node associated with the last used processor (`P'). When -1 is displayed it means that NUMA information is not available. See the `2' and `3' interactive commands for additional NUMA provisions affecting the summary area. OOMa -- Out of Memory Adjustment Factor The value, ranging from -1000 to +1000, added to the current out of memory score (OOMs) which is then used to determine which task to kill when memory is exhausted. OOMs -- Out of Memory Score The value, ranging from 0 to +1000, used to select task(s) to kill when memory is exhausted. Zero translates to `never kill' whereas 1000 means `always kill'. P -- Last used CPU (SMP) A number representing the last used processor. In a true SMP environment this will likely change frequently since the kernel intentionally uses weak affinity. Also, the very act of running top may break this weak affinity and cause more processes to change CPUs more often (because of the extra demand for cpu time). PGRP -- Process Group Id Every process is member of a unique process group which is used for distribution of signals and by terminals to arbitrate requests for their input and output. When a process is created (forked), it becomes a member of the process group of its parent. By convention, this value equals the process ID (see PID) of the first member of a process group, called the process group leader. PID -- Process Id The task's unique process ID, which periodically wraps, though never restarting at zero. In kernel terms, it is a dispatchable entity defined by a task_struct. This value may also be used as: a process group ID (see PGRP); a session ID for the session leader (see SID); a thread group ID for the thread group leader (see TGID); and a TTY process group ID for the process group leader (see TPGID). PPID -- Parent Process Id The process ID (pid) of a task's parent. PR -- Priority The scheduling priority of the task. If you see `rt' in this field, it means the task is running under real time scheduling priority. Under linux, real time priority is somewhat misleading since traditionally the operating itself was not preemptible. And while the 2.6 kernel can be made mostly preemptible, it is not always so. PSS -- Proportional Resident Memory, smaps (KiB) The proportion of this task's share of `RSS' where each page is divided by the number of processes sharing it. It is also the sum of the `PSan', `PSfd' and `PSsh' fields. For example, if a process has 1000 resident pages alone and 1000 resident pages shared with another process, its `PSS' would be 1500 (times page size). Accessing smaps values is 10x more costly than other memory statistics and data for other users requires root privileges. PSan -- Proportional Anonymous Memory, smaps (KiB) PSfd -- Proportional File Memory, smaps (KiB) PSsh -- Proportional Shmem Memory, smaps (KiB) As was true for `PSS' above (total proportional resident memory), these fields represent the proportion of this task's share of each type of memory divided by the number of processes sharing it. Accessing smaps values is 10x more costly than other memory statistics and data for other users requires root privileges. RES -- Resident Memory Size (KiB) A subset of the virtual address space (VIRT) representing the non-swapped physical memory a task is currently using. It is also the sum of the `RSan', `RSfd' and `RSsh' fields. It can include private anonymous pages, private pages mapped to files (including program images and shared libraries) plus shared anonymous pages. All such memory is backed by the swap file represented separately under SWAP. Lastly, this field may also include shared file-backed pages which, when modified, act as a dedicated swap file and thus will never impact SWAP. See `OVERVIEW, Linux Memory Types' for additional details. RSS -- Resident Memory, smaps (KiB) Another, more precise view of process non-swapped physical memory. It is obtained from the `smaps_rollup' file and is generally slightly larger than that shown for `RES'. Accessing smaps values is 10x more costly than other memory statistics and data for other users requires root privileges. RSan -- Resident Anonymous Memory Size (KiB) A subset of resident memory (RES) representing private pages not mapped to a file. RSfd -- Resident File-Backed Memory Size (KiB) A subset of resident memory (RES) representing the implicitly shared pages supporting program images and shared libraries. It also includes explicit file mappings, both private and shared. RSlk -- Resident Locked Memory Size (KiB) A subset of resident memory (RES) which cannot be swapped out. RSsh -- Resident Shared Memory Size (KiB) A subset of resident memory (RES) representing the explicitly shared anonymous shm*/mmap pages. RUID -- Real User Id The real user ID. RUSER -- Real User Name The real user name. S -- Process Status The status of the task which can be one of: D = uninterruptible sleep I = idle R = running S = sleeping T = stopped by job control signal t = stopped by debugger during trace Z = zombie Tasks shown as running should be more properly thought of as ready to run -- their task_struct is simply represented on the Linux run-queue. Even without a true SMP machine, you may see numerous tasks in this state depending on top's delay interval and nice value. SHR -- Shared Memory Size (KiB) A subset of resident memory (RES) that may be used by other processes. It will include shared anonymous pages and shared file-backed pages. It also includes private pages mapped to files representing program images and shared libraries. See `OVERVIEW, Linux Memory Types' for additional details. SID -- Session Id A session is a collection of process groups (see PGRP), usually established by the login shell. A newly forked process joins the session of its creator. By convention, this value equals the process ID (see PID) of the first member of the session, called the session leader, which is usually the login shell. STARTED -- Start Time Interval The length of time since system boot when a process started. Thus, the most recently started task will display the largest time interval. The value will be expressed as `MM:SS' (minutes:seconds). But if the interval is too great to fit column width it will be scaled as `HH,MM' (hours,minutes) and possibly beyond. SUID -- Saved User Id The saved user ID. SUPGIDS -- Supplementary Group IDs The IDs of any supplementary group(s) established at login or inherited from a task's parent. They are displayed in a comma delimited list. Note: The SUPGIDS field, unlike most columns, is not fixed- width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum 512 characters). SUPGRPS -- Supplementary Group Names The names of any supplementary group(s) established at login or inherited from a task's parent. They are displayed in a comma delimited list. Note: The SUPGRPS field, unlike most columns, is not fixed- width. When displayed, it plus any other variable width columns will be allocated all remaining screen width (up to the maximum 512 characters). SUSER -- Saved User Name The saved user name. SWAP -- Swapped Size (KiB) The formerly resident portion of a task's address space written to the swap file when physical memory becomes over committed. See `OVERVIEW, Linux Memory Types' for additional details. TGID -- Thread Group Id The ID of the thread group to which a task belongs. It is the PID of the thread group leader. In kernel terms, it represents those tasks that share an mm_struct. TIME -- CPU Time Total CPU time the task has used since it started. When Cumulative mode is On, each process is listed with the cpu time that it and its dead children have used. You toggle Cumulative mode with `S', which is both a command-line option and an interactive command. See the `S' interactive command for additional information regarding this mode. TIME+ -- CPU Time, hundredths The same as TIME, but reflecting more granularity through hundredths of a second. TPGID -- Tty Process Group Id The process group ID of the foreground process for the connected tty, or -1 if a process is not connected to a terminal. By convention, this value equals the process ID (see PID) of the process group leader (see PGRP). TTY -- Controlling Tty The name of the controlling terminal. This is usually the device (serial port, pty, etc.) from which the process was started, and which it uses for input or output. However, a task need not be associated with a terminal, in which case you'll see `?' displayed. UID -- User Id The effective user ID of the task's owner. USED -- Memory in Use (KiB) This field represents the non-swapped physical memory a task is using (RES) plus the swapped out portion of its address space (SWAP). See `OVERVIEW, Linux Memory Types' for additional details. USER -- User Name The effective user name of the task's owner. USS -- Unique Set Size The non-swapped portion of physical memory (`RSS') not shared with any other process. It is derived from the `smaps_rollup' file. Accessing smaps values is 10x more costly than other memory statistics and data for other users requires root privileges. VIRT -- Virtual Memory Size (KiB) The total amount of virtual memory used by the task. It includes all code, data and shared libraries plus pages that have been swapped out and pages that have been mapped but not used. See `OVERVIEW, Linux Memory Types' for additional details. WCHAN -- Sleeping in Function This field will show the name of the kernel function in which the task is currently sleeping. Running tasks will display a dash (`-') in this column. ioR -- I/O Bytes Read The number of bytes a process caused to be fetched from the storage layer. Root privileges are required to display `io' data for other users. ioRop -- I/O Read Operations The number of read I/O operations (syscalls) for a process. Such calls might not result in actual physical disk I/O. ioW -- I/O Bytes Written The number of bytes a process caused to be sent to the storage layer. ioWop -- I/O Write Operations The number of write I/O operations (syscalls) for a process. Such calls might not result in actual physical disk I/O. nDRT -- Dirty Pages Count The number of pages that have been modified since they were last written to auxiliary storage. Dirty pages must be written to auxiliary storage before the corresponding physical memory location can be used for some other virtual page. This field was deprecated with linux 2.6 and is always zero. nMaj -- Major Page Fault Count The number of major page faults that have occurred for a task. A page fault occurs when a process attempts to read from or write to a virtual page that is not currently present in its address space. A major page fault is when auxiliary storage access is involved in making that page available. nMin -- Minor Page Fault count The number of minor page faults that have occurred for a task. A page fault occurs when a process attempts to read from or write to a virtual page that is not currently present in its address space. A minor page fault does not involve auxiliary storage access in making that page available. nTH -- Number of Threads The number of threads associated with a process. nsCGROUP -- CGROUP namespace The Inode of the namespace used to hide the identity of the control group of which process is a member. nsIPC -- IPC namespace The Inode of the namespace used to isolate interprocess communication (IPC) resources such as System V IPC objects and POSIX message queues. nsMNT -- MNT namespace The Inode of the namespace used to isolate filesystem mount points thus offering different views of the filesystem hierarchy. nsNET -- NET namespace The Inode of the namespace used to isolate resources such as network devices, IP addresses, IP routing, port numbers, etc. nsPID -- PID namespace The Inode of the namespace used to isolate process ID numbers meaning they need not remain unique. Thus, each such namespace could have its own `init/systemd' (PID #1) to manage various initialization tasks and reap orphaned child processes. nsTIME -- TIME namespace The Inode of the namespace which allows processes to see different system times in a way similar to the UTS namespace. nsUSER -- USER namespace The Inode of the namespace used to isolate the user and group ID numbers. Thus, a process could have a normal unprivileged user ID outside a user namespace while having a user ID of 0, with full root privileges, inside that namespace. nsUTS -- UTS namespace The Inode of the namespace used to isolate hostname and NIS domain name. UTS simply means "UNIX Time-sharing System". vMj -- Major Page Fault Count Delta The number of major page faults that have occurred since the last update (see nMaj). vMn -- Minor Page Fault Count Delta The number of minor page faults that have occurred since the last update (see nMin). 3b. MANAGING Fields After pressing the interactive command `f' (Fields Management) you will be presented with a screen showing: 1) the `current' window name; 2) the designated sort field; 3) all fields in their current order along with descriptions. Entries marked with an asterisk are the currently displayed fields, screen width permitting. As the on screen instructions indicate, you navigate among the fields with the Up and Down arrow keys. The PgUp, PgDn, Home and End keys can also be used to quickly reach the first or last available field. The Right arrow key selects a field for repositioning and the Left arrow key or the <Enter> key commits that field's placement. The `d' key or the <Space> bar toggles a field's display status, and thus the presence or absence of the asterisk. The `s' key designates a field as the sort field. See topic 4c. TASK AREA Commands, SORTING for additional information regarding your selection of a sort field. The `a' and `w' keys can be used to cycle through all available windows and the `q' or <Esc> keys exit Fields Management. The Fields Management screen can also be used to change the `current' window/field group in either full-screen mode or alternate-display mode. Whatever was targeted when `q' or <Esc> was pressed will be made current as you return to the top display. See topic 5. ALTERNATE-DISPLAY Provisions and the `g' interactive command for insight into `current' windows and field groups. Note: Any window that has been scrolled horizontally will be reset if any field changes are made via the Fields Management screen. Any vertical scrolled position, however, will not be affected. See topic 5c. SCROLLING a Window for additional information regarding vertical and horizontal scrolling. 4. INTERACTIVE Commands top Listed below is a brief index of commands within categories. Some commands appear more than once -- their meaning or scope may vary depending on the context in which they are issued. 4a. Global-Commands <Ent/Sp> ?, =, 0, A, B, d, E, e, g, H, h, I, k, q, r, s, W, X, Y, Z, ^G, ^K, ^N, ^P, ^U, ^L, ^R 4b. Summary-Area-Commands C, l, t, m, 1, 2, 3, 4, 5, ! 4c. Task-Area-Commands Appearance: b, J, j, x, y, z Content: c, F, f, O, o, S, U, u, V, v, ^E Size: #, i, n Sorting: <, >, f, R 4d. Color-Mapping <Ret>, a, B, b, H, M, q, S, T, w, z, 0 - 7 5b. Commands-for-Windows -, _, =, +, A, a, G, g, w 5c. Scrolling-a-Window C, Up, Dn, Left, Right, PgUp, PgDn, Home, End 5d. Searching-in-a-Window L, & 5e. Filtering-in-a-Window O, o, ^O, =, + 4a. GLOBAL Commands The global interactive commands are always available in both full-screen mode and alternate-display mode. However, some of these interactive commands are not available when running in Secure mode. If you wish to know in advance whether or not your top has been secured, simply ask for help and view the system summary on the second line. <Enter> or <Space> :Refresh-Display These commands awaken top and following receipt of any input the entire display will be repainted. They also force an update of any hotplugged cpu or physical memory changes. Use either of these keys if you have a large delay interval and wish to see current status, ? | h :Help There are two help levels available. The first will provide a reminder of all the basic interactive commands. If top is secured, that screen will be abbreviated. Typing `h' or `?' on that help screen will take you to help for those interactive commands applicable to alternate-display mode. = :Exit-Display-Limits Removes restrictions on what is shown. This command will reverse any `i' (idle tasks), `n' (max tasks), `v' (hide children) and `F' focus commands that might be active. It also provides for an exit from PID monitoring, User filtering, Other filtering, Locate processing and Combine Cpus mode. Additionally, if the window has been scrolled it will be reset with this command. 0 :Zero-Suppress toggle This command determines whether zeros are shown or suppressed for many of the fields in a task window. Fields like UID, GID, NI, PR or P are not affected by this toggle. A :Alternate-Display-Mode toggle This command will switch between full-screen mode and alternate-display mode. See topic 5. ALTERNATE-DISPLAY Provisions and the `g' interactive command for insight into `current' windows and field groups. B :Bold-Disable/Enable toggle This command will influence use of the bold terminfo capability and alters both the summary area and task area for the `current' window. While it is intended primarily for use with dumb terminals, it can be applied anytime. Note: When this toggle is On and top is operating in monochrome mode, the entire display will appear as normal text. Thus, unless the `x' and/or `y' toggles are using reverse for emphasis, there will be no visual confirmation that they are even on. * d | s :Change-Delay-Time-interval You will be prompted to enter the delay time, in seconds, between display updates. Fractional seconds are honored, but a negative number is not allowed. Entering 0 causes (nearly) continuous updates, with an unsatisfactory display as the system and tty driver try to keep up with top's demands. The delay value is inversely proportional to system loading, so set it with care. If at any time you wish to know the current delay time, simply ask for help and view the system summary on the second line. E :Enforce-Summary-Memory-Scale in Summary Area With this command you can cycle through the available summary area memory scaling which ranges from KiB (kibibytes or 1,024 bytes) through EiB (exbibytes or 1,152,921,504,606,846,976 bytes). If you see a `+' between a displayed number and the following label, it means that top was forced to truncate some portion of that number. By raising the scaling factor, such truncation can be avoided. e :Enforce-Task-Memory-Scale in Task Area With this command you can cycle through the available task area memory scaling which ranges from KiB (kibibytes or 1,024 bytes) through PiB (pebibytes or 1,125,899,906,842,624 bytes). While top will try to honor the selected target range, additional scaling might still be necessary in order to accommodate current values. If you wish to see a more homogeneous result in the memory columns, raising the scaling range will usually accomplish that goal. Raising it too high, however, is likely to produce an all zero result which cannot be suppressed with the `0' interactive command. g :Choose-Another-Window/Field-Group You will be prompted to enter a number between 1 and 4 designating the field group which should be made the `current' window. You will soon grow comfortable with these 4 windows, especially after experimenting with alternate-display mode. H :Threads-mode toggle When this toggle is On, individual threads will be displayed for all processes in all visible task windows. Otherwise, top displays a summation of all threads in each process. I :Irix/Solaris-Mode toggle When operating in Solaris mode (`I' toggled Off), a task's cpu usage will be divided by the total number of CPUs. After issuing this command, you'll be told the new state of this toggle. * k :Kill-a-task You will be prompted for a PID and then the signal to send. Entering no PID or a negative number will be interpreted as the default shown in the prompt (the first task displayed). A PID value of zero means the top program itself. The default signal, as reflected in the prompt, is SIGTERM. However, you can send any signal, via number or name. If you wish to abort the kill process, do one of the following depending on your progress: 1) at the pid prompt, type an invalid number 2) at the signal prompt, type 0 (or any invalid signal) 3) at any prompt, type <Esc> q :Quit * r :Renice-a-Task You will be prompted for a PID and then the value to nice it to. Entering no PID or a negative number will be interpreted as the default shown in the prompt (the first task displayed). A PID value of zero means the top program itself. A positive nice value will cause a process to lose priority. Conversely, a negative nice value will cause a process to be viewed more favorably by the kernel. As a general rule, ordinary users can only increase the nice value and are prevented from lowering it. If you wish to abort the renice process, do one of the following depending on your progress: 1) at the pid prompt, type an invalid number 2) at the nice prompt, type <Enter> with no input 3) at any prompt, type <Esc> W :Write-the-Configuration-File This will save all of your options and toggles plus the current display mode and delay time. By issuing this command just before quitting top, you will be able restart later in exactly that same state. X :Extra-Fixed-Width Some fields are fixed width and not scalable. As such, they are subject to truncation which would be indicated by a `+' in the last position. This interactive command can be used to alter the widths of the following fields: field default field default field default GID 5 GROUP 8 WCHAN 10 LOGID 5 LXC 8 nsCGROUP 10 RUID 5 RUSER 8 nsIPC 10 SUID 5 SUSER 8 nsMNT 10 UID 5 TTY 8 nsNET 10 USER 8 nsPID 10 nsTIME 10 nsUSER 10 nsUTS 10 You will be prompted for the amount to be added to the default widths shown above. Entering zero forces a return to those defaults. If you enter a negative number, top will automatically increase the column size as needed until there is no more truncated data. Note: Whether explicitly or automatically increased, the widths for these fields are never decreased by top. To narrow them you must specify a smaller number or restore the defaults. Y :Inspect-Other-Output After issuing the `Y' interactive command, you will be prompted for a target PID. Typing a value or accepting the default results in a separate screen. That screen can be used to view a variety of files or piped command output while the normal top iterative display is paused. Note: This interactive command is only fully realized when supporting entries have been manually added to the end of the top configuration file. For details on creating those entries, see topic 6b. ADDING INSPECT Entries. Most of the keys used to navigate the Inspect feature are reflected in its header prologue. There are, however, additional keys available once you have selected a particular file or command. They are familiar to anyone who has used the pager `less' and are summarized here for future reference. key function = alternate status-line, file or pipeline / find, equivalent to `L' locate n find next, equivalent to `&' locate next <Space> scroll down, equivalent to <PgDn> b scroll up, equivalent to <PgUp> g first line, equivalent to <Home> G last line, equivalent to <End> Z :Change-Color-Mapping This key will take you to a separate screen where you can change the colors for the `current' window, or for all windows. For details regarding this interactive command see topic 4d. COLOR Mapping. ^G :Display-Control-Groups (Ctrl key + `g') ^K :Display-Cmdline (Ctrl key + `k') ^N :Display-Environment (Ctrl key + `n') ^P :Display-Namesspaces (Ctrl key + `p') ^U :Display-Supplementary-Groups (Ctrl key + `u') Applied to the first process displayed, these commands will show that task's full (potentially wrapped) information. Such data will be displayed in a separate window at the bottom of the screen while normal top monitoring continues. Keying the same `Ctrl' command a second time removes that separate window as does the `=' command. Keying a different `Ctrl' combination, while one is already active, immediately transitions to the new information. Notable among these provisions is the Ctrl+N (environment) command. Its output can be extensive and not easily read when line wrapped. A more readable version can be achieved with an `Inspect' entry in the rcfile like the following. pipe ^I Environment ^I cat /proc/%d/environ | tr '\0' '\n' See the `Y' interactive command above and topic 6b. ADDING INSPECT Entries for additional information. As an alternative to `Inspect', and available to all of these `Ctrl' commands, the tab key can be used to highlight individual elements in the bottom window. ^L :Logged-Messages (Ctrl key + `l') The 10 most recent messages are displayed in a separate window at the bottom of the screen while normal top monitoring continues. Keying `^L' a second time removes that window as does the `=' command. Use the tab key to highlight individual messages. * ^R :Renice-an-Autogroup (Ctrl key + `r') You will be prompted for a PID and then the value for its autogroup AGNI. Entering no PID will be interpreted as the default shown in the prompt (the first task displayed). A positive AGNI value will cause processes in that autogroup to lose priority. Conversely, a negative value causes them to be viewed more favorably by the kernel. Ordinary users are not allowed to set negative AGNI values. If you wish to abort the renice process type <Esc>. * The commands shown with an asterisk (`*') are not available in Secure mode, nor will they be shown on the level-1 help screen. 4b. SUMMARY AREA Commands The summary area interactive commands are always available in both full-screen mode and alternate-display mode. They affect the beginning lines of your display and will determine the position of messages and prompts. These commands always impact just the `current' window/field group. See topic 5. ALTERNATE-DISPLAY Provisions and the `g' interactive command for insight into `current' windows and field groups. C :Show-scroll-coordinates toggle Toggle an informational message which is displayed whenever the message line is not otherwise being used. For additional information see topic 5c. SCROLLING a Window. l :Load-Average/Uptime toggle This is also the line containing the program name (possibly an alias) when operating in full-screen mode or the `current' window name when operating in alternate-display mode. t :Task/Cpu-States toggle This command affects from 2 to many summary area lines, depending on the state of the `1', `2' or `3' command toggles and whether or not top is running under true SMP. This portion of the summary area is also influenced by the `H' interactive command toggle, as reflected in the total label which shows either Tasks or Threads. This command serves as a 4-way toggle, cycling through these modes: 1. detailed percentages by category 2. abbreviated user/system and total % + bar graph 3. abbreviated user/system and total % + block graph 4. turn off task and cpu states display When operating in either of the graphic modes, the display becomes much more meaningful when individual CPUs or NUMA nodes are also displayed. See the the `1', `2' and `3' commands below for additional information. m :Memory/Swap-Usage toggle This command affects the two summary area lines dealing with physical and virtual memory. This command serves as a 4-way toggle, cycling through these modes: 1. detailed percentages by memory type 2. abbreviated % used/total available + bar graph 3. abbreviated % used/total available + block graph 4. turn off memory display 1 :Single/Separate-Cpu-States toggle This command affects how the `t' command's Cpu States portion is shown. Although this toggle exists primarily to serve massively-parallel SMP machines, it is not restricted to solely SMP environments. When you see `%Cpu(s):' in the summary area, the `1' toggle is On and all cpu information is gathered in a single line. Otherwise, each cpu is displayed separately as: `%Cpu0, %Cpu1, ...' up to available screen height. 2 :NUMA-Nodes/Cpu-Summary toggle This command toggles between the `1' command cpu summary display (only) or a summary display plus the cpu usage statistics for each NUMA Node. It is only available if a system has the requisite NUMA support. 3 :Expand-NUMA-Node You will be invited to enter a number representing a NUMA Node. Thereafter, a node summary plus the statistics for each cpu in that node will be shown until the `1', `2' or `4' command toggle is pressed. This interactive command is only available if a system has the requisite NUMA support. 4 :Display-Multiple-Elements-Adjacent toggle This command toggle turns the `1' toggle Off and shows multiple CPU and Memory results on each line. Each successive `4' key adds another CPU until again reverting to separate lines for CPU and Memory results. A maximum of 8 CPUs per line can be displayed in this manner. However, data truncation may occur before reaching the maximum. That is definitely true when displaying detailed statistics via the `t' command toggle since such data cannot be scaled like the graphic representations. If one wished to quickly exit adjacent mode without cycling all the way to 8, simply use the `1' command toggle. 5 :Display-P-Cores-and-E-Cores toggle This command toggle is only active when the `t' toggle is On and the `1', `2', `3' and `!' toggles are Off, thus showing individual CPU results. It assumes a platform has multiple cores of two distinct types, either multi- threaded (P-Core) or single-threaded (E-Core). While normally each cpu is displayed as `%Cpu0, %Cpu1, ...', this toggle can be used to identify and/or filter those cpus by their core type, either P-Core (performance) or E-Core (efficient). The 1st time `5' is struck, each CPU is displayed as `%CpP' or `%CpE' representing the two core types. The 2nd time, only P-Cores (%CpP) will be shown. The 3rd time, only E-Cores (%CpE) are displayed. When this command toggle is struck for the 4th time, the CPU display returns to the normal `%Cpu' convention. If separate performance and efficient categories are not present, this command toggle will have no effect. ! :Combine-Cpus-Mode toggle This command toggle is intended for massively parallel SMP environments where, even with the `4' command toggle, not all processors can be displayed. With each press of `!' the number of cpus combined is doubled thus reducing the total number of cpu lines displayed. For example, with the first press of `!' two cpus will be combined and displayed as `0-1, 2-3, ...' instead of the normal `%Cpu0, %Cpu1, %Cpu2, %Cpu3, ...'. With a second `!' command toggle four cpus are combined and shown as `0-3, 4-7, ...'. Then the third `!' press, combining eight cpus, shows as `0-7, 8-15, ...', etc. Such progression continues until individual cpus are again displayed and impacts both the `1' and `4' toggles (one or multiple columns). Use the `=' command to exit Combine Cpus mode. Note: If the entire summary area has been toggled Off for any window, you would be left with just the message line. In that way, you will have maximized available task rows but (temporarily) sacrificed the program name in full-screen mode or the `current' window name when in alternate-display mode. 4c. TASK AREA Commands The task area interactive commands are always available in full-screen mode. The task area interactive commands are never available in alternate-display mode if the `current' window's task display has been toggled Off (see topic 5. ALTERNATE-DISPLAY Provisions). APPEARANCE of task window J :Justify-Numeric-Columns toggle Alternates between right-justified (the default) and left- justified numeric data. If the numeric data completely fills the available column, this command toggle may impact the column header only. j :Justify-Character-Columns toggle Alternates between left-justified (the default) and right- justified character data. If the character data completely fills the available column, this command toggle may impact the column header only. The following commands will also be influenced by the state of the global `B' (bold enable) toggle. b :Bold/Reverse toggle This command will impact how the `x' and `y' toggles are displayed. It may also impact the summary area when a bar graph has been selected for cpu states or memory usage via the `t' or `m' toggles. x :Column-Highlight toggle Changes highlighting for the current sort field. If you forget which field is being sorted this command can serve as a quick visual reminder, providing the sort field is being displayed. The sort field might not be visible because: 1) there is insufficient Screen Width 2) the `f' interactive command turned it Off y :Row-Highlight toggle Changes highlighting for "running" tasks. For additional insight into this task state, see topic 3a. DESCRIPTIONS of Fields, the `S' field (Process Status). Use of this provision provides important insight into your system's health. The only costs will be a few additional tty escape sequences. z :Color/Monochrome toggle Switches the `current' window between your last used color scheme and the older form of black-on-white or white-on- black. This command will alter both the summary area and task area but does not affect the state of the `x', `y' or `b' toggles. CONTENT of task window c :Command-Line/Program-Name toggle This command will be honored whether or not the COMMAND column is currently visible. Later, should that field come into view, the change you applied will be seen. F :Maintain-Parent-Focus toggle When in forest view mode, this key serves as a toggle to retain focus on a target task, presumably one with forked children. If forest view mode is Off this key has no effect. The toggle is applied to the first (topmost) process in the `current' window. Once established, that task is always displayed as the first (topmost) process along with its forked children. All other processes will be suppressed. Note: keys like `i' (idle tasks), `n' (max tasks), `v' (hide children) and User/Other filtering remain accessible and can impact what is displayed. f :Fields-Management This key displays a separate screen where you can change which fields are displayed, their order and also designate the sort field. For additional information on this interactive command see topic 3b. MANAGING Fields. O | o :Other-Filtering You will be prompted for the selection criteria which then determines which tasks will be shown in the `current' window. Your criteria can be made case sensitive or case can be ignored. And you determine if top should include or exclude matching tasks. See topic 5e. FILTERING in a window for details on these and additional related interactive commands. S :Cumulative-Time-Mode toggle When Cumulative mode is On, each process is listed with the cpu time that it and its dead children have used. When Off, programs that fork into many separate tasks will appear less demanding. For programs like `init' or a shell this is appropriate but for others, like compilers, perhaps not. Experiment with two task windows sharing the same sort field but with different `S' states and see which representation you prefer. After issuing this command, you'll be informed of the new state of this toggle. If you wish to know in advance whether or not Cumulative mode is in effect, simply ask for help and view the window summary on the second line. U | u :Show-Specific-User-Only You will be prompted for the uid or name of the user to display. The -u option matches on effective user whereas the -U option matches on any user (real, effective, saved, or filesystem). Thereafter, in that task window only matching users will be shown, or possibly no processes will be shown. Prepending an exclamation point (`!') to the user id or name instructs top to display only processes with users not matching the one provided. Different task windows can be used to filter different users. Later, if you wish to monitor all users again in the `current' window, re-issue this command but just press <Enter> at the prompt. V :Forest-View-Mode toggle In this mode, processes are reordered according to their parents and the layout of the COMMAND column resembles that of a tree. In forest view mode it is still possible to toggle between program name and command line (see the `c' interactive command) or between processes and threads (see the `H' interactive command). Note: Typing any key affecting the sort order will exit forest view mode in the `current' window. See topic 4c. TASK AREA Commands, SORTING for information on those keys. v :Hide/Show-Children toggle When in forest view mode, this key serves as a toggle to collapse or expand the children of a parent. The toggle is applied against the first (topmost) process in the `current' window. See topic 5c. SCROLLING a Window for additional information regarding vertical scrolling. If the target process has not forked any children, this key has no effect. It also has no effect when not in forest view mode. ^E :Scale-CPU-Time-fields (Ctrl key + `e') The `time' fields are normally displayed with the greatest precision their widths permit. This toggle reduces that precision until it wraps. It also illustrates the scaling those fields might experience automatically, which usually depends on how long the system runs. For example, if `MMM:SS.hh' is shown, each ^E keystroke would change it to: `MM:SS', `Hours,MM', `Days+Hours' and finally `Weeks+Days'. Not all time fields are subject to the full range of such scaling. SIZE of task window i :Idle-Process toggle Displays all tasks or just active tasks. When this toggle is Off, tasks that have not used any CPU since the last update will not be displayed. However, due to the granularity of the %CPU and TIME+ fields, some processes may still be displayed that appear to have used no CPU. If this command is applied to the last task display when in alternate-display mode, then it will not affect the window's size, as all prior task displays will have already been painted. n | # :Set-Maximum-Tasks You will be prompted to enter the number of tasks to display. The lessor of your number and available screen rows will be used. When used in alternate-display mode, this is the command that gives you precise control over the size of each currently visible task display, except for the very last. It will not affect the last window's size, as all prior task displays will have already been painted. Note: If you wish to increase the size of the last visible task display when in alternate-display mode, simply decrease the size of the task display(s) above it. SORTING of task window For compatibility, this top supports most of the former top sort keys. Since this is primarily a service to former top users, these commands do not appear on any help screen. command sorted-field supported A start time (non-display) No M %MEM Yes N PID Yes P %CPU Yes T TIME+ Yes Before using any of the following sort provisions, top suggests that you temporarily turn on column highlighting using the `x' interactive command. That will help ensure that the actual sort environment matches your intent. The following interactive commands will only be honored when the current sort field is visible. The sort field might not be visible because: 1) there is insufficient Screen Width 2) the `f' interactive command turned it Off < :Move-Sort-Field-Left Moves the sort column to the left unless the current sort field is the first field being displayed. > :Move-Sort-Field-Right Moves the sort column to the right unless the current sort field is the last field being displayed. The following interactive commands will always be honored whether or not the current sort field is visible. f :Fields-Management This key displays a separate screen where you can change which field is used as the sort column, among other functions. This can be a convenient way to simply verify the current sort field, when running top with column highlighting turned Off. R :Reverse/Normal-Sort-Field toggle Using this interactive command you can alternate between high-to-low and low-to-high sorts. 4d. COLOR Mapping When you issue the `Z' interactive command, you will be presented with a separate screen. That screen can be used to change the colors in just the `current' window or in all four windows before returning to the top display. The following interactive commands are available. 4 upper case letters to select a target 8 numbers to select a color normal toggles available B :bold disable/enable b :running tasks "bold"/reverse z :color/mono other commands available a/w :apply, then go to next/prior <Enter> :apply and exit q :abandon current changes and exit If you use `a' or `w' to cycle the targeted window, you will have applied the color scheme that was displayed when you left that window. You can, of course, easily return to any window and reapply different colors or turn colors Off completely with the `z' toggle. The Color Mapping screen can also be used to change the `current' window/field group in either full-screen mode or alternate-display mode. Whatever was targeted when `q' or <Enter> was pressed will be made current as you return to the top display. 5. ALTERNATE-DISPLAY Provisions top 5a. WINDOWS Overview Field Groups/Windows: In full-screen mode there is a single window represented by the entire screen. That single window can still be changed to display 1 of 4 different field groups (see the `g' interactive command, repeated below). Each of the 4 field groups has a unique separately configurable summary area and its own configurable task area. In alternate-display mode, those 4 underlying field groups can now be made visible simultaneously, or can be turned Off individually at your command. The summary area will always exist, even if it's only the message line. At any given time only one summary area can be displayed. However, depending on your commands, there could be from zero to four separate task displays currently showing on the screen. Current Window: The `current' window is the window associated with the summary area and the window to which task related commands are always directed. Since in alternate-display mode you can toggle the task display Off, some commands might be restricted for the `current' window. A further complication arises when you have toggled the first summary area line Off. With the loss of the window name (the `l' toggled line), you'll not easily know what window is the `current' window. 5b. COMMANDS for Windows - | _ :Show/Hide-Window(s) toggles The `-' key turns the `current' window's task display On and Off. When On, that task area will show a minimum of the columns header you've established with the `f' interactive command. It will also reflect any other task area options/toggles you've applied yielding zero or more tasks. The `_' key does the same for all task displays. In other words, it switches between the currently visible task display(s) and any task display(s) you had toggled Off. If all 4 task displays are currently visible, this interactive command will leave the summary area as the only display element. * = | + :Equalize/Reset-Window(s) The `=' key forces the `current' window's task display to be visible. It also reverses any active `i' (idle tasks), `n' (max tasks), `u/U' (user filter), `o/O' (other filter), `v' (hide children), `F' focused, `L' (locate) and `!' (combine cpus) commands. Also, if the window had been scrolled, it will be reset with this command. See topic 5c. SCROLLING a Window for additional information regarding vertical and horizontal scrolling. The `+' key does the same for all windows. The four task displays will reappear, evenly balanced, while retaining any customizations previously applied beyond those noted for the `=' command toggle. * A :Alternate-Display-Mode toggle This command will switch between full-screen mode and alternate-display mode. The first time you issue this command, all four task displays will be shown. Thereafter when you switch modes, you will see only the task display(s) you've chosen to make visible. * a | w :Next-Window-Forward/Backward This will change the `current' window, which in turn changes the window to which commands are directed. These keys act in a circular fashion so you can reach any desired window using either key. Assuming the window name is visible (you have not toggled `l' Off), whenever the `current' window name loses its emphasis/color, that's a reminder the task display is Off and many commands will be restricted. G :Change-Window/Field-Group-Name You will be prompted for a new name to be applied to the `current' window. It does not require that the window name be visible (the `l' toggle to be On). * The interactive commands shown with an asterisk (`*') have use beyond alternate-display mode. =, A, g are always available a, w act the same with color mapping and fields management * g :Choose-Another-Window/Field-Group You will be prompted to enter a number between 1 and 4 designating the field group which should be made the `current' window. In full-screen mode, this command is necessary to alter the `current' window. In alternate-display mode, it is simply a less convenient alternative to the `a' and `w' commands. 5c. SCROLLING a Window Typically a task window is a partial view into a system's total tasks/threads which shows only some of the available fields/columns. With these scrolling keys, you can move that view vertically or horizontally to reveal any desired task or column. Up,PgUp :Scroll-Tasks Move the view up toward the first task row, until the first task is displayed at the top of the `current' window. The Up arrow key moves a single line while PgUp scrolls the entire window. Down,PgDn :Scroll-Tasks Move the view down toward the last task row, until the last task is the only task displayed at the top of the `current' window. The Down arrow key moves a single line while PgDn scrolls the entire window. Left,Right :Scroll-Columns Move the view of displayable fields horizontally one column at a time. Note: As a reminder, some fields/columns are not fixed-width but allocated all remaining screen width when visible. When scrolling right or left, that feature may produce some unexpected results initially. Additionally, there are special provisions for any variable width field when positioned as the last displayed field. Once that field is reached via the right arrow key, and is thus the only column shown, you can continue scrolling horizontally within such a field. See the `C' interactive command below for additional information. Home :Jump-to-Home-Position Reposition the display to the un-scrolled coordinates. End :Jump-to-End-Position Reposition the display so that the rightmost column reflects the last displayable field and the bottom task row represents the last task. Note: From this position it is still possible to scroll down and right using the arrow keys. This is true until a single column and a single task is left as the only display element. C :Show-scroll-coordinates toggle Toggle an informational message which is displayed whenever the message line is not otherwise being used. That message will take one of two forms depending on whether or not a variable width column has also been scrolled. scroll coordinates: y = n/n (tasks), x = n/n (fields) scroll coordinates: y = n/n (tasks), x = n/n (fields) + nn The coordinates shown as n/n are relative to the upper left corner of the `current' window. The additional `+ nn' represents the displacement into a variable width column when it has been scrolled horizontally. Such displacement occurs in normal 8 character tab stop amounts via the right and left arrow keys. y = n/n (tasks) The first n represents the topmost visible task and is controlled by scrolling keys. The second n is updated automatically to reflect total tasks. x = n/n (fields) The first n represents the leftmost displayed column and is controlled by scrolling keys. The second n is the total number of displayable fields and is established with the `f' interactive command. The above interactive commands are always available in full-screen mode but never available in alternate-display mode if the `current' window's task display has been toggled Off. Note: When any form of filtering is active, you can expect some slight aberrations when scrolling since not all tasks will be visible. This is particularly apparent when using the Up/Down arrow keys. 5d. SEARCHING in a Window You can use these interactive commands to locate a task row containing a particular value. L :Locate-a-string You will be prompted for the case-sensitive string to locate starting from the current window coordinates. There are no restrictions on search string content. Searches are not limited to values from a single field or column. All of the values displayed in a task row are allowed in a search string. You may include spaces, numbers, symbols and even forest view artwork. Keying <Enter> with no input will effectively disable the `&' key until a new search string is entered. & :Locate-next Assuming a search string has been established, top will attempt to locate the next occurrence. When a match is found, the current window is repositioned vertically so the task row containing that string is first. The scroll coordinates message can provide confirmation of such vertical repositioning (see the `C' interactive command). Horizontal scrolling, however, is never altered via searching. The availability of a matching string will be influenced by the following factors. a. Which fields are displayable from the total available, see topic 3b. MANAGING Fields. b. Scrolling a window vertically and/or horizontally, see topic 5c. SCROLLING a Window. c. The state of the command/command-line toggle, see the `c' interactive command. d. The stability of the chosen sort column, for example PID is good but %CPU bad. If a search fails, restoring the `current' window home (unscrolled) position, scrolling horizontally, displaying command-lines or choosing a more stable sort field could yet produce a successful `&' search. The above interactive commands are always available in full-screen mode but never available in alternate-display mode if the `current' window's task display has been toggled Off. 5e. FILTERING in a Window You can use this `Other Filter' feature to establish selection criteria which will then determine which tasks are shown in the `current' window. Such filters can be made persistent if preserved in the rcfile via the `W' interactive command. Establishing a filter requires: 1) a field name; 2) an operator; and 3) a selection value, as a minimum. This is the most complex of top's user input requirements so, when you make a mistake, command recall will be your friend. Remember the Up/Down arrow keys or their aliases when prompted for input. Filter Basics 1. field names are case sensitive and spelled as in the header 2. selection values need not comprise the full displayed field 3. a selection is either case insensitive or sensitive to case 4. the default is inclusion, prepending `!' denotes exclusions 5. multiple selection criteria can be applied to a task window 6. inclusion and exclusion criteria can be used simultaneously 7. the 1 equality and 2 relational filters can be freely mixed 8. separate unique filters are maintained for each task window If a field is not turned on or is not currently in view, then your selection criteria will not affect the display. Later, should a filtered field become visible, the selection criteria will then be applied. Keyboard Summary O :Other-Filter (upper case) You will be prompted to establish a case sensitive filter. o :Other-Filter (lower case) You will be prompted to establish a filter that ignores case when matching. ^O :Show-Active-Filters (Ctrl key + `o') This can serve as a reminder of which filters are active in the `current' window. A summary will be shown on the message line until you press the <Enter> key. = :Reset-Filtering in current window This clears all of your selection criteria in the `current' window. It also has additional impact so please see topic 4a. GLOBAL Commands. + :Reset-Filtering in all windows This clears the selection criteria in all windows, assuming you are in alternate-display mode. As with the `=' interactive command, it too has additional consequences so you might wish to see topic 5b. COMMANDS for Windows. Input Requirements When prompted for selection criteria, the data you provide must take one of two forms. There are 3 required pieces of information, with a 4th as optional. These examples use spaces for clarity but your input generally would not. #1 #2 #3 ( required ) Field-Name ? include-if-value ! Field-Name ? exclude-if-value #4 ( optional ) Items #1, #3 and #4 should be self-explanatory. Item #2 represents both a required delimiter and the operator which must be one of either equality (`=') or relation (`<' or `>'). The `=' equality operator requires only a partial match and that can reduce your `if-value' input requirements. The `>' or `<' relational operators always employ string comparisons, even with numeric fields. They are designed to work with a field's default justification and with homogeneous data. When some field's numeric amounts have been subjected to scaling while others have not, that data is no longer homogeneous. If you establish a relational filter and you have changed the default Numeric or Character justification, that filter is likely to fail. When a relational filter is applied to a memory field and you have not changed the scaling, it may produce misleading results. This happens, for example, because `100.0m' (MiB) would appear greater than `1.000g' (GiB) when compared as strings. If your filtered results appear suspect, simply altering justification or scaling may yet achieve the desired objective. See the `j', `J' and `e' interactive commands for additional information. Potential Problems These GROUP filters could produce the exact same results or the second one might not display anything at all, just a blank task window. GROUP=root ( only the same results when ) GROUP=ROOT ( invoked via lower case `o' ) Either of these RES filters might yield inconsistent and/or misleading results, depending on the current memory scaling factor. Or both filters could produce the exact same results. RES>9999 ( only the same results when ) !RES<10000 ( memory scaling is at `KiB' ) This nMin filter illustrates a problem unique to scalable fields. This particular field can display a maximum of 4 digits, beyond which values are automatically scaled to KiB or above. So while amounts greater than 9999 exist, they will appear as 2.6m, 197k, etc. nMin>9999 ( always a blank task window ) Potential Solutions These examples illustrate how Other Filtering can be creatively applied to achieve almost any desired result. Single quotes are sometimes shown to delimit the spaces which are part of a filter or to represent a request for status (^O) accurately. But if you used them with if-values in real life, no matches would be found. Assuming field nTH is displayed, the first filter will result in only multi-threaded processes being shown. It also reminds us that a trailing space is part of every displayed field. The second filter achieves the exact same results with less typing. !nTH=` 1 ' ( ` for clarity only ) nTH>1 ( same with less i/p ) With Forest View mode active and the COMMAND column in view, this filter effectively collapses child processes so that just 3 levels are shown. !COMMAND=` `- ' ( ` for clarity only ) The final two filters appear as in response to the status request key (^O). In reality, each filter would have required separate input. The PR example shows the two concurrent filters necessary to display tasks with priorities of 20 or more, since some might be negative. Then by exploiting trailing spaces, the nMin series of filters could achieve the failed `9999' objective discussed above. `PR>20' + `!PR=-' ( 2 for right result ) `!nMin=0 ' + `!nMin=1 ' + `!nMin=2 ' + `!nMin=3 ' ... 6. FILES top 6a. PERSONAL Configuration File This file is created or updated via the `W' interactive command. The legacy version is written as `$HOME/.your-name-4-top' + `rc' with a leading period. A newly created configuration file is written as procps/your-name-4-top' + `rc' without a leading period. The procps directory will be subordinate to either $XDG_CONFIG_HOME when set as an absolute path or the $HOME/.config directory. While not intended to be edited manually, here is the general layout: global # line 1: the program name/alias notation " # line 2: id,altscr,irixps,delay,curwin per ea # line a: winname,fieldscur window # line b: winflags,sortindx,maxtasks,etc " # line c: summclr,msgsclr,headclr,taskclr global # line 15: additional miscellaneous settings " # any remaining lines are devoted to optional " # active `other filters' discussed in section 5e above " # plus `inspect' entries discussed in section 6b below If a valid absolute path to the rcfile cannot be established, customizations made to a running top will be impossible to preserve. 6b. ADDING INSPECT Entries To exploit the `Y' interactive command, you must add entries at the end of the top personal configuration file. Such entries simply reflect a file to be read or command/pipeline to be executed whose results will then be displayed in a separate scrollable, searchable window. If you don't know the location or name of your top rcfile, use the `W' interactive command to rewrite it and note those details. Inspect entries can be added with a redirected echo or by editing the configuration file. Redirecting an echo risks overwriting the rcfile should it replace (>) rather than append (>>) to that file. Conversely, when using an editor care must be taken not to corrupt existing lines, some of which could contain unprintable data or unusual characters depending on the top version under which that configuration file was saved. Those Inspect entries beginning with a `#' character are ignored, regardless of content. Otherwise they consist of the following 3 elements, each of which must be separated by a tab character (thus 2 `\t' total): .type: literal `file' or `pipe' .name: selection shown on the Inspect screen .fmts: string representing a path or command The two types of Inspect entries are not interchangeable. Those designated `file' will be accessed using fopen and must reference a single file in the `.fmts' element. Entries specifying `pipe' will employ popen, their `.fmts' element could contain many pipelined commands and, none can be interactive. If the file or pipeline represented in your `.fmts' deals with the specific PID input or accepted when prompted, then the format string must also contain the `%d' specifier, as these examples illustrate. .fmts= /proc/%d/numa_maps .fmts= lsof -P -p %d For `pipe' type entries only, you may also wish to redirect stderr to stdout for a more comprehensive result. Thus the format string becomes: .fmts= pmap -x %d 2>&1 Here are examples of both types of Inspect entries as they might appear in the rcfile. The first entry will be ignored due to the initial `#' character. For clarity, the pseudo tab depictions (^I) are surrounded by an extra space but the actual tabs would not be. # pipe ^I Sockets ^I lsof -n -P -i 2>&1 pipe ^I Open Files ^I lsof -P -p %d 2>&1 file ^I NUMA Info ^I /proc/%d/numa_maps pipe ^I Log ^I tail -n100 /var/log/syslog | sort -Mr Except for the commented entry above, these next examples show what could be echoed to achieve similar results, assuming the rcfile name was `.toprc'. However, due to the embedded tab characters, each of these lines should be preceded by `/bin/echo -e', not just a simple an `echo', to enable backslash interpretation regardless of which shell you use. "pipe\tOpen Files\tlsof -P -p %d 2>&1" >> ~/.toprc "file\tNUMA Info\t/proc/%d/numa_maps" >> ~/.toprc "pipe\tLog\ttail -n200 /var/log/syslog | sort -Mr" >> ~/.toprc If any inspect entry you create produces output with unprintable characters they will be displayed in either the ^C notation or hexadecimal <FF> form, depending on their value. This applies to tab characters as well, which will show as `^I'. If you want a truer representation, any embedded tabs should be expanded. The following example takes what could have been a `file' entry but employs a `pipe' instead so as to expand the embedded tabs. # next would have contained `\t' ... # file ^I <your_name> ^I /proc/%d/status # but this will eliminate embedded `\t' ... pipe ^I <your_name> ^I cat /proc/%d/status | expand - Note: Some programs might rely on SIGINT to end. Therefore, if a `pipe' such as the following is established, one must use Ctrl-C to terminate it in order to review the results. This is the single occasion where a `^C' will not also terminate top. pipe ^I Trace ^I /usr/bin/strace -p %d 2>&1 Lastly, while `pipe' type entries have been discussed in terms of pipelines and commands, there is nothing to prevent you from including shell scripts as well. Perhaps even newly created scripts designed specifically for the `Y' interactive command. For example, as the number of your Inspect entries grows over time, the `Options:' row will be truncated when screen width is exceeded. That does not affect operation other than to make some selections invisible. However, if some choices are lost to truncation but you want to see more options, there is an easy solution hinted at below. Inspection Pause at pid ... Use: left/right then <Enter> ... Options: help 1 2 3 4 5 6 7 8 9 10 11 ... The entries in the top rcfile would have a number for the `.name' element and the `help' entry would identify a shell script you've written explaining what those numbered selections actually mean. In that way, many more choices can be made visible. 6c. SYSTEM Configuration File This configuration file represents defaults for users who have not saved their own configuration file. The format mirrors exactly the personal configuration file and can also include `inspect' entries as explained above. Creating it is a simple process. 1. Configure top appropriately for your installation and preserve that configuration with the `W' interactive command. 2. Add and test any desired `inspect' entries. 3. Copy that configuration file to the /etc/ directory as `topdefaultrc'. 6d. SYSTEM Restrictions File The presence of this file will influence which version of the help screen is shown to an ordinary user. More importantly, it will limit what ordinary users are allowed to do when top is running. They will not be able to issue the following commands. k Kill a task r Renice a task d or s Change delay/sleep interval This configuration file is not created by top. Rather, it is created manually and placed it in the /etc/ directory as `toprc'. It should have exactly two lines, as shown in this example: s # line 1: secure mode switch 5.0 # line 2: delay interval in seconds 7. ENVIRONMENT VARIABLE(S) top The value set for the following is unimportant, just its presence. LIBPROC_HIDE_KERNEL This will prevent display of any kernel threads and exclude such processes from the summary area Tasks/Threads counts. 8. STUPID TRICKS Sampler top Many of these tricks work best when you give top a scheduling boost. So plan on starting him with a nice value of -10, assuming you've got the authority. 7a. Kernel Magic For these stupid tricks, top needs full-screen mode. The user interface, through prompts and help, intentionally implies that the delay interval is limited to tenths of a second. However, you're free to set any desired delay. If you want to see Linux at his scheduling best, try a delay of .09 seconds or less. For this experiment, under x-windows open an xterm and maximize it. Then do the following: . provide a scheduling boost and tiny delay via: nice -n -10 top -d.09 . keep sorted column highlighting Off so as to minimize path length . turn On reverse row highlighting for emphasis . try various sort columns (TIME/MEM work well), and normal or reverse sorts to bring the most active processes into view What you'll see is a very busy Linux doing what he's always done for you, but there was no program available to illustrate this. Under an xterm using `white-on-black' colors, on top's Color Mapping screen set the task color to black and be sure that task highlighting is set to bold, not reverse. Then set the delay interval to around .3 seconds. After bringing the most active processes into view, what you'll see are the ghostly images of just the currently running tasks. Delete the existing rcfile, or create a new symlink. Start this new version then type `T' (a secret key, see topic 4c. Task Area Commands, SORTING) followed by `W' and `q'. Finally, restart the program with -d0 (zero delay). Your display will be refreshed at three times the rate of the former top, a 300% speed advantage. As top climbs the TIME ladder, be as patient as you can while speculating on whether or not top will ever reach the top. 7b. Bouncing Windows For these stupid tricks, top needs alternate-display mode. With 3 or 4 task displays visible, pick any window other than the last and turn idle processes Off using the `i' command toggle. Depending on where you applied `i', sometimes several task displays are bouncing and sometimes it's like an accordion, as top tries his best to allocate space. Set each window's summary lines differently: one with no memory (`m'); another with no states (`t'); maybe one with nothing at all, just the message line. Then hold down `a' or `w' and watch a variation on bouncing windows -- hopping windows. Display all 4 windows and for each, in turn, set idle processes to Off using the `i' command toggle. You've just entered the "extreme bounce" zone. 7c. The Big Bird Window This stupid trick also requires alternate-display mode. Display all 4 windows and make sure that 1:Def is the `current' window. Then, keep increasing window size with the `n' interactive command until all the other task displays are "pushed out of the nest". When they've all been displaced, toggle between all visible/invisible windows using the `_' command toggle. Then ponder this: is top fibbing or telling honestly your imposed truth? 7d. The Ol' Switcheroo This stupid trick works best without alternate-display mode, since justification is active on a per window basis. Start top and make COMMAND the last (rightmost) column displayed. If necessary, use the `c' command toggle to display command lines and ensure that forest view mode is active with the `V' command toggle. Then use the up/down arrow keys to position the display so that some truncated command lines are shown (`+' in last position). You may have to resize your xterm to produce truncation. Lastly, use the `j' command toggle to make the COMMAND column right justified. Now use the right arrow key to reach the COMMAND column. Continuing with the right arrow key, watch closely the direction of travel for the command lines being shown. some lines travel left, while others travel right eventually all lines will Switcheroo, and move right 9. BUGS top Please send bug reports to [email protected]. 10. SEE Also top free(1), ps(1), uptime(1), atop(1), slabtop(1), vmstat(8), w(1) COLOPHON top This page is part of the procps-ng (/proc filesystem utilities) project. Information about the project can be found at https://gitlab.com/procps-ng/procps. If you have a bug report for this manual page, see https://gitlab.com/procps-ng/procps/blob/master/Documentation/bugs.md. This page was obtained from the project's upstream Git repository https://gitlab.com/procps-ng/procps.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-10-16.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] procps-ng August 2023 TOP(1) Pages that refer to this page: free(1), htop(1), irqtop(1), pidstat(1), pmie(1), ps(1), pstree(1), slabtop(1), systemd-cgtop(1), tload(1), uptime(1), w(1), proc(5), sched(7), iotop(8), vmstat(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# top\n\n> Display dynamic real-time information about running processes.\n> More information: <https://manned.org/top>.\n\n- Start `top`:\n\n`top`\n\n- Do not show any idle or zombie processes:\n\n`top -i`\n\n- Show only processes owned by given user:\n\n`top -u {{username}}`\n\n- Sort processes by a field:\n\n`top -o {{field_name}}`\n\n- Show the individual threads of a given process:\n\n`top -Hp {{process_id}}`\n\n- Show only the processes with the given PID(s), passed as a comma-separated list. (Normally you wouldn't know PIDs off hand. This example picks the PIDs from the process name):\n\n`top -p $(pgrep -d ',' {{process_name}})`\n\n- Display help about interactive commands:\n\n`?`\n
touch
touch(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training touch(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | DATE STRING | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON TOUCH(1) User Commands TOUCH(1) NAME top touch - change file timestamps SYNOPSIS top touch [OPTION]... FILE... DESCRIPTION top Update the access and modification times of each FILE to the current time. A FILE argument that does not exist is created empty, unless -c or -h is supplied. A FILE argument string of - is handled specially and causes touch to change the times of the file associated with standard output. Mandatory arguments to long options are mandatory for short options too. -a change only the access time -c, --no-create do not create any files -d, --date=STRING parse STRING and use it instead of current time -f (ignored) -h, --no-dereference affect each symbolic link instead of any referenced file (useful only on systems that can change the timestamps of a symlink) -m change only the modification time -r, --reference=FILE use this file's times instead of current time -t STAMP use [[CC]YY]MMDDhhmm[.ss] instead of current time --time=WORD change the specified time: WORD is access, atime, or use: equivalent to -a WORD is modify or mtime: equivalent to -m --help display this help and exit --version output version information and exit Note that the -d and -t options accept different time-date formats. DATE STRING top The --date=STRING is a mostly free format human readable date string such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or even "next Thursday". A date string may contain items indicating calendar date, time of day, time zone, day of week, relative time, relative date, and numbers. An empty string indicates the beginning of the day. The date string format is more complex than is easily documented here but is fully described in the info documentation. AUTHOR top Written by Paul Rubin, Arnold Robbins, Jim Kingdon, David MacKenzie, and Randy Smith. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top Full documentation <https://www.gnu.org/software/coreutils/touch> or available locally via: info '(coreutils) touch invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 TOUCH(1) Pages that refer to this page: last(1@@util-linux), utime(2), utimensat(2), systemd-update-done.service(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# touch\n\n> Create files and set access/modification times.\n> More information: <https://manned.org/man/freebsd-13.1/touch>.\n\n- Create specific files:\n\n`touch {{path/to/file1 path/to/file2 ...}}`\n\n- Set the file [a]ccess or [m]odification times to the current one and don't [c]reate file if it doesn't exist:\n\n`touch -c -{{a|m}} {{path/to/file1 path/to/file2 ...}}`\n\n- Set the file [t]ime to a specific value and don't [c]reate file if it doesn't exist:\n\n`touch -c -t {{YYYYMMDDHHMM.SS}} {{path/to/file1 path/to/file2 ...}}`\n\n- Set the file time of a specific file to the time of anothe[r] file and don't [c]reate file if it doesn't exist:\n\n`touch -c -r {{~/.emacs}} {{path/to/file1 path/to/file2 ...}}`\n
tput
tput(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training tput(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | FILES | EXIT CODES | DIAGNOSTICS | HISTORY | PORTABILITY | SEE ALSO | COLOPHON @TPUT@(1) General Commands Manual @TPUT@(1) NAME top @TPUT@, reset - initialize a terminal or query terminfo database SYNOPSIS top @TPUT@ [-Ttype] capname [parameters] @TPUT@ [-Ttype] [-x] clear @TPUT@ [-Ttype] init @TPUT@ [-Ttype] reset @TPUT@ [-Ttype] longname @TPUT@ -S << @TPUT@ -V DESCRIPTION top The @TPUT@ utility uses the terminfo database to make the values of terminal-dependent capabilities and information available to the shell (see sh(1)), to initialize or reset the terminal, or return the long name of the requested terminal type. The result depends upon the capability's type: string @TPUT@ writes the string to the standard output. No trailing newline is supplied. integer @TPUT@ writes the decimal value to the standard output, with a trailing newline. boolean @TPUT@ simply sets the exit code (0 for TRUE if the terminal has the capability, 1 for FALSE if it does not), and writes nothing to the standard output. Before using a value returned on the standard output, the application should test the exit code (e.g., $?, see sh(1)) to be sure it is 0. (See the EXIT CODES and DIAGNOSTICS sections.) For a complete list of capabilities and the capname associated with each, see terminfo(5). Options -S allows more than one capability per invocation of @TPUT@. The capabilities must be passed to @TPUT@ from the standard input instead of from the command line (see example). Only one capname is allowed per line. The -S option changes the meaning of the 0 and 1 boolean and string exit codes (see the EXIT CODES section). Because some capabilities may use string parameters rather than numbers, @TPUT@ uses a table and the presence of parameters in its input to decide whether to use tparm(3X), and how to interpret the parameters. -Ttype indicates the type of terminal. Normally this option is unnecessary, because the default is taken from the environment variable TERM. If -T is specified, then the shell variables LINES and COLUMNS will also be ignored. -V reports the version of ncurses which was used in this program, and exits. -x do not attempt to clear the terminal's scrollback buffer using the extended E3 capability. Commands A few commands (init, reset and longname) are special; they are defined by the @TPUT@ program. The others are the names of capabilities from the terminal database (see terminfo(5) for a list). Although init and reset resemble capability names, @TPUT@ uses several capabilities to perform these special functions. capname indicates the capability from the terminal database. If the capability is a string that takes parameters, the arguments following the capability will be used as parameters for the string. Most parameters are numbers. Only a few terminal capabilities require string parameters; @TPUT@ uses a table to decide which to pass as strings. Normally @TPUT@ uses tparm(3X) to perform the substitution. If no parameters are given for the capability, @TPUT@ writes the string without performing the substitution. init If the terminal database is present and an entry for the user's terminal exists (see -Ttype, above), the following will occur: (1) first, @TPUT@ retrieves the current terminal mode settings for your terminal. It does this by successively testing the standard error, standard output, standard input and ultimately /dev/tty to obtain terminal settings. Having retrieved these settings, @TPUT@ remembers which file descriptor to use when updating settings. (2) if the window size cannot be obtained from the operating system, but the terminal description (or environment, e.g., LINES and COLUMNS variables specify this), update the operating system's notion of the window size. (3) the terminal modes will be updated: any delays (e.g., newline) specified in the entry will be set in the tty driver, tabs expansion will be turned on or off according to the specification in the entry, and if tabs are not expanded, standard tabs will be set (every 8 spaces). (4) if present, the terminal's initialization strings will be output as detailed in the terminfo(5) section on Tabs and Initialization, (5) output is flushed. If an entry does not contain the information needed for any of these activities, that activity will silently be skipped. reset This is similar to init, with two differences: (1) before any other initialization, the terminal modes will be reset to a sane state: set cooked and echo modes, turn off cbreak and raw modes, turn on newline translation and reset any unset special characters to their default values (2) Instead of putting out initialization strings, the terminal's reset strings will be output if present (rs1, rs2, rs3, rf). If the reset strings are not present, but initialization strings are, the initialization strings will be output. Otherwise, reset acts identically to init. longname If the terminal database is present and an entry for the user's terminal exists (see -Ttype above), then the long name of the terminal will be put out. The long name is the last name in the first line of the terminal's description in the terminfo database [see term(5)]. Aliases @TPUT@ handles the clear, init and reset commands specially: it allows for the possibility that it is invoked by a link with those names. If @TPUT@ is invoked by a link named reset, this has the same effect as @TPUT@ reset. The @TSET@(1) utility also treats a link named reset specially. Before ncurses 6.1, the two utilities were different from each other: @TSET@ utility reset the terminal modes and special characters (not done with @TPUT@). On the other hand, @TSET@'s repertoire of terminal capabilities for resetting the terminal was more limited, i.e., only reset_1string, reset_2string and reset_file in contrast to the tab-stops and margins which are set by this utility. The reset program is usually an alias for @TSET@, because of this difference with resetting terminal modes and special characters. With the changes made for ncurses 6.1, the reset feature of the two programs is (mostly) the same. A few differences remain: The @TSET@ program waits one second when resetting, in case it happens to be a hardware terminal. The two programs write the terminal initialization strings to different streams (i.e., the standard error for @TSET@ and the standard output for @TPUT@). Note: although these programs write to different streams, redirecting their output to a file will capture only part of their actions. The changes to the terminal modes are not affected by redirecting the output. If @TPUT@ is invoked by a link named init, this has the same effect as @TPUT@ init. Again, you are less likely to use that link because another program named init has a more well- established use. Terminal Size Besides the special commands (e.g., clear), @TPUT@ treats certain terminfo capabilities specially: lines and cols. @TPUT@ calls setupterm(3X) to obtain the terminal size: first, it gets the size from the terminal database (which generally is not provided for terminal emulators which do not have a fixed window size) then it asks the operating system for the terminal's size (which generally works, unless connecting via a serial line which does not support NAWS: negotiations about window size). finally, it inspects the environment variables LINES and COLUMNS which may override the terminal size. If the -T option is given @TPUT@ ignores the environment variables by calling use_tioctl(TRUE), relying upon the operating system (or finally, the terminal database). EXAMPLES top @TPUT@ init Initialize the terminal according to the type of terminal in the environmental variable TERM. This command should be included in everyone's .profile after the environmental variable TERM has been exported, as illustrated on the profile(5) manual page. @TPUT@ -T5620 reset Reset an AT&T 5620 terminal, overriding the type of terminal in the environmental variable TERM. @TPUT@ cup 0 0 Send the sequence to move the cursor to row 0, column 0 (the upper left corner of the screen, usually known as the home cursor position). @TPUT@ clear Echo the clear-screen sequence for the current terminal. @TPUT@ cols Print the number of columns for the current terminal. @TPUT@ -T450 cols Print the number of columns for the 450 terminal. bold=`@TPUT@ smso` offbold=`@TPUT@ rmso` Set the shell variables bold, to begin stand-out mode sequence, and offbold, to end standout mode sequence, for the current terminal. This might be followed by a prompt: echo "${bold}Please type in your name: ${offbold}\c" @TPUT@ hc Set exit code to indicate if the current terminal is a hard copy terminal. @TPUT@ cup 23 4 Send the sequence to move the cursor to row 23, column 4. @TPUT@ cup Send the terminfo string for cursor-movement, with no parameters substituted. @TPUT@ longname Print the long name from the terminfo database for the type of terminal specified in the environmental variable TERM. @TPUT@ -S <<! > clear > cup 10 10 > bold > ! This example shows @TPUT@ processing several capabilities in one invocation. It clears the screen, moves the cursor to position 10, 10 and turns on bold (extra bright) mode. The list is terminated by an exclamation mark (!) on a line by itself. FILES top @TERMINFO@ compiled terminal description database @DATADIR@/tabset/* tab settings for some terminals, in a format appropriate to be output to the terminal (escape sequences that set margins and tabs); for more information, see the Tabs and Initialization, section of terminfo(5) EXIT CODES top If the -S option is used, @TPUT@ checks for errors from each line, and if any errors are found, will set the exit code to 4 plus the number of lines with errors. If no errors are found, the exit code is 0. No indication of which line failed can be given so exit code 1 will never appear. Exit codes 2, 3, and 4 retain their usual interpretation. If the -S option is not used, the exit code depends on the type of capname: boolean a value of 0 is set for TRUE and 1 for FALSE. string a value of 0 is set if the capname is defined for this terminal type (the value of capname is returned on standard output); a value of 1 is set if capname is not defined for this terminal type (nothing is written to standard output). integer a value of 0 is always set, whether or not capname is defined for this terminal type. To determine if capname is defined for this terminal type, the user must test the value written to standard output. A value of -1 means that capname is not defined for this terminal type. other reset or init may fail to find their respective files. In that case, the exit code is set to 4 + errno. Any other exit code indicates an error; see the DIAGNOSTICS section. DIAGNOSTICS top @TPUT@ prints the following error messages and sets the corresponding exit codes. exit code error message 0 (capname is a numeric variable that is not specified in the terminfo(5) database for this terminal type, e.g. @TPUT@ -T450 lines and @TPUT@ -Thp2621 xmc) 1 no error message is printed, see the EXIT CODES section. 2 usage error 3 unknown terminal type or no terminfo database 4 unknown terminfo capability capname >4 error occurred in -S HISTORY top The tput command was begun by Bill Joy in 1980. The initial version only cleared the screen. AT&T System V provided a different tput command: SVr2 provided a rudimentary tput which checked the parameter against each predefined capability and returned the corresponding value. This version of tput did not use tparm(3X) for the capabilities which are parameterized. SVr3 replaced that, a year later, by a more extensive program whose init and reset subcommands (more than half the program) were incorporated from the reset feature of BSD tset written by Eric Allman. SVr4 added color initialization using the orig_colors and orig_pair capabilities in the init subcommand. Keith Bostic replaced the BSD tput command in 1989 with a new implementation based on the AT&T System V program tput. Like the AT&T program, Bostic's version accepted some parameters named for terminfo capabilities (clear, init, longname and reset). However (because he had only termcap available), it accepted termcap names for other capabilities. Also, Bostic's BSD tput did not modify the terminal I/O modes as the earlier BSD tset had done. At the same time, Bostic added a shell script named clear, which used tput to clear the screen. Both of these appeared in 4.4BSD, becoming the modern BSD implementation of tput. This implementation of tput began from a different source than AT&T or BSD: Ross Ridge's mytinfo package, published on comp.sources.unix in December 1992. Ridge's program made more sophisticated use of the terminal capabilities than the BSD program. Eric Raymond used that tput program (and other parts of mytinfo) in ncurses in June 1995. Using the portions dealing with terminal capabilities almost without change, Raymond made improvements to the way the command-line parameters were handled. PORTABILITY top This implementation of tput differs from AT&T tput in two important areas: @TPUT@ capname writes to the standard output. That need not be a regular terminal. However, the subcommands which manipulate terminal modes may not use the standard output. The AT&T implementation's init and reset commands use the BSD (4.1c) tset source, which manipulates terminal modes. It successively tries standard output, standard error, standard input before falling back to /dev/tty and finally just assumes a 1200Bd terminal. When updating terminal modes, it ignores errors. Until changes made after ncurses 6.0, @TPUT@ did not modify terminal modes. @TPUT@ now uses a similar scheme, using functions shared with @TSET@ (and ultimately based on the 4.4BSD tset). If it is not able to open a terminal, e.g., when running in cron(1), @TPUT@ will return an error. AT&T tput guesses the type of its capname operands by seeing if all of the characters are numeric, or not. Most implementations which provide support for capname operands use the tparm function to expand parameters in it. That function expects a mixture of numeric and string parameters, requiring @TPUT@ to know which type to use. This implementation uses a table to determine the parameter types for the standard capname operands, and an internal library function to analyze nonstandard capname operands. Besides providing more reliable operation than AT&T's utility, a portability problem is introduced by this analysis: An OpenBSD developer adapted the internal library function from ncurses to port NetBSD's termcap-based tput to terminfo. That had been modified to interpret multiple commands on a line. Portable applications should not rely upon this feature; ncurses provides it to support applications written specifically for OpenBSD. This implementation (unlike others) can accept both termcap and terminfo names for the capname feature, if termcap support is compiled in. However, the predefined termcap and terminfo names have two ambiguities in this case (and the terminfo name is assumed): The termcap name dl corresponds to the terminfo name dl1 (delete one line). The terminfo name dl corresponds to the termcap name DL (delete a given number of lines). The termcap name ed corresponds to the terminfo name rmdc (end delete mode). The terminfo name ed corresponds to the termcap name cd (clear to end of screen). The longname and -S options, and the parameter-substitution features used in the cup example, were not supported in BSD curses before 4.3reno (1989) or in AT&T/USL curses before SVr4 (1988). IEEE Std 1003.1/The Open Group Base Specifications Issue 7 (POSIX.1-2008) documents only the operands for clear, init and reset. There are a few interesting observations to make regarding that: In this implementation, clear is part of the capname support. The others (init and longname) do not correspond to terminal capabilities. Other implementations of tput on SVr4-based systems such as Solaris, IRIX64 and HPUX as well as others such as AIX and Tru64 provide support for capname operands. A few platforms such as FreeBSD recognize termcap names rather than terminfo capability names in their respective tput commands. Since 2010, NetBSD's tput uses terminfo names. Before that, it (like FreeBSD) recognized termcap names. Beginning in 2021, FreeBSD uses the ncurses tput, configured for both terminfo (tested first) and termcap (as a fallback). Because (apparently) all of the certified Unix systems support the full set of capability names, the reasoning for documenting only a few may not be apparent. X/Open Curses Issue 7 documents tput differently, with capname and the other features used in this implementation. That is, there are two standards for tput: POSIX (a subset) and X/Open Curses (the full implementation). POSIX documents a subset to avoid the complication of including X/Open Curses and the terminal capabilities database. While it is certainly possible to write a tput program without using curses, none of the systems which have a curses implementation provide a tput utility which does not provide the capname feature. X/Open Curses Issue 7 (2009) is the first version to document utilities. However that part of X/Open Curses does not follow existing practice (i.e., Unix features documented in SVID 3): It assigns exit code 4 to invalid operand, which may be the same as unknown capability. For instance, the source code for Solaris' xcurses uses the term invalid in this case. It assigns exit code 255 to a numeric variable that is not specified in the terminfo database. That likely is a documentation error, confusing the -1 written to the standard output for an absent or cancelled numeric value versus an (unsigned) exit code. The various Unix systems (AIX, HPUX, Solaris) use the same exit- codes as ncurses. NetBSD curses documents different exit codes which do not correspond to either ncurses or X/Open. SEE ALSO top @CLEAR@(1), stty(1), @TABS@(1), @TSET@(1), curs_termcap(3X), terminfo(5). This describes ncurses version @NCURSES_MAJOR@.@NCURSES_MINOR@ (patch @NCURSES_PATCH@). COLOPHON top This page is part of the ncurses (new curses) project. Information about the project can be found at https://www.gnu.org/software/ncurses/ncurses.html. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git mirror of the CVS repository https://github.com/mirror/ncurses.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-03-12.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] @TPUT@(1) Pages that refer to this page: setterm(1), termios(3), console_codes(4), termio(7) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# tput\n\n> View and modify terminal settings and capabilities.\n> More information: <https://manned.org/tput>.\n\n- Move the cursor to a screen location:\n\n`tput cup {{row}} {{column}}`\n\n- Set foreground (af) or background (ab) color:\n\n`tput {{setaf|setab}} {{ansi_color_code}}`\n\n- Show number of columns, lines, or colors:\n\n`tput {{cols|lines|colors}}`\n\n- Ring the terminal bell:\n\n`tput bel`\n\n- Reset all terminal attributes:\n\n`tput sgr0`\n\n- Enable or disable word wrap:\n\n`tput {{smam|rmam}}`\n
tr
tr(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training tr(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | BUGS | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON TR(1) User Commands TR(1) NAME top tr - translate or delete characters SYNOPSIS top tr [OPTION]... STRING1 [STRING2] DESCRIPTION top Translate, squeeze, and/or delete characters from standard input, writing to standard output. STRING1 and STRING2 specify arrays of characters ARRAY1 and ARRAY2 that control the action. -c, -C, --complement use the complement of ARRAY1 -d, --delete delete characters in ARRAY1, do not translate -s, --squeeze-repeats replace each sequence of a repeated character that is listed in the last specified ARRAY, with a single occurrence of that character -t, --truncate-set1 first truncate ARRAY1 to length of ARRAY2 --help display this help and exit --version output version information and exit ARRAYs are specified as strings of characters. Most represent themselves. Interpreted sequences are: \NNN character with octal value NNN (1 to 3 octal digits) \\ backslash \a audible BEL \b backspace \f form feed \n new line \r return \t horizontal tab \v vertical tab CHAR1-CHAR2 all characters from CHAR1 to CHAR2 in ascending order [CHAR*] in ARRAY2, copies of CHAR until length of ARRAY1 [CHAR*REPEAT] REPEAT copies of CHAR, REPEAT octal if starting with 0 [:alnum:] all letters and digits [:alpha:] all letters [:blank:] all horizontal whitespace [:cntrl:] all control characters [:digit:] all digits [:graph:] all printable characters, not including space [:lower:] all lower case letters [:print:] all printable characters, including space [:punct:] all punctuation characters [:space:] all horizontal or vertical whitespace [:upper:] all upper case letters [:xdigit:] all hexadecimal digits [=CHAR=] all characters which are equivalent to CHAR Translation occurs if -d is not given and both STRING1 and STRING2 appear. -t is only significant when translating. ARRAY2 is extended to length of ARRAY1 by repeating its last character as necessary. Excess characters of ARRAY2 are ignored. Character classes expand in unspecified order; while translating, [:lower:] and [:upper:] may be used in pairs to specify case conversion. Squeezing occurs after translation or deletion. BUGS top Full support is available only for safe single-byte locales, in which every possible input byte represents a single character. The C locale is safe in GNU systems, so you can avoid this issue in the shell by running LC_ALL=C tr instead of plain tr. AUTHOR top Written by Jim Meyering. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top Full documentation <https://www.gnu.org/software/coreutils/tr> or available locally via: info '(coreutils) tr invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 TR(1) Pages that refer to this page: sed(1), proc(5) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# tr\n\n> Translate characters: run replacements based on single characters and character sets.\n> More information: <https://www.gnu.org/software/coreutils/tr>.\n\n- Replace all occurrences of a character in a file, and print the result:\n\n`tr {{find_character}} {{replace_character}} < {{path/to/file}}`\n\n- Replace all occurrences of a character from another command's output:\n\n`echo {{text}} | tr {{find_character}} {{replace_character}}`\n\n- Map each character of the first set to the corresponding character of the second set:\n\n`tr '{{abcd}}' '{{jkmn}}' < {{path/to/file}}`\n\n- Delete all occurrences of the specified set of characters from the input:\n\n`tr -d '{{input_characters}}' < {{path/to/file}}`\n\n- Compress a series of identical characters to a single character:\n\n`tr -s '{{input_characters}}' < {{path/to/file}}`\n\n- Translate the contents of a file to upper-case:\n\n`tr "[:lower:]" "[:upper:]" < {{path/to/file}}`\n\n- Strip out non-printable characters from a file:\n\n`tr -cd "[:print:]" < {{path/to/file}}`\n
trace-cmd
trace-cmd(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training trace-cmd(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COMMANDS | OPTIONS | SEE ALSO | AUTHOR | RESOURCES | COPYING | NOTES | COLOPHON TRACE-CMD(1) libtracefs Manual TRACE-CMD(1) NAME top trace-cmd - interacts with Ftrace Linux kernel internal tracer SYNOPSIS top trace-cmd COMMAND [OPTIONS] DESCRIPTION top The trace-cmd(1) command interacts with the Ftrace tracer that is built inside the Linux kernel. It interfaces with the Ftrace specific files found in the debugfs file system under the tracing directory. A COMMAND must be specified to tell trace-cmd what to do. COMMANDS top record - record a live trace and write a trace.dat file to the local disk or to the network. set - set a ftrace configuration parameter. report - reads a trace.dat file and converts the binary data to a ASCII text readable format. stream - Start tracing and read the output directly profile - Start profiling and read the output directly hist - show a histogram of the events. stat - show tracing (ftrace) status of the running system options - list the plugin options that are available to *report* start - start the tracing without recording to a trace.dat file. stop - stop tracing (only disables recording, overhead of tracer is still in effect) restart - restart tracing from a previous stop (only effects recording) extract - extract the data from the kernel buffer and create a trace.dat file. show - display the contents of one of the Ftrace Linux kernel tracing files reset - disables all tracing and gives back the system performance. (clears all data from the kernel buffers) clear - clear the content of the Ftrace ring buffers. split - splits a trace.dat file into smaller files. list - list the available plugins or events that can be recorded. listen - open up a port to listen for remote tracing connections. agent - listen on a vsocket for trace clients setup-guest - create FIFOs for tracing guest VMs restore - restore the data files of a crashed run of trace-cmd record snapshot- take snapshot of running trace stack - run and display the stack tracer check-events - parse format strings for all trace events and return whether all formats are parseable convert - convert trace files attach - attach a host trace.dat file to a guest trace.dat file dump - read out the meta data from a trace file OPTIONS top -h, --help Display the help text. Other options see the man page for the corresponding command. SEE ALSO top trace-cmd-record(1), trace-cmd-report(1), trace-cmd-hist(1), trace-cmd-start(1), trace-cmd-stop(1), trace-cmd-extract(1), trace-cmd-reset(1), trace-cmd-restore(1), trace-cmd-stack(1), trace-cmd-convert(1), trace-cmd-split(1), trace-cmd-list(1), trace-cmd-listen(1), trace-cmd.dat(5), trace-cmd-check-events(1), trace-cmd-stat(1), trace-cmd-attach(1) AUTHOR top Written by Steven Rostedt, <[email protected][1]> RESOURCES top https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/ COPYING top Copyright (C) 2010 Red Hat, Inc. Free use of this software is granted under the terms of the GNU Public License (GPL). NOTES top 1. [email protected] mailto:[email protected] COLOPHON top This page is part of the trace-cmd (a front-end for Ftrace) project. Information about the project can be found at https://www.trace-cmd.org/. If you have a bug report for this manual page, see https://www.trace-cmd.org/. This page was obtained from the project's upstream Git repository https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-11-28.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] libtracefs 09/24/2023 TRACE-CMD(1) Pages that refer to this page: sqlhist(1), strace(1), trace-cmd-agent(1), trace-cmd-attach(1), trace-cmd-check-events(1), trace-cmd-clear(1), trace-cmd-convert(1), trace-cmd-dump(1), trace-cmd-extract(1), trace-cmd-hist(1), trace-cmd-list(1), trace-cmd-listen(1), trace-cmd-mem(1), trace-cmd-options(1), trace-cmd-profile(1), trace-cmd-record(1), trace-cmd-report(1), trace-cmd-reset(1), trace-cmd-restore(1), trace-cmd-set(1), trace-cmd-show(1), trace-cmd-snapshot(1), trace-cmd-split(1), trace-cmd-stack(1), trace-cmd-start(1), trace-cmd-stat(1), trace-cmd-stop(1), trace-cmd-stream(1), kbuffer_alloc(3), kbuffer_read_event(3), kbuffer_timestamp(3), libtraceevent(3), libtracefs(3), tep_alloc(3), tep_data_type(3), tep_event_common_fields(3), tep_filter_alloc(3), tep_find_common_field(3), tep_find_event(3), tep_find_function(3), tep_get_any_field_val(3), tep_get_cpus(3), tep_get_event(3), tep_get_header_page_size(3), tep_get_long_size(3), tep_get_page_size(3), tep_is_bigendian(3), tep_is_file_bigendian(3), tep_list_events(3), tep_load_plugins(3), tep_parse_event(3), tep_parse_header_page(3), tep_parse_saved_cmdlines(3), tep_plugin_kvm_get_func(3), tep_print_event(3), tep_print_field_content(3), tep_print_printk(3), tep_read_number(3), tep_read_number_field(3), tep_register_comm(3), tep_register_event_handler(3), tep_register_print_function(3), tep_set_flag(3), tep_set_function_resolver(3), tep_set_loglevel(3), tep_strerror(3), tracefs_binary_init(3), tracefs_cpu_open(3), tracefs_cpu_read_size(3), tracefs_dynevent_create(3), tracefs_eprobe_alloc(3), tracefs_error_last(3), tracefs_event_get_file(3), tracefs_event_systems(3), tracefs_file_exists(3), tracefs_filter_string_append(3), tracefs_find_cid_pid(3), tracefs_function_filter(3), tracefs_get_tracing_file(3), tracefs_hist_add_sort_key(3), tracefs_hist_alloc(3), tracefs_hist_start(3), tracefs_instance_create(3), tracefs_instance_file_open(3), tracefs_instance_get_name(3), tracefs_instance_set_affinity(3), tracefs_instance_tracers(3), tracefs_iterate_raw_events(3), tracefs_kprobe_alloc(3), tracefs_local_events(3), tracefs_option_enable(3), tracefs_options(3), tracefs_options_get_supported(3), tracefs_print_init(3), tracefs_set_loglevel(3), tracefs_sql(3), tracefs_synth_alloc(3), tracefs_synth_create(3), tracefs_synth_echo_cmd(3), tracefs_trace_is_on(3), tracefs_trace_pipe_stream(3), tracefs_tracers(3), tracefs_uprobe_alloc(3), trace_seq_init(3), trace-cmd.dat.v6(5), trace-cmd.dat.v7(5) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# trace-cmd\n\n> Utility to interact with the Ftrace Linux kernel internal tracer.\n> This utility only runs as root.\n> More information: <https://manned.org/trace-cmd>.\n\n- Display the status of tracing system:\n\n`trace-cmd stat`\n\n- List available tracers:\n\n`trace-cmd list -t`\n\n- Start tracing with a specific plugin:\n\n`trace-cmd start -p {{timerlat|osnoise|hwlat|blk|mmiotrace|function_graph|wakeup_dl|wakeup_rt|wakeup|function|nop}}`\n\n- View the trace output:\n\n`trace-cmd show`\n\n- Stop the tracing but retain the buffers:\n\n`trace-cmd stop`\n\n- Clear the trace buffers:\n\n`trace-cmd clear`\n\n- Clear the trace buffers and stop tracing:\n\n`trace-cmd reset`\n
tracepath
tracepath(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training tracepath(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OUTPUT | HANDLING ERRORS | SEE ALSO | AUTHOR | SECURITY | AVAILABILITY | COLOPHON TRACEPATH(8) iputils TRACEPATH(8) NAME top tracepath - traces path to a network host discovering MTU along this path SYNOPSIS top tracepath [-4] [-6] [-n] [-b] [-l pktlen] [-m max_hops] [-p port] [-V] {destination} DESCRIPTION top It traces the network path to destination discovering MTU along this path. It uses UDP port port or some random port. It is similar to traceroute. However, it does not require superuser privileges and has no fancy options. tracepath -6 is a good replacement for traceroute6 and classic example of application of Linux error queues. The situation with IPv4 is worse, because commercial IP routers do not return enough information in ICMP error messages. Probably, it will change, when they are updated. For now it uses Van Jacobson's trick, sweeping a range of UDP ports to maintain trace history. OPTIONS top -4 Use IPv4 only. -6 Use IPv6 only. -n Print primarily IP addresses numerically. -b Print both: Host names and IP addresses. -l Sets the initial packet length to pktlen instead of 65535 for IPv4 or 128000 for IPv6. -m Set maximum hops (or maximum TTLs) to max_hops instead of 30. -p Sets the initial destination port to use. -V Print version and exit. OUTPUT top root@mops:~ # tracepath -6 3ffe:2400:0:109::2 1?: [LOCALHOST] pmtu 1500 1: dust.inr.ac.ru 0.411ms 2: dust.inr.ac.ru asymm 1 0.390ms pmtu 1480 2: 3ffe:2400:0:109::2 463.514ms reached Resume: pmtu 1480 hops 2 back 2 The first column shows the TTL of the probe, followed by colon. Usually the value of TTL is obtained from the reply from the network, but sometimes it does not contain the necessary information and we have to guess it. In this case the number is followed by ?. The second column shows the network hop which replied to the probe. It is either the address of the router or the word [LOCALHOST], if the probe was not sent to the network. The rest of the line shows miscellaneous information about the path to the corresponding network hop. It contains the value of RTT, and additionally it can show Path MTU when it changes. If the path is asymmetric or the probe finishes before it reaches the prescribed hop, the number of hops in return direction is shown next to the keyword "asymm". This information is not reliable, e.g. the third line shows asymmetry of 1. This is because the first probe with TTL of 2 was rejected at the first hop due to Path MTU Discovery. The last line summarizes information about all the paths to the destination. It shows detected Path MTU, amount of hops to the destination and our guess about the number of hops from the destination to us, which can be different when the path is asymmetric. HANDLING ERRORS top In case of errors tracepath prints short error code. Output Code Meaning !A EACCES Communication administratively prohibited !H EHOSTUNREACH Destination host unreachable !N ENETUNREACH Destination network unreachable !P EPROTO Destination protocol unreachable pmtu N EMSGSIZE Message too long reached ECONNREFUSED Connection refused ETIMEDOUT Connection timed out NET ERROR N Any other error SEE ALSO top traceroute(8), traceroute6(8), ping(8). AUTHOR top tracepath was written by Alexey Kuznetsov <[email protected]>. SECURITY top No security issues. This lapidary deserves to be elaborated. tracepath is not a privileged program, unlike traceroute, ping and other beasts of their kind. tracepath may be executed by everyone who has enough access to the network to send UDP datagrams to the desired destination using the given port. AVAILABILITY top tracepath is part of iputils package. COLOPHON top This page is part of the iputils (IP utilities) project. Information about the project can be found at http://www.skbuff.net/iputils/. If you have a bug report for this manual page, send it to [email protected], [email protected]. This page was obtained from the project's upstream Git repository https://github.com/iputils/iputils.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-22.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] iputils 20221126 TRACEPATH(8) Pages that refer to this page: ip(7), arping(8), clockdiff(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# tracepath\n\n> Trace the path to a network host discovering MTU along this path.\n> More information: <https://manned.org/tracepath>.\n\n- A preferred way to trace the path to a host:\n\n`tracepath -p {{33434}} {{host}}`\n\n- Specify the initial destination port, useful with non-standard firewall settings:\n\n`tracepath -p {{destination_port}} {{host}}`\n\n- Print both hostnames and numerical IP addresses:\n\n`tracepath -b {{host}}`\n\n- Specify a maximum TTL (number of hops):\n\n`tracepath -m {{max_hops}} {{host}}`\n\n- Specify the initial packet length (defaults to 65535 for IPv4 and 128000 for IPv6):\n\n`tracepath -l {{packet_length}} {{host}}`\n\n- Use only IPv6 addresses:\n\n`tracepath -6 {{host}}`\n
traceroute
traceroute(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training traceroute(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | LIST OF AVAILABLE METHODS | NOTES | SEE ALSO | COLOPHON TRACEROUTE(8) Traceroute For Linux TRACEROUTE(8) NAME top traceroute - print the route packets trace to network host SYNOPSIS top traceroute [-46dFITUnreAV] [-f first_ttl] [-g gate,...] [-i device] [-m max_ttl] [-p port] [-s src_addr] [-q nqueries] [-N squeries] [-t tos] [-l flow_label] [-w waittimes] [-z sendwait] [-UL] [-D] [-P proto] [--sport=port] [-M method] [-O mod_options] [--mtu] [--back] host [packet_len] traceroute6 [options] DESCRIPTION top traceroute tracks the route packets taken from an IP network on their way to a given host. It utilizes the IP protocol's time to live (TTL) field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to the host. traceroute6 is equivalent to traceroute -6 The only required parameter is the name or IP address of the destination host . The optional packet_len`gth is the total size of the probing packet (default 60 bytes for IPv4 and 80 for IPv6). The specified size can be ignored in some situations or increased up to a minimal value. This program attempts to trace the route an IP packet would follow to some internet host by launching probe packets with a small ttl (time to live) then listening for an ICMP "time exceeded" reply from a gateway. We start our probes with a ttl of one and increase by one until we get an ICMP "port unreachable" (or TCP reset), which means we got to the "host", or hit a max (which defaults to 30 hops). Three probes (by default) are sent at each ttl setting and a line is printed showing the ttl, address of the gateway and round trip time of each probe. The address can be followed by additional information when requested. If the probe answers come from different gateways, the address of each responding system will be printed. If there is no response within a certain timeout, an "*" (asterisk) is printed for that probe. After the trip time, some additional annotation can be printed: !H, !N, or !P (host, network or protocol unreachable), !S (source route failed), !F (fragmentation needed), !X (communication administratively prohibited), !V (host precedence violation), !C (precedence cutoff in effect), or !<num> (ICMP unreachable code <num>). If almost all the probes result in some kind of unreachable, traceroute will give up and exit. We don't want the destination host to process the UDP probe packets, so the destination port is set to an unlikely value (you can change it with the -p flag). There is no such a problem for ICMP or TCP tracerouting (for TCP we use half-open technique, which prevents our probes to be seen by applications on the destination host). In the modern network environment the traditional traceroute methods can not be always applicable, because of widespread use of firewalls. Such firewalls filter the "unlikely" UDP ports, or even ICMP echoes. To solve this, some additional tracerouting methods are implemented (including tcp), see LIST OF AVAILABLE METHODS below. Such methods try to use particular protocol and source/destination port, in order to bypass firewalls (to be seen by firewalls just as a start of allowed type of a network session). OPTIONS top --help Print help info and exit. -4, -6 Explicitly force IPv4 or IPv6 tracerouting. By default, the program will try to resolve the name given, and choose the appropriate protocol automatically. If resolving a host name returns both IPv4 and IPv6 addresses, traceroute will use IPv4. -I, --icmp Use ICMP ECHO for probes -T, --tcp Use TCP SYN for probes -d, --debug Enable socket level debugging (when the Linux kernel supports it) -F, --dont-fragment Do not fragment probe packets. (For IPv4 it also sets DF bit, which tells intermediate routers not to fragment remotely as well). Varying the size of the probing packet by the packet_len command line parameter, you can manually obtain information about the MTU of individual network hops. The --mtu option (see below) tries to do this automatically. Note, that non-fragmented features (like -F or --mtu) work properly since the Linux kernel 2.6.22 only. Before that version, IPv6 was always fragmented, IPv4 could use the once the discovered final mtu only (from the route cache), which can be less than the actual mtu of a device. -f first_ttl, --first=first_ttl Specifies with what TTL to start. Defaults to 1. -g gateway, --gateway=gateway Tells traceroute to add an IP source routing option to the outgoing packet that tells the network to route the packet through the specified gateway (most routers have disabled source routing for security reasons). In general, several gateway's is allowed (comma separated). For IPv6, the form of num,addr,addr... is allowed, where num is a route header type (default is type 2). Note the type 0 route header is now deprecated (rfc5095). -i interface, --interface=interface Specifies the interface through which traceroute should send packets. By default, the interface is selected according to the routing table. -m max_ttl, --max-hops=max_ttl Specifies the maximum number of hops (max time-to-live value) traceroute will probe. The default is 30. -N squeries, --sim-queries=squeries Specifies the number of probe packets sent out simultaneously. Sending several probes concurrently can speed up traceroute considerably. The default value is 16. Note that some routers and hosts can use ICMP rate throttling. In such a situation specifying too large number can lead to loss of some responses. -n Do not try to map IP addresses to host names when displaying them. -p port, --port=port For UDP tracing, specifies the destination port base traceroute will use (the destination port number will be incremented by each probe). For ICMP tracing, specifies the initial ICMP sequence value (incremented by each probe too). For TCP and others specifies just the (constant) destination port to connect. -t tos, --tos=tos For IPv4, set the Type of Service (TOS) and Precedence value. Useful values are 16 (low delay) and 8 (high throughput). Note that in order to use some TOS precedence values, you have to be super user. For IPv6, set the Traffic Control value. -l flow_label, --flowlabel=flow_label Use specified flow_label for IPv6 packets. -w max[,here,near], --wait=max[,here,near] Determines how long to wait for a response to a probe. There are three (in general) float values separated by a comma (or a slash). Max specifies the maximum time (in seconds, default 5.0) to wait, in any case. Traditional traceroute implementation always waited whole max seconds for any probe. But if we already have some replies from the same hop, or even from some next hop, we can use the round trip time of such a reply as a hint to determine the actual reasonable amount of time to wait. The optional here (default 3.0) specifies a factor to multiply the round trip time of an already received response from the same hop. The resulting value is used as a timeout for the probe, instead of (but no more than) max. The optional near (default 10.0) specifies a similar factor for a response from some next hop. (The time of the first found result is used in both cases). First, we look for the same hop (of the probe which will be printed first from now). If nothing found, then look for some next hop. If nothing found, use max. If here and/or near have zero values, the corresponding computation is skipped. Here and near are always set to zero if only max is specified (for compatibility with previous versions). -q nqueries, --queries=nqueries Sets the number of probe packets per hop. The default is 3. -r Bypass the normal routing tables and send directly to a host on an attached network. If the host is not on a directly-attached network, an error is returned. This option can be used to ping a local host through an interface that has no route through it. -s source_addr, --source=source_addr Chooses an alternative source address. Note that you must select the address of one of the interfaces. By default, the address of the outgoing interface is used. -z sendwait, --sendwait=sendwait Minimal time interval between probes (default 0). If the value is more than 10, then it specifies a number in milliseconds, else it is a number of seconds (float point values allowed too). Useful when some routers use rate- limit for ICMP messages. -e, --extensions Show ICMP extensions (rfc4884). The general form is CLASS/TYPE: followed by a hexadecimal dump. The MPLS (rfc4950) is shown parsed, in a form: MPLS:L=label,E=exp_use,S=stack_bottom,T=TTL (more objects separated by / ). The Interface Information (rfc5837) is shown parsed as well, in a following form: {INC|SUB|OUT|NXT}:index,IP_addr,"name",mtu=MTU (all four fields may be missing). -A, --as-path-lookups Perform AS path lookups in routing registries and print results directly after the corresponding addresses. -V, --version Print the version and exit. There are additional options intended for advanced usage (such as alternate trace methods etc.): --sport=port Chooses the source port to use. Implies -N 1 -w 5 . Normally source ports (if applicable) are chosen by the system. --fwmark=mark Set the firewall mark for outgoing packets (since the Linux kernel 2.6.25). -M method, --module=name Use specified method for traceroute operations. Default traditional udp method has name default, icmp (-I) and tcp (-T) have names icmp and tcp respectively. Method-specific options can be passed by -O . Most methods have their simple shortcuts, (-I means -M icmp, etc). -O option, --options=options Specifies some method-specific option. Several options are separated by comma (or use several -O on cmdline). Each method may have its own specific options, or many not have them at all. To print information about available options, use -O help. -U, --udp Use UDP to particular destination port for tracerouting (instead of increasing the port per each probe). Default port is 53 (dns). -UL Use UDPLITE for tracerouting (default port is 53). -D, --dccp Use DCCP Requests for probes. -P protocol, --protocol=protocol Use raw packet of specified protocol for tracerouting. Default protocol is 253 (rfc3692). --mtu Discover MTU along the path being traced. Implies -F -N 1. New mtu is printed once in a form of F=NUM at the first probe of a hop which requires such mtu to be reached. (Actually, the correspond "frag needed" icmp message normally is sent by the previous hop). Note, that some routers might cache once the seen information on a fragmentation. Thus you can receive the final mtu from a closer hop. Try to specify an unusual tos by -t , this can help for one attempt (then it can be cached there as well). See -F option for more info. --back Print the number of backward hops when it seems different with the forward direction. This number is guessed in assumption that remote hops send reply packets with initial ttl set to either 64, or 128 or 255 (which seems a common practice). It is printed as a negate value in a form of '-NUM' . LIST OF AVAILABLE METHODS top In general, a particular traceroute method may have to be chosen by -M name, but most of the methods have their simple cmdline switches (you can see them after the method name, if present). default The traditional, ancient method of tracerouting. Used by default. Probe packets are udp datagrams with so-called "unlikely" destination ports. The "unlikely" port of the first probe is 33434, then for each next probe it is incremented by one. Since the ports are expected to be unused, the destination host normally returns "icmp unreach port" as a final response. (Nobody knows what happens when some application listens for such ports, though). This method is allowed for unprivileged users. icmp -I Most usual method for now, which uses icmp echo packets for probes. If you can ping(8) the destination host, icmp tracerouting is applicable as well. This method may be allowed for unprivileged users since the kernel 3.0 (IPv4, for IPv6 since 3.11), which supports new dgram icmp (or "ping") sockets. To allow such sockets, sysadmin should provide net/ipv4/ping_group_range sysctl range to match any group of the user. Options: raw Use only raw sockets (the traditional way). This way is tried first by default (for compatibility reasons), then new dgram icmp sockets as fallback. dgram Use only dgram icmp sockets. tcp -T Well-known modern method, intended to bypass firewalls. Uses the constant destination port (default is 80, http). If some filters are present in the network path, then most probably any "unlikely" udp ports (as for default method) or even icmp echoes (as for icmp) are filtered, and whole tracerouting will just stop at such a firewall. To bypass a network filter, we have to use only allowed protocol/port combinations. If we trace for some, say, mailserver, then more likely -T -p 25 can reach it, even when -I can not. This method uses well-known "half-open technique", which prevents applications on the destination host from seeing our probes at all. Normally, a tcp syn is sent. For non-listened ports we receive tcp reset, and all is done. For active listening ports we receive tcp syn+ack, but answer by tcp reset (instead of expected tcp ack), this way the remote tcp session is dropped even without the application ever taking notice. There is a couple of options for tcp method: syn,ack,fin,rst,psh,urg,ece,cwr Sets specified tcp flags for probe packet, in any combination. flags=num Sets the flags field in the tcp header exactly to num. ecn Send syn packet with tcp flags ECE and CWR (for Explicit Congestion Notification, rfc3168). sack,timestamps,window_scaling Use the corresponding tcp header option in the outgoing probe packet. sysctl Use current sysctl (/proc/sys/net/*) setting for the tcp header options above and ecn. Always set by default, if nothing else specified. fastopen Use fastopen tcp option (when syn), for initial cookie negotiation only. mss=[num] Use value of num (or unchanged) for maxseg tcp header option (when syn), and discover its clamping along the path being traced. New changed mss is printed once in a form of M=NUM at the first probe on which it was detected. Note, some routers may return too short original fragment in the time exceeded message, making the check impossible. Besides that the responses may come in a different order. All this can lead to a later place of the report (using -N 1 can help for the order). info Print tcp flags and supported options of final tcp replies when the target host is reached. Allows to determine whether an application listens the port and other useful things. Supported tcp options are all that can be set by -T -O, ie. mss, sack, timestamps, window_scaling and fastopen, with the similar output format (a value for mss and just presence for others). Default options is syn,sysctl. tcpconn An initial implementation of tcp method, simple using connect(2) call, which does full tcp session opening. Not recommended for normal use, because a destination application is always affected (and can be confused). udp -U Use udp datagram with constant destination port (default 53, dns). Intended to bypass firewall as well. Note, that unlike in tcp method, the correspond application on the destination host always receive our probes (with random data), and most can easily be confused by them. Most cases it will not respond to our packets though, so we will never see the final hop in the trace. (Fortunately, it seems that at least dns servers replies with something angry). This method is allowed for unprivileged users. udplite -UL Use udplite datagram for probes (with constant destination port, default 53). This method is allowed for unprivileged users. Options: coverage=num Set udplite send coverage to num. dccp -D Use DCCP Request packets for probes (rfc4340). This method uses the same "half-open technique" as used for TCP. The default destination port is 33434. Options: service=num Set DCCP service code to num (default is 1885957735). raw -P proto Send raw packet of protocol proto. No protocol-specific headers are used, just IP header only. Implies -N 1 -w 5 . Options: protocol=proto Use IP protocol proto (default 253). NOTES top To speed up work, normally several probes are sent simultaneously. On the other hand, it creates a "storm of packages", especially in the reply direction. Routers can throttle the rate of icmp responses, and some of replies can be lost. To avoid this, decrease the number of simultaneous probes, or even set it to 1 (like in initial traceroute implementation), i.e. -N 1 The final (target) host can drop some of the simultaneous probes, and might even answer only the latest ones. It can lead to extra "looks like expired" hops near the final hop. We use a smart algorithm to auto-detect such a situation, but if it cannot help in your case, just use -N 1 too. For even greater stability you can slow down the program's work by -z option, for example use -z 0.5 for half-second pause between probes. To avoid an extra waiting, we use adaptive algorithm for timeouts (see -w option for more info). It can lead to premature expiry (especially when response times differ at times) and printing "*" instead of a time. In such a case, switch this algorithm off, by specifying -w with the desired timeout only (for example, -w 5). If some hops report nothing for every method, the last chance to obtain something is to use ping -R command (IPv4, and for nearest 8 hops only). SEE ALSO top ping(8), ping6(8), tcpdump(8), netstat(8) COLOPHON top This page is part of the traceroute (trace route to network host) project. Information about the project can be found at http://traceroute.sourceforge.net/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the tarball traceroute-2.1.5.tar.gz fetched from http://sourceforge.net/projects/traceroute/files/latest/download?source=files on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] Traceroute 11 October 2006 TRACEROUTE(8) Pages that refer to this page: tracepath(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# traceroute\n\n> Print the route packets trace to network host.\n> More information: <https://manned.org/traceroute>.\n\n- Traceroute to a host:\n\n`traceroute {{example.com}}`\n\n- Disable IP address and host name mapping:\n\n`traceroute -n {{example.com}}`\n\n- Specify wait time in seconds for response:\n\n`traceroute --wait={{0.5}} {{example.com}}`\n\n- Specify number of queries per hop:\n\n`traceroute --queries={{5}} {{example.com}}`\n\n- Specify size in bytes of probing packet:\n\n`traceroute {{example.com}} {{42}}`\n\n- Determine the MTU to the destination:\n\n`traceroute --mtu {{example.com}}`\n\n- Use ICMP instead of UDP for tracerouting:\n\n`traceroute --icmp {{example.com}}`\n
trap
trap(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training trap(1p) Linux manual page PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES OF ERRORS | APPLICATION USAGE | EXAMPLES | RATIONALE | FUTURE DIRECTIONS | SEE ALSO | COPYRIGHT TRAP(1P) POSIX Programmer's Manual TRAP(1P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME top trap trap signals SYNOPSIS top trap n [condition...] trap [action condition...] DESCRIPTION top If the first operand is an unsigned decimal integer, the shell shall treat all operands as conditions, and shall reset each condition to the default value. Otherwise, if there are operands, the first is treated as an action and the remaining as conditions. If action is '-', the shell shall reset each condition to the default value. If action is null (""), the shell shall ignore each specified condition if it arises. Otherwise, the argument action shall be read and executed by the shell when one of the corresponding conditions arises. The action of trap shall override a previous action (either default action or one explicitly set). The value of "$?" after the trap action completes shall be the value it had before trap was invoked. The condition can be EXIT, 0 (equivalent to EXIT), or a signal specified using a symbolic name, without the SIG prefix, as listed in the tables of signal names in the <signal.h> header defined in the Base Definitions volume of POSIX.12017, Chapter 13, Headers; for example, HUP, INT, QUIT, TERM. Implementations may permit names with the SIG prefix or ignore case in signal names as an extension. Setting a trap for SIGKILL or SIGSTOP produces undefined results. The environment in which the shell executes a trap on EXIT shall be identical to the environment immediately after the last command executed before the trap on EXIT was taken. Each time trap is invoked, the action argument shall be processed in a manner equivalent to: eval action Signals that were ignored on entry to a non-interactive shell cannot be trapped or reset, although no error need be reported when attempting to do so. An interactive shell may reset or catch signals ignored on entry. Traps shall remain in place for a given shell until explicitly changed with another trap command. When a subshell is entered, traps that are not being ignored shall be set to the default actions, except in the case of a command substitution containing only a single trap command, when the traps need not be altered. Implementations may check for this case using only lexical analysis; for example, if `trap` and $( trap -- ) do not alter the traps in the subshell, cases such as assigning var=trap and then using $($var) may still alter them. This does not imply that the trap command cannot be used within the subshell to set new traps. The trap command with no operands shall write to standard output a list of commands associated with each condition. If the command is executed in a subshell, the implementation does not perform the optional check described above for a command substitution containing only a single trap command, and no trap commands with operands have been executed since entry to the subshell, the list shall contain the commands that were associated with each condition immediately before the subshell environment was entered. Otherwise, the list shall contain the commands currently associated with each condition. The format shall be: "trap -- %s %s ...\n", <action>, <condition> ... The shell shall format the output, including the proper use of quoting, so that it is suitable for reinput to the shell as commands that achieve the same trapping results. For example: save_traps=$(trap) ... eval "$save_traps" XSI-conformant systems also allow numeric signal numbers for the conditions corresponding to the following signal names: 1 SIGHUP 2 SIGINT 3 SIGQUIT 6 SIGABRT 9 SIGKILL 14 SIGALRM 15 SIGTERM The trap special built-in shall conform to the Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines. OPTIONS top None. OPERANDS top See the DESCRIPTION. STDIN top Not used. INPUT FILES top None. ENVIRONMENT VARIABLES top None. ASYNCHRONOUS EVENTS top Default. STDOUT top See the DESCRIPTION. STDERR top The standard error shall be used only for diagnostic messages. OUTPUT FILES top None. EXTENDED DESCRIPTION top None. EXIT STATUS top If the trap name or number is invalid, a non-zero exit status shall be returned; otherwise, zero shall be returned. For both interactive and non-interactive shells, invalid signal names or numbers shall not be considered a syntax error and do not cause the shell to abort. CONSEQUENCES OF ERRORS top Default. The following sections are informative. APPLICATION USAGE top None. EXAMPLES top Write out a list of all traps and actions: trap Set a trap so the logout utility in the directory referred to by the HOME environment variable executes when the shell terminates: trap '"$HOME"/logout' EXIT or: trap '"$HOME"/logout' 0 Unset traps on INT, QUIT, TERM, and EXIT: trap - INT QUIT TERM EXIT RATIONALE top Implementations may permit lowercase signal names as an extension. Implementations may also accept the names with the SIG prefix; no known historical shell does so. The trap and kill utilities in this volume of POSIX.12017 are now consistent in their omission of the SIG prefix for signal names. Some kill implementations do not allow the prefix, and kill -l lists the signals without prefixes. Trapping SIGKILL or SIGSTOP is syntactically accepted by some historical implementations, but it has no effect. Portable POSIX applications cannot attempt to trap these signals. The output format is not historical practice. Since the output of historical trap commands is not portable (because numeric signal values are not portable) and had to change to become so, an opportunity was taken to format the output in a way that a shell script could use to save and then later reuse a trap if it wanted. The KornShell uses an ERR trap that is triggered whenever set -e would cause an exit. This is allowable as an extension, but was not mandated, as other shells have not used it. The text about the environment for the EXIT trap invalidates the behavior of some historical versions of interactive shells which, for example, close the standard input before executing a trap on 0. For example, in some historical interactive shell sessions the following trap on 0 would always print "--": trap 'read foo; echo "-$foo-"' 0 The command: trap 'eval " $cmd"' 0 causes the contents of the shell variable cmd to be executed as a command when the shell exits. Using: trap '$cmd' 0 does not work correctly if cmd contains any special characters such as quoting or redirections. Using: trap " $cmd" 0 also works (the leading <space> character protects against unlikely cases where cmd is a decimal integer or begins with '-'), but it expands the cmd variable when the trap command is executed, not when the exit action is executed. FUTURE DIRECTIONS top None. SEE ALSO top Section 2.14, Special Built-In Utilities The Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines, signal.h(0p) COPYRIGHT top Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE/The Open Group 2017 TRAP(1P) Pages that refer to this page: sh(1p) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# trap\n\n> Execute a command upon an event.\n> More information: <https://www.gnu.org/software/bash/manual/bash.html#index-trap>.\n\n- List the available event names (e.g. `SIGWINCH`):\n\n`trap -l`\n\n- List the commands and the names of the expected events:\n\n`trap -p`\n\n- Execute a command when a signal is received:\n\n`trap 'echo "Caught signal {{SIGHUP}}"' {{SIGHUP}}`\n\n- Remove commands:\n\n`trap - {{SIGHUP}} {{SIGINT}}`\n
tree
tree(1) - Linux man page tree(1) - Linux man page Name tree - list contents of directories in a tree-like format. Synopsis tree [-adfghilnopqrstuvxACDFNS] [-L level [-R]] [-H baseHREF] [-T title] [-o filename] [--nolinks] [-P pattern] [-I pattern] [--inodes] [--device] [--noreport] [--dirsfirst] [--version] [--help] [--filelimit #] [directory ...] Description Tree is a recursive directory listing program that produces a depth indented listing of files. Color is supported ala dircolors if the LS_COLORS environment variable is set, output is to a tty, and the -C flag is used. With no arguments, tree lists the files in the current directory. When directory arguments are given, tree lists all the files and/or directories found in the given directories each in turn. Upon completion of listing all files/directories found, tree returns the total number of files and/or directories listed. By default, when a symbolic link is encountered, the path that the symbolic link refers to is printed after the name of the link in the format: name -> real-path If the '-l' option is given and the symbolic link refers to an actual directory, then tree will follow the path of the symbolic link as if it were a real directory. Options Tree understands the following command line switches: --help Outputs a verbose usage listing. --version Outputs the version of tree. -a All files are printed. By default tree does not print hidden files (those beginning with a dot '.'). In no event does tree print the file system constructs '.' (current directory) and '..' (previous directory). -d List directories only. -f Prints the full path prefix for each file. -i Makes tree not print the indentation lines, useful when used in conjunction with the -f option. -l Follows symbolic links if they point to directories, as if they were directories. Symbolic links that will result in recursion are avoided when detected. -x Stay on the current file-system only. Ala find -xdev. -P pattern List only those files that match the wild-card pattern. Note: you must use the -a option to also consider those files beginning with a dot '.' for matching. Valid wildcard operators are '*' (any zero or more characters), '?' (any single character), '[...]' (any single character listed between brackets (optional - (dash) for character range may be used: ex: [A-Z]), and '[^...]' (any single character not listed in brackets) and '|' separates alternate patterns. -I pattern Do not list those files that match the wild-card pattern. --noreport Omits printing of the file and directory report at the end of the tree listing. -p Print the file type and permissions for each file (as per ls -l). -s Print the size of each file in bytes along with the name. -h Print the size of each file but in a more human readable way, e.g. appending a size letter for kilobytes (K), megabytes (M), gigabytes (G), terrabytes (T), petabytes (P) and exabytes (E). -u Print the username, or UID # if no username is available, of the file. -g Print the group name, or GID # if no group name is available, of the file. -D Print the date of the last modification time for the file listed. --inodes Prints the inode number of the file or directory --device Prints the device number to which the file or directory belongs -F Append a '/' for directories, a '=' for socket files, a '*' for executable files and a '|' for FIFO's, as per ls -F -q Print non-printable characters in filenames as question marks instead of the default caret notation. -N Print non-printable characters as is instead of the default caret notation. -v Sort the output by version. -r Sort the output in reverse alphabetic order. -t Sort the output by last modification time instead of alphabetically. --dirsfirst List directories before files. -n Turn colorization off always, over-ridden by the -C option. -C Turn colorization on always, using built-in color defaults if the LS_COLORS environment variable is not set. Useful to colorize output to a pipe. -A Turn on ANSI line graphics hack when printing the indentation lines. -S Turn on ASCII line graphics (useful when using linux console mode fonts). This option is now equivalent to '--charset=IBM437' and will eventually be depreciated. -L level Max display depth of the directory tree. --filelimit # Do not descend directories that contain more than # entries. -R Recursively cross down the tree each level directories (see -L option), and at each of them execute tree again adding '-o 00Tree.html' as a new option. -H baseHREF Turn on HTML output, including HTTP references. Useful for ftp sites. baseHREF gives the base ftp location when using HTML output. That is, the local directory may be '/local/ftp/pub', but it must be referenced as 'ftp://hostname.organization.domain/pub' (baseHREF should be 'ftp://hostname.organization.domain'). Hint: don't use ANSI lines with this option, and don't give more than one directory in the directory list. If you wish to use colors via CCS stylesheet, use the -C option in addition to this option to force color output. -T title Sets the title and H1 header string in HTML output mode. --charset charset Set the character set to use when outputting HTML and for line drawing. --nolinks Turns off hyperlinks in HTML output. -o filename Send output to filename. Files /etc/DIR_COLORS System color database. ~/.dircolors Users color database. Environment LS_COLORS Color information created by dircolors TREE_CHARSET Character set for tree to use in HTML mode. LC_CTYPE Locale for filename output. Author Steve Baker ([email protected]) HTML output hacked by Francesc Rocher ([email protected]) Charsets and OS/2 support by Kyosuke Tokoro ([email protected]) Bugs Tree does not prune "empty" directories when the -P and -I options are used. Tree prints directories as it comes to them, so cannot accumulate information on files and directories beneath the directory it is printing. The -h option rounds to the nearest whole number unlike the ls implementation of -h which rounds up always. The IEC standard names for powers of 2 cooresponding to metric powers of 10 (KiBi, et al.) are silly. Pruning files and directories with the -I, -P and --filelimit options will lead to incorrect file/directory count reports. Probably more. See Also dircolors(1L), ls(1L), find(1L) Referenced By pass(1) Site Search Library linux docs linux man pages page load time Toys world sunlight moon phase trace explorer
# tree\n\n> Show the contents of the current directory as a tree.\n> More information: <http://mama.indstate.edu/users/ice/tree/>.\n\n- Print files and directories up to 'num' levels of depth (where 1 means the current directory):\n\n`tree -L {{num}}`\n\n- Print directories only:\n\n`tree -d`\n\n- Print hidden files too with colorization on:\n\n`tree -a -C`\n\n- Print the tree without indentation lines, showing the full path instead (use `-N` to not escape non-printable characters):\n\n`tree -i -f`\n\n- Print the size of each file and the cumulative size of each directory, in human-readable format:\n\n`tree -s -h --du`\n\n- Print files within the tree hierarchy, using a wildcard (glob) pattern, and pruning out directories that don't contain matching files:\n\n`tree -P '{{*.txt}}' --prune`\n\n- Print directories within the tree hierarchy, using the wildcard (glob) pattern, and pruning out directories that aren't ancestors of the wanted one:\n\n`tree -P {{directory_name}} --matchdirs --prune`\n\n- Print the tree ignoring the given directories:\n\n`tree -I '{{directory_name1|directory_name2}}'`\n
troff
troff(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training troff(1) Linux manual page Name | Synopsis | Description | Options | Warnings | Environment | Files | Authors | See also | COLOPHON troff(1) General Commands Manual troff(1) Name top troff - GNU roff typesetter and document formatter Synopsis top troff [-abcCEiRUz] [-d ctext] [-d string=text] [-f font-family] [-F font-directory] [-I inclusion-directory] [-m macro- package] [-M macro-directory] [-n page-number] [-o page- list] [-r cnumeric-expression] [-r register=numeric- expression] [-T output-device] [-w warning-category] [-W warning-category] [file ...] troff --help troff -v troff --version Description top GNU troff transforms groff(7) language input into the device- independent output format described in groff_out(5); troff is thus the heart of the GNU roff document formatting system. If no file operands are present, or if file is -, troff reads the standard input stream. GNU troff is functionally compatible with the AT&T troff typesetter and features numerous extensions. Many people prefer to use the groff(1) command, a front end which also runs preprocessors and output drivers in the appropriate order and with appropriate options. Options top -h and --help display a usage message, while -v and --version show version information; all exit afterward. -a Generate a plain text approximation of the typeset output. The read-only register .A is set to 1. This option produces a sort of abstract preview of the formatted output. Page breaks are marked by a phrase in angle brackets; for example, <beginning of page>. Lines are broken where they would be in formatted output. Vertical motion, apart from that implied by a break, is not represented. A horizontal motion of any size is represented as one space. Adjacent horizontal motions are not combined. Inter-sentence space nodes (those arising from the second argument to the .ss request) are not represented. A special character is rendered as its identifier between angle brackets; for example, a hyphen appears as <hy>. The above description should not be considered a specification; the details of -a output are subject to change. -b Write a backtrace reporting the state of troff's input parser to the standard error stream with each diagnostic message. The line numbers given in the backtrace might not always be correct, because troff's idea of line numbers can be confused by requests that append to macros. -c Start with color output disabled. -C Enable AT&T troff compatibility mode; implies -c. See groff_diff(7). -d ctext -d string=text Define roff string c or string as text. c must be a one- character identifier; string can be of arbitrary length. Such assignments happen before any macro file is loaded, including the startup file. Due to getopt_long(3) limitations, c cannot be, and string cannot contain, an equals sign, even though that is a valid character in a roff identifier. -E Inhibit troff error messages; implies -Ww. This option does not suppress messages sent to the standard error stream by documents or macro packages using tm or related requests. -f fam Use fam as the default font family. -F dir Search in directory dir for the selected output device's directory of device and font description files. See the description of GROFF_FONT_PATH in section Environment below for the default search locations and ordering. -i Read the standard input stream after all named input files have been processed. -I dir Search the directory dir for files (those named on the command line; in psbb, so, and soquiet requests; and in \X'ps: import', \X'ps: file', and \X'pdf: pdfpic' device control escape sequences). -I may be specified more than once; each dir is searched in the given order. To search the current working directory before others, add -I . at the desired place; it is otherwise searched last. -I works similarly to, and is named for, the include option of Unix C compilers. -m mac Search for the macro package mac.tmac and read it prior to any input files. If not found, tmac.mac is attempted. See the description of GROFF_TMAC_PATH in section Environment below for the default search locations and ordering. -M dir Search directory dir for macro files. See the description of GROFF_TMAC_PATH in section Environment below for the default search locations and ordering. -n num Begin numbering pages at num. The default is 1. -o list Output only pages in list, which is a comma-separated list of inclusive page ranges; n means page n, m-n means every page between m and n, -n means every page up to n, and n- means every page from n on. troff stops processing and exits after formatting the last page enumerated in list. -r cnumeric-expression -r register=numeric-expression Define roff register c or register as numeric-expression. c must be a one-character identifier; register can be of arbitrary length. Such assignments happen before any macro file is loaded, including the startup file. Due to getopt_long(3) limitations, c cannot be, and register cannot contain, an equals sign, even though that is a valid character in a roff identifier. -R Don't load troffrc and troffrc-end. -T dev Prepare output for device dev. The default is ps; see groff(1). -U Operate in unsafe mode, enabling the open, opena, pi, pso, and sy requests, which are disabled by default because they allow an untrusted input document to write to arbitrary file names and run arbitrary commands. This option also adds the current directory to the macro package search path; see the -m and -M options above. -w cat -W cat Enable and inhibit, respectively, warnings in category cat. See section Warnings below. -z Suppress formatted output. Warnings top Warning diagnostics emitted by troff are divided into named, numbered categories. The name associated with each warning category is used by the -w and -W options. Each category is also assigned a power of two; the sum of enabled category codes is used by the warn request and the .warn register. Warnings of each category are produced under the following circumstances. Bit Code Category Bit Code Category 0 1 char 10 1024 reg 1 2 number 11 2048 tab 2 4 break 12 4096 right-brace 3 8 delim 13 8192 missing 4 16 el 14 16384 input 5 32 scale 15 32768 escape 6 64 range 16 65536 space 7 128 syntax 17 131072 font 8 256 di 18 262144 ig 9 512 mac 19 524288 color 20 1048576 file break 4 A filled output line could not be broken such that its length was less than the output line length \n[.l]. This category is enabled by default. char 1 No mounted font defines a glyph for the requested character. This category is enabled by default. color 524288 An undefined color name was selected, an attempt was made to define a color using an unrecognized color space, an invalid component in a color definition was encountered, or an attempt was made to redefine a default color. delim 8 The closing delimiter in an escape sequence was missing or mismatched. di 256 A di, da, box, or boxa request was invoked without an argument when there was no current diversion. el 16 The el request was encountered with no prior corresponding ie request. escape 32768 An unsupported escape sequence was encountered. file 1048576 An attempt was made to load a file that does not exist. This category is enabled by default. font 131072 A non-existent font was selected, or the selection was ignored because a font selection escape sequence was used after the output line continuation escape sequence on an input line. This category is enabled by default. ig 262144 An invalid escape sequence occurred in input ignored using the ig request. This warning category diagnoses a condition that is an error when it occurs in non-ignored input. input 16384 An invalid character occurred on the input stream. mac 512 An undefined string, macro, or diversion was used. When such an object is dereferenced, an empty one of that name is automatically created. So, unless it is later deleted, at most one warning is given for each. This warning is also emitted upon an attempt to move an unplanted trap macro. In such cases, the unplanted macro is not dereferenced, so it is not created if it does not exist. missing 8192 A request was invoked with a mandatory argument absent. number 2 An invalid numeric expression was encountered. This category is enabled by default. range 64 A numeric expression was out of range for its context. reg 1024 An undefined register was used. When an undefined register is dereferenced, it is automatically defined with a value of 0. So, unless it is later deleted, at most one warning is given for each. right-brace 4096 A right brace escape sequence \} was encountered where a number was expected. scale 32 A scaling unit inappropriate to its context was used in a numeric expression. space 65536 A space was missing between a request or macro and its argument. This warning is produced when an undefined name longer than two characters is encountered and the first two characters of the name constitute a defined name. No request is invoked, no macro called, and an empty macro is not defined. This category is enabled by default. It never occurs in compatibility mode. syntax 128 A self-contradictory hyphenation mode was requested; an empty or incomplete numeric expression was encountered; an operand to a numeric operator was missing; an attempt was made to define a recursive, empty, or nonsensical character class; or a groff extension conditional expression operator was used while in compatibility mode. tab 2048 A tab character was encountered where a number was expected, or appeared in an unquoted macro argument. Two warning names group other warning categories for convenience. all All warning categories except di, mac, and reg. This shorthand is intended to produce all warnings that are useful with macro packages and documents written for AT&T troff and its descendants, which have less fastidious diagnostics than GNU troff. w All warning categories. Authors of documents and macro packages targeting groff are encouraged to use this setting. Environment top GROFF_FONT_PATH and GROFF_TMAC_PATH each accept a search path of directories; that is, a list of directory names separated by the system's path component separator character. On Unix systems, this character is a colon (:); on Windows systems, it is a semicolon (;). GROFF_FONT_PATH A list of directories in which to seek the selected output device's directory of device and font description files. troff will scan directories given as arguments to any specified -F options before these, then in a site-specific directory (/usr/local/share/groff/site-font), a standard location (/usr/local/share/groff/1.23.0/font), and a compatibility directory (/usr/lib/font) after them. GROFF_TMAC_PATH A list of directories in which to search for macro files. troff will scan directories given as arguments to any specified -M options before these, then the current directory (only if in unsafe mode), the user's home directory, a site-specific directory (/usr/local/share/ groff/site-tmac), and a standard location (/usr/local/ share/groff/1.23.0/tmac) after them. GROFF_TYPESETTER Set the default output device. If empty or not set, ps is used. The -T option overrides GROFF_TYPESETTER. SOURCE_DATE_EPOCH A timestamp (expressed as seconds since the Unix epoch) to use as the output creation timestamp in place of the current time. The time is converted to human-readable form using gmtime(3) and asctime(3) when the formatter starts up and stored in registers usable by documents and macro packages. TZ The time zone to use when converting the current time to human-readable form; see tzset(3). If SOURCE_DATE_EPOCH is used, it is always converted to human-readable form using UTC. Files top /usr/local/share/groff/1.23.0/tmac/troffrc is an initialization macro file loaded before any macro packages specified with -m options. /usr/local/share/groff/1.23.0/tmac/troffrc-end is an initialization macro file loaded after all macro packages specified with -m options. /usr/local/share/groff/1.23.0/tmac/name.tmac are macro files distributed with groff. /usr/local/share/groff/1.23.0/font/devname/DESC describes the output device name. /usr/local/share/groff/1.23.0/font/devname/F describes the font F of device name. troffrc and troffrc-end are sought neither in the current nor the home directory by default for security reasons, even if the -U option is specified. Use the -M command-line option or the GROFF_TMAC_PATH environment variable to add these directories to the search path if necessary. Authors top The GNU version of troff was originally written by James Clark; he also wrote the original version of this document, which was updated by Werner Lemberg [email protected], Bernd Warken groff-bernd [email protected], and G. Branden Robinson g.branden.robinson@ gmail.com. See also top Groff: The GNU Implementation of troff, by Trent A. Fisher and Werner Lemberg, is the primary groff manual. You can browse it interactively with info groff. groff(1) offers an overview of the GNU roff system and describes its front end executable. groff(7) details the groff language, including a short but complete reference of all predefined requests, registers, and escape sequences. groff_char(7) explains the syntax of groff special character escape sequences, and lists all special characters predefined by the language. groff_diff(7) enumerates the differences between AT&T device-independent troff and groff. groff_font(5) covers the format of groff device and font description files. groff_out(5) describes the format of troff's output. groff_tmac(5) includes information about macro files that ship with groff. roff(7) supplies background on roff systems in general, including pointers to further related documentation. COLOPHON top This page is part of the groff (GNU troff) project. Information about the project can be found at http://www.gnu.org/software/groff/. If you have a bug report for this manual page, see http://www.gnu.org/software/groff/. This page was obtained from the project's upstream Git repository https://git.savannah.gnu.org/git/groff.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-08.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] groff 1.23.0.453-330f9-dirty 1 November 2023 troff(1) Pages that refer to this page: colcrt(1), man(1), zsoelim(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# troff\n\n> Typesetting processor for the groff (GNU Troff) document formatting system.\n> See also `groff`.\n> More information: <https://manned.org/troff>.\n\n- Format output for a PostScript printer, saving the output to a file:\n\n`troff {{path/to/input.roff}} | grops > {{path/to/output.ps}}`\n\n- Format output for a PostScript printer using the [me] macro package, saving the output to a file:\n\n`troff -{{me}} {{path/to/input.roff}} | grops > {{path/to/output.ps}}`\n\n- Format output as [a]SCII text using the [man] macro package:\n\n`troff -T {{ascii}} -{{man}} {{path/to/input.roff}} | grotty`\n\n- Format output as a [pdf] file, saving the output to a file:\n\n`troff -T {{pdf}} {{path/to/input.roff}} | gropdf > {{path/to/output.pdf}}`\n
true
true(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training true(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON TRUE(1) User Commands TRUE(1) NAME top true - do nothing, successfully SYNOPSIS top true [ignored command line arguments] true OPTION DESCRIPTION top Exit with a status code indicating success. --help display this help and exit --version output version information and exit NOTE: your shell may have its own version of true, which usually supersedes the version described here. Please refer to your shell's documentation for details about the options it supports. AUTHOR top Written by Jim Meyering. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top Full documentation <https://www.gnu.org/software/coreutils/true> or available locally via: info '(coreutils) true invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 TRUE(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# true\n\n> Returns a successful exit status code of 0.\n> Use this with the || operator to make a command always exit with 0.\n> More information: <https://www.gnu.org/software/coreutils/true>.\n\n- Return a successful exit code:\n\n`true`\n
truncate
truncate(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training truncate(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON TRUNCATE(1) User Commands TRUNCATE(1) NAME top truncate - shrink or extend the size of a file to the specified size SYNOPSIS top truncate OPTION... FILE... DESCRIPTION top Shrink or extend the size of each FILE to the specified size A FILE argument that does not exist is created. If a FILE is larger than the specified size, the extra data is lost. If a FILE is shorter, it is extended and the sparse extended part (hole) reads as zero bytes. Mandatory arguments to long options are mandatory for short options too. -c, --no-create do not create any files -o, --io-blocks treat SIZE as number of IO blocks instead of bytes -r, --reference=RFILE base size on RFILE -s, --size=SIZE set or adjust the file size by SIZE bytes --help display this help and exit --version output version information and exit The SIZE argument is an integer and optional unit (example: 10K is 10*1024). Units are K,M,G,T,P,E,Z,Y,R,Q (powers of 1024) or KB,MB,... (powers of 1000). Binary prefixes can be used, too: KiB=K, MiB=M, and so on. SIZE may also be prefixed by one of the following modifying characters: '+' extend by, '-' reduce by, '<' at most, '>' at least, '/' round down to multiple of, '%' round up to multiple of. AUTHOR top Written by Padraig Brady. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top dd(1), truncate(2), ftruncate(2) Full documentation <https://www.gnu.org/software/coreutils/truncate> or available locally via: info '(coreutils) truncate invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 TRUNCATE(1) Pages that refer to this page: fallocate(1), truncate(2), swapon(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# truncate\n\n> Shrink or extend the size of a file to the specified size.\n> More information: <https://www.gnu.org/software/coreutils/truncate>.\n\n- Set a size of 10 GB to an existing file, or create a new file with the specified size:\n\n`truncate --size {{10G}} {{filename}}`\n\n- Extend the file size by 50 MiB, fill with holes (which reads as zero bytes):\n\n`truncate --size +{{50M}} {{filename}}`\n\n- Shrink the file by 2 GiB, by removing data from the end of file:\n\n`truncate --size -{{2G}} {{filename}}`\n\n- Empty the file's content:\n\n`truncate --size 0 {{filename}}`\n\n- Empty the file's content, but do not create the file if it does not exist:\n\n`truncate --no-create --size 0 {{filename}}`\n
tsort
tsort(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training tsort(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON TSORT(1) User Commands TSORT(1) NAME top tsort - perform topological sort SYNOPSIS top tsort [OPTION] [FILE] DESCRIPTION top Write totally ordered list consistent with the partial ordering in FILE. With no FILE, or when FILE is -, read standard input. --help display this help and exit --version output version information and exit AUTHOR top Written by Mark Kettenis. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top Full documentation <https://www.gnu.org/software/coreutils/tsort> or available locally via: info '(coreutils) tsort invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 TSORT(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# tsort\n\n> Perform a topological sort.\n> A common use is to show the dependency order of nodes in a directed acyclic graph.\n> More information: <https://www.gnu.org/software/coreutils/tsort>.\n\n- Perform a topological sort consistent with a partial sort per line of input separated by blanks:\n\n`tsort {{path/to/file}}`\n\n- Perform a topological sort consistent on strings:\n\n`echo -e "{{UI Backend\nBackend Database\nDocs UI}}" | tsort`\n
tty
tty(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training tty(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON TTY(1) User Commands TTY(1) NAME top tty - print the file name of the terminal connected to standard input SYNOPSIS top tty [OPTION]... DESCRIPTION top Print the file name of the terminal connected to standard input. -s, --silent, --quiet print nothing, only return an exit status --help display this help and exit --version output version information and exit AUTHOR top Written by David MacKenzie. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top Full documentation <https://www.gnu.org/software/coreutils/tty> or available locally via: info '(coreutils) tty invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 TTY(1) Pages that refer to this page: termios(3), ttyname(3) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# tty\n\n> Returns terminal name.\n> More information: <https://www.gnu.org/software/coreutils/tty>.\n\n- Print the file name of this terminal:\n\n`tty`\n
tune2fs
tune2fs(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training tune2fs(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | BUGS | AUTHOR | AVAILABILITY | SEE ALSO | COLOPHON TUNE2FS(8) System Manager's Manual TUNE2FS(8) NAME top tune2fs - adjust tunable file system parameters on ext2/ext3/ext4 file systems SYNOPSIS top tune2fs [ -l ] [ -c max-mount-counts ] [ -e errors-behavior ] [ -f ] [ -i interval-between-checks ] [ -I new_inode_size ] [ -j ] [ -J journal-options ] [ -m reserved-blocks-percentage ] [ -o [^]mount-options[,...] ] [ -r reserved-blocks-count ] [ -u user ] [ -g group ] [ -C mount-count ] [ -E extended-options ] [ -L volume-label ] [ -M last-mounted-directory ] [ -O [^]feature[,...] ] [ -Q quota-options ] [ -T time-last-checked ] [ -U UUID ] [ -z undo_file ] device DESCRIPTION top tune2fs allows the system administrator to adjust various tunable file system parameters on Linux ext2, ext3, or ext4 file systems. The current values of these options can be displayed by using the -l option to tune2fs(8) program, or by using the dumpe2fs(8) program. The device specifier can either be a filename (i.e., /dev/sda1), or a LABEL or UUID specifier: "LABEL=volume-label" or "UUID=uuid". (i.e., LABEL=home or UUID=e40486c6-84d5-4f2f- b99c-032281799c9d). OPTIONS top -c max-mount-counts Adjust the number of mounts after which the file system will be checked by e2fsck(8). If max-mount-counts is the string "random", tune2fs will use a random value between 20 and 40. If max-mount-counts is 0 or -1, the number of times the file system is mounted will be disregarded by e2fsck(8) and the kernel. Staggering the mount-counts at which file systems are forcibly checked will avoid all file systems being checked at one time when using journaled file systems. Mount-count-dependent checking is disabled by default to avoid unanticipated long reboots while e2fsck does its work. If you are concerned about file system corruptions caused by potential hardware problems of kernel bugs, a better solution than mount-count-dependent checking is to use the e2scrub(8) program. This does require placing the file system on an LVM volume, however. -C mount-count Set the number of times the file system has been mounted. If set to a greater value than the max-mount-counts parameter set by the -c option, e2fsck(8) will check the file system at the next reboot. -e error-behavior Change the behavior of the kernel code when errors are detected. In all cases, a file system error will cause e2fsck(8) to check the file system on the next boot. error-behavior can be one of the following: continue Continue normal execution. remount-ro Remount file system read-only. panic Cause a kernel panic. -E extended-options Set extended options for the file system. Extended options are comma separated, and may take an argument using the equals ('=') sign. The following extended options are supported: clear_mmp Reset the MMP block (if any) back to the clean state. Use only if absolutely certain the device is not currently mounted or being fscked, or major file system corruption can result. Needs '-f'. mmp_update_interval=interval Adjust the initial MMP update interval to interval seconds. Specifying an interval of 0 means to use the default interval. The specified interval must be less than 300 seconds. Requires that the mmp feature be enabled. stride=stride-size Configure the file system for a RAID array with stride-size file system blocks. This is the number of blocks read or written to disk before moving to next disk. This mostly affects placement of file system metadata like bitmaps at mke2fs(2) time to avoid placing them on a single disk, which can hurt the performance. It may also be used by block allocator. stripe_width=stripe-width Configure the file system for a RAID array with stripe-width file system blocks per stripe. This is typically be stride-size * N, where N is the number of data disks in the RAID (e.g. RAID 5 N+1, RAID 6 N+2). This allows the block allocator to prevent read- modify-write of the parity in a RAID stripe if possible when the data is written. hash_alg=hash-alg Set the default hash algorithm used for file systems with hashed b-tree directories. Valid algorithms accepted are: legacy, half_md4, and tea. encoding=encoding-name Enable the casefold feature in the super block and set encoding-name as the encoding to be used. If encoding-name is not specified, utf8 is used. The encoding cannot be altered if casefold was previously enabled. encoding_flags=encoding-flags Define parameters for file name character encoding operations. If a flag is not changed using this parameter, its default value is used. encoding-flags should be a comma- separated lists of flags to be enabled. The flags cannot be altered if casefold was previously enabled. The only flag that can be set right now is strict which means that invalid strings should be rejected by the file system. In the default configuration, the strict flag is disabled. mount_opts=mount_option_string Set a set of default mount options which will be used when the file system is mounted. Unlike the bitmask-based default mount options which can be specified with the -o option, mount_option_string is an arbitrary string with a maximum length of 63 bytes, which is stored in the superblock. The ext4 file system driver will first apply the bitmask-based default options, and then parse the mount_option_string, before parsing the mount options passed from the mount(8) program. This superblock setting is only honored in 2.6.35+ kernels; and not at all by the ext2 and ext3 file system drivers. orphan_file_size=size Set size of the file for tracking unlinked but still open inodes and inodes with truncate in progress. Larger file allows for better scalability, reserving a few blocks per cpu is ideal. force_fsck Set a flag in the file system superblock indicating that errors have been found. This will force fsck to run at the next mount. test_fs Set a flag in the file system superblock indicating that it may be mounted using experimental kernel code, such as the ext4dev file system. ^test_fs Clear the test_fs flag, indicating the file system should only be mounted using production-level file system code. -f Force the tune2fs operation to complete even in the face of errors. This option is useful when removing the has_journal file system feature from a file system which has an external journal (or is corrupted such that it appears to have an external journal), but that external journal is not available. If the file system appears to require journal replay, the -f flag must be specified twice to proceed. WARNING: Removing an external journal from a file system which was not cleanly unmounted without first replaying the external journal can result in severe data loss and file system corruption. -g group Set the group which can use the reserved file system blocks. The group parameter can be a numerical gid or a group name. If a group name is given, it is converted to a numerical gid before it is stored in the superblock. -i interval-between-checks[d|m|w] Adjust the maximal time between two file system checks. No suffix or d will interpret the number interval-between- checks as days, m as months, and w as weeks. A value of zero will disable the time-dependent checking. There are pros and cons to disabling these periodic checks; see the discussion under the -c (mount-count- dependent check) option for details. -I Change the inode size used by the file system. This requires rewriting the inode table, so it requires that the file system is checked for consistency first using e2fsck(8). This operation can also take a while and the file system can be corrupted and data lost if it is interrupted while in the middle of converting the file system. Backing up the file system before changing inode size is recommended. File systems with an inode size of 128 bytes do not support timestamps beyond January 19, 2038. Inodes which are 256 bytes or larger will support extended timestamps, project id's, and the ability to store some extended attributes in the inode table for improved performance. -j Add an ext3 journal to the file system. If the -J option is not specified, the default journal parameters will be used to create an appropriately sized journal (given the size of the file system) stored within the file system. Note that you must be using a kernel which has ext3 support in order to actually make use of the journal. If this option is used to create a journal on a mounted file system, an immutable file, .journal, will be created in the top-level directory of the file system, as it is the only safe way to create the journal inode while the file system is mounted. While the ext3 journal is visible, it is not safe to delete it, or modify it while the file system is mounted; for this reason the file is marked immutable. While checking unmounted file systems, e2fsck(8) will automatically move .journal files to the invisible, reserved journal inode. For all file systems except for the root file system, this should happen automatically and naturally during the next reboot cycle. Since the root file system is mounted read-only, e2fsck(8) must be run from a rescue floppy in order to effect this transition. On some distributions, such as Debian, if an initial ramdisk is used, the initrd scripts will automatically convert an ext2 root file system to ext3 if the /etc/fstab file specifies the ext3 file system for the root file system in order to avoid requiring the use of a rescue floppy to add an ext3 journal to the root file system. -J journal-options Override the default ext3 journal parameters. Journal options are comma separated, and may take an argument using the equals ('=') sign. The following journal options are supported: size=journal-size Create a journal stored in the file system of size journal-size megabytes. The size of the journal must be at least 1024 file system blocks (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.) and may be no more than 10,240,000 file system blocks. There must be enough free space in the file system to create a journal of that size. fast_commit_size=fast-commit-size Create an additional fast commit journal area of size fast-commit-size kilobytes. This option is only valid if fast_commit feature is enabled on the file system. If this option is not specified and if fast_commit feature is turned on, fast commit area size defaults to journal-size / 64 megabytes. The total size of the journal with fast_commit feature set is journal-size + ( fast-commit-size * 1024) megabytes. The total journal size may be no more than 10,240,000 file system blocks or half the total file system size (whichever is smaller). location=journal-location Specify the location of the journal. The argument journal-location can either be specified as a block number, or if the number has a units suffix (e.g., 'M', 'G', etc.) interpret it as the offset from the beginning of the file system. device=external-journal Attach the file system to the journal block device located on external-journal. The external journal must have been already created using the command mke2fs -O journal_dev external-journal Note that external-journal must be formatted with the same block size as file systems which will be using it. In addition, while there is support for attaching multiple file systems to a single external journal, the Linux kernel and e2fsck(8) do not currently support shared external journals yet. Instead of specifying a device name directly, external-journal can also be specified by either LABEL=label or UUID=UUID to locate the external journal by either the volume label or UUID stored in the ext2 superblock at the start of the journal. Use dumpe2fs(8) to display a journal device's volume label and UUID. See also the -L option of tune2fs(8). Only one of the size or device options can be given for a file system. -l List the contents of the file system superblock, including the current values of the parameters that can be set via this program. -L volume-label Set the volume label of the file system. Ext2 file system labels can be at most 16 characters long; if volume-label is longer than 16 characters, tune2fs will truncate it and print a warning. For other file systems that support online label manipulation and are mounted tune2fs will work as well, but it will not attempt to truncate the volume-label at all. The volume label can be used by mount(8), fsck(8), and /etc/fstab(5) (and possibly others) by specifying LABEL=volume-label instead of a block special device name like /dev/hda5. -m reserved-blocks-percentage Set the percentage of the file system which may only be allocated by privileged processes. Reserving some number of file system blocks for use by privileged processes is done to avoid file system fragmentation, and to allow system daemons, such as syslogd(8), to continue to function correctly after non-privileged processes are prevented from writing to the file system. Normally, the default percentage of reserved blocks is 5%. -M last-mounted-directory Set the last-mounted directory for the file system. -o [^]mount-option[,...] Set or clear the indicated default mount options in the file system. Default mount options can be overridden by mount options specified either in /etc/fstab(5) or on the command line arguments to mount(8). Older kernels may not support this feature; in particular, kernels which predate 2.4.20 will almost certainly ignore the default mount options field in the superblock. More than one mount option can be cleared or set by separating features with commas. Mount options prefixed with a caret character ('^') will be cleared in the file system's superblock; mount options without a prefix character or prefixed with a plus character ('+') will be added to the file system. The following mount options can be set or cleared using tune2fs: debug Enable debugging code for this file system. bsdgroups Emulate BSD behavior when creating new files: they will take the group-id of the directory in which they were created. The standard System V behavior is the default, where newly created files take on the fsgid of the current process, unless the directory has the setgid bit set, in which case it takes the gid from the parent directory, and also gets the setgid bit set if it is a directory itself. user_xattr Enable user-specified extended attributes. acl Enable Posix Access Control Lists. uid16 Disables 32-bit UIDs and GIDs. This is for interoperability with older kernels which only store and expect 16-bit values. journal_data When the file system is mounted with journaling enabled, all data (not just metadata) is committed into the journal prior to being written into the main file system. journal_data_ordered When the file system is mounted with journaling enabled, all data is forced directly out to the main file system prior to its metadata being committed to the journal. journal_data_writeback When the file system is mounted with journaling enabled, data may be written into the main file system after its metadata has been committed to the journal. This may increase throughput, however, it may allow old data to appear in files after a crash and journal recovery. nobarrier The file system will be mounted with barrier operations in the journal disabled. (This option is currently only supported by the ext4 file system driver in 2.6.35+ kernels.) block_validity The file system will be mounted with the block_validity option enabled, which causes extra checks to be performed after reading or writing from the file system. This prevents corrupted metadata blocks from causing file system damage by overwriting parts of the inode table or block group descriptors. This comes at the cost of increased memory and CPU overhead, so it is enabled only for debugging purposes. (This option is currently only supported by the ext4 file system driver in 2.6.35+ kernels.) discard The file system will be mounted with the discard mount option. This will cause the file system driver to attempt to use the trim/discard feature of some storage devices (such as SSD's and thin-provisioned drives available in some enterprise storage arrays) to inform the storage device that blocks belonging to deleted files can be reused for other purposes. (This option is currently only supported by the ext4 file system driver in 2.6.35+ kernels.) nodelalloc The file system will be mounted with the nodelalloc mount option. This will disable the delayed allocation feature. (This option is currently only supported by the ext4 file system driver in 2.6.35+ kernels.) -O [^]feature[,...] Set or clear the indicated file system features (options) in the file system. More than one file system feature can be cleared or set by separating features with commas. File System features prefixed with a caret character ('^') will be cleared in the file system's superblock; file system features without a prefix character or prefixed with a plus character ('+') will be added to the file system. For a detailed description of the file system features, please see the man page ext4(5). The following file system features can be set or cleared using tune2fs: 64bit Enable the file system to be larger than 2^32 blocks. casefold Enable support for file system level casefolding. The option can be cleared only if filesystem has no directories with F attribute. dir_index Use hashed b-trees to speed up lookups for large directories. dir_nlink Allow more than 65000 subdirectories per directory. ea_inode Allow the value of each extended attribute to be placed in the data blocks of a separate inode if necessary, increasing the limit on the size and number of extended attributes per file. Tune2fs currently only supports setting this file system feature. encrypt Enable support for file system level encryption. Tune2fs currently only supports setting this file system feature. extent Enable the use of extent trees to store the location of data blocks in inodes. Tune2fs currently only supports setting this file system feature. extra_isize Enable the extended inode fields used by ext4. filetype Store file type information in directory entries. flex_bg Allow bitmaps and inode tables for a block group to be placed anywhere on the storage media. Tune2fs will not reorganize the location of the inode tables and allocation bitmaps, as mke2fs(8) will do when it creates a freshly formatted file system with flex_bg enabled. has_journal Use a journal to ensure file system consistency even across unclean shutdowns. Setting the file system feature is equivalent to using the -j option. fast_commit Enable fast commit journaling feature to improve fsync latency. large_dir Increase the limit on the number of files per directory. Tune2fs currently only supports setting this file system feature. huge_file Support files larger than 2 terabytes in size. large_file File System can contain files that are greater than 2GB. metadata_csum Store a checksum to protect the contents in each metadata block. metadata_csum_seed Allow the file system to store the metadata checksum seed in the superblock, enabling the administrator to change the UUID of a file system using the metadata_csum feature while it is mounted. mmp Enable or disable multiple mount protection (MMP) feature. project Enable project ID tracking. This is used for project quota tracking. quota Enable internal file system quota inodes. read-only Force the kernel to mount the file system read-only. resize_inode Reserve space so the block group descriptor table may grow in the future. Tune2fs only supports clearing this file system feature. sparse_super Limit the number of backup superblocks to save space on large file systems. Tune2fs currently only supports setting this file system feature. stable_inodes Prevent the file system from being shrunk or having its UUID changed, in order to allow the use of specialized encryption settings that make use of the inode numbers and UUID. Tune2fs currently only supports setting this file system feature. uninit_bg Allow the kernel to initialize bitmaps and inode tables lazily, and to keep a high watermark for the unused inodes in a file system, to reduce e2fsck(8) time. The first e2fsck run after enabling this feature will take the full time, but subsequent e2fsck runs will take only a fraction of the original time, depending on how full the file system is. verity Enable support for verity protected files. Tune2fs currently only supports setting this file system feature. After setting or clearing sparse_super, uninit_bg, filetype, or resize_inode file system features, the file system may require being checked using e2fsck(8) to return the file system to a consistent state. Tune2fs will print a message requesting that the system administrator run e2fsck(8) if necessary. After setting the dir_index feature, e2fsck -D can be run to convert existing directories to the hashed B-tree format. Enabling certain file system features may prevent the file system from being mounted by kernels which do not support those features. In particular, the uninit_bg and flex_bg features are only supported by the ext4 file system. -r reserved-blocks-count Set the number of reserved file system blocks. -Q quota-options Sets 'quota' feature on the superblock and works on the quota files for the given quota type. Quota options could be one or more of the following: [^]usrquota Sets/clears user quota inode in the superblock. [^]grpquota Sets/clears group quota inode in the superblock. [^]prjquota Sets/clears project quota inode in the superblock. -T time-last-checked Set the time the file system was last checked using e2fsck. The time is interpreted using the current (local) timezone. This can be useful in scripts which use a Logical Volume Manager to make a consistent snapshot of a file system, and then check the file system during off hours to make sure it hasn't been corrupted due to hardware problems, etc. If the file system was clean, then this option can be used to set the last checked time on the original file system. The format of time-last- checked is the international date format, with an optional time specifier, i.e. YYYYMMDD[HH[MM[SS]]]. The keyword now is also accepted, in which case the last checked time will be set to the current time. -u user Set the user who can use the reserved file system blocks. user can be a numerical uid or a user name. If a user name is given, it is converted to a numerical uid before it is stored in the superblock. -U UUID Set the universally unique identifier (UUID) of the file system to UUID. The format of the UUID is a series of hex digits separated by hyphens, like this: "c1b9d5a2-f162-11cf-9ece-0020afc76f16". The UUID parameter may also be one of the following: clear clear the file system UUID random generate a new randomly-generated UUID time generate a new time-based UUID The UUID may be used by mount(8), fsck(8), and /etc/fstab(5) (and possibly others) by specifying UUID=uuid instead of a block special device name like /dev/hda1. See uuidgen(8) for more information. If the system does not have a good random number generator such as /dev/random or /dev/urandom, tune2fs will automatically use a time-based UUID instead of a randomly-generated UUID. -z undo_file Before overwriting a file system block, write the old contents of the block to an undo file. This undo file can be used with e2undo(8) to restore the old contents of the file system should something go wrong. If the empty string is passed as the undo_file argument, the undo file will be written to a file named tune2fs-device.e2undo in the directory specified via the E2FSPROGS_UNDO_DIR environment variable. WARNING: The undo file cannot be used to recover from a power or system crash. BUGS top We haven't found any bugs yet. That doesn't mean there aren't any... AUTHOR top tune2fs was written by Remy Card <[email protected]>. It is currently being maintained by Theodore Ts'o <[email protected]>. tune2fs uses the ext2fs library written by Theodore Ts'o <[email protected]>. This manual page was written by Christian Kuhtz <[email protected]>. Time-dependent checking was added by Uwe Ohse <[email protected]>. AVAILABILITY top tune2fs is part of the e2fsprogs package and is available from http://e2fsprogs.sourceforge.net. SEE ALSO top debugfs(8), dumpe2fs(8), e2fsck(8), mke2fs(8), ext4(5) COLOPHON top This page is part of the e2fsprogs (utilities for ext2/3/4 filesystems) project. Information about the project can be found at http://e2fsprogs.sourceforge.net/. It is not known how to report bugs for this man page; if you know, please send a mail to [email protected]. This page was obtained from the project's upstream Git repository git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-07.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] E2fsprogs version 1.47.0 February 2023 TUNE2FS(8) Pages that refer to this page: ext4(5), mke2fs.conf(5), debugfs(8), dumpe2fs(8), e2fsck(8), e2label(8), e2undo(8), fsadm(8), mke2fs(8), mount(8), tune2fs(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# tune2fs\n\n> Adjust parameters of an ext2, ext3 or ext4 filesystem.\n> May be used on mounted filesystems.\n> More information: <https://manned.org/tune2fs>.\n\n- Set the max number of counts before a filesystem is checked to 2:\n\n`tune2fs -c {{2}} {{/dev/sdXN}}`\n\n- Set the filesystem label to MY_LABEL:\n\n`tune2fs -L {{'MY_LABEL'}} {{/dev/sdXN}}`\n\n- Enable discard and user-specified extended attributes for a filesystem:\n\n`tune2fs -o {{discard,user_xattr}} {{/dev/sdXN}}`\n\n- Enable journaling for a filesystem:\n\n`tune2fs -o^{{nobarrier}} {{/dev/sdXN}}`\n
type
type(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training type(1p) Linux manual page PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES OF ERRORS | APPLICATION USAGE | EXAMPLES | RATIONALE | FUTURE DIRECTIONS | SEE ALSO | COPYRIGHT TYPE(1P) POSIX Programmer's Manual TYPE(1P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME top type write a description of command type SYNOPSIS top type name... DESCRIPTION top The type utility shall indicate how each argument would be interpreted if used as a command name. OPTIONS top None. OPERANDS top The following operand shall be supported: name A name to be interpreted. STDIN top Not used. INPUT FILES top None. ENVIRONMENT VARIABLES top The following environment variables shall affect the execution of type: LANG Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.12017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments). LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. PATH Determine the location of name, as described in the Base Definitions volume of POSIX.12017, Chapter 8, Environment Variables. ASYNCHRONOUS EVENTS top Default. STDOUT top The standard output of type contains information about each operand in an unspecified format. The information provided typically identifies the operand as a shell built-in, function, alias, or keyword, and where applicable, may display the operand's pathname. STDERR top The standard error shall be used only for diagnostic messages. OUTPUT FILES top None. EXTENDED DESCRIPTION top None. EXIT STATUS top The following exit values shall be returned: 0 Successful completion. >0 An error occurred. CONSEQUENCES OF ERRORS top Default. The following sections are informative. APPLICATION USAGE top Since type must be aware of the contents of the current shell execution environment (such as the lists of commands, functions, and built-ins processed by hash), it is always provided as a shell regular built-in. If it is called in a separate utility execution environment, such as one of the following: nohup type writer find . -type f | xargs type it might not produce accurate results. EXAMPLES top None. RATIONALE top None. FUTURE DIRECTIONS top None. SEE ALSO top command(1p), hash(1p) The Base Definitions volume of POSIX.12017, Chapter 8, Environment Variables COPYRIGHT top Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE/The Open Group 2017 TYPE(1P) Pages that refer to this page: command(1p) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# type\n\n> Display the type of command the shell will execute.\n> More information: <https://manned.org/type>.\n\n- Display the type of a command:\n\n`type {{command}}`\n\n- Display all locations containing the specified executable:\n\n`type -a {{command}}`\n\n- Display the name of the disk file that would be executed:\n\n`type -p {{command}}`\n
udevadm
udevadm(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training udevadm(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | INITIALIZED DEVICES | EXAMPLE | SEE ALSO | NOTES | COLOPHON UDEVADM(8) udevadm UDEVADM(8) NAME top udevadm - udev management tool SYNOPSIS top udevadm [--debug] [--version] [--help] udevadm info [options] [devpath] udevadm trigger [options] [devpath] udevadm settle [options] udevadm control option udevadm monitor [options] udevadm test [options] devpath udevadm test-builtin [options] command devpath udevadm verify [options...] [file...] udevadm wait [options] device|syspath udevadm lock [options] command DESCRIPTION top udevadm expects a command and command specific options. It controls the runtime behavior of systemd-udevd, requests kernel events, manages the event queue, and provides simple debugging mechanisms. OPTIONS top -d, --debug Print debug messages to standard error. This option is implied in udevadm test and udevadm test-builtin commands. -h, --help Print a short help text and exit. udevadm info [options] [devpath|file|unit...] Query the udev database for device information. Positional arguments should be used to specify one or more devices. Each one may be a device name (in which case it must start with /dev/), a sys path (in which case it must start with /sys/), or a systemd device unit name (in which case it must end with ".device", see systemd.device(5)). -q, --query=TYPE Query the database for the specified type of device data. Valid TYPEs are: name, symlink, path, property, all. --property=NAME When showing device properties using the --query=property option, limit display to properties specified in the argument. The argument should be a comma-separated list of property names. If not specified, all known properties are shown. Added in version 250. --value When showing device properties using the --query=property option, print only their values, and skip the property name and "=". Cannot be used together with -x/--export or -P/--export-prefix. Added in version 250. -p, --path=DEVPATH The /sys/ path of the device to query, e.g. [/sys/]/class/block/sda. This option is an alternative to the positional argument with a /sys/ prefix. udevadm info --path=/class/block/sda is equivalent to udevadm info /sys/class/block/sda. -n, --name=FILE The name of the device node or a symlink to query, e.g. [/dev/]/sda. This option is an alternative to the positional argument with a /dev/ prefix. udevadm info --name=sda is equivalent to udevadm info /dev/sda. -r, --root Print absolute paths in name or symlink query. -a, --attribute-walk Print all sysfs properties of the specified device that can be used in udev rules to match the specified device. It prints all devices along the chain, up to the root of sysfs that can be used in udev rules. -t, --tree Display a sysfs tree. This recursively iterates through the sysfs hierarchy and displays it in a tree structure. If a path is specified only the subtree below and its parent directories are shown. This will show both device and subsystem items. Added in version 251. -x, --export Print output as key/value pairs. Values are enclosed in single quotes. This takes effects only when --query=property or --device-id-of-file=FILE is specified. -P, --export-prefix=NAME Add a prefix to the key name of exported values. This implies --export. -d, --device-id-of-file=FILE Print major/minor numbers of the underlying device, where the file lives on. If this is specified, all positional arguments are ignored. -e, --export-db Export the content of the udev database. -c, --cleanup-db Cleanup the udev database. -w[SECONDS], --wait-for-initialization[=SECONDS] Wait for device to be initialized. If argument SECONDS is not specified, the default is to wait forever. Added in version 243. --subsystem-match[=SUBSYSTEM], --subsystem-nomatch[=SUBSYSTEM] When used with --export-db, only show devices of or not of the given subsystem respectively. Added in version 255. --attr-match[=FILE[=VALUE]], --attr-nomatch[=FILE[=VALUE]] When used with --export-db, only show devices matching or not matching the given attribute respectively. Added in version 255. --property-match[=KEY=VALUE] When used with --export-db, only show devices matching the given property and value. Added in version 255. --tag-match[=TAG] When used with --export-db, only show devices with the given tag. Added in version 255. --sysname-match[=NAME] When used with --export-db, only show devices with the given "/sys" path. Added in version 255. --name-match[=NAME] When used with --export-db, only show devices with the given name in "/dev". Added in version 255. --parent-match[=NAME] When used with --export-db, only show devices with the given parent device. Added in version 255. --initialized-match, --initialized-nomatch When used with --export-db, only show devices that are initialized or not initialized respectively. Added in version 255. --json=MODE Shows output formatted as JSON. Expects one of "short" (for the shortest possible output without any redundant whitespace or line breaks), "pretty" (for a pretty version of the same, with indentation and line breaks) or "off" (to turn off JSON output, the default). -h, --help Print a short help text and exit. --no-pager Do not pipe output into a pager. The generated output shows the current device database entry in a terse format. Each line shown is prefixed with one of the following characters: Table 1. udevadm info output prefixes Prefix Meaning "P:" Device path in /sys/ "M:" Device name in /sys/ (i.e. the last component of "P:") "R:" Device number in /sys/ (i.e. the numeric suffix of the last component of "P:") "U:" Kernel subsystem "T:" Kernel device type within subsystem "D:" Kernel device node major/minor "I:" Network interface index "N:" Kernel device node name "L:" Device node symlink priority "S:" Device node symlink "Q:" Block device sequence number (DISKSEQ) "V:" Attached driver "E:" Device property udevadm trigger [options] [devpath|file|unit] Request device events from the kernel. Primarily used to replay events at system coldplug time. Takes device specifications as positional arguments. See the description of info above. -v, --verbose Print the list of devices which will be triggered. -n, --dry-run Do not actually trigger the event. -q, --quiet Suppress error logging in triggering events. Added in version 248. -t, --type=TYPE Trigger a specific type of devices. Valid types are "all", "devices", and "subsystems". The default value is "devices". -c, --action=ACTION Type of event to be triggered. Possible actions are "add", "remove", "change", "move", "online", "offline", "bind", and "unbind". Also, the special value "help" can be used to list the possible actions. The default value is "change". --prioritized-subsystem=SUBSYSTEM[,SUBSYSTEM...] Takes a comma separated list of subsystems. When triggering events for devices, the devices from the specified subsystems and their parents are triggered first. For example, if --prioritized-subsystem=block,net, then firstly all block devices and their parents are triggered, in the next all network devices and their parents are triggered, and lastly the other devices are triggered. This option can be specified multiple times, and in that case the lists of the subsystems will be merged. That is, --prioritized-subsystem=block --prioritized-subsystem=net is equivalent to --prioritized-subsystem=block,net. Added in version 251. -s, --subsystem-match=SUBSYSTEM Trigger events for devices which belong to a matching subsystem. This option supports shell style pattern matching. When this option is specified more than once, then each matching result is ORed, that is, all the devices in each subsystem are triggered. -S, --subsystem-nomatch=SUBSYSTEM Do not trigger events for devices which belong to a matching subsystem. This option supports shell style pattern matching. When this option is specified more than once, then each matching result is ANDed, that is, devices which do not match all specified subsystems are triggered. -a, --attr-match=ATTRIBUTE=VALUE Trigger events for devices with a matching sysfs attribute. If a value is specified along with the attribute name, the content of the attribute is matched against the given value using shell style pattern matching. If no value is specified, the existence of the sysfs attribute is checked. When this option is specified multiple times, then each matching result is ANDed, that is, only devices which have all specified attributes are triggered. -A, --attr-nomatch=ATTRIBUTE=VALUE Do not trigger events for devices with a matching sysfs attribute. If a value is specified along with the attribute name, the content of the attribute is matched against the given value using shell style pattern matching. If no value is specified, the existence of the sysfs attribute is checked. When this option is specified multiple times, then each matching result is ANDed, that is, only devices which have none of the specified attributes are triggered. -p, --property-match=PROPERTY=VALUE Trigger events for devices with a matching property value. This option supports shell style pattern matching. When this option is specified more than once, then each matching result is ORed, that is, devices which have one of the specified properties are triggered. -g, --tag-match=TAG Trigger events for devices with a matching tag. When this option is specified multiple times, then each matching result is ANDed, that is, devices which have all specified tags are triggered. -y, --sysname-match=NAME Trigger events for devices for which the last component (i.e. the filename) of the /sys/ path matches the specified PATH. This option supports shell style pattern matching. When this option is specified more than once, then each matching result is ORed, that is, all devices which have any of the specified NAME are triggered. --name-match=NAME Trigger events for devices with a matching device path. When this option is specified more than once, then each matching result is ORed, that is, all specified devices are triggered. Added in version 218. -b, --parent-match=SYSPATH Trigger events for all children of a given device. When this option is specified more than once, then each matching result is ORed, that is, all children of each specified device are triggered. --initialized-match, --initialized-nomatch When --initialized-match is specified, trigger events for devices that are already initialized by systemd-udevd, and skip devices that are not initialized yet. When --initialized-nomatch is specified, trigger events for devices that are not initialized by systemd-udevd yet, and skip devices that are already initialized. Typically, it is essential that applications which intend to use such a match, make sure a suitable udev rule is installed that sets at least one property on devices that shall be matched. See also Initialized Devices section below for more details. WARNING: --initialized-nomatch can potentially save a significant amount of time compared to re-triggering all devices in the system and e.g. can be used to optimize boot time. However, this is not safe to be used in a boot sequence in general. Especially, when udev rules for a device depend on its parent devices (e.g. "ATTRS" or "IMPORT{parent}" keys, see udev(7) for more details), the final state of the device becomes easily unstable with this option. Added in version 251. -w, --settle Apart from triggering events, also waits for those events to finish. Note that this is different from calling udevadm settle. udevadm settle waits for all events to finish. This option only waits for events triggered by the same command to finish. Added in version 238. --uuid Trigger the synthetic device events, and associate a randomized UUID with each. These UUIDs are printed to standard output, one line for each event. These UUIDs are included in the uevent environment block (in the "SYNTH_UUID=" property) and may be used to track delivery of the generated events. Added in version 249. --wait-daemon[=SECONDS] Before triggering uevents, wait for systemd-udevd daemon to be initialized. Optionally takes timeout value. Default timeout is 5 seconds. This is equivalent to invoking udevadm control --ping before udevadm trigger. Added in version 241. -h, --help Print a short help text and exit. In addition, optional positional arguments can be used to specify device names or sys paths. They must start with /dev/ or /sys/ respectively. udevadm settle [options] Watches the udev event queue, and exits if all current events are handled. -t, --timeout=SECONDS Maximum number of seconds to wait for the event queue to become empty. The default value is 120 seconds. A value of 0 will check if the queue is empty and always return immediately. A non-zero value will return an exit code of 0 if queue became empty before timeout was reached, non-zero otherwise. -E, --exit-if-exists=FILE Stop waiting if file exists. -h, --help Print a short help text and exit. See systemd-udev-settle.service(8) for more information. udevadm control option Modify the internal state of the running udev daemon. -e, --exit Signal and wait for systemd-udevd to exit. No option except for --timeout can be specified after this option. Note that systemd-udevd.service contains Restart=always and so as a result, this option restarts systemd-udevd. If you want to stop systemd-udevd.service, please use the following: systemctl stop systemd-udevd-control.socket systemd-udevd-kernel.socket systemd-udevd.service -l, --log-level=value Set the internal log level of systemd-udevd. Valid values are the numerical syslog priorities or their textual representations: emerg, alert, crit, err, warning, notice, info, and debug. -s, --stop-exec-queue Signal systemd-udevd to stop executing new events. Incoming events will be queued. -S, --start-exec-queue Signal systemd-udevd to enable the execution of events. -R, --reload Signal systemd-udevd to reload the rules files and other databases like the kernel module index. Reloading rules and databases does not apply any changes to already existing devices; the new configuration will only be applied to new events. -p, --property=KEY=value Set a global property for all events. -m, --children-max=value Set the maximum number of events, systemd-udevd will handle at the same time. When 0 is specified, then the maximum is determined based on the system resources. --ping Send a ping message to systemd-udevd and wait for the reply. This may be useful to check that systemd-udevd daemon is running. Added in version 241. -t, --timeout=seconds The maximum number of seconds to wait for a reply from systemd-udevd. -h, --help Print a short help text and exit. udevadm monitor [options] Listens to the kernel uevents and events sent out by a udev rule and prints the devpath of the event to the console. It can be used to analyze the event timing, by comparing the timestamps of the kernel uevent and the udev event. -k, --kernel Print the kernel uevents. -u, --udev Print the udev event after the rule processing. -p, --property Also print the properties of the event. -s, --subsystem-match=string[/string] Filter kernel uevents and udev events by subsystem[/devtype]. Only events with a matching subsystem value will pass. When this option is specified more than once, then each matching result is ORed, that is, all devices in the specified subsystems are monitored. -t, --tag-match=string Filter udev events by tag. Only udev events with a given tag attached will pass. When this option is specified more than once, then each matching result is ORed, that is, devices which have one of the specified tags are monitored. -h, --help Print a short help text and exit. udevadm test [options] [devpath|file|unit] Simulate a udev event run for the given device, and print debug output. -a, --action=ACTION Type of event to be simulated. Possible actions are "add", "remove", "change", "move", "online", "offline", "bind", and "unbind". Also, the special value "help" can be used to list the possible actions. The default value is "add". -N, --resolve-names=early|late|never Specify when udevadm should resolve names of users and groups. When set to early (the default), names will be resolved when the rules are parsed. When set to late, names will be resolved for every event. When set to never, names will never be resolved and all devices will be owned by root. Added in version 209. -h, --help Print a short help text and exit. udevadm test-builtin [options] [command] [devpath|file|unit] Run a built-in command COMMAND for device DEVPATH, and print debug output. -a, --action=ACTION Type of event to be simulated. Possible actions are "add", "remove", "change", "move", "online", "offline", "bind", and "unbind". Also, the special value "help" can be used to list the possible actions. The default value is "add". Added in version 250. -h, --help Print a short help text and exit. --version Print a short version string and exit. udevadm verify [options] [file...] ... Verify syntactic, semantic, and stylistic correctness of udev rules files. Positional arguments could be used to specify one or more files to check. If no files are specified, the udev rules are read from the files located in the same udev/rules.d directories that are processed by the udev daemon. The exit status is 0 if all specified udev rules files are syntactically, semantically, and stylistically correct, and a non-zero error code otherwise. -N, --resolve-names=early|never Specify when udevadm should resolve names of users and groups. When set to early (the default), names will be resolved when the rules are parsed. When set to never, names will never be resolved. Added in version 254. --root=PATH When looking for udev rules files located in udev/rules.d directories, operate on files underneath the specified root path PATH. Added in version 254. --no-summary Do not show summary. Added in version 254. --no-style Ignore style issues. When specified, even if style issues are found in udev rules files, the exit status is 0 if no syntactic or semantic errors are found. Added in version 254. -h, --help Print a short help text and exit. udevadm wait [options] [device|syspath] ... Wait for devices or device symlinks being created and initialized by systemd-udevd. Each device path must start with "/dev/" or "/sys/", e.g. "/dev/sda", "/dev/disk/by-path/pci-0000:3c:00.0-nvme-1-part1", "/sys/devices/pci0000:00/0000:00:1f.6/net/eth0", or "/sys/class/net/eth0". This can take multiple devices. This may be useful for waiting for devices being processed by systemd-udevd after e.g. partitioning or formatting the devices. -t, --timeout=SECONDS Maximum number of seconds to wait for the specified devices or device symlinks being created, initialized, or removed. The default value is "infinity". Added in version 251. --initialized=BOOL Check if systemd-udevd initialized devices. Defaults to true. When false, the command only checks if the specified devices exist. Set false to this setting if there is no udev rules for the specified devices, as the devices will never be considered as initialized in that case. See Initialized Devices section below for more details. Added in version 251. --removed When specified, the command wait for devices being removed instead of created or initialized. If this is specified, --initialized= will be ignored. Added in version 251. --settle When specified, also watches the udev event queue, and wait for all queued events being processed by systemd-udevd. Added in version 251. -h, --help Print a short help text and exit. udevadm lock [options] [command] ... udevadm lock takes an (advisory) exclusive lock on a block device (or all specified devices), as per Locking Block Device Access[1] and invokes a program with the locks taken. When the invoked program exits the locks are automatically released and its return value is propagated as exit code of udevadm lock. This tool is in particular useful to ensure that systemd-udevd.service(8) does not probe a block device while changes are made to it, for example partitions created or file systems formatted. Note that many tools that interface with block devices natively support taking relevant locks, see for example sfdisk(8)'s --lock switch. The command expects at least one block device specified via --device= or --backing=, and a command line to execute as arguments. --device=DEVICE, -d DEVICE Takes a path to a device node of the device to lock. This switch may be used multiple times (and in combination with --backing=) in order to lock multiple devices. If a partition block device node is specified the containing "whole" block device is automatically determined and used for the lock, as per the specification. If multiple devices are specified, they are deduplicated, sorted by the major/minor of their device nodes and then locked in order. This switch must be used at least once, to specify at least one device to lock. (Alternatively, use --backing=, see below.) Added in version 251. --backing=PATH, -b PATH If a path to a device node is specified, identical to --device=. However, this switch alternatively accepts a path to a regular file or directory, in which case the block device of the file system the file/directory resides on is automatically determined and used as if it was specified with --device=. Added in version 251. --timeout=SECS, -t SECS Specifies how long to wait at most until all locks can be taken. Takes a value in seconds, or in the usual supported time units, see systemd.time(7). If specified as zero the lock is attempted and if not successful the invocation will immediately fail. If passed as "infinity" (the default) the invocation will wait indefinitely until the lock can be acquired. If the lock cannot be taken in the specified time the specified command will not be executed and the invocation will fail. Added in version 251. --print, -p Instead of locking the specified devices and executing a command, just print the device paths that would be locked, and execute no command. This command is useful to determine the "whole" block device in case a partition block device is specified. The devices will be sorted by their device node major number as primary ordering key and the minor number as secondary ordering key (i.e. they are shown in the order they'd be locked). Note that the number of lines printed here can be less than the number of --device= and --backing= switches specified in case these resolve to the same "whole" devices. Added in version 251. -h, --help Print a short help text and exit. INITIALIZED DEVICES top Initialized devices are those for which at least one udev rule already completed execution for any action but "remove" that set a property or other device setting (and thus has an entry in the udev device database). Devices are no longer considered initialized if a "remove" action is seen for them (which removes their entry in the udev device database). Note that devices that have no udev rules are never considered initialized, but might still be announced via the sd-device API (or similar). EXAMPLE top Example 1. Format a File System Take a lock on the backing block device while creating a file system, to ensure that systemd-udevd doesn't probe or announce the new superblock before it is comprehensively written: # udevadm lock --device=/dev/sda1 mkfs.ext4 /dev/sda1 Example 2. Format a RAID File System Similar, but take locks on multiple devices at once: # udevadm lock --device=/dev/sda1 --device=/dev/sdb1 mkfs.btrfs /dev/sda1 /dev/sdb1 Example 3. Copy in a File System Take a lock on the backing block device while copying in a prepared file system image, to ensure that systemd-udevd doesn't probe or announce the new superblock before it is fully written: # udevadm lock -d /dev/sda1 dd if=fs.raw of=/dev/sda1 SEE ALSO top udev(7), systemd-udevd.service(8) NOTES top 1. Locking Block Device Access https://systemd.io/BLOCK_DEVICE_LOCKING COLOPHON top This page is part of the systemd (systemd system and service manager) project. Information about the project can be found at http://www.freedesktop.org/wiki/Software/systemd. If you have a bug report for this manual page, see http://www.freedesktop.org/wiki/Software/systemd/#bugreports. This page was obtained from the project's upstream Git repository https://github.com/systemd/systemd.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-22.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] systemd 255 UDEVADM(8) Pages that refer to this page: sd-device(3), iocost.conf(5), systemd.link(5), udev.conf(5), systemd.directives(7), systemd.index(7), systemd.net-naming-scheme(7), udev(7), dmsetup(8), lvmdump(8), systemd-udevd.service(8), systemd-udev-settle.service(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# udevadm\n\n> Linux `udev` management tool.\n> More information: <https://www.freedesktop.org/software/systemd/man/udevadm>.\n\n- Monitor all device events:\n\n`sudo udevadm monitor`\n\n- Print `uevents` sent out by the kernel:\n\n`sudo udevadm monitor --kernel`\n\n- Print device events after being processed by `udev`:\n\n`sudo udevadm monitor --udev`\n\n- List attributes of device `/dev/sda`:\n\n`sudo udevadm info --attribute-walk {{/dev/sda}}`\n\n- Reload all `udev` rules:\n\n`sudo udevadm control --reload-rules`\n\n- Trigger all `udev` rules to run:\n\n`sudo udevadm trigger`\n\n- Test an event run by simulating loading of `/dev/sda`:\n\n`sudo udevadm test {{/dev/sda}}`\n
ul
ul(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training ul(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | ENVIRONMENT | HISTORY | BUGS | SEE ALSO | REPORTING BUGS | AVAILABILITY UL(1) User Commands UL(1) NAME top ul - do underlining SYNOPSIS top ul [options] [file...] DESCRIPTION top ul reads the named files (or standard input if none are given) and translates occurrences of underscores to the sequence which indicates underlining for the terminal in use, as specified by the environment variable TERM. The terminfo database is read to determine the appropriate sequences for underlining. If the terminal is incapable of underlining but is capable of a standout mode, then that is used instead. If the terminal can overstrike, or handles underlining automatically, ul degenerates to cat(1). If the terminal cannot underline, underlining is ignored. OPTIONS top -i, --indicated Underlining is indicated by a separate line containing appropriate dashes `-'; this is useful when you want to look at the underlining which is present in an nroff output stream on a crt-terminal. -t, -T, --terminal terminal Override the environment variable TERM with the specified terminal type. -h, --help Display help text and exit. -V, --version Print version and exit. ENVIRONMENT top The following environment variable is used: TERM The TERM variable is used to relate a tty device with its device capability description (see terminfo(5)). TERM is set at login time, either by the default terminal type specified in /etc/ttys or as set during the login process by the user in their login file (see setenv(3)). HISTORY top The ul command appeared in 3.0BSD. BUGS top nroff usually outputs a series of backspaces and underlines intermixed with the text to indicate underlining. No attempt is made to optimize the backward motion. SEE ALSO top colcrt(1), login(1), man(1), nroff(1), setenv(3), terminfo(5) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The ul command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is part of the util-linux (a random collection of Linux utilities) project. Information about the project can be found at https://www.kernel.org/pub/linux/utils/util-linux/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-14.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] util-linux 2.39.594-1e0ad 2023-07-19 UL(1) Pages that refer to this page: colcrt(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# ul\n\n> Performs the underlining of a text.\n> Each character in a string must be underlined separately.\n> More information: <https://manned.org/ul>.\n\n- Display the contents of the file with underlines where applicable:\n\n`ul {{file.txt}}`\n\n- Display the contents of the file with underlines made of dashes `-`:\n\n`ul -i {{file.txt}}`\n
ulimit
ulimit(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training ulimit(1p) Linux manual page PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES OF ERRORS | APPLICATION USAGE | EXAMPLES | RATIONALE | FUTURE DIRECTIONS | SEE ALSO | COPYRIGHT ULIMIT(1P) POSIX Programmer's Manual ULIMIT(1P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME top ulimit set or report file size limit SYNOPSIS top ulimit [-f] [blocks] DESCRIPTION top The ulimit utility shall set or report the file-size writing limit imposed on files written by the shell and its child processes (files of any size may be read). Only a process with appropriate privileges can increase the limit. OPTIONS top The ulimit utility shall conform to the Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines. The following option shall be supported: -f Set (or report, if no blocks operand is present), the file size limit in blocks. The -f option shall also be the default case. OPERANDS top The following operand shall be supported: blocks The number of 512-byte blocks to use as the new file size limit. STDIN top Not used. INPUT FILES top None. ENVIRONMENT VARIABLES top The following environment variables shall affect the execution of ulimit: LANG Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.12017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments). LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. ASYNCHRONOUS EVENTS top Default. STDOUT top The standard output shall be used when no blocks operand is present. If the current number of blocks is limited, the number of blocks in the current limit shall be written in the following format: "%d\n", <number of 512-byte blocks> If there is no current limit on the number of blocks, in the POSIX locale the following format shall be used: "unlimited\n" STDERR top The standard error shall be used only for diagnostic messages. OUTPUT FILES top None. EXTENDED DESCRIPTION top None. EXIT STATUS top The following exit values shall be returned: 0 Successful completion. >0 A request for a higher limit was rejected or an error occurred. CONSEQUENCES OF ERRORS top Default. The following sections are informative. APPLICATION USAGE top Since ulimit affects the current shell execution environment, it is always provided as a shell regular built-in. If it is called in a separate utility execution environment, such as one of the following: nohup ulimit -f 10000 env ulimit 10000 it does not affect the file size limit of the caller's environment. Once a limit has been decreased by a process, it cannot be increased (unless appropriate privileges are involved), even back to the original system limit. EXAMPLES top Set the file size limit to 51200 bytes: ulimit -f 100 RATIONALE top None. FUTURE DIRECTIONS top None. SEE ALSO top The Base Definitions volume of POSIX.12017, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines The System Interfaces volume of POSIX.12017, ulimit(3p) COPYRIGHT top Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE/The Open Group 2017 ULIMIT(1P) Pages that refer to this page: prlimit(1), renice(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# ulimit\n\n> Get and set user limits.\n> More information: <https://manned.org/ulimit>.\n\n- Get the properties of all the user limits:\n\n`ulimit -a`\n\n- Get hard limit for the number of simultaneously opened files:\n\n`ulimit -H -n`\n\n- Get soft limit for the number of simultaneously opened files:\n\n`ulimit -S -n`\n\n- Set max per-user process limit:\n\n`ulimit -u 30`\n
umask
umask(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training umask(1p) Linux manual page PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES OF ERRORS | APPLICATION USAGE | EXAMPLES | RATIONALE | FUTURE DIRECTIONS | SEE ALSO | COPYRIGHT UMASK(1P) POSIX Programmer's Manual UMASK(1P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME top umask get or set the file mode creation mask SYNOPSIS top umask [-S] [mask] DESCRIPTION top The umask utility shall set the file mode creation mask of the current shell execution environment (see Section 2.12, Shell Execution Environment) to the value specified by the mask operand. This mask shall affect the initial value of the file permission bits of subsequently created files. If umask is called in a subshell or separate utility execution environment, such as one of the following: (umask 002) nohup umask ... find . -exec umask ... \; it shall not affect the file mode creation mask of the caller's environment. If the mask operand is not specified, the umask utility shall write to standard output the value of the file mode creation mask of the invoking process. OPTIONS top The umask utility shall conform to the Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines. The following option shall be supported: -S Produce symbolic output. The default output style is unspecified, but shall be recognized on a subsequent invocation of umask on the same system as a mask operand to restore the previous file mode creation mask. OPERANDS top The following operand shall be supported: mask A string specifying the new file mode creation mask. The string is treated in the same way as the mode operand described in the EXTENDED DESCRIPTION section for chmod. For a symbolic_mode value, the new value of the file mode creation mask shall be the logical complement of the file permission bits portion of the file mode specified by the symbolic_mode string. In a symbolic_mode value, the permissions op characters '+' and '-' shall be interpreted relative to the current file mode creation mask; '+' shall cause the bits for the indicated permissions to be cleared in the mask; '-' shall cause the bits for the indicated permissions to be set in the mask. The interpretation of mode values that specify file mode bits other than the file permission bits is unspecified. In the octal integer form of mode, the specified bits are set in the file mode creation mask. The file mode creation mask shall be set to the resulting numeric value. The default output of a prior invocation of umask on the same system with no operand also shall be recognized as a mask operand. STDIN top Not used. INPUT FILES top None. ENVIRONMENT VARIABLES top The following environment variables shall affect the execution of umask: LANG Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.12017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments). LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. ASYNCHRONOUS EVENTS top Default. STDOUT top When the mask operand is not specified, the umask utility shall write a message to standard output that can later be used as a umask mask operand. If -S is specified, the message shall be in the following format: "u=%s,g=%s,o=%s\n", <owner permissions>, <group permissions>, <other permissions> where the three values shall be combinations of letters from the set {r, w, x}; the presence of a letter shall indicate that the corresponding bit is clear in the file mode creation mask. If a mask operand is specified, there shall be no output written to standard output. STDERR top The standard error shall be used only for diagnostic messages. OUTPUT FILES top None. EXTENDED DESCRIPTION top None. EXIT STATUS top The following exit values shall be returned: 0 The file mode creation mask was successfully changed, or no mask operand was supplied. >0 An error occurred. CONSEQUENCES OF ERRORS top Default. The following sections are informative. APPLICATION USAGE top Since umask affects the current shell execution environment, it is generally provided as a shell regular built-in. In contrast to the negative permission logic provided by the file mode creation mask and the octal number form of the mask argument, the symbolic form of the mask argument specifies those permissions that are left alone. EXAMPLES top Either of the commands: umask a=rx,ug+w umask 002 sets the mode mask so that subsequently created files have their S_IWOTH bit cleared. After setting the mode mask with either of the above commands, the umask command can be used to write out the current value of the mode mask: $ umask 0002 (The output format is unspecified, but historical implementations use the octal integer mode format.) $ umask -S u=rwx,g=rwx,o=rx Either of these outputs can be used as the mask operand to a subsequent invocation of the umask utility. Assuming the mode mask is set as above, the command: umask g-w sets the mode mask so that subsequently created files have their S_IWGRP and S_IWOTH bits cleared. The command: umask -- -w sets the mode mask so that subsequently created files have all their write bits cleared. Note that mask operands -r, -w, -x or anything beginning with a <hyphen-minus>, must be preceded by "--" to keep it from being interpreted as an option. RATIONALE top Since umask affects the current shell execution environment, it is generally 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: (umask 002) nohup umask ... find . -exec umask ... \; it does not affect the file mode creation mask of the environment of the caller. The description of the historical utility was modified to allow it to use the symbolic modes of chmod. The -s option used in early proposals was changed to -S because -s could be confused with a symbolic_mode form of mask referring to the S_ISUID and S_ISGID bits. The default output style is unspecified to permit implementors to provide migration to the new symbolic style at the time most appropriate to their users. A -o flag to force octal mode output was omitted because the octal mode may not be sufficient to specify all of the information that may be present in the file mode creation mask when more secure file access permission checks are implemented. It has been suggested that trusted systems developers might appreciate ameliorating the requirement that the mode mask ``affects'' the file access permissions, since it seems access control lists might replace the mode mask to some degree. The wording has been changed to say that it affects the file permission bits, and it leaves the details of the behavior of how they affect the file access permissions to the description in the System Interfaces volume of POSIX.12017. FUTURE DIRECTIONS top None. SEE ALSO top Chapter 2, Shell Command Language, chmod(1p) The Base Definitions volume of POSIX.12017, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines The System Interfaces volume of POSIX.12017, umask(3p) COPYRIGHT top Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE/The Open Group 2017 UMASK(1P) Pages that refer to this page: c99(1p), chmod(1p), fort77(1p), mkdir(1p), mkfifo(1p), sh(1p), uudecode(1p) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# umask\n\n> Manage the read/write/execute permissions that are masked out (i.e. restricted) for newly created files by the user.\n> More information: <https://manned.org/umask>.\n\n- Display the current mask in octal notation:\n\n`umask`\n\n- Display the current mask in symbolic (human-readable) mode:\n\n`umask -S`\n\n- Change the mask symbolically to allow read permission for all users (the rest of the mask bits are unchanged):\n\n`umask {{a+r}}`\n\n- Set the mask (using octal) to restrict no permissions for the file's owner, and restrict all permissions for everyone else:\n\n`umask {{077}}`\n
umount
umount(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training umount(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | NON-SUPERUSER UMOUNTS | LOOP DEVICE | EXTERNAL HELPERS | ENVIRONMENT | FILES | HISTORY | SEE ALSO | REPORTING BUGS | AVAILABILITY UMOUNT(8) System Administration UMOUNT(8) NAME top umount - unmount filesystems SYNOPSIS top umount -a [-dflnrv] [-t fstype] [-O option...] umount [-dflnrv] {directory|device} umount -h|-V DESCRIPTION top The umount command detaches the mentioned filesystem(s) from the file hierarchy. A filesystem is specified by giving the directory where it has been mounted. Giving the special device on which the filesystem lives may also work, but is obsolete, mainly because it will fail in case this device was mounted on more than one directory. Note that a filesystem cannot be unmounted when it is 'busy' - for example, when there are open files on it, or when some process has its working directory there, or when a swap file on it is in use. The offending process could even be umount itself - it opens libc, and libc in its turn may open for example locale files. A lazy unmount avoids this problem, but it may introduce other issues. See --lazy description below. OPTIONS top -a, --all All of the filesystems described in /proc/self/mountinfo (or in deprecated /etc/mtab) are unmounted, except the proc, devfs, devpts, sysfs, rpc_pipefs and nfsd filesystems. This list of the filesystems may be replaced by --types umount option. -A, --all-targets Unmount all mountpoints in the current mount namespace for the specified filesystem. The filesystem can be specified by one of the mountpoints or the device name (or UUID, etc.). When this option is used together with --recursive, then all nested mounts within the filesystem are recursively unmounted. This option is only supported on systems where /etc/mtab is a symlink to /proc/mounts. -c, --no-canonicalize Do not canonicalize paths. The paths canonicalization is based on stat(2) and readlink(2) system calls. These system calls may hang in some cases (for example on NFS if server is not available). The option has to be used with canonical path to the mount point. This option is silently ignored by umount for non-root users. For more details about this option see the mount(8) man page. Note that umount does not pass this option to the /sbin/umount.type helpers. -d, --detach-loop When the unmounted device was a loop device, also free this loop device. This option is unnecessary for devices initialized by mount(8), in this case "autoclear" functionality is enabled by default. --fake Causes everything to be done except for the actual system call or umount helper execution; this 'fakes' unmounting the filesystem. It can be used to remove entries from the deprecated /etc/mtab that were unmounted earlier with the -n option. -f, --force Force an unmount (in case of an unreachable NFS system). Note that this option does not guarantee that umount command does not hang. Its strongly recommended to use absolute paths without symlinks to avoid unwanted readlink(2) and stat(2) system calls on unreachable NFS in umount. -i, --internal-only Do not call the /sbin/umount.filesystem helper even if it exists. By default such a helper program is called if it exists. -l, --lazy Lazy unmount. Detach the filesystem from the file hierarchy now, and clean up all references to this filesystem as soon as it is not busy anymore. A system reboot would be expected in near future if youre going to use this option for network filesystem or local filesystem with submounts. The recommended use-case for umount -l is to prevent hangs on shutdown due to an unreachable network share where a normal umount will hang due to a downed server or a network partition. Remounts of the share will not be possible. -N, --namespace ns Perform umount in the mount namespace specified by ns. ns is either PID of process running in that namespace or special file representing that namespace. umount switches to the namespace when it reads /etc/fstab, writes /etc/mtab (or writes to /run/mount) and calls umount(2) system call, otherwise it runs in the original namespace. It means that the target mount namespace does not have to contain any libraries or other requirements necessary to execute umount(2) command. See mount_namespaces(7) for more information. -n, --no-mtab Unmount without writing in /etc/mtab. -O, --test-opts option... Unmount only the filesystems that have the specified option set in /etc/fstab. More than one option may be specified in a comma-separated list. Each option can be prefixed with no to indicate that no action should be taken for this option. -q, --quiet Suppress "not mounted" error messages. -R, --recursive Recursively unmount each specified directory. Recursion for each directory will stop if any unmount operation in the chain fails for any reason. The relationship between mountpoints is determined by /proc/self/mountinfo entries. The filesystem must be specified by mountpoint path; a recursive unmount by device name (or UUID) is unsupported. Since version 2.37 it umounts also all over-mounted filesystems (more filesystems on the same mountpoint). -r, --read-only When an unmount fails, try to remount the filesystem read-only. -t, --types type... Indicate that the actions should only be taken on filesystems of the specified type. More than one type may be specified in a comma-separated list. The list of filesystem types can be prefixed with no to indicate that no action should be taken for all of the mentioned types. Note that umount reads information about mounted filesystems from kernel (/proc/mounts) and filesystem names may be different than filesystem names used in the /etc/fstab (e.g., "nfs4" vs. "nfs"). -v, --verbose Verbose mode. -h, --help Display help text and exit. -V, --version Print version and exit. NON-SUPERUSER UMOUNTS top Normally, only the superuser can umount filesystems. However, when fstab contains the user option on a line, anybody can umount the corresponding filesystem. For more details see mount(8) man page. Since version 2.34 the umount command can be used to perform umount operation also for fuse filesystems if kernel mount table contains users ID. In this case fstab user= mount option is not required. Since version 2.35 umount command does not exit when user permissions are inadequate by internal libmount security rules. It drops suid permissions and continue as regular non-root user. This can be used to support use-cases where root permissions are not necessary (e.g., fuse filesystems, user namespaces, etc). LOOP DEVICE top The umount command will automatically detach loop device previously initialized by mount(8) command independently of /etc/mtab. In this case the device is initialized with "autoclear" flag (see losetup(8) output for more details), otherwise its necessary to use the option --detach-loop or call losetup -d device. The autoclear feature is supported since Linux 2.6.25. EXTERNAL HELPERS top The syntax of external unmount helpers is: umount.suffix {directory|device} [-flnrv] [-N namespace] [-t type.subtype] where suffix is the filesystem type (or the value from a uhelper= or helper= marker in the mtab file). The -t option can be used for filesystems that have subtype support. For example: umount.fuse -t fuse.sshfs A uhelper=something marker (unprivileged helper) can appear in the /etc/mtab file when ordinary users need to be able to unmount a mountpoint that is not defined in /etc/fstab (for example for a device that was mounted by udisks(1)). A helper=type marker in the mtab file will redirect all unmount requests to the /sbin/umount.type helper independently of UID. Note that /etc/mtab is currently deprecated and helper= and other userspace mount options are maintained by libmount. ENVIRONMENT top LIBMOUNT_FSTAB=<path> overrides the default location of the fstab file (ignored for suid) LIBMOUNT_DEBUG=all enables libmount debug output FILES top /etc/mtab table of mounted filesystems (deprecated and usually replaced by symlink to /proc/mounts) /etc/fstab table of known filesystems /proc/self/mountinfo table of mounted filesystems generated by kernel. HISTORY top A umount command appeared in Version 6 AT&T UNIX. SEE ALSO top umount(2), losetup(8), mount_namespaces(7), mount(8) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The umount command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is part of the util-linux (a random collection of Linux utilities) project. Information about the project can be found at https://www.kernel.org/pub/linux/utils/util-linux/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-14.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] util-linux 2.39.594-1e0ad 2023-07-19 UMOUNT(8) Pages that refer to this page: eject(1), systemd-dissect(1), unshare(1), mount(2), umount(2), fstab(5), nfs(5), systemd.mount(5), cgroups(7), mount_namespaces(7), blkdeactivate(8), mount(8), pivot_root(8), umount.nfs(8), xfs_repair(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# umount\n\n> Unlink a filesystem from its mount point, making it no longer accessible.\n> A filesystem cannot be unmounted when it is busy.\n> More information: <https://manned.org/umount.8>.\n\n- Unmount a filesystem, by passing the path to the source it is mounted from:\n\n`umount {{path/to/device_file}}`\n\n- Unmount a filesystem, by passing the path to the target where it is mounted:\n\n`umount {{path/to/mounted_directory}}`\n\n- When an unmount fails, try to remount the filesystem read-only:\n\n`umount --read-only {{path/to/mounted_directory}}`\n\n- Recursively unmount each specified directory:\n\n`umount --recursive {{path/to/mounted_directory}}`\n\n- Unmount all mounted filesystems (except the `proc` filesystem):\n\n`umount -a`\n
unalias
unalias(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training unalias(1p) Linux manual page PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES OF ERRORS | APPLICATION USAGE | EXAMPLES | RATIONALE | FUTURE DIRECTIONS | SEE ALSO | COPYRIGHT UNALIAS(1P) POSIX Programmer's Manual UNALIAS(1P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME top unalias remove alias definitions SYNOPSIS top unalias alias-name... unalias -a DESCRIPTION top The unalias utility shall remove the definition for each alias name specified. See Section 2.3.1, Alias Substitution. The aliases shall be removed from the current shell execution environment; see Section 2.12, Shell Execution Environment. OPTIONS top The unalias utility shall conform to the Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines. The following option shall be supported: -a Remove all alias definitions from the current shell execution environment. OPERANDS top The following operand shall be supported: alias-name The name of an alias to be removed. STDIN top Not used. INPUT FILES top None. ENVIRONMENT VARIABLES top The following environment variables shall affect the execution of unalias: LANG Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.12017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments). LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. ASYNCHRONOUS EVENTS top Default. STDOUT top Not used. STDERR top The standard error shall be used only for diagnostic messages. OUTPUT FILES top None. EXTENDED DESCRIPTION top None. EXIT STATUS top The following exit values shall be returned: 0 Successful completion. >0 One of the alias-name operands specified did not represent a valid alias definition, or an error occurred. CONSEQUENCES OF ERRORS top Default. The following sections are informative. APPLICATION USAGE top Since unalias affects the current shell execution environment, it is generally provided as a shell regular built-in. EXAMPLES top None. RATIONALE top The unalias description is based on that from historical KornShell implementations. Known differences exist between that and the C shell. The KornShell version was adopted to be consistent with all the other KornShell features in this volume of POSIX.12017, such as command line editing. The -a option is the equivalent of the unalias * form of the C shell and is provided to address security concerns about unknown aliases entering the environment of a user (or application) through the allowable implementation-defined predefined alias route or as a result of an ENV file. (Although unalias could be used to simplify the ``secure'' shell script shown in the command rationale, it does not obviate the need to quote all command names. An initial call to unalias -a would have to be quoted in case there was an alias for unalias.) FUTURE DIRECTIONS top None. SEE ALSO top Chapter 2, Shell Command Language, alias(1p) The Base Definitions volume of POSIX.12017, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines COPYRIGHT top Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE/The Open Group 2017 UNALIAS(1P) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# unalias\n\n> Remove aliases.\n> More information: <https://manned.org/unalias>.\n\n- Remove an alias:\n\n`unalias {{alias_name}}`\n\n- Remove all aliases:\n\n`unalias -a`\n
uname
uname(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training uname(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON UNAME(1) User Commands UNAME(1) NAME top uname - print system information SYNOPSIS top uname [OPTION]... DESCRIPTION top Print certain system information. With no OPTION, same as -s. -a, --all print all information, in the following order, except omit -p and -i if unknown: -s, --kernel-name print the kernel name -n, --nodename print the network node hostname -r, --kernel-release print the kernel release -v, --kernel-version print the kernel version -m, --machine print the machine hardware name -p, --processor print the processor type (non-portable) -i, --hardware-platform print the hardware platform (non-portable) -o, --operating-system print the operating system --help display this help and exit --version output version information and exit AUTHOR top Written by David MacKenzie. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top arch(1), uname(2) Full documentation <https://www.gnu.org/software/coreutils/uname> or available locally via: info '(coreutils) uname invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 UNAME(1) Pages that refer to this page: arch(1), uname(2), systemd.unit(5), lsof(8), ovs-l3ping(8), ovs-test(8), ovs-vlan-test(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# uname\n\n> Uname prints information about the machine and operating system it is run on.\n> More information: <https://www.gnu.org/software/coreutils/manual/html_node/uname-invocation.html>.\n\n- Print all information:\n\n`uname --all`\n\n- Print the current kernel name:\n\n`uname --kernel-name`\n\n- Print the current network node host name:\n\n`uname --nodename`\n\n- Print the current kernel release:\n\n`uname --kernel-release`\n\n- Print the current kernel version:\n\n`uname --kernel-version`\n\n- Print the current machine hardware name:\n\n`uname --machine`\n\n- Print the current processor type:\n\n`uname --processor`\n\n- Print the current operating system name:\n\n`uname --operating-system`\n
uncompress
uncompress(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training uncompress(1p) Linux manual page PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES OF ERRORS | APPLICATION USAGE | EXAMPLES | RATIONALE | FUTURE DIRECTIONS | SEE ALSO | COPYRIGHT UNCOMPRESS(1P) POSIX Programmer's Manual UNCOMPRESS(1P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME top uncompress expand compressed data SYNOPSIS top uncompress [-cfv] [file...] DESCRIPTION top The uncompress utility shall restore files to their original state after they have been compressed using the compress utility. If no files are specified, the standard input shall be uncompressed to the standard output. If the invoking process has appropriate privileges, the ownership, modes, access time, and modification time of the original file shall be preserved. This utility shall support the uncompressing of any files produced by the compress utility on the same implementation. For files produced by compress on other systems, uncompress supports 9 to 14-bit compression (see compress(1p), -b); it is implementation-defined whether values of -b greater than 14 are supported. OPTIONS top The uncompress utility shall conform to the Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines, except that Guideline 1 does apply since the utility name has ten letters. The following options shall be supported: -c Write to standard output; no files are changed. -f Do not prompt for overwriting files. Except when run in the background, if -f is not given the user shall be prompted as to whether an existing file should be overwritten. If the standard input is not a terminal and -f is not given, uncompress shall write a diagnostic message to standard error and exit with a status greater than zero. -v Write messages to standard error concerning the expansion of each file. OPERANDS top The following operand shall be supported: file A pathname of a file. If file already has the .Z suffix specified, it shall be used as the input file and the output file shall be named file with the .Z suffix removed. Otherwise, file shall be used as the name of the output file and file with the .Z suffix appended shall be used as the input file. STDIN top The standard input shall be used only if no file operands are specified, or if a file operand is '-'. INPUT FILES top Input files shall be in the format produced by the compress utility. ENVIRONMENT VARIABLES top The following environment variables shall affect the execution of uncompress: LANG Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.12017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments). LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. ASYNCHRONOUS EVENTS top Default. STDOUT top When there are no file operands or the -c option is specified, the uncompressed output is written to standard output. STDERR top Prompts shall be written to the standard error output under the conditions specified in the DESCRIPTION and OPTIONS sections. The prompts shall contain the file pathname, but their format is otherwise unspecified. Otherwise, the standard error output shall be used only for diagnostic messages. OUTPUT FILES top Output files are the same as the respective input files to compress. EXTENDED DESCRIPTION top None. EXIT STATUS top The following exit values shall be returned: 0 Successful completion. >0 An error occurred. CONSEQUENCES OF ERRORS top The input file remains unmodified. The following sections are informative. APPLICATION USAGE top The limit of 14 on the compress -b bits argument is to achieve portability to all systems (within the restrictions imposed by the lack of an explicit published file format). Some implementations based on 16-bit architectures cannot support 15 or 16-bit uncompression. EXAMPLES top None. RATIONALE top None. FUTURE DIRECTIONS top None. SEE ALSO top compress(1p), zcat(1p) The Base Definitions volume of POSIX.12017, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines COPYRIGHT top Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE/The Open Group 2017 UNCOMPRESS(1P) Pages that refer to this page: compress(1p), zcat(1p) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# uncompress\n\n> Uncompress files compressed using the Unix `compress` command.\n> More information: <https://manned.org/uncompress.1>.\n\n- Uncompress specific files:\n\n`uncompress {{path/to/file1.Z path/to/file2.Z ...}}`\n\n- Uncompress specific files while ignoring non-existent ones:\n\n`uncompress -f {{path/to/file1.Z path/to/file2.Z ...}}`\n\n- Write to `stdout` (no files are changed and no `.Z` files are created):\n\n`uncompress -c {{path/to/file1.Z path/to/file2.Z ...}}`\n\n- Verbose mode (write to `stderr` about percentage reduction or expansion):\n\n`uncompress -v {{path/to/file1.Z path/to/file2.Z ...}}`\n
unexpand
unexpand(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training unexpand(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON UNEXPAND(1) User Commands UNEXPAND(1) NAME top unexpand - convert spaces to tabs SYNOPSIS top unexpand [OPTION]... [FILE]... DESCRIPTION top Convert blanks in each FILE to tabs, writing to standard output. With no FILE, or when FILE is -, read standard input. Mandatory arguments to long options are mandatory for short options too. -a, --all convert all blanks, instead of just initial blanks --first-only convert only leading sequences of blanks (overrides -a) -t, --tabs=N have tabs N characters apart instead of 8 (enables -a) -t, --tabs=LIST use comma separated list of tab positions. The last specified position can be prefixed with '/' to specify a tab size to use after the last explicitly specified tab stop. Also a prefix of '+' can be used to align remaining tab stops relative to the last specified tab stop instead of the first column --help display this help and exit --version output version information and exit AUTHOR top Written by David MacKenzie. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top expand(1) Full documentation <https://www.gnu.org/software/coreutils/unexpand> or available locally via: info '(coreutils) unexpand invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 UNEXPAND(1) Pages that refer to this page: expand(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# unexpand\n\n> Convert spaces to tabs.\n> More information: <https://www.gnu.org/software/coreutils/unexpand>.\n\n- Convert blanks in each file to tabs, writing to `stdout`:\n\n`unexpand {{path/to/file}}`\n\n- Convert blanks to tabs, reading from `stdout`:\n\n`unexpand`\n\n- Convert all blanks, instead of just initial blanks:\n\n`unexpand -a {{path/to/file}}`\n\n- Convert only leading sequences of blanks (overrides -a):\n\n`unexpand --first-only {{path/to/file}}`\n\n- Have tabs a certain number of characters apart, not 8 (enables -a):\n\n`unexpand -t {{number}} {{path/to/file}}`\n
uniq
uniq(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training uniq(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON UNIQ(1) User Commands UNIQ(1) NAME top uniq - report or omit repeated lines SYNOPSIS top uniq [OPTION]... [INPUT [OUTPUT]] DESCRIPTION top Filter adjacent matching lines from INPUT (or standard input), writing to OUTPUT (or standard output). With no options, matching lines are merged to the first occurrence. Mandatory arguments to long options are mandatory for short options too. -c, --count prefix lines by the number of occurrences -d, --repeated only print duplicate lines, one for each group -D print all duplicate lines --all-repeated[=METHOD] like -D, but allow separating groups with an empty line; METHOD={none(default),prepend,separate} -f, --skip-fields=N avoid comparing the first N fields --group[=METHOD] show all items, separating groups with an empty line; METHOD={separate(default),prepend,append,both} -i, --ignore-case ignore differences in case when comparing -s, --skip-chars=N avoid comparing the first N characters -u, --unique only print unique lines -z, --zero-terminated line delimiter is NUL, not newline -w, --check-chars=N compare no more than N characters in lines --help display this help and exit --version output version information and exit A field is a run of blanks (usually spaces and/or TABs), then non-blank characters. Fields are skipped before chars. Note: 'uniq' does not detect repeated lines unless they are adjacent. You may want to sort the input first, or use 'sort -u' without 'uniq'. AUTHOR top Written by Richard M. Stallman and David MacKenzie. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top comm(1), join(1), sort(1) Full documentation <https://www.gnu.org/software/coreutils/uniq> or available locally via: info '(coreutils) uniq invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 UNIQ(1) Pages that refer to this page: comm(1), join(1), sort(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# uniq\n\n> Output the unique lines from a input or file.\n> Since it does not detect repeated lines unless they are adjacent, we need to sort them first.\n> More information: <https://www.gnu.org/software/coreutils/uniq>.\n\n- Display each line once:\n\n`sort {{path/to/file}} | uniq`\n\n- Display only unique lines:\n\n`sort {{path/to/file}} | uniq -u`\n\n- Display only duplicate lines:\n\n`sort {{path/to/file}} | uniq -d`\n\n- Display number of occurrences of each line along with that line:\n\n`sort {{path/to/file}} | uniq -c`\n\n- Display number of occurrences of each line, sorted by the most frequent:\n\n`sort {{path/to/file}} | uniq -c | sort -nr`\n
unlink
unlink(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training unlink(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON UNLINK(1) User Commands UNLINK(1) NAME top unlink - call the unlink function to remove the specified file SYNOPSIS top unlink FILE unlink OPTION DESCRIPTION top Call the unlink function to remove the specified FILE. --help display this help and exit --version output version information and exit AUTHOR top Written by Michael Stone. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top unlink(2) Full documentation <https://www.gnu.org/software/coreutils/unlink> or available locally via: info '(coreutils) unlink invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 UNLINK(1) Pages that refer to this page: rm(1), unlink(2), remove(3) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# unlink\n\n> Remove a link to a file from the filesystem.\n> The file contents is lost if the link is the last one to the file.\n> More information: <https://www.gnu.org/software/coreutils/unlink>.\n\n- Remove the specified file if it is the last link:\n\n`unlink {{path/to/file}}`\n
unset
unset(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training unset(1p) Linux manual page PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES OF ERRORS | APPLICATION USAGE | EXAMPLES | RATIONALE | FUTURE DIRECTIONS | SEE ALSO | COPYRIGHT UNSET(1P) POSIX Programmer's Manual UNSET(1P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME top unset unset values and attributes of variables and functions SYNOPSIS top unset [-fv] name... DESCRIPTION top Each variable or function specified by name shall be unset. If -v is specified, name refers to a variable name and the shell shall unset it and remove it from the environment. Read-only variables cannot be unset. If -f is specified, name refers to a function and the shell shall unset the function definition. If neither -f nor -v is specified, name refers to a variable; if a variable by that name does not exist, it is unspecified whether a function by that name, if any, shall be unset. Unsetting a variable or function that was not previously set shall not be considered an error and does not cause the shell to abort. The unset special built-in shall support the Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines. Note that: VARIABLE= is not equivalent to an unset of VARIABLE; in the example, VARIABLE is set to "". Also, the variables that can be unset should not be misinterpreted to include the special parameters (see Section 2.5.2, Special Parameters). OPTIONS top See the DESCRIPTION. OPERANDS top See the DESCRIPTION. STDIN top Not used. INPUT FILES top None. ENVIRONMENT VARIABLES top None. ASYNCHRONOUS EVENTS top Default. STDOUT top Not used. STDERR top The standard error shall be used only for diagnostic messages. OUTPUT FILES top None. EXTENDED DESCRIPTION top None. EXIT STATUS top 0 All name operands were successfully unset. >0 At least one name could not be unset. CONSEQUENCES OF ERRORS top Default. The following sections are informative. APPLICATION USAGE top None. EXAMPLES top Unset VISUAL variable: unset -v VISUAL Unset the functions foo and bar: unset -f foo bar RATIONALE top Consideration was given to omitting the -f option in favor of an unfunction utility, but the standard developers decided to retain historical practice. The -v option was introduced because System V historically used one name space for both variables and functions. When unset is used without options, System V historically unset either a function or a variable, and there was no confusion about which one was intended. A portable POSIX application can use unset without an option to unset a variable, but not a function; the -f option must be used. FUTURE DIRECTIONS top None. SEE ALSO top Section 2.14, Special Built-In Utilities The Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines COPYRIGHT top Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE/The Open Group 2017 UNSET(1P) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# unset\n\n> Remove shell variables or functions.\n> More information: <https://manned.org/unset>.\n\n- Remove the variable `foo`, or if the variable doesn't exist, remove the function `foo`:\n\n`unset {{foo}}`\n\n- Remove the variables foo and bar:\n\n`unset -v {{foo}} {{bar}}`\n\n- Remove the function my_func:\n\n`unset -f {{my_func}}`\n
unshare
unshare(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training unshare(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | NOTES | EXAMPLES | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY UNSHARE(1) User Commands UNSHARE(1) NAME top unshare - run program in new namespaces SYNOPSIS top unshare [options] [program [arguments]] DESCRIPTION top The unshare command creates new namespaces (as specified by the command-line options described below) and then executes the specified program. If program is not given, then "${SHELL}" is run (default: /bin/sh). By default, a new namespace persists only as long as it has member processes. A new namespace can be made persistent even when it has no member processes by bind mounting /proc/pid/ns/type files to a filesystem path. A namespace that has been made persistent in this way can subsequently be entered with nsenter(1) even after the program terminates (except PID namespaces where a permanently running init process is required). Once a persistent namespace is no longer needed, it can be unpersisted by using umount(8) to remove the bind mount. See the EXAMPLES section for more details. unshare since util-linux version 2.36 uses /proc/[pid]/ns/pid_for_children and /proc/[pid]/ns/time_for_children files for persistent PID and TIME namespaces. This change requires Linux kernel 4.17 or newer. The following types of namespaces can be created with unshare: mount namespace Mounting and unmounting filesystems will not affect the rest of the system, except for filesystems which are explicitly marked as shared (with mount --make-shared; see /proc/self/mountinfo or findmnt -o+PROPAGATION for the shared flags). For further details, see mount_namespaces(7). unshare since util-linux version 2.27 automatically sets propagation to private in a new mount namespace to make sure that the new namespace is really unshared. Its possible to disable this feature with option --propagation unchanged. Note that private is the kernel default. UTS namespace Setting hostname or domainname will not affect the rest of the system. For further details, see uts_namespaces(7). IPC namespace The process will have an independent namespace for POSIX message queues as well as System V message queues, semaphore sets and shared memory segments. For further details, see ipc_namespaces(7). network namespace The process will have independent IPv4 and IPv6 stacks, IP routing tables, firewall rules, the /proc/net and /sys/class/net directory trees, sockets, etc. For further details, see network_namespaces(7). PID namespace Children will have a distinct set of PID-to-process mappings from their parent. For further details, see pid_namespaces(7). cgroup namespace The process will have a virtualized view of /proc/self/cgroup, and new cgroup mounts will be rooted at the namespace cgroup root. For further details, see cgroup_namespaces(7). user namespace The process will have a distinct set of UIDs, GIDs and capabilities. For further details, see user_namespaces(7). time namespace The process can have a distinct view of CLOCK_MONOTONIC and/or CLOCK_BOOTTIME which can be changed using /proc/self/timens_offsets. For further details, see time_namespaces(7). OPTIONS top -i, --ipc[=file] Create a new IPC namespace. If file is specified, then the namespace is made persistent by creating a bind mount at file. -m, --mount[=file] Create a new mount namespace. If file is specified, then the namespace is made persistent by creating a bind mount at file. Note that file must be located on a mount whose propagation type is not shared (or an error results). Use the command findmnt -o+PROPAGATION when not sure about the current setting. See also the examples below. -n, --net[=file] Create a new network namespace. If file is specified, then the namespace is made persistent by creating a bind mount at file. -p, --pid[=file] Create a new PID namespace. If file is specified, then the namespace is made persistent by creating a bind mount at file. (Creation of a persistent PID namespace will fail if the --fork option is not also specified.) See also the --fork and --mount-proc options. -u, --uts[=file] Create a new UTS namespace. If file is specified, then the namespace is made persistent by creating a bind mount at file. -U, --user[=file] Create a new user namespace. If file is specified, then the namespace is made persistent by creating a bind mount at file. -C, --cgroup[=file] Create a new cgroup namespace. If file is specified, then the namespace is made persistent by creating a bind mount at file. -T, --time[=file] Create a new time namespace. If file is specified, then the namespace is made persistent by creating a bind mount at file. The --monotonic and --boottime options can be used to specify the corresponding offset in the time namespace. -f, --fork Fork the specified program as a child process of unshare rather than running it directly. This is useful when creating a new PID namespace. Note that when unshare is waiting for the child process, then it ignores SIGINT and SIGTERM and does not forward any signals to the child. It is necessary to send signals to the child process. --keep-caps When the --user option is given, ensure that capabilities granted in the user namespace are preserved in the child process. --kill-child[=signame] When unshare terminates, have signame be sent to the forked child process. Combined with --pid this allows for an easy and reliable killing of the entire process tree below unshare. If not given, signame defaults to SIGKILL. This option implies --fork. --mount-proc[=mountpoint] Just before running the program, mount the proc filesystem at mountpoint (default is /proc). This is useful when creating a new PID namespace. It also implies creating a new mount namespace since the /proc mount would otherwise mess up existing programs on the system. The new proc filesystem is explicitly mounted as private (with MS_PRIVATE|MS_REC). --map-user=uid|name Run the program only after the current effective user ID has been mapped to uid. If this option is specified multiple times, the last occurrence takes precedence. This option implies --user. --map-users=inneruid:outeruid:count|auto|all Run the program only after the block of user IDs of size count beginning at outeruid has been mapped to the block of user IDs beginning at inneruid. This mapping is created with newuidmap(1) if unshare was run unprivileged. If the range of user IDs overlaps with the mapping specified by --map-user, then a "hole" will be removed from the mapping. This may result in the highest user ID of the mapping not being mapped. Use --map-users multiple times to map more than one block of user IDs. The special value auto will map the first block of user IDs owned by the effective user from /etc/subuid to a block starting at user ID 0. The special value all will create a pass-through map for every user ID available in the parent namespace. This option implies --user. Before util-linux version 2.39, this option expected a comma-separated argument of the form outeruid,inneruid,count but that format is now deprecated for consistency with the ordering used in /proc/[pid]/uid_map and the X-mount.idmap mount option. --map-group=gid|name Run the program only after the current effective group ID has been mapped to gid. If this option is specified multiple times, the last occurrence takes precedence. This option implies --setgroups=deny and --user. --map-groups=innergid:outergid:count|auto|all Run the program only after the block of group IDs of size count beginning at outergid has been mapped to the block of group IDs beginning at innergid. This mapping is created with newgidmap(1) if unshare was run unprivileged. If the range of group IDs overlaps with the mapping specified by --map-group, then a "hole" will be removed from the mapping. This may result in the highest group ID of the mapping not being mapped. Use --map-groups multiple times to map more than one block of group IDs. The special value auto will map the first block of user IDs owned by the effective user from /etc/subgid to a block starting at group ID 0. The special value all will create a pass-through map for every group ID available in the parent namespace. This option implies --user. Before util-linux version 2.39, this option expected a comma-separated argument of the form outergid,innergid,count but that format is now deprecated for consistency with the ordering used in /proc/[pid]/gid_map and the X-mount.idmap mount option. --map-auto Map the first block of user IDs owned by the effective user from /etc/subuid to a block starting at user ID 0. In the same manner, also map the first block of group IDs owned by the effective group from /etc/subgid to a block starting at group ID 0. This option is intended to handle the common case where the first block of subordinate user and group IDs can map the whole user and group ID space. This option is equivalent to specifying --map-users=auto and --map-groups=auto. -r, --map-root-user Run the program only after the current effective user and group IDs have been mapped to the superuser UID and GID in the newly created user namespace. This makes it possible to conveniently gain capabilities needed to manage various aspects of the newly created namespaces (such as configuring interfaces in the network namespace or mounting filesystems in the mount namespace) even when run unprivileged. As a mere convenience feature, it does not support more sophisticated use cases, such as mapping multiple ranges of UIDs and GIDs. This option implies --setgroups=deny and --user. This option is equivalent to --map-user=0 --map-group=0. -c, --map-current-user Run the program only after the current effective user and group IDs have been mapped to the same UID and GID in the newly created user namespace. This option implies --setgroups=deny and --user. This option is equivalent to --map-user=$(id -ru) --map-group=$(id -rg). --propagation private|shared|slave|unchanged Recursively set the mount propagation flag in the new mount namespace. The default is to set the propagation to private. It is possible to disable this feature with the argument unchanged. The option is silently ignored when the mount namespace (--mount) is not requested. --setgroups allow|deny Allow or deny the setgroups(2) system call in a user namespace. To be able to call setgroups(2), the calling process must at least have CAP_SETGID. But since Linux 3.19 a further restriction applies: the kernel gives permission to call setgroups(2) only after the GID map (/proc/pid*/gid_map*) has been set. The GID map is writable by root when setgroups(2) is enabled (i.e., allow, the default), and the GID map becomes writable by unprivileged processes when setgroups(2) is permanently disabled (with deny). -R, --root=dir run the command with root directory set to dir. -w, --wd=dir change working directory to dir. -S, --setuid uid Set the user ID which will be used in the entered namespace. -G, --setgid gid Set the group ID which will be used in the entered namespace and drop supplementary groups. --monotonic offset Set the offset of CLOCK_MONOTONIC which will be used in the entered time namespace. This option requires unsharing a time namespace with --time. --boottime offset Set the offset of CLOCK_BOOTTIME which will be used in the entered time namespace. This option requires unsharing a time namespace with --time. -h, --help Display help text and exit. -V, --version Print version and exit. NOTES top The proc and sysfs filesystems mounting as root in a user namespace have to be restricted so that a less privileged user cannot get more access to sensitive files that a more privileged user made unavailable. In short the rule for proc and sysfs is as close to a bind mount as possible. EXAMPLES top The following command creates a PID namespace, using --fork to ensure that the executed command is performed in a child process that (being the first process in the namespace) has PID 1. The --mount-proc option ensures that a new mount namespace is also simultaneously created and that a new proc(5) filesystem is mounted that contains information corresponding to the new PID namespace. When the readlink(1) command terminates, the new namespaces are automatically torn down. # unshare --fork --pid --mount-proc readlink /proc/self 1 As an unprivileged user, create a new user namespace where the users credentials are mapped to the root IDs inside the namespace: $ id -u; id -g 1000 1000 $ unshare --user --map-root-user \ sh -c 'whoami; cat /proc/self/uid_map /proc/self/gid_map' root 0 1000 1 0 1000 1 As an unprivileged user, create a user namespace where the first 65536 IDs are all mapped, and the users credentials are mapped to the root IDs inside the namespace. The map is determined by the subordinate IDs assigned in subuid(5) and subgid(5). Demonstrate this mapping by creating a file with user ID 1 and group ID 1. For brevity, only the user ID mappings are shown: $ id -u 1000 $ cat /etc/subuid 1000:100000:65536 $ unshare --user --map-auto --map-root-user # id -u 0 # cat /proc/self/uid_map 0 1000 1 1 100000 65535 # touch file; chown 1:1 file # ls -ln --time-style=+ file -rw-r--r-- 1 1 1 0 file # exit $ ls -ln --time-style=+ file -rw-r--r-- 1 100000 100000 0 file The first of the following commands creates a new persistent UTS namespace and modifies the hostname as seen in that namespace. The namespace is then entered with nsenter(1) in order to display the modified hostname; this step demonstrates that the UTS namespace continues to exist even though the namespace had no member processes after the unshare command terminated. The namespace is then destroyed by removing the bind mount. # touch /root/uts-ns # unshare --uts=/root/uts-ns hostname FOO # nsenter --uts=/root/uts-ns hostname FOO # umount /root/uts-ns The following commands establish a persistent mount namespace referenced by the bind mount /root/namespaces/mnt. In order to ensure that the creation of that bind mount succeeds, the parent directory (/root/namespaces) is made a bind mount whose propagation type is not shared. # mount --bind /root/namespaces /root/namespaces # mount --make-private /root/namespaces # touch /root/namespaces/mnt # unshare --mount=/root/namespaces/mnt The following commands demonstrate the use of the --kill-child option when creating a PID namespace, in order to ensure that when unshare is killed, all of the processes within the PID namespace are killed. # set +m # Don't print job status messages # unshare --pid --fork --mount-proc --kill-child -- \ bash --norc -c '(sleep 555 &) && (ps a &) && sleep 999' & [1] 53456 # PID TTY STAT TIME COMMAND 1 pts/3 S+ 0:00 sleep 999 3 pts/3 S+ 0:00 sleep 555 5 pts/3 R+ 0:00 ps a # ps h -o 'comm' $! # Show that background job is unshare(1) unshare # kill $! # Kill unshare(1) # pidof sleep The pidof(1) command prints no output, because the sleep processes have been killed. More precisely, when the sleep process that has PID 1 in the namespace (i.e., the namespaces init process) was killed, this caused all other processes in the namespace to be killed. By contrast, a similar series of commands where the --kill-child option is not used shows that when unshare terminates, the processes in the PID namespace are not killed: # unshare --pid --fork --mount-proc -- \ bash --norc -c '(sleep 555 &) && (ps a &) && sleep 999' & [1] 53479 # PID TTY STAT TIME COMMAND 1 pts/3 S+ 0:00 sleep 999 3 pts/3 S+ 0:00 sleep 555 5 pts/3 R+ 0:00 ps a # kill $! # pidof sleep 53482 53480 The following example demonstrates the creation of a time namespace where the boottime clock is set to a point several years in the past: # uptime -p # Show uptime in initial time namespace up 21 hours, 30 minutes # unshare --time --fork --boottime 300000000 uptime -p up 9 years, 28 weeks, 1 day, 2 hours, 50 minutes AUTHORS top Mikhail Gusarov <[email protected]>, Karel Zak <[email protected]> SEE ALSO top newuidmap(1), newgidmap(1), clone(2), unshare(2), namespaces(7), mount(8) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The unshare command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is part of the util-linux (a random collection of Linux utilities) project. Information about the project can be found at https://www.kernel.org/pub/linux/utils/util-linux/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-14.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] util-linux 2.39.1041-8a7c 2023-12-22 UNSHARE(1) Pages that refer to this page: unshare(2), cgroup_namespaces(7), ipc_namespaces(7), mount_namespaces(7), namespaces(7), network_namespaces(7), time_namespaces(7), uts_namespaces(7), findmnt(8), lsns(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# unshare\n\n> Execute a command in new user-defined namespaces.\n> More information: <https://www.kernel.org/doc/html/latest/userspace-api/unshare.html>.\n\n- Execute a command without sharing access to connected networks:\n\n`unshare --net {{command}} {{command_arguments}}`\n\n- Execute a command as a child process without sharing mounts, processes, or networks:\n\n`unshare --mount --pid --net --fork {{command}} {{command_arguments}}`\n
update-alternatives
update-alternatives(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training update-alternatives(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | TERMINOLOGY | COMMANDS | OPTIONS | EXIT STATUS | ENVIRONMENT | FILES | QUERY FORMAT | DIAGNOSTICS | EXAMPLES | SEE ALSO | COLOPHON update-alternatives(1) dpkg suite update-alternatives(1) NAME top update-alternatives - maintain symbolic links determining default commands SYNOPSIS top update-alternatives [option...] command DESCRIPTION top update-alternatives creates, removes, maintains and displays information about the symbolic links comprising the alternatives system. It is possible for several programs fulfilling the same or similar functions to be installed on a single system at the same time. For example, many systems have several text editors installed at once. This gives choice to the users of a system, allowing each to use a different editor, if desired, but makes it difficult for a program to make a good choice for an editor to invoke if the user has not specified a particular preference. The alternatives system aims to solve this problem. A generic name in the filesystem is shared by all files providing interchangeable functionality. The alternatives system and the system administrator together determine which actual file is referenced by this generic name. For example, if the text editors ed(1) and nvi(1) are both installed on the system, the alternatives system will cause the generic name /usr/bin/editor to refer to /usr/bin/nvi by default. The system administrator can override this and cause it to refer to /usr/bin/ed instead, and the alternatives system will not alter this setting until explicitly requested to do so. The generic name is not a direct symbolic link to the selected alternative. Instead, it is a symbolic link to a name in the alternatives directory, which in turn is a symbolic link to the actual file referenced. This is done so that the system administrator's changes can be confined within the /usr/local/etc directory: the FHS (q.v.) gives reasons why this is a Good Thing. When each package providing a file with a particular functionality is installed, changed or removed, update- alternatives is called to update information about that file in the alternatives system. update-alternatives is usually called from the following Debian package maintainer scripts, postinst (configure) to install the alternative and from prerm and postrm (remove) to remove the alternative. Note: in most (if not all) cases no other maintainer script actions should call update- alternatives, in particular neither of upgrade nor disappear, as any other such action can lose the manual state of an alternative, or make the alternative temporarily flip-flop, or completely switch when several of them have the same priority. It is often useful for a number of alternatives to be synchronized, so that they are changed as a group; for example, when several versions of the vi(1) editor are installed, the manual page referenced by /usr/share/man/man1/vi.1 should correspond to the executable referenced by /usr/bin/vi. update- alternatives handles this by means of master and slave links; when the master is changed, any associated slaves are changed too. A master link and its associated slaves make up a link group. Each link group is, at any given time, in one of two modes: automatic or manual. When a group is in automatic mode, the alternatives system will automatically decide, as packages are installed and removed, whether and how to update the links. In manual mode, the alternatives system will retain the choice of the administrator and avoid changing the links (except when something is broken). Link groups are in automatic mode when they are first introduced to the system. If the system administrator makes changes to the system's automatic settings, this will be noticed the next time update-alternatives is run on the changed link's group, and the group will automatically be switched to manual mode. Each alternative has a priority associated with it. When a link group is in automatic mode, the alternatives pointed to by members of the group will be those which have the highest priority. When using the --config option, update-alternatives will list all of the choices for the link group of which given name is the master alternative name. The current choice is marked with a *. You will then be prompted for your choice regarding this link group. Depending on the choice made, the link group might no longer be in auto mode. You will need to use the --auto option in order to return to the automatic mode (or you can rerun --config and select the entry marked as automatic). If you want to configure non-interactively you can use the --set option instead (see below). Different packages providing the same file need to do so cooperatively. In other words, the usage of update-alternatives is mandatory for all involved packages in such case. It is not possible to override some file in a package that does not employ the update-alternatives mechanism. TERMINOLOGY top Since the activities of update-alternatives are quite involved, some specific terms will help to explain its operation. generic name (or alternative link) A name, like /usr/bin/editor, which refers, via the alternatives system, to one of a number of files of similar function. alternative name The name of a symbolic link in the alternatives directory. alternative (or alternative path) The name of a specific file in the filesystem, which may be made accessible via a generic name using the alternatives system. alternatives directory A directory, by default /usr/local/etc/alternatives, containing the symlinks. administrative directory A directory, by default /usr/local/var/lib/dpkg/alternatives, containing update-alternatives' state information. link group A set of related symlinks, intended to be updated as a group. master link The alternative link in a link group which determines how the other links in the group are configured. slave link An alternative link in a link group which is controlled by the setting of the master link. automatic mode When a link group is in automatic mode, the alternatives system ensures that the links in the group point to the highest priority alternative appropriate for the group. manual mode When a link group is in manual mode, the alternatives system will not make any changes to the system administrator's settings. COMMANDS top --install link name path priority [--slave link name path]... Add a group of alternatives to the system. link is the generic name for the master link, name is the name of its symlink in the alternatives directory, and path is the alternative being introduced for the master link. The arguments after --slave are the generic name, symlink name in the alternatives directory and the alternative path for a slave link. Zero or more --slave options, each followed by three arguments, may be specified. Note that the master alternative must exist or the call will fail. However if a slave alternative doesn't exist, the corresponding slave alternative link will simply not be installed (a warning will still be displayed). If some real file is installed where an alternative link has to be installed, it is kept unless --force is used. If the alternative name specified exists already in the alternatives system's records, the information supplied will be added as a new set of alternatives for the group. Otherwise, a new group, set to automatic mode, will be added with this information. If the group is in automatic mode, and the newly added alternatives' priority is higher than any other installed alternatives for this group, the symlinks will be updated to point to the newly added alternatives. --set name path Set the program path as alternative for name. This is equivalent to --config but is non-interactive and thus scriptable. --remove name path Remove an alternative and all of its associated slave links. name is a name in the alternatives directory, and path is an absolute filename to which name could be linked. If name is indeed linked to path, name will be updated to point to another appropriate alternative (and the group is put back in automatic mode), or removed if there is no such alternative left. Associated slave links will be updated or removed, correspondingly. If the link is not currently pointing to path, no links are changed; only the information about the alternative is removed. --remove-all name Remove all alternatives and all of their associated slave links. name is a name in the alternatives directory. --all Call --config on all alternatives. It can be usefully combined with --skip-auto to review and configure all alternatives which are not configured in automatic mode. Broken alternatives are also displayed. Thus a simple way to fix all broken alternatives is to call yes '' | update- alternatives --force --all. --auto name Switch the link group behind the alternative for name to automatic mode. In the process, the master symlink and its slaves are updated to point to the highest priority installed alternatives. --display name Display information about the link group. Information displayed includes the group's mode (auto or manual), the master and slave links, which alternative the master link currently points to, what other alternatives are available (and their corresponding slave alternatives), and the highest priority alternative currently installed. --get-selections List all master alternative names (those controlling a link group) and their status (since version 1.15.0). Each line contains up to 3 fields (separated by one or more spaces). The first field is the alternative name, the second one is the status (either auto or manual), and the last one contains the current choice in the alternative (beware: it's a filename and thus might contain spaces). --set-selections Read configuration of alternatives on standard input in the format generated by --get-selections and reconfigure them accordingly (since version 1.15.0). --query name Display information about the link group like --display does, but in a machine parseable way (since version 1.15.0, see section "QUERY FORMAT" below). --list name Display all targets of the link group. --config name Show available alternatives for a link group and allow the user to interactively select which one to use. The link group is updated. --help Show the usage message and exit. --version Show the version and exit. OPTIONS top --altdir directory Specifies the alternatives directory, when this is to be different from the default. Defaults to /usr/local/etc/alternatives. --admindir directory Specifies the administrative directory, when this is to be different from the default. Defaults to /usr/local/var/lib/dpkg/alternatives if DPKG_ADMINDIR has not been set. --instdir directory Specifies the installation directory where alternatives links will be created (since version 1.20.1). Defaults to / if DPKG_ROOT has not been set. --root directory Specifies the root directory (since version 1.20.1). This also sets the alternatives, installation and administrative directories to match. Defaults to / if DPKG_ROOT has not been set. --log file Specifies the log file (since version 1.15.0), when this is to be different from the default (/usr/local/var/log/alternatives.log). --force Allow replacing or dropping any real file that is installed where an alternative link has to be installed or removed. --skip-auto Skip configuration prompt for alternatives which are properly configured in automatic mode. This option is only relevant with --config or --all. --quiet Do not generate any comments unless errors occur. --verbose Generate more comments about what is being done. --debug Generate even more comments, helpful for debugging, about what is being done (since version 1.19.3). EXIT STATUS top 0 The requested action was successfully performed. 2 Problems were encountered whilst parsing the command line or performing the action. ENVIRONMENT top DPKG_ROOT If set and the --instdir or --root options have not been specified, it will be used as the filesystem root directory. DPKG_ADMINDIR If set and the --admindir option has not been specified, it will be used as the base administrative directory. FILES top /usr/local/etc/alternatives/ The default alternatives directory. Can be overridden by the --altdir option. /usr/local/var/lib/dpkg/alternatives/ The default administration directory. Can be overridden by the --admindir option. QUERY FORMAT top The --query format is using an RFC822-like flat format. It's made of n + 1 stanzas where n is the number of alternatives available in the queried link group. The first stanza contains the following fields: Name: name The alternative name in the alternative directory. Link: link The generic name of the alternative. Slaves: list-of-slaves When this field is present, the next lines hold all slave links associated to the master link of the alternative. There is one slave per line. Each line contains one space, the generic name of the slave alternative, another space, and the path to the slave link. Status: status The status of the alternative (auto or manual). Best: best-choice The path of the best alternative for this link group. Not present if there is no alternatives available. Value: currently-selected-alternative The path of the currently selected alternative. It can also take the magic value none. It is used if the link doesn't exist. The other stanzas describe the available alternatives in the queried link group: Alternative: path-of-this-alternative Path to this stanza's alternative. Priority: priority-value Value of the priority of this alternative. Slaves: list-of-slaves When this field is present, the next lines hold all slave alternatives associated to the master link of the alternative. There is one slave per line. Each line contains one space, the generic name of the slave alternative, another space, and the path to the slave alternative. Example $ update-alternatives --query editor Name: editor Link: /usr/bin/editor Slaves: editor.1.gz /usr/share/man/man1/editor.1.gz editor.fr.1.gz /usr/share/man/fr/man1/editor.1.gz editor.it.1.gz /usr/share/man/it/man1/editor.1.gz editor.pl.1.gz /usr/share/man/pl/man1/editor.1.gz editor.ru.1.gz /usr/share/man/ru/man1/editor.1.gz Status: auto Best: /usr/bin/vim.basic Value: /usr/bin/vim.basic Alternative: /bin/ed Priority: -100 Slaves: editor.1.gz /usr/share/man/man1/ed.1.gz Alternative: /usr/bin/vim.basic Priority: 50 Slaves: editor.1.gz /usr/share/man/man1/vim.1.gz editor.fr.1.gz /usr/share/man/fr/man1/vim.1.gz editor.it.1.gz /usr/share/man/it/man1/vim.1.gz editor.pl.1.gz /usr/share/man/pl/man1/vim.1.gz editor.ru.1.gz /usr/share/man/ru/man1/vim.1.gz DIAGNOSTICS top With --verbose update-alternatives chatters incessantly about its activities on its standard output channel. If problems occur, update-alternatives outputs error messages on its standard error channel and returns an exit status of 2. These diagnostics should be self-explanatory; if you do not find them so, please report this as a bug. EXAMPLES top There are several packages which provide a text editor compatible with vi, for example nvi and vim. Which one is used is controlled by the link group vi, which includes links for the program itself and the associated manual page. To display the available packages which provide vi and the current setting for it, use the --display action: update-alternatives --display vi To choose a particular vi implementation, use this command as root and then select a number from the list: update-alternatives --config vi To go back to having the vi implementation chosen automatically, do this as root: update-alternatives --auto vi SEE ALSO top ln(1), FHS (the Filesystem Hierarchy Standard). COLOPHON top This page is part of the dpkg (Debian Package Manager) project. Information about the project can be found at https://wiki.debian.org/Teams/Dpkg/. If you have a bug report for this manual page, see http://bugs.debian.org/cgi-bin/pkgreport.cgi?src=dpkg. This page was obtained from the project's upstream Git repository git clone https://git.dpkg.org/git/dpkg/dpkg.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-18.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] 1.22.1-2-gddb42 2023-10-30 update-alternatives(1) Pages that refer to this page: dh_installalternatives(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# update-alternatives\n\n> Convenientily maintain symbolic links to determine default commands.\n> More information: <https://manned.org/update-alternatives>.\n\n- Add a symbolic link:\n\n`sudo update-alternatives --install {{path/to/symlink}} {{command_name}} {{path/to/command_binary}} {{priority}}`\n\n- Configure a symbolic link for `java`:\n\n`sudo update-alternatives --config {{java}}`\n\n- Remove a symbolic link:\n\n`sudo update-alternatives --remove {{java}} {{/opt/java/jdk1.8.0_102/bin/java}}`\n\n- Display information about a specified command:\n\n`update-alternatives --display {{java}}`\n\n- Display all commands and their current selection:\n\n`update-alternatives --get-selections`\n
updatedb
updatedb(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training updatedb(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | BUGS | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON UPDATEDB(1) General Commands Manual UPDATEDB(1) NAME top updatedb - update a file name database SYNOPSIS top updatedb [options] DESCRIPTION top This manual page documents the GNU version of updatedb, which updates file name databases used by GNU locate. The file name databases contain lists of files that were in particular directory trees when the databases were last updated. The file name of the default database is determined when locate and updatedb are configured and installed. The frequency with which the databases are updated and the directories for which they contain entries depend on how often updatedb is run, and with which arguments. In networked environments, it often makes sense to build a database at the root of each filesystem, containing the entries for that filesystem. updatedb is then run for each filesystem on the fileserver where that filesystem is on a local disk, to prevent thrashing the network. Users can select which databases locate searches using an environment variable or command line option; see locate(1). Databases cannot be concatenated together. The LOCATE02 database format was introduced in GNU findutils version 4.0 in order to allow machines with different byte orderings to share the databases. GNU locate can read both the old and LOCATE02 database formats, though support for the old pre-4.0 database format will be removed shortly. OPTIONS top --findoptions='-option1 -option2...' Global options to pass on to find. The environment variable FINDOPTIONS also sets this value. Default is none. --localpaths='path1 path2...' Non-network directories to put in the database. Default is /. --netpaths='path1 path2...' Network (NFS, AFS, RFS, etc.) directories to put in the database. The environment variable NETPATHS also sets this value. Default is none. --prunepaths='path1 path2...' Directories to not put in the database, which would otherwise be. Remove any trailing slashes from the path names, otherwise updatedb won't recognise the paths you want to omit (because it uses them as regular expression patterns). The environment variable PRUNEPATHS also sets this value. Default is /tmp /usr/tmp /var/tmp /afs. --prunefs='path...' File systems to not put in the database, which would otherwise be. Note that files are pruned when a file system is reached; any file system mounted under an undesired file system will be ignored. The environment variable PRUNEFS also sets this value. Default is nfs NFS proc. --output=dbfile The database file to build. Default is system-dependent. In Debian GNU/Linux, the default is /var/cache/locate/locatedb. --localuser=user The user to search non-network directories as, using su(1). Default is to search the non-network directories as the current user. You can also use the environment variable LOCALUSER to set this user. --netuser=user The user to search network directories as, using su(1). Default is daemon. You can also use the environment variable NETUSER to set this user. --dbformat=F Create the database in format F. The default format is called LOCATE02. Alternatively the slocate format is also supported. When the slocate format is in use, the database produced is marked as having security level 1. If you want to build a system-wide slocate database, you may want to run updatedb as root. --version Print the version number of updatedb and exit. --help Print a summary of the options to updatedb and exit. BUGS top The updatedb program correctly handles filenames containing newlines, but only if the system's sort command has a working -z option. If you suspect that locate may need to return filenames containing newlines, consider using its --null option. REPORTING BUGS top GNU findutils online help: <https://www.gnu.org/software/findutils/#get-help> Report any translation bugs to <https://translationproject.org/team/> Report any other issue via the form at the GNU Savannah bug tracker: <https://savannah.gnu.org/bugs/?group=findutils> General topics about the GNU findutils package are discussed at the bug-findutils mailing list: <https://lists.gnu.org/mailman/listinfo/bug-findutils> COPYRIGHT top Copyright 1994-2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top find(1), locate(1), xargs(1), locatedb(5) Full documentation <https://www.gnu.org/software/findutils/updatedb> or available locally via: info updatedb COLOPHON top This page is part of the findutils (find utilities) project. Information about the project can be found at http://www.gnu.org/software/findutils/. If you have a bug report for this manual page, see https://savannah.gnu.org/bugs/?group=findutils. This page was obtained from the project's upstream Git repository git://git.savannah.gnu.org/findutils.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-11-11.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] UPDATEDB(1) Pages that refer to this page: find(1), locate(1), xargs(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# updatedb\n\n> Create or update the database used by `locate`.\n> It is usually run daily by cron.\n> More information: <https://manned.org/updatedb>.\n\n- Refresh database content:\n\n`sudo updatedb`\n\n- Display file names as soon as they are found:\n\n`sudo updatedb --verbose`\n
uptime
uptime(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training Another version of this page is provided by the coreutils project uptime(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | FILES | AUTHORS | SEE ALSO | REPORTING BUGS | COLOPHON UPTIME(1) User Commands UPTIME(1) NAME top uptime - Tell how long the system has been running. SYNOPSIS top uptime [options] DESCRIPTION top 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. OPTIONS top -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 -V, --version display version information and exit FILES top /var/run/utmp information about who is currently logged on /proc process information AUTHORS top uptime was written by Larry Greenfield [email protected]. edu and Michael K. Johnson [email protected] SEE ALSO top ps(1), top(1), utmp(5), w(1) REPORTING BUGS top Please send bug reports to [email protected] COLOPHON top This page is part of the procps-ng (/proc filesystem utilities) project. Information about the project can be found at https://gitlab.com/procps-ng/procps. If you have a bug report for this manual page, see https://gitlab.com/procps-ng/procps/blob/master/Documentation/bugs.md. This page was obtained from the project's upstream Git repository https://gitlab.com/procps-ng/procps.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-10-16.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] procps-ng December 2012 UPTIME(1) Pages that refer to this page: htop(1), pcp-uptime(1), tload(1), top(1), w(1), getloadavg(3), proc(5), time_namespaces(7) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# uptime\n\n> Tell how long the system has been running and other information.\n> More information: <https://www.gnu.org/software/coreutils/uptime>.\n\n- Print current time, uptime, number of logged-in users and other information:\n\n`uptime`\n\n- Show only the amount of time the system has been booted for:\n\n`uptime --pretty`\n\n- Print the date and time the system booted up at:\n\n`uptime --since`\n\n- Display version:\n\n`uptime --version`\n
useradd
useradd(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training useradd(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | NOTES | CAVEATS | CONFIGURATION | FILES | EXIT VALUES | SEE ALSO | COLOPHON USERADD(8) System Management Commands USERADD(8) NAME top useradd - create a new user or update default new user information SYNOPSIS top useradd [options] LOGIN useradd -D useradd -D [options] DESCRIPTION top When invoked without the -D option, the useradd command creates a new user account using the values specified on the command line plus the default values from the system. Depending on command line options, the useradd command will update system files and may also create the new user's home directory and copy initial files. By default, a group will also be created for the new user (see -g, -N, -U, and USERGROUPS_ENAB). OPTIONS top The options which apply to the useradd command are: --badname Allow names that do not conform to standards. -b, --base-dir BASE_DIR The default base directory for the system if -d HOME_DIR is not specified. BASE_DIR is concatenated with the account name to define the home directory. If this option is not specified, useradd will use the base directory specified by the HOME variable in /etc/default/useradd, or /home by default. -c, --comment COMMENT Any text string. It is generally a short description of the account, and is currently used as the field for the user's full name. -d, --home-dir HOME_DIR The new user will be created using HOME_DIR as the value for the user's login directory. The default is to append the LOGIN name to BASE_DIR and use that as the login directory name. If the directory HOME_DIR does not exist, then it will be created unless the -M option is specified. -D, --defaults See below, the subsection "Changing the default values". -e, --expiredate EXPIRE_DATE The date on which the user account will be disabled. The date is specified in the format YYYY-MM-DD. If not specified, useradd will use the default expiry date specified by the EXPIRE variable in /etc/default/useradd, or an empty string (no expiry) by default. -f, --inactive INACTIVE defines the number of days after the password exceeded its maximum age where the user is expected to replace this password. The value is stored in the shadow password file. An input of 0 will disable an expired password with no delay. An input of -1 will blank the respective field in the shadow password file. See shadow(5)for more information. If not specified, useradd will use the default inactivity period specified by the INACTIVE variable in /etc/default/useradd, or -1 by default. -F, --add-subids-for-system Update /etc/subuid and /etc/subgid even when creating a system account with -r option. -g, --gid GROUP The name or the number of the user's primary group. The group name must exist. A group number must refer to an already existing group. If not specified, the behavior of useradd will depend on the USERGROUPS_ENAB variable in /etc/login.defs. If this variable is set to yes (or -U/--user-group is specified on the command line), a group will be created for the user, with the same name as her loginname. If the variable is set to no (or -N/--no-user-group is specified on the command line), useradd will set the primary group of the new user to the value specified by the GROUP variable in /etc/default/useradd, or 1000 by default. -G, --groups GROUP1[,GROUP2,...[,GROUPN]]] A list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no intervening whitespace. The groups are subject to the same restrictions as the group given with the -g option. The default is for the user to belong only to the initial group. In addition to passing in the -G flag, you can add the option GROUPS to the file /etc/default/useradd which in turn will add all users to those supplementary groups. -h, --help Display help message and exit. -k, --skel SKEL_DIR The skeleton directory, which contains files and directories to be copied in the user's home directory, when the home directory is created by useradd. This option is only valid if the -m (or --create-home) option is specified. If this option is not set, the skeleton directory is defined by the SKEL variable in /etc/default/useradd or, by default, /etc/skel. If possible, the ACLs and extended attributes are copied. -K, --key KEY=VALUE Overrides /etc/login.defs defaults (UID_MIN, UID_MAX, UMASK, PASS_MAX_DAYS and others). Example: -K PASS_MAX_DAYS =-1 can be used when creating an account to turn off password aging. Multiple -K options can be specified, e.g.: -K UID_MIN =100 -K UID_MAX=499 -l, --no-log-init Do not add the user to the lastlog and faillog databases. By default, the user's entries in the lastlog and faillog databases are reset to avoid reusing the entry from a previously deleted user. If this option is not specified, useradd will also consult the variable LOG_INIT in the /etc/default/useradd if set to no the user will not be added to the lastlog and faillog databases. -m, --create-home Create the user's home directory if it does not exist. The files and directories contained in the skeleton directory (which can be defined with the -k option) will be copied to the home directory. By default, if this option is not specified and CREATE_HOME is not enabled, no home directories are created. The directory where the user's home directory is created must exist and have proper SELinux context and permissions. Otherwise the user's home directory cannot be created or accessed. -M, --no-create-home Do not create the user's home directory, even if the system wide setting from /etc/login.defs (CREATE_HOME) is set to yes. -N, --no-user-group Do not create a group with the same name as the user, but add the user to the group specified by the -g option or by the GROUP variable in /etc/default/useradd. The default behavior (if the -g, -N, and -U options are not specified) is defined by the USERGROUPS_ENAB variable in /etc/login.defs. -o, --non-unique allows the creation of an account with an already existing UID. This option is only valid in combination with the -u option. As a user identity serves as key to map between users on one hand and permissions, file ownerships and other aspects that determine the system's behavior on the other hand, more than one login name will access the account of the given UID. -p, --password PASSWORD defines an initial password for the account. PASSWORD is expected to be encrypted, as returned by crypt (3). Within a shell script, this option allows to create efficiently batches of users. Without this option, the new account will be locked and with no password defined, i.e. a single exclamation mark in the respective field of /etc/shadow. This is a state where the user won't be able to access the account or to define a password himself. Note:Avoid this option on the command line because the password (or encrypted password) will be visible by users listing the processes. You should make sure the password respects the system's password policy. -r, --system Create a system account. System users will be created with no aging information in /etc/shadow, and their numeric identifiers are chosen in the SYS_UID_MIN-SYS_UID_MAX range, defined in /etc/login.defs, instead of UID_MIN-UID_MAX (and their GID counterparts for the creation of groups). Note that useradd will not create a home directory for such a user, regardless of the default setting in /etc/login.defs (CREATE_HOME). You have to specify the -m options if you want a home directory for a system account to be created. Note that this option will not update /etc/subuid and /etc/subgid. You have to specify the -F options if you want to update the files for a system account to be created. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. Only absolute paths are supported. -P, --prefix PREFIX_DIR Apply changes to configuration files under the root filesystem found under the directory PREFIX_DIR. This option does not chroot and is intended for preparing a cross-compilation target. Some limitations: NIS and LDAP users/groups are not verified. PAM authentication is using the host files. No SELINUX support. -s, --shell SHELL sets the path to the user's login shell. Without this option, the system will use the SHELL variable specified in /etc/default/useradd, or, if that is as well not set, the field for the login shell in /etc/passwd remains empty. -u, --uid UID The numerical value of the user's ID. This value must be unique, unless the -o option is used. The value must be non-negative. The default is to use the smallest ID value greater than or equal to UID_MIN and greater than every other user. See also the -r option and the UID_MAX description. -U, --user-group Create a group with the same name as the user, and add the user to this group. The default behavior (if the -g, -N, and -U options are not specified) is defined by the USERGROUPS_ENAB variable in /etc/login.defs. -Z, --selinux-user SEUSER defines the SELinux user for the new account. Without this option, SELinux uses the default user. Note that the shadow system doesn't store the selinux-user, it uses semanage(8) for that. --selinux-range SERANGE defines the SELinux MLS range for the new account. Without this option, SELinux uses the default range. Note that the shadow system doesn't store the selinux-range, it uses semanage(8) for that. This option is only valid if the -Z (or --selinux-user) option is specified. Changing the default values When invoked with only the -D option, useradd will display the current default values. When invoked with -D plus other options, useradd will update the default values for the specified options. Valid default-changing options are: -b, --base-dir BASE_DIR sets the path prefix for a new user's home directory. The user's name will be affixed to the end of BASE_DIR to form the new user's home directory name, if the -d option is not used when creating a new account. This option sets the HOME variable in /etc/default/useradd. -e, --expiredate EXPIRE_DATE sets the date on which newly created user accounts are disabled. This option sets the EXPIRE variable in /etc/default/useradd. -f, --inactive INACTIVE defines the number of days after the password exceeded its maximum age where the user is expected to replace this password. See shadow(5)for more information. This option sets the INACTIVE variable in /etc/default/useradd. -g, --gid GROUP sets the default primary group for newly created users, accepting group names or a numerical group ID. The named group must exist, and the GID must have an existing entry. This option sets the GROUP variable in /etc/default/useradd. -s, --shell SHELL defines the default login shell for new users. This option sets the SHELL variable in /etc/default/useradd. NOTES top The system administrator is responsible for placing the default user files in the /etc/skel/ directory (or any other skeleton directory specified in /etc/default/useradd or on the command line). CAVEATS top You may not add a user to a NIS or LDAP group. This must be performed on the corresponding server. Similarly, if the username already exists in an external user database such as NIS or LDAP, useradd will deny the user account creation request. Usernames may contain only lower and upper case letters, digits, underscores, or dashes. They can end with a dollar sign. Dashes are not allowed at the beginning of the username. Fully numeric usernames and usernames . or .. are also disallowed. It is not recommended to use usernames beginning with . character as their home directories will be hidden in the ls output. Usernames may only be up to 32 characters long. CONFIGURATION top The following configuration variables in /etc/login.defs change the behavior of this tool: CREATE_HOME (boolean) Indicate if a home directory should be created by default for new users. This setting does not apply to system users, and can be overridden on the command line. GID_MAX (number), GID_MIN (number) Range of group IDs used for the creation of regular groups by useradd, groupadd, or newusers. The default value for GID_MIN (resp. GID_MAX) is 1000 (resp. 60000). HOME_MODE (number) The mode for new home directories. If not specified, the UMASK is used to create the mode. useradd and newusers use this to set the mode of the home directory they create. LASTLOG_UID_MAX (number) Highest user ID number for which the lastlog entries should be updated. As higher user IDs are usually tracked by remote user identity and authentication services there is no need to create a huge sparse lastlog file for them. No LASTLOG_UID_MAX option present in the configuration means that there is no user ID limit for writing lastlog entries. MAIL_DIR (string) The mail spool directory. This is needed to manipulate the mailbox when its corresponding user account is modified or deleted. If not specified, a compile-time default is used. The parameter CREATE_MAIL_SPOOL in /etc/default/useradd determines whether the mail spool should be created. MAIL_FILE (string) Defines the location of the users mail spool files relatively to their home directory. The MAIL_DIR and MAIL_FILE variables are used by useradd, usermod, and userdel to create, move, or delete the user's mail spool. MAX_MEMBERS_PER_GROUP (number) Maximum members per group entry. When the maximum is reached, a new group entry (line) is started in /etc/group (with the same name, same password, and same GID). The default value is 0, meaning that there are no limits in the number of members in a group. This feature (split group) permits to limit the length of lines in the group file. This is useful to make sure that lines for NIS groups are not larger than 1024 characters. If you need to enforce such limit, you can use 25. Note: split groups may not be supported by all tools (even in the Shadow toolsuite). You should not use this variable unless you really need it. PASS_MAX_DAYS (number) The maximum number of days a password may be used. If the password is older than this, a password change will be forced. If not specified, -1 will be assumed (which disables the restriction). PASS_MIN_DAYS (number) The minimum number of days allowed between password changes. Any password changes attempted sooner than this will be rejected. If not specified, 0 will be assumed (which disables the restriction). PASS_WARN_AGE (number) The number of days warning given before a password expires. A zero means warning is given only upon the day of expiration, a negative value means no warning is given. If not specified, no warning will be provided. SUB_GID_MIN (number), SUB_GID_MAX (number), SUB_GID_COUNT (number) If /etc/subuid exists, the commands useradd and newusers (unless the user already have subordinate group IDs) allocate SUB_GID_COUNT unused group IDs from the range SUB_GID_MIN to SUB_GID_MAX for each new user. The default values for SUB_GID_MIN, SUB_GID_MAX, SUB_GID_COUNT are respectively 100000, 600100000 and 65536. SUB_UID_MIN (number), SUB_UID_MAX (number), SUB_UID_COUNT (number) If /etc/subuid exists, the commands useradd and newusers (unless the user already have subordinate user IDs) allocate SUB_UID_COUNT unused user IDs from the range SUB_UID_MIN to SUB_UID_MAX for each new user. The default values for SUB_UID_MIN, SUB_UID_MAX, SUB_UID_COUNT are respectively 100000, 600100000 and 65536. SYS_GID_MAX (number), SYS_GID_MIN (number) Range of group IDs used for the creation of system groups by useradd, groupadd, or newusers. The default value for SYS_GID_MIN (resp. SYS_GID_MAX) is 101 (resp. GID_MIN-1). SYS_UID_MAX (number), SYS_UID_MIN (number) Range of user IDs used for the creation of system users by useradd or newusers. The default value for SYS_UID_MIN (resp. SYS_UID_MAX) is 101 (resp. UID_MIN-1). UID_MAX (number), UID_MIN (number) Range of user IDs used for the creation of regular users by useradd or newusers. The default value for UID_MIN (resp. UID_MAX) is 1000 (resp. 60000). UMASK (number) The file mode creation mask is initialized to this value. If not specified, the mask will be initialized to 022. useradd and newusers use this mask to set the mode of the home directory they create if HOME_MODE is not set. It is also used by pam_umask as the default umask value. USERGROUPS_ENAB (boolean) If set to yes, userdel will remove the user's group if it contains no more members, and useradd will create by default a group with the name of the user. FILES top /etc/passwd User account information. /etc/shadow Secure user account information. /etc/group Group account information. /etc/gshadow Secure group account information. /etc/default/useradd Default values for account creation. /etc/shadow-maint/useradd-pre.d/*, /etc/shadow-maint/useradd-post.d/* Run-part files to execute during user addition. The environment variable ACTION will be populated with useradd and SUBJECT with the username. useradd-pre.d will be executed prior to any user addition. useradd-post.d will execute after user addition. If a script exits non-zero then execution will terminate. /etc/skel/ Directory containing default files. /etc/subgid Per user subordinate group IDs. /etc/subuid Per user subordinate user IDs. /etc/login.defs Shadow password suite configuration. EXIT VALUES top The useradd command exits with the following values: 0 success 1 can't update password file 2 invalid command syntax 3 invalid argument to option 4 UID already in use (and no -o) 6 specified group doesn't exist 9 username or group name already in use 10 can't update group file 12 can't create home directory 14 can't update SELinux user mapping SEE ALSO top chfn(1), chsh(1), passwd(1), crypt(3), groupadd(8), groupdel(8), groupmod(8), login.defs(5), newusers(8), subgid(5), subuid(5), userdel(8), usermod(8). COLOPHON top This page is part of the shadow-utils (utilities for managing accounts and shadow password files) project. Information about the project can be found at https://github.com/shadow-maint/shadow. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository https://github.com/shadow-maint/shadow on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-15.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] shadow-utils 4.11.1 12/22/2023 USERADD(8) Pages that refer to this page: getsubids(1), homectl(1), newgidmap(1), newuidmap(1), subgid(5), subuid(5), chpasswd(8), groupadd(8), groupdel(8), groupmems(8), groupmod(8), newusers(8), userdel(8), usermod(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# useradd\n\n> Create a new user.\n> See also: `users`, `userdel`, `usermod`.\n> More information: <https://manned.org/useradd>.\n\n- Create a new user:\n\n`sudo useradd {{username}}`\n\n- Create a new user with the specified user ID:\n\n`sudo useradd --uid {{id}} {{username}}`\n\n- Create a new user with the specified shell:\n\n`sudo useradd --shell {{path/to/shell}} {{username}}`\n\n- Create a new user belonging to additional groups (mind the lack of whitespace):\n\n`sudo useradd --groups {{group1,group2,...}} {{username}}`\n\n- Create a new user with the default home directory:\n\n`sudo useradd --create-home {{username}}`\n\n- Create a new user with the home directory filled by template directory files:\n\n`sudo useradd --skel {{path/to/template_directory}} --create-home {{username}}`\n\n- Create a new system user without the home directory:\n\n`sudo useradd --system {{username}}`\n
userdbctl
userdbctl(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training userdbctl(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | COMMANDS | WELL-KNOWN SERVICES | INTEGRATION WITH SSH | EXIT STATUS | ENVIRONMENT | SEE ALSO | NOTES | COLOPHON USERDBCTL(1) userdbctl USERDBCTL(1) NAME top userdbctl - Inspect users, groups and group memberships SYNOPSIS top userdbctl [OPTIONS...] {COMMAND} [NAME...] DESCRIPTION top userdbctl may be used to inspect user and groups (as well as group memberships) of the system. This client utility inquires user/group information provided by various system services, both operating on JSON user/group records (as defined by the JSON User Records[1] and JSON Group Records[2] definitions), and classic UNIX NSS/glibc user and group records. This tool is primarily a client to the User/Group Record Lookup API via Varlink[3], and may also pick up drop-in JSON user and group records from /etc/userdb/, /run/userdb/, /run/host/userdb/, /usr/lib/userdb/. OPTIONS top The following options are understood: --output=MODE Choose the output mode, takes one of "classic", "friendly", "table", "json". If "classic", an output very close to the format of /etc/passwd or /etc/group is generated. If "friendly" a more comprehensive and user friendly, human readable output is generated; if "table" a minimal, tabular output is generated; if "json" a JSON formatted output is generated. Defaults to "friendly" if a user/group is specified on the command line, "table" otherwise. Note that most output formats do not show all available information. In particular, "classic" and "table" show only the most important fields. Various modes also do not show password hashes. Use "json" to view all fields, including any authentication fields. Added in version 245. --json=FORMAT Selects JSON output mode (like --output=json) and selects the precise display mode. Takes one of "pretty" or "short". If "pretty", human-friendly whitespace and newlines are inserted in the output to make the JSON data more readable. If "short", all superfluous whitespace is suppressed. Added in version 250. --service=SERVICE[:SERVICE...], -s SERVICE:SERVICE... Controls which services to query for users/groups. Takes a list of one or more service names, separated by ":". See below for a list of well-known service names. If not specified all available services are queried at once. Added in version 245. --with-nss=BOOL Controls whether to include classic glibc/NSS user/group lookups in the output. If --with-nss=no is used any attempts to resolve or enumerate users/groups provided only via glibc NSS is suppressed. If --with-nss=yes is specified such users/groups are included in the output (which is the default). Added in version 245. --with-varlink=BOOL Controls whether to include Varlink user/group lookups in the output, i.e. those done via the User/Group Record Lookup API via Varlink[3]. If --with-varlink=no is used any attempts to resolve or enumerate users/groups provided only via Varlink are suppressed. If --with-varlink=yes is specified such users/groups are included in the output (which is the default). Added in version 249. --with-dropin=BOOL Controls whether to include user/group lookups in the output that are defined using drop-in files in /etc/userdb/, /run/userdb/, /run/host/userdb/, /usr/lib/userdb/. If --with-dropin=no is used these records are suppressed. If --with-dropin=yes is specified such users/groups are included in the output (which is the default). Added in version 249. --synthesize=BOOL Controls whether to synthesize records for the root and nobody users/groups if they aren't defined otherwise. By default (or "yes") such records are implicitly synthesized if otherwise missing since they have special significance to the OS. When "no" this synthesizing is turned off. Added in version 245. -N This option is short for --with-nss=no --synthesize=no. Use this option to show only records that are natively defined as JSON user or group records, with all NSS/glibc compatibility and all implicit synthesis turned off. Added in version 245. --multiplexer=BOOL Controls whether to do lookups via the multiplexer service (if specified as true, the default) or do lookups in the client (if specified as false). Using the multiplexer service is typically preferable, since it runs in a locked down sandbox. Added in version 250. --chain When used with the ssh-authorized-keys command, this will allow passing an additional command line after the user name that is chain executed after the lookup completed. This allows chaining multiple tools that show SSH authorized keys. Added in version 250. --no-pager Do not pipe output into a pager. --no-legend Do not print the legend, i.e. column headers and the footer with hints. -h, --help Print a short help text and exit. --version Print a short version string and exit. COMMANDS top The following commands are understood: user [USER...] List all known users records or show details of one or more specified user records. Use --output= to tweak output mode. Added in version 245. group [GROUP...] List all known group records or show details of one or more specified group records. Use --output= to tweak output mode. Added in version 245. users-in-group [GROUP...] List users that are members of the specified groups. If no groups are specified list all user/group memberships defined. Use --output= to tweak output mode. Added in version 245. groups-of-user [USER...] List groups that the specified users are members of. If no users are specified list all user/group memberships defined (in this case groups-of-user and users-in-group are equivalent). Use --output= to tweak output mode. Added in version 245. services List all services currently providing user/group definitions to the system. See below for a list of well-known services providing user information. Added in version 245. ssh-authorized-keys Show SSH authorized keys for this account. This command is intended to be used to allow the SSH daemon to pick up authorized keys from user records, see below. Added in version 245. WELL-KNOWN SERVICES top The userdbctl services command will list all currently running services that provide user or group definitions to the system. The following well-known services are shown among this list: io.systemd.DynamicUser This service is provided by the system service manager itself (i.e. PID 1) and makes all users (and their groups) synthesized through the DynamicUser= setting in service unit files available to the system (see systemd.exec(5) for details about this setting). Added in version 245. io.systemd.Home This service is provided by systemd-homed.service(8) and makes all users (and their groups) belonging to home directories managed by that service available to the system. Added in version 245. io.systemd.Machine This service is provided by systemd-machined.service(8) and synthesizes records for all users/groups used by a container that employs user namespacing. Added in version 246. io.systemd.Multiplexer This service is provided by systemd-userdbd.service(8) and multiplexes user/group look-ups to all other running lookup services. This is the primary entry point for user/group record clients, as it simplifies client side implementation substantially since they can ask a single service for lookups instead of asking all running services in parallel. userdbctl uses this service preferably, too, unless --with-nss= or --service= are used, in which case finer control over the services to talk to is required. Added in version 245. io.systemd.NameServiceSwitch This service is (also) provided by systemd-userdbd.service(8) and converts classic NSS/glibc user and group records to JSON user/group records, providing full backwards compatibility. Use --with-nss=no to disable this compatibility, see above. Note that compatibility is actually provided in both directions: nss-systemd(8) will automatically synthesize classic NSS/glibc user/group records from all JSON user/group records provided to the system, thus using both APIs is mostly equivalent and provides access to the same data, however the NSS/glibc APIs necessarily expose a more reduced set of fields only. Added in version 245. io.systemd.DropIn This service is (also) provided by systemd-userdbd.service(8) and picks up JSON user/group records from /etc/userdb/, /run/userdb/, /run/host/userdb/, /usr/lib/userdb/. Added in version 249. Note that userdbctl has internal support for NSS-based lookups too. This means that if neither io.systemd.Multiplexer nor io.systemd.NameServiceSwitch are running look-ups into the basic user/group databases will still work. INTEGRATION WITH SSH top The userdbctl tool may be used to make the list of SSH authorized keys possibly contained in a user record available to the SSH daemon for authentication. For that configure the following in sshd_config(5): ... AuthorizedKeysCommand /usr/bin/userdbctl ssh-authorized-keys %u AuthorizedKeysCommandUser root ... Sometimes it's useful to allow chain invocation of another program to list SSH authorized keys. By using the --chain such a tool may be chain executed by userdbctl ssh-authorized-keys once a lookup completes (regardless if an SSH key was found or not). Example: ... AuthorizedKeysCommand /usr/bin/userdbctl ssh-authorized-keys %u --chain /usr/bin/othertool %u AuthorizedKeysCommandUser root ... The above will first query the userdb database for SSH keys, and then chain execute /usr/bin/othertool to also be queried. EXIT STATUS top On success, 0 is returned, a non-zero failure code otherwise. ENVIRONMENT top $SYSTEMD_LOG_LEVEL The maximum log level of emitted messages (messages with a higher log level, i.e. less important ones, will be suppressed). Either one of (in order of decreasing importance) emerg, alert, crit, err, warning, notice, info, debug, or an integer in the range 0...7. See syslog(3) for more information. $SYSTEMD_LOG_COLOR A boolean. If true, messages written to the tty will be colored according to priority. This setting is only useful when messages are written directly to the terminal, because journalctl(1) and other tools that display logs will color messages based on the log level on their own. $SYSTEMD_LOG_TIME A boolean. If true, console log messages will be prefixed with a timestamp. This setting is only useful when messages are written directly to the terminal or a file, because journalctl(1) and other tools that display logs will attach timestamps based on the entry metadata on their own. $SYSTEMD_LOG_LOCATION A boolean. If true, messages will be prefixed with a filename and line number in the source code where the message originates. Note that the log location is often attached as metadata to journal entries anyway. Including it directly in the message text can nevertheless be convenient when debugging programs. $SYSTEMD_LOG_TID A boolean. If true, messages will be prefixed with the current numerical thread ID (TID). Note that the this information is attached as metadata to journal entries anyway. Including it directly in the message text can nevertheless be convenient when debugging programs. $SYSTEMD_LOG_TARGET The destination for log messages. One of console (log to the attached tty), console-prefixed (log to the attached tty but with prefixes encoding the log level and "facility", see syslog(3), kmsg (log to the kernel circular log buffer), journal (log to the journal), journal-or-kmsg (log to the journal if available, and to kmsg otherwise), auto (determine the appropriate log target automatically, the default), null (disable log output). $SYSTEMD_LOG_RATELIMIT_KMSG Whether to ratelimit kmsg or not. Takes a boolean. Defaults to "true". If disabled, systemd will not ratelimit messages written to kmsg. $SYSTEMD_PAGER Pager to use when --no-pager is not given; overrides $PAGER. If neither $SYSTEMD_PAGER nor $PAGER are set, a set of well-known pager implementations are tried in turn, including less(1) and more(1), until one is found. If no pager implementation is discovered no pager is invoked. Setting this environment variable to an empty string or the value "cat" is equivalent to passing --no-pager. Note: if $SYSTEMD_PAGERSECURE is not set, $SYSTEMD_PAGER (as well as $PAGER) will be silently ignored. $SYSTEMD_LESS Override the options passed to less (by default "FRSXMK"). Users might want to change two options in particular: K This option instructs the pager to exit immediately when Ctrl+C is pressed. To allow less to handle Ctrl+C itself to switch back to the pager command prompt, unset this option. If the value of $SYSTEMD_LESS does not include "K", and the pager that is invoked is less, Ctrl+C will be ignored by the executable, and needs to be handled by the pager. X This option instructs the pager to not send termcap initialization and deinitialization strings to the terminal. It is set by default to allow command output to remain visible in the terminal even after the pager exits. Nevertheless, this prevents some pager functionality from working, in particular paged output cannot be scrolled with the mouse. See less(1) for more discussion. $SYSTEMD_LESSCHARSET Override the charset passed to less (by default "utf-8", if the invoking terminal is determined to be UTF-8 compatible). $SYSTEMD_PAGERSECURE Takes a boolean argument. When true, the "secure" mode of the pager is enabled; if false, disabled. If $SYSTEMD_PAGERSECURE is not set at all, secure mode is enabled if the effective UID is not the same as the owner of the login session, see geteuid(2) and sd_pid_get_owner_uid(3). In secure mode, LESSSECURE=1 will be set when invoking the pager, and the pager shall disable commands that open or create new files or start new subprocesses. When $SYSTEMD_PAGERSECURE is not set at all, pagers which are not known to implement secure mode will not be used. (Currently only less(1) implements secure mode.) Note: when commands are invoked with elevated privileges, for example under sudo(8) or pkexec(1), care must be taken to ensure that unintended interactive features are not enabled. "Secure" mode for the pager may be enabled automatically as describe above. Setting SYSTEMD_PAGERSECURE=0 or not removing it from the inherited environment allows the user to invoke arbitrary commands. Note that if the $SYSTEMD_PAGER or $PAGER variables are to be honoured, $SYSTEMD_PAGERSECURE must be set too. It might be reasonable to completely disable the pager using --no-pager instead. $SYSTEMD_COLORS Takes a boolean argument. When true, systemd and related utilities will use colors in their output, otherwise the output will be monochrome. Additionally, the variable can take one of the following special values: "16", "256" to restrict the use of colors to the base 16 or 256 ANSI colors, respectively. This can be specified to override the automatic decision based on $TERM and what the console is connected to. $SYSTEMD_URLIFY The value must be a boolean. Controls whether clickable links should be generated in the output for terminal emulators supporting this. This can be specified to override the decision that systemd makes based on $TERM and other conditions. SEE ALSO top systemd(1), systemd-userdbd.service(8), systemd-homed.service(8), nss-systemd(8), getent(1) NOTES top 1. JSON User Records https://systemd.io/USER_RECORD 2. JSON Group Records https://systemd.io/GROUP_RECORD 3. User/Group Record Lookup API via Varlink https://systemd.io/USER_GROUP_API COLOPHON top This page is part of the systemd (systemd system and service manager) project. Information about the project can be found at http://www.freedesktop.org/wiki/Software/systemd. If you have a bug report for this manual page, see http://www.freedesktop.org/wiki/Software/systemd/#bugreports. This page was obtained from the project's upstream Git repository https://github.com/systemd/systemd.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-22.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] systemd 255 USERDBCTL(1) Pages that refer to this page: homectl(1), systemd.directives(7), systemd.index(7), systemd-homed.service(8), systemd-machined.service(8), systemd-userdbd.service(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# userdbctl\n\n> Inspect users, groups and group memberships on the system.\n> More information: <https://www.freedesktop.org/software/systemd/man/userdbctl.html>.\n\n- List all known user records:\n\n`userdbctl user`\n\n- Show details of a specific user:\n\n`userdbctl user {{username}}`\n\n- List all known groups:\n\n`userdbctl group`\n\n- Show details of a specific group:\n\n`userdbctl group {{groupname}}`\n\n- List all services currently providing user/group definitions to the system:\n\n`userdbctl services`\n
userdel
userdel(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training userdel(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | CONFIGURATION | FILES | EXIT VALUES | CAVEATS | SEE ALSO | COLOPHON USERDEL(8) System Management Commands USERDEL(8) NAME top userdel - delete a user account and related files SYNOPSIS top userdel [options] LOGIN DESCRIPTION top The userdel command modifies the system account files, deleting all entries that refer to the user name LOGIN. The named user must exist. OPTIONS top The options which apply to the userdel command are: -f, --force This option forces the removal of the user account, even if the user is still logged in. It also forces userdel to remove the user's home directory and mail spool, even if another user uses the same home directory or if the mail spool is not owned by the specified user. If USERGROUPS_ENAB is defined to yes in /etc/login.defs and if a group exists with the same name as the deleted user, then this group will be removed, even if it is still the primary group of another user. Note: This option is dangerous and may leave your system in an inconsistent state. -h, --help Display help message and exit. -r, --remove Files in the user's home directory will be removed along with the home directory itself and the user's mail spool. Files located in other file systems will have to be searched for and deleted manually. The mail spool is defined by the MAIL_DIR variable in the login.defs file. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. Only absolute paths are supported. -P, --prefix PREFIX_DIR Apply changes in the PREFIX_DIR directory and use the configuration files from the PREFIX_DIR directory. This option does not chroot and is intended for preparing a cross-compilation target. Some limitations: NIS and LDAP users/groups are not verified. PAM authentication is using the host files. No SELINUX support. -Z, --selinux-user Remove any SELinux user mapping for the user's login. CONFIGURATION top The following configuration variables in /etc/login.defs change the behavior of this tool: MAIL_DIR (string) The mail spool directory. This is needed to manipulate the mailbox when its corresponding user account is modified or deleted. If not specified, a compile-time default is used. The parameter CREATE_MAIL_SPOOL in /etc/default/useradd determines whether the mail spool should be created. MAIL_FILE (string) Defines the location of the users mail spool files relatively to their home directory. The MAIL_DIR and MAIL_FILE variables are used by useradd, usermod, and userdel to create, move, or delete the user's mail spool. MAX_MEMBERS_PER_GROUP (number) Maximum members per group entry. When the maximum is reached, a new group entry (line) is started in /etc/group (with the same name, same password, and same GID). The default value is 0, meaning that there are no limits in the number of members in a group. This feature (split group) permits to limit the length of lines in the group file. This is useful to make sure that lines for NIS groups are not larger than 1024 characters. If you need to enforce such limit, you can use 25. Note: split groups may not be supported by all tools (even in the Shadow toolsuite). You should not use this variable unless you really need it. USERDEL_CMD (string) If defined, this command is run when removing a user. It should remove any at/cron/print jobs etc. owned by the user to be removed (passed as the first argument). The return code of the script is not taken into account. Here is an example script, which removes the user's cron, at and print jobs: #! /bin/sh # Check for the required argument. if [ $# != 1 ]; then echo "Usage: $0 username" exit 1 fi # Remove cron jobs. crontab -r -u $1 # Remove at jobs. # Note that it will remove any jobs owned by the same UID, # even if it was shared by a different username. AT_SPOOL_DIR=/var/spool/cron/atjobs find $AT_SPOOL_DIR -name "[^.]*" -type f -user $1 -delete \; # Remove print jobs. lprm $1 # All done. exit 0 USERGROUPS_ENAB (boolean) If set to yes, userdel will remove the user's group if it contains no more members, and useradd will create by default a group with the name of the user. FILES top /etc/group Group account information. /etc/login.defs Shadow password suite configuration. /etc/passwd User account information. /etc/shadow Secure user account information. /etc/shadow-maint/userdel-pre.d/*, /etc/shadow-maint/userdel-post.d/* Run-part files to execute during user deletion. The environment variable ACTION will be populated with userdel and SUBJECT with the username. userdel-pre.d will be executed prior to any user deletion. userdel-post.d will execute after user deletion. If a script exits non-zero then execution will terminate. /etc/subgid Per user subordinate group IDs. /etc/subuid Per user subordinate user IDs. EXIT VALUES top The userdel command exits with the following values: 0 success 1 can't update password file 2 invalid command syntax 6 specified user doesn't exist 8 user currently logged in 10 can't update group file 12 can't remove home directory CAVEATS top userdel will not allow you to remove an account if there are running processes which belong to this account. In that case, you may have to kill those processes or lock the user's password or account and remove the account later. The -f option can force the deletion of this account. You should manually check all file systems to ensure that no files remain owned by this user. You may not remove any NIS attributes on a NIS client. This must be performed on the NIS server. If USERGROUPS_ENAB is defined to yes in /etc/login.defs, userdel will delete the group with the same name as the user. To avoid inconsistencies in the passwd and group databases, userdel will check that this group is not used as a primary group for another user, and will just warn without deleting the group otherwise. The -f option can force the deletion of this group. SEE ALSO top chfn(1), chsh(1), passwd(1), login.defs(5), gpasswd(8), groupadd(8), groupdel(8), groupmod(8), subgid(5), subuid(5), useradd(8), usermod(8). COLOPHON top This page is part of the shadow-utils (utilities for managing accounts and shadow password files) project. Information about the project can be found at https://github.com/shadow-maint/shadow. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository https://github.com/shadow-maint/shadow on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-15.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] shadow-utils 4.11.1 12/22/2023 USERDEL(8) Pages that refer to this page: getsubids(1), newgidmap(1), newuidmap(1), subgid(5), subuid(5), groupadd(8), groupdel(8), groupmems(8), groupmod(8), useradd(8), usermod(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# userdel\n\n> Remove a user account or remove a user from a group.\n> See also: `users`, `useradd`, `usermod`.\n> More information: <https://manned.org/userdel>.\n\n- Remove a user:\n\n`sudo userdel {{username}}`\n\n- Remove a user in other root directory:\n\n`sudo userdel --root {{path/to/other/root}} {{username}}`\n\n- Remove a user along with the home directory and mail spool:\n\n`sudo userdel --remove {{username}}`\n
usermod
usermod(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training usermod(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | CAVEATS | CONFIGURATION | FILES | SEE ALSO | COLOPHON USERMOD(8) System Management Commands USERMOD(8) NAME top usermod - modify a user account SYNOPSIS top usermod [options] LOGIN DESCRIPTION top The usermod command modifies the system account files. OPTIONS top The options which apply to the usermod command are: -a, --append Add the user to the supplementary group(s). Use only with the -G option. -b, --badname Allow names that do not conform to standards. -c, --comment COMMENT update the comment field of the user in /etc/passwd, which is normally modified using the chfn(1) utility. -d, --home HOME_DIR The user's new login directory. If the -m option is given, the contents of the current home directory will be moved to the new home directory, which is created if it does not already exist. If the current home directory does not exist the new home directory will not be created. -e, --expiredate EXPIRE_DATE The date on which the user account will be disabled. The date is specified in the format YYYY-MM-DD. Integers as input are interpreted as days after 1970-01-01. An input of -1 or an empty string will blank the account expiration field in the shadow password file. The account will remain available with no date limit. This option requires a /etc/shadow file. A /etc/shadow entry will be created if there were none. -f, --inactive INACTIVE defines the number of days after the password exceeded its maximum age during which the user may still login by immediately replacing the password. This grace period before the account becomes inactive is stored in the shadow password file. An input of 0 will disable an expired password with no delay. An input of -1 will blank the respective field in the shadow password file. See shadow(5) for more information. This option requires a /etc/shadow file. A /etc/shadow entry will be created if there were none. -g, --gid GROUP The name or numerical ID of the user's new primary group. The group must exist. Any file from the user's home directory owned by the previous primary group of the user will be owned by this new group. The group ownership of files outside of the user's home directory must be fixed manually. The change of the group ownership of files inside of the user's home directory is also not done if the home dir owner uid is different from the current or new user id. This is a safety measure for special home directories such as /. -G, --groups GROUP1[,GROUP2,...[,GROUPN]]] A list of supplementary groups which the user is also a member of. Each group is separated from the next by a comma, with no intervening whitespace. The groups must exist. If the user is currently a member of a group which is not listed, the user will be removed from the group. This behaviour can be changed via the -a option, which appends the user to the current supplementary group list. -l, --login NEW_LOGIN The name of the user will be changed from LOGIN to NEW_LOGIN. Nothing else is changed. In particular, the user's home directory or mail spool should probably be renamed manually to reflect the new login name. -L, --lock Lock a user's password. This puts a '!' in front of the encrypted password, effectively disabling the password. You can't use this option with -p or -U. Note: if you wish to lock the account (not only access with a password), you should also set the EXPIRE_DATE to 1. -m, --move-home moves the content of the user's home directory to the new location. If the current home directory does not exist the new home directory will not be created. This option is only valid in combination with the -d (or --home) option. usermod will try to adapt the ownership of the files and to copy the modes, ACL and extended attributes, but manual changes might be needed afterwards. -o, --non-unique allows to change the user ID to a non-unique value. This option is only valid in combination with the -u option. As a user identity serves as key to map between users on one hand and permissions, file ownerships and other aspects that determine the system's behavior on the other hand, more than one login name will access the account of the given UID. -p, --password PASSWORD defines a new password for the user. PASSWORD is expected to be encrypted, as returned by crypt (3). Note: Avoid this option on the command line because the password (or encrypted password) will be visible by users listing the processes. The password will be written in the local /etc/passwd or /etc/shadow file. This might differ from the password database configured in your PAM configuration. You should make sure the password respects the system's password policy. -r, --remove Remove the user from named supplementary group(s). Use only with the -G option. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. Only absolute paths are supported. -P, --prefix PREFIX_DIR Apply changes within the directory tree starting with PREFIX_DIR and use as well the configuration files located there. This option does not chroot and is intended for preparing a cross-compilation target. Some limitations: NIS and LDAP users/groups are not verified. PAM authentication is using the host files. No SELINUX support. -s, --shell SHELL changes the user's login shell. An empty string for SHELL blanks the field in /etc/passwd and logs the user into the system's default shell. -u, --uid UID The new value of the user's ID. This value must be unique, unless the -o option is used. The value must be non-negative. The user's mailbox, and any files which the user owns and which are located in the user's home directory will have the file user ID changed automatically. The ownership of files outside of the user's home directory must be fixed manually. The change of the user ownership of files inside of the user's home directory is also not done if the home dir owner uid is different from the current or new user id. This is a safety measure for special home directories such as /. No checks will be performed with regard to the UID_MIN, UID_MAX, SYS_UID_MIN, or SYS_UID_MAX from /etc/login.defs. -U, --unlock Unlock a user's password. This removes the '!' in front of the encrypted password. You can't use this option with -p or -L. Note: if you wish to unlock the account (not only access with a password), you should also set the EXPIRE_DATE (for example to 99999, or to the EXPIRE value from /etc/default/useradd). -v, --add-subuids FIRST-LAST Add a range of subordinate uids to the user's account. This option may be specified multiple times to add multiple ranges to a user's account. No checks will be performed with regard to SUB_UID_MIN, SUB_UID_MAX, or SUB_UID_COUNT from /etc/login.defs. -V, --del-subuids FIRST-LAST Remove a range of subordinate uids from the user's account. This option may be specified multiple times to remove multiple ranges to a user's account. When both --del-subuids and --add-subuids are specified, the removal of all subordinate uid ranges happens before any subordinate uid range is added. No checks will be performed with regard to SUB_UID_MIN, SUB_UID_MAX, or SUB_UID_COUNT from /etc/login.defs. -w, --add-subgids FIRST-LAST Add a range of subordinate gids to the user's account. This option may be specified multiple times to add multiple ranges to a user's account. No checks will be performed with regard to SUB_GID_MIN, SUB_GID_MAX, or SUB_GID_COUNT from /etc/login.defs. -W, --del-subgids FIRST-LAST Remove a range of subordinate gids from the user's account. This option may be specified multiple times to remove multiple ranges to a user's account. When both --del-subgids and --add-subgids are specified, the removal of all subordinate gid ranges happens before any subordinate gid range is added. No checks will be performed with regard to SUB_GID_MIN, SUB_GID_MAX, or SUB_GID_COUNT from /etc/login.defs. -Z, --selinux-user SEUSER defines the SELinux user to be mapped with LOGIN. An empty string ("") will remove the respective entry (if any). Note that the shadow system doesn't store the selinux-user, it uses semanage(8) for that. --selinux-range SERANGE defines the SELinux MLS range for the new account. Note that the shadow system doesn't store the selinux-range, it uses semanage(8) for that. This option is only valid if the -Z (or --selinux-user) option is specified. CAVEATS top You must make certain that the named user is not executing any processes when this command is being executed if the user's numerical user ID, the user's name, or the user's home directory is being changed. usermod checks this on Linux. On other operating systems it only uses utmp to check if the user is logged in. You must change the owner of any crontab files or at jobs manually. You must make any changes involving NIS on the NIS server. CONFIGURATION top The following configuration variables in /etc/login.defs change the behavior of this tool: LASTLOG_UID_MAX (number) Highest user ID number for which the lastlog entries should be updated. As higher user IDs are usually tracked by remote user identity and authentication services there is no need to create a huge sparse lastlog file for them. No LASTLOG_UID_MAX option present in the configuration means that there is no user ID limit for writing lastlog entries. MAIL_DIR (string) The mail spool directory. This is needed to manipulate the mailbox when its corresponding user account is modified or deleted. If not specified, a compile-time default is used. The parameter CREATE_MAIL_SPOOL in /etc/default/useradd determines whether the mail spool should be created. MAIL_FILE (string) Defines the location of the users mail spool files relatively to their home directory. The MAIL_DIR and MAIL_FILE variables are used by useradd, usermod, and userdel to create, move, or delete the user's mail spool. MAX_MEMBERS_PER_GROUP (number) Maximum members per group entry. When the maximum is reached, a new group entry (line) is started in /etc/group (with the same name, same password, and same GID). The default value is 0, meaning that there are no limits in the number of members in a group. This feature (split group) permits to limit the length of lines in the group file. This is useful to make sure that lines for NIS groups are not larger than 1024 characters. If you need to enforce such limit, you can use 25. Note: split groups may not be supported by all tools (even in the Shadow toolsuite). You should not use this variable unless you really need it. SUB_GID_MIN (number), SUB_GID_MAX (number), SUB_GID_COUNT (number) If /etc/subuid exists, the commands useradd and newusers (unless the user already have subordinate group IDs) allocate SUB_GID_COUNT unused group IDs from the range SUB_GID_MIN to SUB_GID_MAX for each new user. The default values for SUB_GID_MIN, SUB_GID_MAX, SUB_GID_COUNT are respectively 100000, 600100000 and 65536. SUB_UID_MIN (number), SUB_UID_MAX (number), SUB_UID_COUNT (number) If /etc/subuid exists, the commands useradd and newusers (unless the user already have subordinate user IDs) allocate SUB_UID_COUNT unused user IDs from the range SUB_UID_MIN to SUB_UID_MAX for each new user. The default values for SUB_UID_MIN, SUB_UID_MAX, SUB_UID_COUNT are respectively 100000, 600100000 and 65536. FILES top /etc/group Group account information /etc/gshadow Secure group account information /etc/login.defs Shadow password suite configuration /etc/passwd User account information /etc/shadow Secure user account information /etc/subgid Per user subordinate group IDs /etc/subuid Per user subordinate user IDs SEE ALSO top chfn(1), chsh(1), passwd(1), crypt(3), gpasswd(8), groupadd(8), groupdel(8), groupmod(8), login.defs(5), subgid(5), subuid(5), useradd(8), userdel(8). COLOPHON top This page is part of the shadow-utils (utilities for managing accounts and shadow password files) project. Information about the project can be found at https://github.com/shadow-maint/shadow. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository https://github.com/shadow-maint/shadow on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-15.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] shadow-utils 4.11.1 12/22/2023 USERMOD(8) Pages that refer to this page: getsubids(1), newgidmap(1), newuidmap(1), passwd(1), pcap(3pcap), subgid(5), subuid(5), groupadd(8), groupdel(8), groupmems(8), groupmod(8), pwck(8), useradd(8), userdel(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# usermod\n\n> Modifies a user account.\n> See also: `users`, `useradd`, `userdel`.\n> More information: <https://manned.org/usermod>.\n\n- Change a username:\n\n`sudo usermod --login {{new_username}} {{username}}`\n\n- Change a user ID:\n\n`sudo usermod --uid {{id}} {{username}}`\n\n- Change a user shell:\n\n`sudo usermod --shell {{path/to/shell}} {{username}}`\n\n- Add a user to supplementary groups (mind the lack of whitespace):\n\n`sudo usermod --append --groups {{group1,group2,...}} {{username}}`\n\n- Change a user home directory:\n\n`sudo usermod --move-home --home {{path/to/new_home}} {{username}}`\n
users
users(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training users(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON USERS(1) User Commands USERS(1) NAME top users - print the user names of users currently logged in to the current host SYNOPSIS top users [OPTION]... [FILE] DESCRIPTION top Output who is currently logged in according to FILE. If FILE is not specified, use /var/run/utmp. /var/log/wtmp as FILE is common. --help display this help and exit --version output version information and exit AUTHOR top Written by Joseph Arceneaux and David MacKenzie. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top getent(1), who(1) Full documentation <https://www.gnu.org/software/coreutils/users> or available locally via: info '(coreutils) users invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 USERS(1) Pages that refer to this page: utmp(5) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# users\n\n> Display a list of logged in users.\n> See also: `useradd`, `userdel`, `usermod`.\n> More information: <https://www.gnu.org/software/coreutils/users>.\n\n- Print logged in usernames:\n\n`users`\n\n- Print logged in usernames according to a given file:\n\n`users {{/var/log/wmtp}}`\n
utmpdump
utmpdump(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training utmpdump(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | NOTES | BUGS | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY UTMPDUMP(1) User Commands UTMPDUMP(1) NAME top utmpdump - dump UTMP and WTMP files in raw format SYNOPSIS top utmpdump [options] filename DESCRIPTION top utmpdump is a simple program to dump UTMP and WTMP files in raw format, so they can be examined. utmpdump reads from stdin unless a filename is passed. OPTIONS top -f, --follow Output appended data as the file grows. -o, --output file Write command output to file instead of standard output. -r, --reverse Undump, write back edited login information into the utmp or wtmp files. -h, --help Display help text and exit. -V, --version Print version and exit. NOTES top utmpdump can be useful in cases of corrupted utmp or wtmp entries. It can dump out utmp/wtmp to an ASCII file, which can then be edited to remove bogus entries, and reintegrated using: utmpdump -r < ascii_file > wtmp But be warned, utmpdump was written for debugging purposes only. File formats Only the binary version of the utmp(5) is standardised. Textual dumps may become incompatible in future. The version 2.28 was the last one that printed text output using ctime(3) timestamp format. Newer dumps use millisecond precision ISO-8601 timestamp format in UTC-0 timezone. Conversion from former timestamp format can be made to binary, although attempt to do so can lead the timestamps to drift amount of timezone offset. BUGS top You may not use the -r option, as the format for the utmp/wtmp files strongly depends on the input format. This tool was not written for normal use, but for debugging only. AUTHORS top Michael Krapp SEE ALSO top last(1), w(1), who(1), utmp(5) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The utmpdump command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is part of the util-linux (a random collection of Linux utilities) project. Information about the project can be found at https://www.kernel.org/pub/linux/utils/util-linux/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-14.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] util-linux 2.39.594-1e0ad 2023-07-19 UTMPDUMP(1) Pages that refer to this page: getutmp(3), utmp(5) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# utmpdump\n\n> Dump and load btmp, utmp and wtmp accounting files.\n> More information: <https://manned.org/utmpdump>.\n\n- Dump the `/var/log/wtmp` file to `stdout` as plain text:\n\n`utmpdump {{/var/log/wtmp}}`\n\n- Load a previously dumped file into `/var/log/wtmp`:\n\n`utmpdump -r {{dumpfile}} > {{/var/log/wtmp}}`\n
uudecode
uudecode(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training uudecode(1p) Linux manual page PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES OF ERRORS | APPLICATION USAGE | EXAMPLES | RATIONALE | FUTURE DIRECTIONS | SEE ALSO | COPYRIGHT UUDECODE(1P) POSIX Programmer's Manual UUDECODE(1P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME top uudecode decode a binary file SYNOPSIS top uudecode [-o outfile] [file] DESCRIPTION top The uudecode utility shall read a file, or standard input if no file is specified, that includes data created by the uuencode utility. The uudecode utility shall scan the input file, searching for data compatible with one of the formats specified in uuencode, and attempt to create or overwrite the file described by the data (or overridden by the -o option). The pathname shall be contained in the data or specified by the -o option. The file access permission bits and contents for the file to be produced shall be contained in that data. The mode bits of the created file (other than standard output) shall be set from the file access permission bits contained in the data; that is, other attributes of the mode, including the file mode creation mask (see umask), shall not affect the file being produced. If either of the op characters '+' and '-' (see chmod) are specified in symbolic mode, the initial mode on which those operations are based is unspecified. If the pathname of the file resolves to an existing file and the user does not have write permission on that file, uudecode shall terminate with an error. If the pathname of the file resolves to an existing file and the user has write permission on that file, the existing file shall be overwritten and, if possible, the mode bits of the file (other than standard output) shall be set as described above; if the mode bits cannot be set, uudecode shall not treat this as an error. If the input data was produced by uuencode on a system with a different number of bits per byte than on the target system, the results of uudecode are unspecified. OPTIONS top The uudecode utility shall conform to the Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines. The following option shall be supported by the implementation: -o outfile A pathname of a file that shall be used instead of any pathname contained in the input data. Specifying an outfile option-argument of /dev/stdout shall indicate standard output. OPERANDS top The following operand shall be supported: file The pathname of a file containing the output of uuencode. STDIN top See the INPUT FILES section. INPUT FILES top The input files shall be files containing the output of uuencode. ENVIRONMENT VARIABLES top The following environment variables shall affect the execution of uudecode: LANG Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.12017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files). LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. ASYNCHRONOUS EVENTS top Default. STDOUT top If the file data header encoded by uuencode is - or /dev/stdout, or the -o /dev/stdout option overrides the file data, the standard output shall be in the same format as the file originally encoded by uuencode. Otherwise, the standard output shall not be used. STDERR top The standard error shall be used only for diagnostic messages. OUTPUT FILES top The output file shall be in the same format as the file originally encoded by uuencode. EXTENDED DESCRIPTION top None. EXIT STATUS top The following exit values shall be returned: 0 Successful completion. >0 An error occurred. CONSEQUENCES OF ERRORS top Default. The following sections are informative. APPLICATION USAGE top The user who is invoking uudecode must have write permission on any file being created. The output of uuencode is essentially an encoded bit stream that is not cognizant of byte boundaries. It is possible that a 9-bit byte target machine can process input from an 8-bit source, if it is aware of the requirement, but the reverse is unlikely to be satisfying. Of course, the only data that is meaningful for such a transfer between architectures is generally character data. EXAMPLES top None. RATIONALE top Input files are not necessarily text files, as stated by an early proposal. Although the uuencode output is a text file, that output could have been wrapped within another file or mail message that is not a text file. The -o option is not historical practice, but was added at the request of WG15 so that the user could override the target pathname without having to edit the input data itself. In early drafts, the [-o outfile] option-argument allowed the use of - to mean standard output. The symbol - has only been used previously in POSIX.12008 as a standard input indicator. The standard developers did not wish to overload the meaning of - in this manner. The /dev/stdout concept exists on most modern systems. The /dev/stdout syntax does not refer to a new special file. It is just a magic cookie to specify standard output. FUTURE DIRECTIONS top None. SEE ALSO top chmod(1p), umask(1p), uuencode(1p) The Base Definitions volume of POSIX.12017, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines COPYRIGHT top Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE/The Open Group 2017 UUDECODE(1P) Pages that refer to this page: uuencode(1p) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# uudecode\n\n> Decode files encoded by `uuencode`.\n> More information: <https://manned.org/uudecode>.\n\n- Decode a file that was encoded with `uuencode` and print the result to `stdout`:\n\n`uudecode {{path/to/encoded_file}}`\n\n- Decode a file that was encoded with `uuencode` and write the result to a file:\n\n`uudecode -o {{path/to/decoded_file}} {{path/to/encoded_file}}`\n
uuencode
uuencode(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training uuencode(1p) Linux manual page PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES OF ERRORS | APPLICATION USAGE | EXAMPLES | RATIONALE | FUTURE DIRECTIONS | SEE ALSO | COPYRIGHT UUENCODE(1P) POSIX Programmer's Manual UUENCODE(1P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME top uuencode encode a binary file SYNOPSIS top uuencode [-m] [file] decode_pathname DESCRIPTION top The uuencode utility shall write an encoded version of the named input file, or standard input if no file is specified, to standard output. The output shall be encoded using one of the algorithms described in the STDOUT section and shall include the file access permission bits (in chmod octal or symbolic notation) of the input file and the decode_pathname, for re-creation of the file on another system that conforms to this volume of POSIX.12017. OPTIONS top The uuencode utility shall conform to the Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines. The following option shall be supported by the implementation: -m Encode the output using the MIME Base64 algorithm described in STDOUT. If -m is not specified, the historical algorithm described in STDOUT shall be used. OPERANDS top The following operands shall be supported: decode_pathname The pathname of the file into which the uudecode utility shall place the decoded file. Specifying a decode_pathname operand of /dev/stdout shall indicate that uudecode is to use standard output. If there are characters in decode_pathname that are not in the portable filename character set the results are unspecified. file A pathname of the file to be encoded. STDIN top See the INPUT FILES section. INPUT FILES top Input files can be files of any type. ENVIRONMENT VARIABLES top The following environment variables shall affect the execution of uuencode: LANG Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.12017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files). LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. ASYNCHRONOUS EVENTS top Default. STDOUT top uuencode Base64 Algorithm The standard output shall be a text file (encoded in the character set of the current locale) that begins with the line: "begin-base64 %s %s\n", <mode>, <decode_pathname> and ends with the line: "====\n" In both cases, the lines shall have no preceding or trailing <blank> characters. The encoding process represents 24-bit groups of input bits as output strings of four encoded characters. Proceeding from left to right, a 24-bit input group shall be formed by concatenating three 8-bit input groups. Each 24-bit input group then shall be treated as four concatenated 6-bit groups, each of which shall be translated into a single digit in the Base64 alphabet. When encoding a bit stream via the Base64 encoding, the bit stream shall be presumed to be ordered with the most-significant bit first. That is, the first bit in the stream shall be the high- order bit in the first byte, and the eighth bit shall be the low- order bit in the first byte, and so on. Each 6-bit group is used as an index into an array of 64 printable characters, as shown in Table 4-22, uuencode Base64 Values. Table 4-22: uuencode Base64 Values Value Encoding Value Encoding Value Encoding Value Encoding 0 A 17 R 34 i 51 z 1 B 18 S 35 j 52 0 2 C 19 T 36 k 53 1 3 D 20 U 37 l 54 2 4 E 21 V 38 m 55 3 5 F 22 W 39 n 56 4 6 G 23 X 40 o 57 5 7 H 24 Y 41 p 58 6 8 I 25 Z 42 q 59 7 9 J 26 a 43 r 60 8 10 K 27 b 44 s 61 9 11 L 28 c 45 t 62 + 12 M 29 d 46 u 63 / 13 N 30 e 47 v 14 O 31 f 48 w (pad) = 15 P 32 g 49 x 16 Q 33 h 50 y The character referenced by the index shall be placed in the output string. The output stream (encoded bytes) shall be represented in lines of no more than 76 characters each. All line breaks or other characters not found in the table shall be ignored by decoding software (see uudecode(1p)). Special processing shall be performed if fewer than 24 bits are available at the end of a message or encapsulated part of a message. A full encoding quantum shall always be completed at the end of a message. When fewer than 24 input bits are available in an input group, zero bits shall be added (on the right) to form an integral number of 6-bit groups. Output character positions that are not required to represent actual input data shall be set to the character '='. Since all Base64 input is an integral number of octets, only the following cases can arise: 1. The final quantum of encoding input is an integral multiple of 24 bits; here, the final unit of encoded output shall be an integral multiple of 4 characters with no '=' padding. 2. The final quantum of encoding input is exactly 16 bits; here, the final unit of encoded output shall be three characters followed by one '=' padding character. 3. The final quantum of encoding input is exactly 8 bits; here, the final unit of encoded output shall be two characters followed by two '=' padding characters. A terminating "====" evaluates to nothing and denotes the end of the encoded data. uuencode Historical Algorithm The standard output shall be a text file (encoded in the character set of the current locale) that begins with the line: "begin %s %s\n" <mode>, <decode_pathname> and ends with the line: "end\n" In both cases, the lines shall have no preceding or trailing <blank> characters. The algorithm that shall be used for lines in between begin and end takes three octets as input and writes four characters of output by splitting the input at six-bit intervals into four octets, containing data in the lower six bits only. These octets shall be converted to characters by adding a value of 0x20 to each octet, so that each octet is in the range [0x20,0x5f], and then it shall be assumed to represent a printable character in the ISO/IEC 646:1991 standard encoded character set. It then shall be translated into the corresponding character codes for the codeset in use in the current locale. (For example, the octet 0x41, representing 'A', would be translated to 'A' in the current codeset, such as 0xc1 if it were EBCDIC.) Where the bits of two octets are combined, the least significant bits of the first octet shall be shifted left and combined with the most significant bits of the second octet shifted right. Thus the three octets A, B, C shall be converted into the four octets: 0x20 + (( A >> 2 ) & 0x3F) 0x20 + (((A << 4) | ((B >> 4) & 0xF)) & 0x3F) 0x20 + (((B << 2) | ((C >> 6) & 0x3)) & 0x3F) 0x20 + (( C ) & 0x3F) These octets then shall be translated into the local character set. Each encoded line contains a length character, equal to the number of characters to be decoded plus 0x20 translated to the local character set as described above, followed by the encoded characters. The maximum number of octets to be encoded on each line shall be 45. STDERR top The standard error shall be used only for diagnostic messages. OUTPUT FILES top None. EXTENDED DESCRIPTION top None. EXIT STATUS top The following exit values shall be returned: 0 Successful completion. >0 An error occurred. CONSEQUENCES OF ERRORS top Default. The following sections are informative. APPLICATION USAGE top The file is expanded by 35 percent (each three octets become four, plus control information) causing it to take longer to transmit. Since this utility is intended to create files to be used for data interchange between systems with possibly different codesets, and to represent binary data as a text file, the ISO/IEC 646:1991 standard was chosen for a midpoint in the algorithm as a known reference point. The output from uuencode is a text file on the local system. If the output were in the ISO/IEC 646:1991 standard codeset, it might not be a text file (at least because the <newline> characters might not match), and the goal of creating a text file would be defeated. If this text file was then carried to another machine with the same codeset, it would be perfectly compatible with that system's uudecode. If it was transmitted over a mail system or sent to a machine with a different codeset, it is assumed that, as for every other text file, some translation mechanism would convert it (by the time it reached a user on the other system) into an appropriate codeset. This translation only makes sense from the local codeset, not if the file has been put into a ISO/IEC 646:1991 standard representation first. Similarly, files processed by uuencode can be placed in pax archives, intermixed with other text files in the same codeset. EXAMPLES top None. RATIONALE top A new algorithm was added at the request of the international community to parallel work in RFC 2045 (MIME). As with the historical uuencode format, the Base64 Content-Transfer-Encoding is designed to represent arbitrary sequences of octets in a form that is not humanly readable. A 65-character subset of the ISO/IEC 646:1991 standard is used, enabling 6 bits to be represented per printable character. (The extra 65th character, '=', is used to signify a special processing function.) This subset has the important property that it is represented identically in all versions of the ISO/IEC 646:1991 standard, including US ASCII, and all characters in the subset are also represented identically in all versions of EBCDIC. The historical uuencode algorithm does not share this property, which is the reason that a second algorithm was added to the ISO POSIX2 standard. The string "====" was used for the termination instead of the end used in the original format because the latter is a string that could be valid encoded input. In an early draft, the -m option was named -b (for Base64), but it was renamed to reflect its relationship to the RFC 2045. A -u was also present to invoke the default algorithm, but since this was not historical practice, it was omitted as being unnecessary. See the RATIONALE section in uudecode(1p) for the derivation of the /dev/stdout symbol. FUTURE DIRECTIONS top None. SEE ALSO top chmod(1p), mailx(1p), uudecode(1p) The Base Definitions volume of POSIX.12017, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines COPYRIGHT top Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE/The Open Group 2017 UUENCODE(1P) Pages that refer to this page: uucp(1p), uudecode(1p), uux(1p), a64l(3p) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# uuencode\n\n> Encode binary files into ASCII for transport via mediums that only support simple ASCII encoding.\n> More information: <https://manned.org/uuencode>.\n\n- Encode a file and print the result to `stdout`:\n\n`uuencode {{path/to/input_file}} {{output_file_name_after_decoding}}`\n\n- Encode a file and write the result to a file:\n\n`uuencode -o {{path/to/output_file}} {{path/to/input_file}} {{output_file_name_after_decoding}}`\n\n- Encode a file using Base64 instead of the default uuencode encoding and write the result to a file:\n\n`uuencode -m -o {{path/to/output_file}} {{path/to/input_file}} {{output_file_name_after_decoding}}`\n
uuidd
uuidd(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training uuidd(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLE | AUTHOR | SEE ALSO | REPORTING BUGS | AVAILABILITY UUIDD(8) System Administration UUIDD(8) NAME top uuidd - UUID generation daemon SYNOPSIS top uuidd [options] DESCRIPTION top The uuidd daemon is used by the UUID library to generate universally unique identifiers (UUIDs), especially time-based UUIDs, in a secure and guaranteed-unique fashion, even in the face of large numbers of threads running on different CPUs trying to grab UUIDs. OPTIONS top -C, --cont-clock[=time] Activate continuous clock handling for time based UUIDs. uuidd could use all possible clock values, beginning with the daemons start time. The optional argument can be used to set a value for the max_clock_offset. This gurantees, that a clock value of a UUID will always be within the range of the max_clock_offset. The option '-C' or '--cont-clock' enables the feature with a default max_clock_offset of 2 hours. The option '-C<NUM>[hd]' or '--cont-clock=<NUM>[hd]' enables the feature with a max_clock_offset of NUM seconds. In case of an appended h or d, the NUM value is read in hours or days. The minimum value is 60 seconds, the maximum value is 365 days. -d, --debug Run uuidd in debugging mode. This prevents uuidd from running as a daemon. -F, --no-fork Do not daemonize using a double-fork. -k, --kill If currently a uuidd daemon is running, kill it. -n, --uuids number When issuing a test request to a running uuidd, request a bulk response of number UUIDs. -P, --no-pid Do not create a pid file. -p, --pid path Specify the pathname where the pid file should be written. By default, the pid file is written to {runstatedir}/uuidd/uuidd.pid. -q, --quiet Suppress some failure messages. -r, --random Test uuidd by trying to connect to a running uuidd daemon and request it to return a random-based UUID. -S, --socket-activation Do not create a socket but instead expect it to be provided by the calling process. This implies --no-fork and --no-pid. This option is intended to be used only with systemd(1). It needs to be enabled with a configure option. -s, --socket path Make uuidd use this pathname for the unix-domain socket. By default, the pathname used is {runstatedir}/uuidd/request. This option is primarily for debugging purposes, since the pathname is hard-coded in the libuuid library. -T, --timeout number Make uuidd exit after number seconds of inactivity. -t, --time Test uuidd by trying to connect to a running uuidd daemon and request it to return a time-based UUID. -h, --help Display help text and exit. -V, --version Print version and exit. EXAMPLE top Start up a daemon, print 42 random keys, and then stop the daemon: uuidd -p /tmp/uuidd.pid -s /tmp/uuidd.socket uuidd -d -r -n 42 -s /tmp/uuidd.socket uuidd -d -k -s /tmp/uuidd.socket AUTHOR top The uuidd daemon was written by Theodore Tso <[email protected]>. SEE ALSO top uuid(3), uuidgen(1) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The uuidd command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is part of the util-linux (a random collection of Linux utilities) project. Information about the project can be found at https://www.kernel.org/pub/linux/utils/util-linux/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-14.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] util-linux 2.39.594-1e0ad 2023-08-25 UUIDD(8) Pages that refer to this page: uuid_generate(3) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# uuidd\n\n> Daemon for generating UUIDs.\n> More information: <https://manned.org/uuidd>.\n\n- Generate a random UUID:\n\n`uuidd --random`\n\n- Generate a bulk number of random UUIDs:\n\n`uuidd --random --uuids {{number_of_uuids}}`\n\n- Generate a time-based UUID, based on the current time and MAC address of the system:\n\n`uuidd --time`\n
uuidgen
uuidgen(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training uuidgen(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | CONFORMING TO | EXAMPLES | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY UUIDGEN(1) User Commands UUIDGEN(1) NAME top uuidgen - create a new UUID value SYNOPSIS top uuidgen [options] DESCRIPTION top The uuidgen program creates (and prints) a new universally unique identifier (UUID) using the libuuid(3) library. The new UUID can reasonably be considered unique among all UUIDs created on the local system, and among UUIDs created on other systems in the past and in the future. There are three types of UUIDs which uuidgen can generate: time-based UUIDs, random-based UUIDs, and hash-based UUIDs. By default uuidgen will generate a random-based UUID if a high-quality random number generator is present. Otherwise, it will choose a time-based UUID. It is possible to force the generation of one of these first two UUID types by using the --random or --time options. The third type of UUID is generated with the --md5 or --sha1 options, followed by --namespace namespace and --name name. The namespace may either be a well-known UUID, or else an alias to one of the well-known UUIDs defined in RFC 4122, that is @dns, @url, @oid, or @x500. The name is an arbitrary string value. The generated UUID is the digest of the concatenation of the namespace UUID and the name value, hashed with the MD5 or SHA1 algorithms. It is, therefore, a predictable value which may be useful when UUIDs are being used as handles or nonces for more complex values or values which shouldnt be disclosed directly. See the RFC for more information. OPTIONS top -r, --random Generate a random-based UUID. This method creates a UUID consisting mostly of random bits. It requires that the operating system has a high quality random number generator, such as /dev/random. -t, --time Generate a time-based UUID. This method creates a UUID based on the system clock plus the systems ethernet hardware address, if present. -h, --help Display help text and exit. -V, --version Print version and exit. -m, --md5 Use MD5 as the hash algorithm. -s, --sha1 Use SHA1 as the hash algorithm. -n, --namespace namespace Generate the hash with the namespace prefix. The namespace is UUID, or '@ns' where "ns" is well-known predefined UUID addressed by namespace name (see above). -N, --name name Generate the hash of the name. -C, --count num Generate multiple UUIDs using the enhanced capability of the libuuid to cache time-based UUIDs, thus resulting in improved performance. However, this holds no significance for other UUID types. -x, --hex Interpret name name as a hexadecimal string. CONFORMING TO top OSF DCE 1.1 EXAMPLES top uuidgen --sha1 --namespace @dns --name "www.example.com" AUTHORS top uuidgen was written by Andreas Dilger for libuuid(3). SEE ALSO top uuidparse(1), libuuid(3), RFC 4122 <https://tools.ietf.org/html/rfc4122> REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The uuidgen command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is part of the util-linux (a random collection of Linux utilities) project. Information about the project can be found at https://www.kernel.org/pub/linux/utils/util-linux/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-14.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] util-linux 2.39.594-1e0ad 2023-09-01 UUIDGEN(1) Pages that refer to this page: uuidparse(1), uuid(3), uuid_generate(3), swaplabel(8), uuidd(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# uuidgen\n\n> Generate unique identifiers (UUIDs).\n> See also `uuid`.\n> More information: <https://manned.org/uuidgen>.\n\n- Create a random UUIDv4:\n\n`uuidgen --random`\n\n- Create a UUIDv1 based on the current time:\n\n`uuidgen --time`\n\n- Create a UUIDv5 of the name with a specified namespace prefix:\n\n`uuidgen --sha1 --namespace {{@dns|@url|@oid|@x500}} --name {{object_name}}`\n
uuidparse
uuidparse(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training uuidparse(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OUTPUT | OPTIONS | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY UUIDPARSE(1) User Commands UUIDPARSE(1) NAME top uuidparse - a utility to parse unique identifiers SYNOPSIS top uuidparse [options] uuid DESCRIPTION top This command will parse unique identifier inputs from either command line arguments or standard input. The inputs are white-space separated. OUTPUT top Variants NCS Network Computing System identifier. These were the original UUIDs. DCE The Open Software Foundations (OSF) Distributed Computing Environment UUIDs. Microsoft Microsoft Windows platform globally unique identifier (GUID). other Unknown variant. Usually invalid input data. Types nil Special type for zero in type file. time-based The DCE time based. DCE The DCE time and MAC Address. name-based RFC 4122 md5sum hash. random RFC 4122 random. sha1-based RFC 4122 sha-1 hash. unknown Unknown type. Usually invalid input data. OPTIONS top -J, --json Use JSON output format. -n, --noheadings Do not print a header line. -o, --output Specify which output columns to print. Use --help to get a list of all supported columns. -r, --raw Use the raw output format. -h, --help Display help text and exit. -V, --version Print version and exit. AUTHORS top Sami Kerola <[email protected]> SEE ALSO top uuidgen(1), libuuid(3), RFC 4122 <https://tools.ietf.org/html/rfc4122> REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The uuidparse command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is part of the util-linux (a random collection of Linux utilities) project. Information about the project can be found at https://www.kernel.org/pub/linux/utils/util-linux/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-14.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] util-linux 2.39.594-1e0ad 2023-07-19 UUIDPARSE(1) Pages that refer to this page: uuidgen(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# uuidparse\n\n> Parse universally unique identifiers.\n> See also: `uuidgen`.\n> More information: <https://manned.org/uuidparse.1>.\n\n- Parse the specified UUIDs, use a tabular output format:\n\n`uuidparse {{uuid1 uuid2 ...}}`\n\n- Parse UUIDs from `stdin`:\n\n`{{command}} | uuidparse`\n\n- Use the JSON output format:\n\n`uuidparse --json {{uuid1 uuid2 ...}}`\n\n- Do not print a header line:\n\n`uuidparse --noheadings {{uuid1 uuid2 ...}}`\n\n- Use the raw output format:\n\n`uuidparse --raw {{uuid1 uuid2 ...}}`\n\n- Specify which of the four output columns to print:\n\n`uuidparse --output {{UUID,VARIANT,TYPE,TIME}}`\n\n- Display help:\n\n`uuidparse -h`\n
valgrind
valgrind(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training valgrind(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | TOOL SELECTION OPTIONS | BASIC OPTIONS | ERROR-RELATED OPTIONS | MALLOC()-RELATED OPTIONS | UNCOMMON OPTIONS | DEBUGGING VALGRIND OPTIONS | MEMCHECK OPTIONS | CACHEGRIND OPTIONS | CALLGRIND OPTIONS | HELGRIND OPTIONS | DRD OPTIONS | MASSIF OPTIONS | BBV OPTIONS | LACKEY OPTIONS | DEBUGINFOD | SEE ALSO | AUTHOR | NOTES | COLOPHON VALGRIND(1) valgrind VALGRIND(1) NAME top valgrind - a suite of tools for debugging and profiling programs SYNOPSIS top valgrind [valgrind-options] [your-program] [your-program-options] DESCRIPTION top Valgrind is a flexible program for debugging and profiling Linux executables. It consists of a core, which provides a synthetic CPU in software, and a series of debugging and profiling tools. The architecture is modular, so that new tools can be created easily and without disturbing the existing structure. Some of the options described below work with all Valgrind tools, and some only work with a few or one. The section MEMCHECK OPTIONS and those below it describe tool-specific options. This manual page covers only basic usage and options. For more comprehensive information, please see the HTML documentation on your system: $INSTALL/share/doc/valgrind/html/index.html, or online: http://www.valgrind.org/docs/manual/index.html. TOOL SELECTION OPTIONS top The single most important option. --tool=<toolname> [default: memcheck] Run the Valgrind tool called toolname, e.g. memcheck, cachegrind, callgrind, helgrind, drd, massif, dhat, lackey, none, exp-bbv, etc. BASIC OPTIONS top These options work with all tools. -h --help Show help for all options, both for the core and for the selected tool. If the option is repeated it is equivalent to giving --help-debug. --help-debug Same as --help, but also lists debugging options which usually are only of use to Valgrind's developers. --version Show the version number of the Valgrind core. Tools can have their own version numbers. There is a scheme in place to ensure that tools only execute when the core version is one they are known to work with. This was done to minimise the chances of strange problems arising from tool-vs-core version incompatibilities. -q, --quiet Run silently, and only print error messages. Useful if you are running regression tests or have some other automated test machinery. -v, --verbose Be more verbose. Gives extra information on various aspects of your program, such as: the shared objects loaded, the suppressions used, the progress of the instrumentation and execution engines, and warnings about unusual behaviour. Repeating the option increases the verbosity level. --trace-children=<yes|no> [default: no] When enabled, Valgrind will trace into sub-processes initiated via the exec system call. This is necessary for multi-process programs. Note that Valgrind does trace into the child of a fork (it would be difficult not to, since fork makes an identical copy of a process), so this option is arguably badly named. However, most children of fork calls immediately call exec anyway. --trace-children-skip=patt1,patt2,... This option only has an effect when --trace-children=yes is specified. It allows for some children to be skipped. The option takes a comma separated list of patterns for the names of child executables that Valgrind should not trace into. Patterns may include the metacharacters ? and *, which have the usual meaning. This can be useful for pruning uninteresting branches from a tree of processes being run on Valgrind. But you should be careful when using it. When Valgrind skips tracing into an executable, it doesn't just skip tracing that executable, it also skips tracing any of that executable's child processes. In other words, the flag doesn't merely cause tracing to stop at the specified executables -- it skips tracing of entire process subtrees rooted at any of the specified executables. --trace-children-skip-by-arg=patt1,patt2,... This is the same as --trace-children-skip, with one difference: the decision as to whether to trace into a child process is made by examining the arguments to the child process, rather than the name of its executable. --child-silent-after-fork=<yes|no> [default: no] When enabled, Valgrind will not show any debugging or logging output for the child process resulting from a fork call. This can make the output less confusing (although more misleading) when dealing with processes that create children. It is particularly useful in conjunction with --trace-children=. Use of this option is also strongly recommended if you are requesting XML output (--xml=yes), since otherwise the XML from child and parent may become mixed up, which usually makes it useless. --vgdb=<no|yes|full> [default: yes] Valgrind will provide "gdbserver" functionality when --vgdb=yes or --vgdb=full is specified. This allows an external GNU GDB debugger to control and debug your program when it runs on Valgrind. --vgdb=full incurs significant performance overheads, but provides more precise breakpoints and watchpoints. See Debugging your program using Valgrind's gdbserver and GDB for a detailed description. If the embedded gdbserver is enabled but no gdb is currently being used, the vgdb command line utility can send "monitor commands" to Valgrind from a shell. The Valgrind core provides a set of Valgrind monitor commands. A tool can optionally provide tool specific monitor commands, which are documented in the tool specific chapter. --vgdb-error=<number> [default: 999999999] Use this option when the Valgrind gdbserver is enabled with --vgdb=yes or --vgdb=full. Tools that report errors will wait for "number" errors to be reported before freezing the program and waiting for you to connect with GDB. It follows that a value of zero will cause the gdbserver to be started before your program is executed. This is typically used to insert GDB breakpoints before execution, and also works with tools that do not report errors, such as Massif. --vgdb-stop-at=<set> [default: none] Use this option when the Valgrind gdbserver is enabled with --vgdb=yes or --vgdb=full. The Valgrind gdbserver will be invoked for each error after --vgdb-error have been reported. You can additionally ask the Valgrind gdbserver to be invoked for other events, specified in one of the following ways: a comma separated list of one or more of startup exit abexit valgrindabexit. The values startup exit valgrindabexit respectively indicate to invoke gdbserver before your program is executed, after the last instruction of your program, on Valgrind abnormal exit (e.g. internal error, out of memory, ...). The option abexit is similar to exit but tells to invoke gdbserver only when your application exits abnormally (i.e. with an exit code different of 0). Note: startup and --vgdb-error=0 will both cause Valgrind gdbserver to be invoked before your program is executed. The --vgdb-error=0 will in addition cause your program to stop on all subsequent errors. all to specify the complete set. It is equivalent to --vgdb-stop-at=startup,exit,abexit,valgrindabexit. none for the empty set. --track-fds=<yes|no|all> [default: no] When enabled, Valgrind will print out a list of open file descriptors on exit or on request, via the gdbserver monitor command v.info open_fds. Along with each file descriptor is printed a stack backtrace of where the file was opened and any details relating to the file descriptor such as the file name or socket details. Use all to include reporting on stdin, stdout and stderr. --time-stamp=<yes|no> [default: no] When enabled, each message is preceded with an indication of the elapsed wallclock time since startup, expressed as days, hours, minutes, seconds and milliseconds. --log-fd=<number> [default: 2, stderr] Specifies that Valgrind should send all of its messages to the specified file descriptor. The default, 2, is the standard error channel (stderr). Note that this may interfere with the client's own use of stderr, as Valgrind's output will be interleaved with any output that the client sends to stderr. --log-file=<filename> Specifies that Valgrind should send all of its messages to the specified file. If the file name is empty, it causes an abort. There are three special format specifiers that can be used in the file name. %p is replaced with the current process ID. This is very useful for program that invoke multiple processes. WARNING: If you use --trace-children=yes and your program invokes multiple processes OR your program forks without calling exec afterwards, and you don't use this specifier (or the %q specifier below), the Valgrind output from all those processes will go into one file, possibly jumbled up, and possibly incomplete. Note: If the program forks and calls exec afterwards, Valgrind output of the child from the period between fork and exec will be lost. Fortunately this gap is really tiny for most programs; and modern programs use posix_spawn anyway. %n is replaced with a file sequence number unique for this process. This is useful for processes that produces several files from the same filename template. %q{FOO} is replaced with the contents of the environment variable FOO. If the {FOO} part is malformed, it causes an abort. This specifier is rarely needed, but very useful in certain circumstances (eg. when running MPI programs). The idea is that you specify a variable which will be set differently for each process in the job, for example BPROC_RANK or whatever is applicable in your MPI setup. If the named environment variable is not set, it causes an abort. Note that in some shells, the { and } characters may need to be escaped with a backslash. %% is replaced with %. If an % is followed by any other character, it causes an abort. If the file name specifies a relative file name, it is put in the program's initial working directory: this is the current directory when the program started its execution after the fork or after the exec. If it specifies an absolute file name (ie. starts with '/') then it is put there. --log-socket=<ip-address:port-number> Specifies that Valgrind should send all of its messages to the specified port at the specified IP address. The port may be omitted, in which case port 1500 is used. If a connection cannot be made to the specified socket, Valgrind falls back to writing output to the standard error (stderr). This option is intended to be used in conjunction with the valgrind-listener program. For further details, see the commentary in the manual. --enable-debuginfod=<no|yes> [default: yes] When enabled Valgrind will attempt to download missing debuginfo from debuginfod servers if space-separated server URLs are present in the $DEBUGINFOD_URLS environment variable. This option is supported on Linux only. ERROR-RELATED OPTIONS top These options are used by all tools that can report errors, e.g. Memcheck, but not Cachegrind. --xml=<yes|no> [default: no] When enabled, the important parts of the output (e.g. tool error messages) will be in XML format rather than plain text. Furthermore, the XML output will be sent to a different output channel than the plain text output. Therefore, you also must use one of --xml-fd, --xml-file or --xml-socket to specify where the XML is to be sent. Less important messages will still be printed in plain text, but because the XML output and plain text output are sent to different output channels (the destination of the plain text output is still controlled by --log-fd, --log-file and --log-socket) this should not cause problems. This option is aimed at making life easier for tools that consume Valgrind's output as input, such as GUI front ends. Currently this option works with Memcheck, Helgrind and DRD. The output format is specified in the file docs/internals/xml-output-protocol4.txt in the source tree for Valgrind 3.5.0 or later. The recommended options for a GUI to pass, when requesting XML output, are: --xml=yes to enable XML output, --xml-file to send the XML output to a (presumably GUI-selected) file, --log-file to send the plain text output to a second GUI-selected file, --child-silent-after-fork=yes, and -q to restrict the plain text output to critical error messages created by Valgrind itself. For example, failure to read a specified suppressions file counts as a critical error message. In this way, for a successful run the text output file will be empty. But if it isn't empty, then it will contain important information which the GUI user should be made aware of. --xml-fd=<number> [default: -1, disabled] Specifies that Valgrind should send its XML output to the specified file descriptor. It must be used in conjunction with --xml=yes. --xml-file=<filename> Specifies that Valgrind should send its XML output to the specified file. It must be used in conjunction with --xml=yes. Any %p or %q sequences appearing in the filename are expanded in exactly the same way as they are for --log-file. See the description of --log-file for details. --xml-socket=<ip-address:port-number> Specifies that Valgrind should send its XML output the specified port at the specified IP address. It must be used in conjunction with --xml=yes. The form of the argument is the same as that used by --log-socket. See the description of --log-socket for further details. --xml-user-comment=<string> Embeds an extra user comment string at the start of the XML output. Only works when --xml=yes is specified; ignored otherwise. --demangle=<yes|no> [default: yes] Enable/disable automatic demangling (decoding) of C++ names. Enabled by default. When enabled, Valgrind will attempt to translate encoded C++ names back to something approaching the original. The demangler handles symbols mangled by g++ versions 2.X, 3.X and 4.X. An important fact about demangling is that function names mentioned in suppressions files should be in their mangled form. Valgrind does not demangle function names when searching for applicable suppressions, because to do otherwise would make suppression file contents dependent on the state of Valgrind's demangling machinery, and also slow down suppression matching. --num-callers=<number> [default: 12] Specifies the maximum number of entries shown in stack traces that identify program locations. Note that errors are commoned up using only the top four function locations (the place in the current function, and that of its three immediate callers). So this doesn't affect the total number of errors reported. The maximum value for this is 500. Note that higher settings will make Valgrind run a bit more slowly and take a bit more memory, but can be useful when working with programs with deeply-nested call chains. --unw-stack-scan-thresh=<number> [default: 0] , --unw-stack-scan-frames=<number> [default: 5] Stack-scanning support is available only on ARM targets. These flags enable and control stack unwinding by stack scanning. When the normal stack unwinding mechanisms -- usage of Dwarf CFI records, and frame-pointer following -- fail, stack scanning may be able to recover a stack trace. Note that stack scanning is an imprecise, heuristic mechanism that may give very misleading results, or none at all. It should be used only in emergencies, when normal unwinding fails, and it is important to nevertheless have stack traces. Stack scanning is a simple technique: the unwinder reads words from the stack, and tries to guess which of them might be return addresses, by checking to see if they point just after ARM or Thumb call instructions. If so, the word is added to the backtrace. The main danger occurs when a function call returns, leaving its return address exposed, and a new function is called, but the new function does not overwrite the old address. The result of this is that the backtrace may contain entries for functions which have already returned, and so be very confusing. A second limitation of this implementation is that it will scan only the page (4KB, normally) containing the starting stack pointer. If the stack frames are large, this may result in only a few (or not even any) being present in the trace. Also, if you are unlucky and have an initial stack pointer near the end of its containing page, the scan may miss all interesting frames. By default stack scanning is disabled. The normal use case is to ask for it when a stack trace would otherwise be very short. So, to enable it, use --unw-stack-scan-thresh=number. This requests Valgrind to try using stack scanning to "extend" stack traces which contain fewer than number frames. If stack scanning does take place, it will only generate at most the number of frames specified by --unw-stack-scan-frames. Typically, stack scanning generates so many garbage entries that this value is set to a low value (5) by default. In no case will a stack trace larger than the value specified by --num-callers be created. --error-limit=<yes|no> [default: yes] When enabled, Valgrind stops reporting errors after 10,000,000 in total, or 1,000 different ones, have been seen. This is to stop the error tracking machinery from becoming a huge performance overhead in programs with many errors. --error-exitcode=<number> [default: 0] Specifies an alternative exit code to return if Valgrind reported any errors in the run. When set to the default value (zero), the return value from Valgrind will always be the return value of the process being simulated. When set to a nonzero value, that value is returned instead, if Valgrind detects any errors. This is useful for using Valgrind as part of an automated test suite, since it makes it easy to detect test cases for which Valgrind has reported errors, just by inspecting return codes. When set to a nonzero value and Valgrind detects no error, the return value of Valgrind will be the return value of the program being simulated. --exit-on-first-error=<yes|no> [default: no] If this option is enabled, Valgrind exits on the first error. A nonzero exit value must be defined using --error-exitcode option. Useful if you are running regression tests or have some other automated test machinery. --error-markers=<begin>,<end> [default: none] When errors are output as plain text (i.e. XML not used), --error-markers instructs to output a line containing the begin (end) string before (after) each error. Such marker lines facilitate searching for errors and/or extracting errors in an output file that contain valgrind errors mixed with the program output. Note that empty markers are accepted. So, only using a begin (or an end) marker is possible. --show-error-list=no|yes [default: no] If this option is enabled, for tools that report errors, valgrind will show the list of detected errors and the list of used suppressions at exit. Note that at verbosity 2 and above, valgrind automatically shows the list of detected errors and the list of used suppressions at exit, unless --show-error-list=no is selected. -s Specifying -s is equivalent to --show-error-list=yes. --sigill-diagnostics=<yes|no> [default: yes] Enable/disable printing of illegal instruction diagnostics. Enabled by default, but defaults to disabled when --quiet is given. The default can always be explicitly overridden by giving this option. When enabled, a warning message will be printed, along with some diagnostics, whenever an instruction is encountered that Valgrind cannot decode or translate, before the program is given a SIGILL signal. Often an illegal instruction indicates a bug in the program or missing support for the particular instruction in Valgrind. But some programs do deliberately try to execute an instruction that might be missing and trap the SIGILL signal to detect processor features. Using this flag makes it possible to avoid the diagnostic output that you would otherwise get in such cases. --keep-debuginfo=<yes|no> [default: no] When enabled, keep ("archive") symbols and all other debuginfo for unloaded code. This allows saved stack traces to include file/line info for code that has been dlclose'd (or similar). Be careful with this, since it can lead to unbounded memory use for programs which repeatedly load and unload shared objects. Some tools and some functionalities have only limited support for archived debug info. Memcheck fully supports it. Generally, tools that report errors can use archived debug info to show the error stack traces. The known limitations are: Helgrind's past access stack trace of a race condition is does not use archived debug info. Massif (and more generally the xtree Massif output format) does not make use of archived debug info. Only Memcheck has been (somewhat) tested with --keep-debuginfo=yes, so other tools may have unknown limitations. --show-below-main=<yes|no> [default: no] By default, stack traces for errors do not show any functions that appear beneath main because most of the time it's uninteresting C library stuff and/or gobbledygook. Alternatively, if main is not present in the stack trace, stack traces will not show any functions below main-like functions such as glibc's __libc_start_main. Furthermore, if main-like functions are present in the trace, they are normalised as (below main), in order to make the output more deterministic. If this option is enabled, all stack trace entries will be shown and main-like functions will not be normalised. --fullpath-after=<string> [default: don't show source paths] By default Valgrind only shows the filenames in stack traces, but not full paths to source files. When using Valgrind in large projects where the sources reside in multiple different directories, this can be inconvenient. --fullpath-after provides a flexible solution to this problem. When this option is present, the path to each source file is shown, with the following all-important caveat: if string is found in the path, then the path up to and including string is omitted, else the path is shown unmodified. Note that string is not required to be a prefix of the path. For example, consider a file named /home/janedoe/blah/src/foo/bar/xyzzy.c. Specifying --fullpath-after=/home/janedoe/blah/src/ will cause Valgrind to show the name as foo/bar/xyzzy.c. Because the string is not required to be a prefix, --fullpath-after=src/ will produce the same output. This is useful when the path contains arbitrary machine-generated characters. For example, the path /my/build/dir/C32A1B47/blah/src/foo/xyzzy can be pruned to foo/xyzzy using --fullpath-after=/blah/src/. If you simply want to see the full path, just specify an empty string: --fullpath-after=. This isn't a special case, merely a logical consequence of the above rules. Finally, you can use --fullpath-after multiple times. Any appearance of it causes Valgrind to switch to producing full paths and applying the above filtering rule. Each produced path is compared against all the --fullpath-after-specified strings, in the order specified. The first string to match causes the path to be truncated as described above. If none match, the full path is shown. This facilitates chopping off prefixes when the sources are drawn from a number of unrelated directories. --extra-debuginfo-path=<path> [default: undefined and unused] By default Valgrind searches in several well-known paths for debug objects, such as /usr/lib/debug/. However, there may be scenarios where you may wish to put debug objects at an arbitrary location, such as external storage when running Valgrind on a mobile device with limited local storage. Another example might be a situation where you do not have permission to install debug object packages on the system where you are running Valgrind. In these scenarios, you may provide an absolute path as an extra, final place for Valgrind to search for debug objects by specifying --extra-debuginfo-path=/path/to/debug/objects. The given path will be prepended to the absolute path name of the searched-for object. For example, if Valgrind is looking for the debuginfo for /w/x/y/zz.so and --extra-debuginfo-path=/a/b/c is specified, it will look for a debug object at /a/b/c/w/x/y/zz.so. This flag should only be specified once. If it is specified multiple times, only the last instance is honoured. --debuginfo-server=ipaddr:port [default: undefined and unused] This is a new, experimental, feature introduced in version 3.9.0. In some scenarios it may be convenient to read debuginfo from objects stored on a different machine. With this flag, Valgrind will query a debuginfo server running on ipaddr and listening on port port, if it cannot find the debuginfo object in the local filesystem. The debuginfo server must accept TCP connections on port port. The debuginfo server is contained in the source file auxprogs/valgrind-di-server.c. It will only serve from the directory it is started in. port defaults to 1500 in both client and server if not specified. If Valgrind looks for the debuginfo for /w/x/y/zz.so by using the debuginfo server, it will strip the pathname components and merely request zz.so on the server. That in turn will look only in its current working directory for a matching debuginfo object. The debuginfo data is transmitted in small fragments (8 KB) as requested by Valgrind. Each block is compressed using LZO to reduce transmission time. The implementation has been tuned for best performance over a single-stage 802.11g (WiFi) network link. Note that checks for matching primary vs debug objects, using GNU debuglink CRC scheme, are performed even when using the debuginfo server. To disable such checking, you need to also specify --allow-mismatched-debuginfo=yes. By default the Valgrind build system will build valgrind-di-server for the target platform, which is almost certainly not what you want. So far we have been unable to find out how to get automake/autoconf to build it for the build platform. If you want to use it, you will have to recompile it by hand using the command shown at the top of auxprogs/valgrind-di-server.c. Valgrind can also download debuginfo via debuginfod. See the DEBUGINFOD section for more information. --allow-mismatched-debuginfo=no|yes [no] When reading debuginfo from separate debuginfo objects, Valgrind will by default check that the main and debuginfo objects match, using the GNU debuglink mechanism. This guarantees that it does not read debuginfo from out of date debuginfo objects, and also ensures that Valgrind can't crash as a result of mismatches. This check can be overridden using --allow-mismatched-debuginfo=yes. This may be useful when the debuginfo and main objects have not been split in the proper way. Be careful when using this, though: it disables all consistency checking, and Valgrind has been observed to crash when the main and debuginfo objects don't match. --suppressions=<filename> [default: $PREFIX/lib/valgrind/default.supp] Specifies an extra file from which to read descriptions of errors to suppress. You may use up to 100 extra suppression files. --gen-suppressions=<yes|no|all> [default: no] When set to yes, Valgrind will pause after every error shown and print the line: ---- Print suppression ? --- [Return/N/n/Y/y/C/c] ---- Pressing Ret, or N Ret or n Ret, causes Valgrind continue execution without printing a suppression for this error. Pressing Y Ret or y Ret causes Valgrind to write a suppression for this error. You can then cut and paste it into a suppression file if you don't want to hear about the error in the future. When set to all, Valgrind will print a suppression for every reported error, without querying the user. This option is particularly useful with C++ programs, as it prints out the suppressions with mangled names, as required. Note that the suppressions printed are as specific as possible. You may want to common up similar ones, by adding wildcards to function names, and by using frame-level wildcards. The wildcarding facilities are powerful yet flexible, and with a bit of careful editing, you may be able to suppress a whole family of related errors with only a few suppressions. Sometimes two different errors are suppressed by the same suppression, in which case Valgrind will output the suppression more than once, but you only need to have one copy in your suppression file (but having more than one won't cause problems). Also, the suppression name is given as <insert a suppression name here>; the name doesn't really matter, it's only used with the -v option which prints out all used suppression records. --input-fd=<number> [default: 0, stdin] When using --gen-suppressions=yes, Valgrind will stop so as to read keyboard input from you when each error occurs. By default it reads from the standard input (stdin), which is problematic for programs which close stdin. This option allows you to specify an alternative file descriptor from which to read input. --dsymutil=no|yes [yes] This option is only relevant when running Valgrind on macOS. macOS uses a deferred debug information (debuginfo) linking scheme. When object files containing debuginfo are linked into a .dylib or an executable, the debuginfo is not copied into the final file. Instead, the debuginfo must be linked manually by running dsymutil, a system-provided utility, on the executable or .dylib. The resulting combined debuginfo is placed in a directory alongside the executable or .dylib, but with the extension .dSYM. With --dsymutil=no, Valgrind will detect cases where the .dSYM directory is either missing, or is present but does not appear to match the associated executable or .dylib, most likely because it is out of date. In these cases, Valgrind will print a warning message but take no further action. With --dsymutil=yes, Valgrind will, in such cases, automatically run dsymutil as necessary to bring the debuginfo up to date. For all practical purposes, if you always use --dsymutil=yes, then there is never any need to run dsymutil manually or as part of your applications's build system, since Valgrind will run it as necessary. Valgrind will not attempt to run dsymutil on any executable or library in /usr/, /bin/, /sbin/, /opt/, /sw/, /System/, /Library/ or /Applications/ since dsymutil will always fail in such situations. It fails both because the debuginfo for such pre-installed system components is not available anywhere, and also because it would require write privileges in those directories. Be careful when using --dsymutil=yes, since it will cause pre-existing .dSYM directories to be silently deleted and re-created. Also note that dsymutil is quite slow, sometimes excessively so. --max-stackframe=<number> [default: 2000000] The maximum size of a stack frame. If the stack pointer moves by more than this amount then Valgrind will assume that the program is switching to a different stack. You may need to use this option if your program has large stack-allocated arrays. Valgrind keeps track of your program's stack pointer. If it changes by more than the threshold amount, Valgrind assumes your program is switching to a different stack, and Memcheck behaves differently than it would for a stack pointer change smaller than the threshold. Usually this heuristic works well. However, if your program allocates large structures on the stack, this heuristic will be fooled, and Memcheck will subsequently report large numbers of invalid stack accesses. This option allows you to change the threshold to a different value. You should only consider use of this option if Valgrind's debug output directs you to do so. In that case it will tell you the new threshold you should specify. In general, allocating large structures on the stack is a bad idea, because you can easily run out of stack space, especially on systems with limited memory or which expect to support large numbers of threads each with a small stack, and also because the error checking performed by Memcheck is more effective for heap-allocated data than for stack-allocated data. If you have to use this option, you may wish to consider rewriting your code to allocate on the heap rather than on the stack. --main-stacksize=<number> [default: use current 'ulimit' value] Specifies the size of the main thread's stack. To simplify its memory management, Valgrind reserves all required space for the main thread's stack at startup. That means it needs to know the required stack size at startup. By default, Valgrind uses the current "ulimit" value for the stack size, or 16 MB, whichever is lower. In many cases this gives a stack size in the range 8 to 16 MB, which almost never overflows for most applications. If you need a larger total stack size, use --main-stacksize to specify it. Only set it as high as you need, since reserving far more space than you need (that is, hundreds of megabytes more than you need) constrains Valgrind's memory allocators and may reduce the total amount of memory that Valgrind can use. This is only really of significance on 32-bit machines. On Linux, you may request a stack of size up to 2GB. Valgrind will stop with a diagnostic message if the stack cannot be allocated. --main-stacksize only affects the stack size for the program's initial thread. It has no bearing on the size of thread stacks, as Valgrind does not allocate those. You may need to use both --main-stacksize and --max-stackframe together. It is important to understand that --main-stacksize sets the maximum total stack size, whilst --max-stackframe specifies the largest size of any one stack frame. You will have to work out the --main-stacksize value for yourself (usually, if your applications segfaults). But Valgrind will tell you the needed --max-stackframe size, if necessary. As discussed further in the description of --max-stackframe, a requirement for a large stack is a sign of potential portability problems. You are best advised to place all large data in heap-allocated memory. --max-threads=<number> [default: 500] By default, Valgrind can handle to up to 500 threads. Occasionally, that number is too small. Use this option to provide a different limit. E.g. --max-threads=3000. --realloc-zero-bytes-frees=yes|no [default: yes for glibc no otherwise] The behaviour of realloc() is implementation defined (in C17, in C23 it is likely to become undefined). Valgrind tries to work in the same way as the underlying OS and C runtime library. However, if you use a different C runtime library then this default may be wrong. For instance, if you use Valgrind on Linux installed via a package and use the musl C runtime or the JEMalloc library then consider using --realloc-zero-bytes-frees=no. Address Sanitizer has a similar and even wordier option allocator_frees_and_returns_null_on_realloc_zero. MALLOC()-RELATED OPTIONS top For tools that use their own version of malloc (e.g. Memcheck, Massif, Helgrind, DRD), the following options apply. --alignment=<number> [default: 8 or 16, depending on the platform] By default Valgrind's malloc, realloc, etc, return a block whose starting address is 8-byte aligned or 16-byte aligned (the value depends on the platform and matches the platform default). This option allows you to specify a different alignment. The supplied value must be greater than or equal to the default, less than or equal to 4096, and must be a power of two. --redzone-size=<number> [default: depends on the tool] Valgrind's malloc, realloc, etc, add padding blocks before and after each heap block allocated by the program being run. Such padding blocks are called redzones. The default value for the redzone size depends on the tool. For example, Memcheck adds and protects a minimum of 16 bytes before and after each block allocated by the client. This allows it to detect block underruns or overruns of up to 16 bytes. Increasing the redzone size makes it possible to detect overruns of larger distances, but increases the amount of memory used by Valgrind. Decreasing the redzone size will reduce the memory needed by Valgrind but also reduces the chances of detecting over/underruns, so is not recommended. --xtree-memory=none|allocs|full [none] Tools replacing Valgrind's malloc, realloc, etc, can optionally produce an execution tree detailing which piece of code is responsible for heap memory usage. See Execution Trees for a detailed explanation about execution trees. When set to none, no memory execution tree is produced. When set to allocs, the memory execution tree gives the current number of allocated bytes and the current number of allocated blocks. When set to full, the memory execution tree gives 6 different measurements : the current number of allocated bytes and blocks (same values as for allocs), the total number of allocated bytes and blocks, the total number of freed bytes and blocks. Note that the overhead in cpu and memory to produce an xtree depends on the tool. The overhead in cpu is small for the value allocs, as the information needed to produce this report is maintained in any case by the tool. For massif and helgrind, specifying full implies to capture a stack trace for each free operation, while normally these tools only capture an allocation stack trace. For Memcheck, the cpu overhead for the value full is small, as this can only be used in combination with --keep-stacktraces=alloc-and-free or --keep-stacktraces=alloc-then-free, which already records a stack trace for each free operation. The memory overhead varies between 5 and 10 words per unique stacktrace in the xtree, plus the memory needed to record the stack trace for the free operations, if needed specifically for the xtree. --xtree-memory-file=<filename> [default: xtmemory.kcg.%p] Specifies that Valgrind should produce the xtree memory report in the specified file. Any %p or %q sequences appearing in the filename are expanded in exactly the same way as they are for --log-file. See the description of --log- file for details. If the filename contains the extension .ms, then the produced file format will be a massif output file format. If the filename contains the extension .kcg or no extension is provided or recognised, then the produced file format will be a callgrind output format. See Execution Trees for a detailed explanation about execution trees formats. UNCOMMON OPTIONS top These options apply to all tools, as they affect certain obscure workings of the Valgrind core. Most people won't need to use them. --smc-check=<none|stack|all|all-non-file> [default: all-non-file for x86/amd64/s390x, stack for other archs] This option controls Valgrind's detection of self-modifying code. If no checking is done, when a program executes some code, then overwrites it with new code, and executes the new code, Valgrind will continue to execute the translations it made for the old code. This will likely lead to incorrect behaviour and/or crashes. For "modern" architectures -- anything that's not x86, amd64 or s390x -- the default is stack. This is because a correct program must take explicit action to reestablish D-I cache coherence following code modification. Valgrind observes and honours such actions, with the result that self-modifying code is transparently handled with zero extra cost. For x86, amd64 and s390x, the program is not required to notify the hardware of required D-I coherence syncing. Hence the default is all-non-file, which covers the normal case of generating code into an anonymous (non-file-backed) mmap'd area. The meanings of the four available settings are as follows. No detection (none), detect self-modifying code on the stack (which is used by GCC to implement nested functions) (stack), detect self-modifying code everywhere (all), and detect self-modifying code everywhere except in file-backed mappings (all-non-file). Running with all will slow Valgrind down noticeably. Running with none will rarely speed things up, since very little code gets dynamically generated in most programs. The VALGRIND_DISCARD_TRANSLATIONS client request is an alternative to --smc-check=all and --smc-check=all-non-file that requires more programmer effort but allows Valgrind to run your program faster, by telling it precisely when translations need to be re-made. --smc-check=all-non-file provides a cheaper but more limited version of --smc-check=all. It adds checks to any translations that do not originate from file-backed memory mappings. Typical applications that generate code, for example JITs in web browsers, generate code into anonymous mmaped areas, whereas the "fixed" code of the browser always lives in file-backed mappings. --smc-check=all-non-file takes advantage of this observation, limiting the overhead of checking to code which is likely to be JIT generated. --read-inline-info=<yes|no> [default: see below] When enabled, Valgrind will read information about inlined function calls from DWARF3 debug info. This slows Valgrind startup and makes it use more memory (typically for each inlined piece of code, 6 words and space for the function name), but it results in more descriptive stacktraces. Currently, this functionality is enabled by default only for Linux, Android and Solaris targets and only for the tools Memcheck, Massif, Helgrind and DRD. Here is an example of some stacktraces with --read-inline-info=no: ==15380== Conditional jump or move depends on uninitialised value(s) ==15380== at 0x80484EA: main (inlinfo.c:6) ==15380== ==15380== Conditional jump or move depends on uninitialised value(s) ==15380== at 0x8048550: fun_noninline (inlinfo.c:6) ==15380== by 0x804850E: main (inlinfo.c:34) ==15380== ==15380== Conditional jump or move depends on uninitialised value(s) ==15380== at 0x8048520: main (inlinfo.c:6) And here are the same errors with --read-inline-info=yes: ==15377== Conditional jump or move depends on uninitialised value(s) ==15377== at 0x80484EA: fun_d (inlinfo.c:6) ==15377== by 0x80484EA: fun_c (inlinfo.c:14) ==15377== by 0x80484EA: fun_b (inlinfo.c:20) ==15377== by 0x80484EA: fun_a (inlinfo.c:26) ==15377== by 0x80484EA: main (inlinfo.c:33) ==15377== ==15377== Conditional jump or move depends on uninitialised value(s) ==15377== at 0x8048550: fun_d (inlinfo.c:6) ==15377== by 0x8048550: fun_noninline (inlinfo.c:41) ==15377== by 0x804850E: main (inlinfo.c:34) ==15377== ==15377== Conditional jump or move depends on uninitialised value(s) ==15377== at 0x8048520: fun_d (inlinfo.c:6) ==15377== by 0x8048520: main (inlinfo.c:35) --read-var-info=<yes|no> [default: no] When enabled, Valgrind will read information about variable types and locations from DWARF3 debug info. This slows Valgrind startup significantly and makes it use significantly more memory, but for the tools that can take advantage of it (Memcheck, Helgrind, DRD) it can result in more precise error messages. For example, here are some standard errors issued by Memcheck: ==15363== Uninitialised byte(s) found during client check request ==15363== at 0x80484A9: croak (varinfo1.c:28) ==15363== by 0x8048544: main (varinfo1.c:55) ==15363== Address 0x80497f7 is 7 bytes inside data symbol "global_i2" ==15363== ==15363== Uninitialised byte(s) found during client check request ==15363== at 0x80484A9: croak (varinfo1.c:28) ==15363== by 0x8048550: main (varinfo1.c:56) ==15363== Address 0xbea0d0cc is on thread 1's stack ==15363== in frame #1, created by main (varinfo1.c:45) And here are the same errors with --read-var-info=yes: ==15370== Uninitialised byte(s) found during client check request ==15370== at 0x80484A9: croak (varinfo1.c:28) ==15370== by 0x8048544: main (varinfo1.c:55) ==15370== Location 0x80497f7 is 0 bytes inside global_i2[7], ==15370== a global variable declared at varinfo1.c:41 ==15370== ==15370== Uninitialised byte(s) found during client check request ==15370== at 0x80484A9: croak (varinfo1.c:28) ==15370== by 0x8048550: main (varinfo1.c:56) ==15370== Location 0xbeb4a0cc is 0 bytes inside local var "local" ==15370== declared at varinfo1.c:46, in frame #1 of thread 1 --vgdb-poll=<number> [default: 5000] As part of its main loop, the Valgrind scheduler will poll to check if some activity (such as an external command or some input from a gdb) has to be handled by gdbserver. This activity poll will be done after having run the given number of basic blocks (or slightly more than the given number of basic blocks). This poll is quite cheap so the default value is set relatively low. You might further decrease this value if vgdb cannot use ptrace system call to interrupt Valgrind if all threads are (most of the time) blocked in a system call. --vgdb-shadow-registers=no|yes [default: no] When activated, gdbserver will expose the Valgrind shadow registers to GDB. With this, the value of the Valgrind shadow registers can be examined or changed using GDB. Exposing shadow registers only works with GDB version 7.1 or later. --vgdb-prefix=<prefix> [default: /tmp/vgdb-pipe] To communicate with gdb/vgdb, the Valgrind gdbserver creates 3 files (2 named FIFOs and a mmap shared memory file). The prefix option controls the directory and prefix for the creation of these files. --run-libc-freeres=<yes|no> [default: yes] This option is only relevant when running Valgrind on Linux. The GNU C library (libc.so), which is used by all programs, may allocate memory for its own uses. Usually it doesn't bother to free that memory when the program endsthere would be no point, since the Linux kernel reclaims all process resources when a process exits anyway, so it would just slow things down. The glibc authors realised that this behaviour causes leak checkers, such as Valgrind, to falsely report leaks in glibc, when a leak check is done at exit. In order to avoid this, they provided a routine called __libc_freeres specifically to make glibc release all memory it has allocated. Memcheck therefore tries to run __libc_freeres at exit. Unfortunately, in some very old versions of glibc, __libc_freeres is sufficiently buggy to cause segmentation faults. This was particularly noticeable on Red Hat 7.1. So this option is provided in order to inhibit the run of __libc_freeres. If your program seems to run fine on Valgrind, but segfaults at exit, you may find that --run-libc-freeres=no fixes that, although at the cost of possibly falsely reporting space leaks in libc.so. --run-cxx-freeres=<yes|no> [default: yes] This option is only relevant when running Valgrind on Linux or Solaris C++ programs. The GNU Standard C++ library (libstdc++.so), which is used by all C++ programs compiled with g++, may allocate memory for its own uses. Usually it doesn't bother to free that memory when the program endsthere would be no point, since the kernel reclaims all process resources when a process exits anyway, so it would just slow things down. The gcc authors realised that this behaviour causes leak checkers, such as Valgrind, to falsely report leaks in libstdc++, when a leak check is done at exit. In order to avoid this, they provided a routine called __gnu_cxx::__freeres specifically to make libstdc++ release all memory it has allocated. Memcheck therefore tries to run __gnu_cxx::__freeres at exit. For the sake of flexibility and unforeseen problems with __gnu_cxx::__freeres, option --run-cxx-freeres=no exists, although at the cost of possibly falsely reporting space leaks in libstdc++.so. --sim-hints=hint1,hint2,... Pass miscellaneous hints to Valgrind which slightly modify the simulated behaviour in nonstandard or dangerous ways, possibly to help the simulation of strange features. By default no hints are enabled. Use with caution! Currently known hints are: lax-ioctls: Be very lax about ioctl handling; the only assumption is that the size is correct. Doesn't require the full buffer to be initialised when writing. Without this, using some device drivers with a large number of strange ioctl commands becomes very tiresome. fuse-compatible: Enable special handling for certain system calls that may block in a FUSE file-system. This may be necessary when running Valgrind on a multi-threaded program that uses one thread to manage a FUSE file-system and another thread to access that file-system. enable-outer: Enable some special magic needed when the program being run is itself Valgrind. no-inner-prefix: Disable printing a prefix > in front of each stdout or stderr output line in an inner Valgrind being run by an outer Valgrind. This is useful when running Valgrind regression tests in an outer/inner setup. Note that the prefix > will always be printed in front of the inner debug logging lines. no-nptl-pthread-stackcache: This hint is only relevant when running Valgrind on Linux; it is ignored on FreeBSD, Solaris and macOS. The GNU glibc pthread library (libpthread.so), which is used by pthread programs, maintains a cache of pthread stacks. When a pthread terminates, the memory used for the pthread stack and some thread local storage related data structure are not always directly released. This memory is kept in a cache (up to a certain size), and is re-used if a new thread is started. This cache causes the helgrind tool to report some false positive race condition errors on this cached memory, as helgrind does not understand the internal glibc cache synchronisation primitives. So, when using helgrind, disabling the cache helps to avoid false positive race conditions, in particular when using thread local storage variables (e.g. variables using the __thread qualifier). When using the memcheck tool, disabling the cache ensures the memory used by glibc to handle __thread variables is directly released when a thread terminates. Note: Valgrind disables the cache using some internal knowledge of the glibc stack cache implementation and by examining the debug information of the pthread library. This technique is thus somewhat fragile and might not work for all glibc versions. This has been successfully tested with various glibc versions (e.g. 2.11, 2.16, 2.18) on various platforms. lax-doors: (Solaris only) Be very lax about door syscall handling over unrecognised door file descriptors. Does not require that full buffer is initialised when writing. Without this, programs using libdoor(3LIB) functionality with completely proprietary semantics may report large number of false positives. fallback-llsc: (MIPS and ARM64 only): Enables an alternative implementation of Load-Linked (LL) and Store-Conditional (SC) instructions. The standard implementation gives more correct behaviour, but can cause indefinite looping on certain processor implementations that are intolerant of extra memory references between LL and SC. So far this is known only to happen on Cavium 3 cores. You should not need to use this flag, since the relevant cores are detected at startup and the alternative implementation is automatically enabled if necessary. There is no equivalent anti-flag: you cannot force-disable the alternative implementation, if it is automatically enabled. The underlying problem exists because the "standard" implementation of LL and SC is done by copying through LL and SC instructions into the instrumented code. However, tools may insert extra instrumentation memory references in between the LL and SC instructions. These memory references are not present in the original uninstrumented code, and their presence in the instrumented code can cause the SC instructions to persistently fail, leading to indefinite looping in LL-SC blocks. The alternative implementation gives correct behaviour of LL and SC instructions between threads in a process, up to and including the ABA scenario. It also gives correct behaviour between a Valgrinded thread and a non-Valgrinded thread running in a different process, that communicate via shared memory, but only up to and including correct CAS behaviour -- in this case the ABA scenario may not be correctly handled. --scheduling-quantum=<number> [default: 100000] The --scheduling-quantum option controls the maximum number of basic blocks executed by a thread before releasing the lock used by Valgrind to serialise thread execution. Smaller values give finer interleaving but increases the scheduling overhead. Finer interleaving can be useful to reproduce race conditions with helgrind or DRD. For more details about the Valgrind thread serialisation scheme and its impact on performance and thread scheduling, see Scheduling and Multi- Thread Performance. --fair-sched=<no|yes|try> [default: no] The --fair-sched option controls the locking mechanism used by Valgrind to serialise thread execution. The locking mechanism controls the way the threads are scheduled, and different settings give different trade-offs between fairness and performance. For more details about the Valgrind thread serialisation scheme and its impact on performance and thread scheduling, see Scheduling and Multi-Thread Performance. The value --fair-sched=yes activates a fair scheduler. In short, if multiple threads are ready to run, the threads will be scheduled in a round robin fashion. This mechanism is not available on all platforms or Linux versions. If not available, using --fair-sched=yes will cause Valgrind to terminate with an error. You may find this setting improves overall responsiveness if you are running an interactive multithreaded program, for example a web browser, on Valgrind. The value --fair-sched=try activates fair scheduling if available on the platform. Otherwise, it will automatically fall back to --fair-sched=no. The value --fair-sched=no activates a scheduler which does not guarantee fairness between threads ready to run, but which in general gives the highest performance. --kernel-variant=variant1,variant2,... Handle system calls and ioctls arising from minor variants of the default kernel for this platform. This is useful for running on hacked kernels or with kernel modules which support nonstandard ioctls, for example. Use with caution. If you don't understand what this option does then you almost certainly don't need it. Currently known variants are: bproc: support the sys_broc system call on x86. This is for running on BProc, which is a minor variant of standard Linux which is sometimes used for building clusters. android-no-hw-tls: some versions of the Android emulator for ARM do not provide a hardware TLS (thread-local state) register, and Valgrind crashes at startup. Use this variant to select software support for TLS. android-gpu-sgx5xx: use this to support handling of proprietary ioctls for the PowerVR SGX 5XX series of GPUs on Android devices. Failure to select this does not cause stability problems, but may cause Memcheck to report false errors after the program performs GPU-specific ioctls. android-gpu-adreno3xx: similarly, use this to support handling of proprietary ioctls for the Qualcomm Adreno 3XX series of GPUs on Android devices. --merge-recursive-frames=<number> [default: 0] Some recursive algorithms, for example balanced binary tree implementations, create many different stack traces, each containing cycles of calls. A cycle is defined as two identical program counter values separated by zero or more other program counter values. Valgrind may then use a lot of memory to store all these stack traces. This is a poor use of memory considering that such stack traces contain repeated uninteresting recursive calls instead of more interesting information such as the function that has initiated the recursive call. The option --merge-recursive-frames=<number> instructs Valgrind to detect and merge recursive call cycles having a size of up to <number> frames. When such a cycle is detected, Valgrind records the cycle in the stack trace as a unique program counter. The value 0 (the default) causes no recursive call merging. A value of 1 will cause stack traces of simple recursive algorithms (for example, a factorial implementation) to be collapsed. A value of 2 will usually be needed to collapse stack traces produced by recursive algorithms such as binary trees, quick sort, etc. Higher values might be needed for more complex recursive algorithms. Note: recursive calls are detected by analysis of program counter values. They are not detected by looking at function names. --num-transtab-sectors=<number> [default: 6 for Android platforms, 16 for all others] Valgrind translates and instruments your program's machine code in small fragments (basic blocks). The translations are stored in a translation cache that is divided into a number of sections (sectors). If the cache is full, the sector containing the oldest translations is emptied and reused. If these old translations are needed again, Valgrind must re-translate and re-instrument the corresponding machine code, which is expensive. If the "executed instructions" working set of a program is big, increasing the number of sectors may improve performance by reducing the number of re-translations needed. Sectors are allocated on demand. Once allocated, a sector can never be freed, and occupies considerable space, depending on the tool and the value of --avg-transtab-entry-size (about 40 MB per sector for Memcheck). Use the option --stats=yes to obtain precise information about the memory used by a sector and the allocation and recycling of sectors. --avg-transtab-entry-size=<number> [default: 0, meaning use tool provided default] Average size of translated basic block. This average size is used to dimension the size of a sector. Each tool provides a default value to be used. If this default value is too small, the translation sectors will become full too quickly. If this default value is too big, a significant part of the translation sector memory will be unused. Note that the average size of a basic block translation depends on the tool, and might depend on tool options. For example, the memcheck option --track-origins=yes increases the size of the basic block translations. Use --avg-transtab-entry-size to tune the size of the sectors, either to gain memory or to avoid too many retranslations. --aspace-minaddr=<address> [default: depends on the platform] To avoid potential conflicts with some system libraries, Valgrind does not use the address space below --aspace-minaddr value, keeping it reserved in case a library specifically requests memory in this region. So, some "pessimistic" value is guessed by Valgrind depending on the platform. On linux, by default, Valgrind avoids using the first 64MB even if typically there is no conflict in this complete zone. You can use the option --aspace-minaddr to have your memory hungry application benefitting from more of this lower memory. On the other hand, if you encounter a conflict, increasing aspace-minaddr value might solve it. Conflicts will typically manifest themselves with mmap failures in the low range of the address space. The provided address must be page aligned and must be equal or bigger to 0x1000 (4KB). To find the default value on your platform, do something such as valgrind -d -d date 2>&1 | grep -i minaddr. Values lower than 0x10000 (64KB) are known to create problems on some distributions. --valgrind-stacksize=<number> [default: 1MB] For each thread, Valgrind needs its own 'private' stack. The default size for these stacks is largely dimensioned, and so should be sufficient in most cases. In case the size is too small, Valgrind will segfault. Before segfaulting, a warning might be produced by Valgrind when approaching the limit. Use the option --valgrind-stacksize if such an (unlikely) warning is produced, or Valgrind dies due to a segmentation violation. Such segmentation violations have been seen when demangling huge C++ symbols. If your application uses many threads and needs a lot of memory, you can gain some memory by reducing the size of these Valgrind stacks using the option --valgrind-stacksize. --show-emwarns=<yes|no> [default: no] When enabled, Valgrind will emit warnings about its CPU emulation in certain cases. These are usually not interesting. --require-text-symbol=:sonamepatt:fnnamepatt When a shared object whose soname matches sonamepatt is loaded into the process, examine all the text symbols it exports. If none of those match fnnamepatt, print an error message and abandon the run. This makes it possible to ensure that the run does not continue unless a given shared object contains a particular function name. Both sonamepatt and fnnamepatt can be written using the usual ? and * wildcards. For example: ":*libc.so*:foo?bar". You may use characters other than a colon to separate the two patterns. It is only important that the first character and the separator character are the same. For example, the above example could also be written "Q*libc.so*Qfoo?bar". Multiple --require-text-symbol flags are allowed, in which case shared objects that are loaded into the process will be checked against all of them. The purpose of this is to support reliable usage of marked-up libraries. For example, suppose we have a version of GCC's libgomp.so which has been marked up with annotations to support Helgrind. It is only too easy and confusing to load the wrong, un-annotated libgomp.so into the application. So the idea is: add a text symbol in the marked-up library, for example annotated_for_helgrind_3_6, and then give the flag --require-text-symbol=:*libgomp*so*:annotated_for_helgrind_3_6 so that when libgomp.so is loaded, Valgrind scans its symbol table, and if the symbol isn't present the run is aborted, rather than continuing silently with the un-marked-up library. Note that you should put the entire flag in quotes to stop shells expanding up the * and ? wildcards. --soname-synonyms=syn1=pattern1,syn2=pattern2,... When a shared library is loaded, Valgrind checks for functions in the library that must be replaced or wrapped. For example, Memcheck replaces some string and memory functions (strchr, strlen, strcpy, memchr, memcpy, memmove, etc.) with its own versions. Such replacements are normally done only in shared libraries whose soname matches a predefined soname pattern (e.g. libc.so* on linux). By default, no replacement is done for a statically linked binary or for alternative libraries, except for the allocation functions (malloc, free, calloc, memalign, realloc, operator new, operator delete, etc.) Such allocation functions are intercepted by default in any shared library or in the executable if they are exported as global symbols. This means that if a replacement allocation library such as tcmalloc is found, its functions are also intercepted by default. In some cases, the replacements allow --soname-synonyms to specify one additional synonym pattern, giving flexibility in the replacement. Or to prevent interception of all public allocation symbols. Currently, this flexibility is only allowed for the malloc related functions, using the synonym somalloc. This synonym is usable for all tools doing standard replacement of malloc related functions (e.g. memcheck, helgrind, drd, massif, dhat). Alternate malloc library: to replace the malloc related functions in a specific alternate library with soname mymalloclib.so (and not in any others), give the option --soname-synonyms=somalloc=mymalloclib.so. A pattern can be used to match multiple libraries sonames. For example, --soname-synonyms=somalloc=*tcmalloc* will match the soname of all variants of the tcmalloc library (native, debug, profiled, ... tcmalloc variants). Note: the soname of a elf shared library can be retrieved using the readelf utility. Replacements in a statically linked library are done by using the NONE pattern. For example, if you link with libtcmalloc.a, and only want to intercept the malloc related functions in the executable (and standard libraries) themselves, but not any other shared libraries, you can give the option --soname-synonyms=somalloc=NONE. Note that a NONE pattern will match the main executable and any shared library having no soname. To run a "default" Firefox build for Linux, in which JEMalloc is linked in to the main executable, use --soname-synonyms=somalloc=NONE. To only intercept allocation symbols in the default system libraries, but not in any other shared library or the executable defining public malloc or operator new related functions use a non-existing library name like --soname-synonyms=somalloc=nouserintercepts (where nouserintercepts can be any non-existing library name). Shared library of the dynamic (runtime) linker is excluded from searching for global public symbols, such as those for the malloc related functions (identified by somalloc synonym). --progress-interval=<number> [default: 0, meaning 'disabled'] This is an enhancement to Valgrind's debugging output. It is unlikely to be of interest to end users. When number is set to a non-zero value, Valgrind will print a one-line progress summary every number seconds. Valid settings for number are between 0 and 3600 inclusive. Here's some example output with number set to 10: PROGRESS: U 110s, W 113s, 97.3% CPU, EvC 414.79M, TIn 616.7k, TOut 0.5k, #thr 67 PROGRESS: U 120s, W 124s, 96.8% CPU, EvC 505.27M, TIn 636.6k, TOut 3.0k, #thr 64 PROGRESS: U 130s, W 134s, 97.0% CPU, EvC 574.90M, TIn 657.5k, TOut 3.0k, #thr 63 Each line shows: U: total user time W: total wallclock time CPU: overall average cpu use EvC: number of event checks. An event check is a backwards branch in the simulated program, so this is a measure of forward progress of the program TIn: number of code blocks instrumented by the JIT TOut: number of instrumented code blocks that have been thrown away #thr: number of threads in the program From the progress of these, it is possible to observe: when the program is compute bound (TIn rises slowly, EvC rises rapidly) when the program is in a spinloop (TIn/TOut fixed, EvC rises rapidly) when the program is JIT-bound (TIn rises rapidly) when the program is rapidly discarding code (TOut rises rapidly) when the program is about to achieve some expected state (EvC arrives at some value you expect) when the program is idling (U rises more slowly than W) DEBUGGING VALGRIND OPTIONS top There are also some options for debugging Valgrind itself. You shouldn't need to use them in the normal run of things. If you wish to see the list, use the --help-debug option. MEMCHECK OPTIONS top --leak-check=<no|summary|yes|full> [default: summary] When enabled, search for memory leaks when the client program finishes. If set to summary, it says how many leaks occurred. If set to full or yes, each individual leak will be shown in detail and/or counted as an error, as specified by the options --show-leak-kinds and --errors-for-leak-kinds. If --xml=yes is given, memcheck will automatically use the value --leak-check=full. You can use --show-leak-kinds=none to reduce the size of the xml output if you are not interested in the leak results. --leak-resolution=<low|med|high> [default: high] When doing leak checking, determines how willing Memcheck is to consider different backtraces to be the same for the purposes of merging multiple leaks into a single leak report. When set to low, only the first two entries need match. When med, four entries have to match. When high, all entries need to match. For hardcore leak debugging, you probably want to use --leak-resolution=high together with --num-callers=40 or some such large number. Note that the --leak-resolution setting does not affect Memcheck's ability to find leaks. It only changes how the results are presented. --show-leak-kinds=<set> [default: definite,possible] Specifies the leak kinds to show in a full leak search, in one of the following ways: a comma separated list of one or more of definite indirect possible reachable. all to specify the complete set (all leak kinds). It is equivalent to --show-leak-kinds=definite,indirect,possible,reachable. none for the empty set. --errors-for-leak-kinds=<set> [default: definite,possible] Specifies the leak kinds to count as errors in a full leak search. The <set> is specified similarly to --show-leak-kinds --leak-check-heuristics=<set> [default: all] Specifies the set of leak check heuristics to be used during leak searches. The heuristics control which interior pointers to a block cause it to be considered as reachable. The heuristic set is specified in one of the following ways: a comma separated list of one or more of stdstring length64 newarray multipleinheritance. all to activate the complete set of heuristics. It is equivalent to --leak-check-heuristics=stdstring,length64,newarray,multipleinheritance. none for the empty set. Note that these heuristics are dependent on the layout of the objects produced by the C++ compiler. They have been tested with some gcc versions (e.g. 4.4 and 4.7). They might not work properly with other C++ compilers. --show-reachable=<yes|no> , --show-possibly-lost=<yes|no> These options provide an alternative way to specify the leak kinds to show: --show-reachable=no --show-possibly-lost=yes is equivalent to --show-leak-kinds=definite,possible. --show-reachable=no --show-possibly-lost=no is equivalent to --show-leak-kinds=definite. --show-reachable=yes is equivalent to --show-leak-kinds=all. Note that --show-possibly-lost=no has no effect if --show-reachable=yes is specified. --xtree-leak=<no|yes> [no] If set to yes, the results for the leak search done at exit will be output in a 'Callgrind Format' execution tree file. Note that this automatically sets the options --leak-check=full and --show-leak-kinds=all, to allow xtree visualisation tools such as kcachegrind to select what kind to leak to visualise. The produced file will contain the following events: RB : Reachable Bytes PB : Possibly lost Bytes IB : Indirectly lost Bytes DB : Definitely lost Bytes (direct plus indirect) DIB : Definitely Indirectly lost Bytes (subset of DB) RBk : reachable Blocks PBk : Possibly lost Blocks IBk : Indirectly lost Blocks DBk : Definitely lost Blocks The increase or decrease for all events above will also be output in the file to provide the delta (increase or decrease) between 2 successive leak searches. For example, iRB is the increase of the RB event, dPBk is the decrease of PBk event. The values for the increase and decrease events will be zero for the first leak search done. See Execution Trees for a detailed explanation about execution trees. --xtree-leak-file=<filename> [default: xtleak.kcg.%p] Specifies that Valgrind should produce the xtree leak report in the specified file. Any %p, %q or %n sequences appearing in the filename are expanded in exactly the same way as they are for --log-file. See the description of --log-file for details. See Execution Trees for a detailed explanation about execution trees formats. --undef-value-errors=<yes|no> [default: yes] Controls whether Memcheck reports uses of undefined value errors. Set this to no if you don't want to see undefined value errors. It also has the side effect of speeding up Memcheck somewhat. AddrCheck (removed in Valgrind 3.1.0) functioned like Memcheck with --undef-value-errors=no. --track-origins=<yes|no> [default: no] Controls whether Memcheck tracks the origin of uninitialised values. By default, it does not, which means that although it can tell you that an uninitialised value is being used in a dangerous way, it cannot tell you where the uninitialised value came from. This often makes it difficult to track down the root problem. When set to yes, Memcheck keeps track of the origins of all uninitialised values. Then, when an uninitialised value error is reported, Memcheck will try to show the origin of the value. An origin can be one of the following four places: a heap block, a stack allocation, a client request, or miscellaneous other sources (eg, a call to brk). For uninitialised values originating from a heap block, Memcheck shows where the block was allocated. For uninitialised values originating from a stack allocation, Memcheck can tell you which function allocated the value, but no more than that -- typically it shows you the source location of the opening brace of the function. So you should carefully check that all of the function's local variables are initialised properly. Performance overhead: origin tracking is expensive. It halves Memcheck's speed and increases memory use by a minimum of 100MB, and possibly more. Nevertheless it can drastically reduce the effort required to identify the root cause of uninitialised value errors, and so is often a programmer productivity win, despite running more slowly. Accuracy: Memcheck tracks origins quite accurately. To avoid very large space and time overheads, some approximations are made. It is possible, although unlikely, that Memcheck will report an incorrect origin, or not be able to identify any origin. Note that the combination --track-origins=yes and --undef-value-errors=no is nonsensical. Memcheck checks for and rejects this combination at startup. --partial-loads-ok=<yes|no> [default: yes] Controls how Memcheck handles 32-, 64-, 128- and 256-bit naturally aligned loads from addresses for which some bytes are addressable and others are not. When yes, such loads do not produce an address error. Instead, loaded bytes originating from illegal addresses are marked as uninitialised, and those corresponding to legal addresses are handled in the normal way. When no, loads from partially invalid addresses are treated the same as loads from completely invalid addresses: an illegal-address error is issued, and the resulting bytes are marked as initialised. Note that code that behaves in this way is in violation of the ISO C/C++ standards, and should be considered broken. If at all possible, such code should be fixed. --expensive-definedness-checks=<no|auto|yes> [default: auto] Controls whether Memcheck should employ more precise but also more expensive (time consuming) instrumentation when checking the definedness of certain values. In particular, this affects the instrumentation of integer adds, subtracts and equality comparisons. Selecting --expensive-definedness-checks=yes causes Memcheck to use the most accurate analysis possible. This minimises false error rates but can cause up to 30% performance degradation. Selecting --expensive-definedness-checks=no causes Memcheck to use the cheapest instrumentation possible. This maximises performance but will normally give an unusably high false error rate. The default setting, --expensive-definedness-checks=auto, is strongly recommended. This causes Memcheck to use the minimum of expensive instrumentation needed to achieve the same false error rate as --expensive-definedness-checks=yes. It also enables an instrumentation-time analysis pass which aims to further reduce the costs of accurate instrumentation. Overall, the performance loss is generally around 5% relative to --expensive-definedness-checks=no, although this is strongly workload dependent. Note that the exact instrumentation settings in this mode are architecture dependent. --keep-stacktraces=alloc|free|alloc-and-free|alloc-then-free|none [default: alloc-and-free] Controls which stack trace(s) to keep for malloc'd and/or free'd blocks. With alloc-then-free, a stack trace is recorded at allocation time, and is associated with the block. When the block is freed, a second stack trace is recorded, and this replaces the allocation stack trace. As a result, any "use after free" errors relating to this block can only show a stack trace for where the block was freed. With alloc-and-free, both allocation and the deallocation stack traces for the block are stored. Hence a "use after free" error will show both, which may make the error easier to diagnose. Compared to alloc-then-free, this setting slightly increases Valgrind's memory use as the block contains two references instead of one. With alloc, only the allocation stack trace is recorded (and reported). With free, only the deallocation stack trace is recorded (and reported). These values somewhat decrease Valgrind's memory and cpu usage. They can be useful depending on the error types you are searching for and the level of detail you need to analyse them. For example, if you are only interested in memory leak errors, it is sufficient to record the allocation stack traces. With none, no stack traces are recorded for malloc and free operations. If your program allocates a lot of blocks and/or allocates/frees from many different stack traces, this can significantly decrease cpu and/or memory required. Of course, few details will be reported for errors related to heap blocks. Note that once a stack trace is recorded, Valgrind keeps the stack trace in memory even if it is not referenced by any block. Some programs (for example, recursive algorithms) can generate a huge number of stack traces. If Valgrind uses too much memory in such circumstances, you can reduce the memory required with the options --keep-stacktraces and/or by using a smaller value for the option --num-callers. If you want to use --xtree-memory=full memory profiling (see Execution Trees), then you cannot specify --keep-stacktraces=free or --keep-stacktraces=none. --freelist-vol=<number> [default: 20000000] When the client program releases memory using free (in C) or delete (C++), that memory is not immediately made available for re-allocation. Instead, it is marked inaccessible and placed in a queue of freed blocks. The purpose is to defer as long as possible the point at which freed-up memory comes back into circulation. This increases the chance that Memcheck will be able to detect invalid accesses to blocks for some significant period of time after they have been freed. This option specifies the maximum total size, in bytes, of the blocks in the queue. The default value is twenty million bytes. Increasing this increases the total amount of memory used by Memcheck but may detect invalid uses of freed blocks which would otherwise go undetected. --freelist-big-blocks=<number> [default: 1000000] When making blocks from the queue of freed blocks available for re-allocation, Memcheck will in priority re-circulate the blocks with a size greater or equal to --freelist-big-blocks. This ensures that freeing big blocks (in particular freeing blocks bigger than --freelist-vol) does not immediately lead to a re-circulation of all (or a lot of) the small blocks in the free list. In other words, this option increases the likelihood to discover dangling pointers for the "small" blocks, even when big blocks are freed. Setting a value of 0 means that all the blocks are re-circulated in a FIFO order. --workaround-gcc296-bugs=<yes|no> [default: no] When enabled, assume that reads and writes some small distance below the stack pointer are due to bugs in GCC 2.96, and does not report them. The "small distance" is 256 bytes by default. Note that GCC 2.96 is the default compiler on some ancient Linux distributions (RedHat 7.X) and so you may need to use this option. Do not use it if you do not have to, as it can cause real errors to be overlooked. A better alternative is to use a more recent GCC in which this bug is fixed. You may also need to use this option when working with GCC 3.X or 4.X on 32-bit PowerPC Linux. This is because GCC generates code which occasionally accesses below the stack pointer, particularly for floating-point to/from integer conversions. This is in violation of the 32-bit PowerPC ELF specification, which makes no provision for locations below the stack pointer to be accessible. This option is deprecated as of version 3.12 and may be removed from future versions. You should instead use --ignore-range-below-sp to specify the exact range of offsets below the stack pointer that should be ignored. A suitable equivalent is --ignore-range-below-sp=1024-1. --ignore-range-below-sp=<number>-<number> This is a more general replacement for the deprecated --workaround-gcc296-bugs option. When specified, it causes Memcheck not to report errors for accesses at the specified offsets below the stack pointer. The two offsets must be positive decimal numbers and -- somewhat counterintuitively -- the first one must be larger, in order to imply a non-wraparound address range to ignore. For example, to ignore 4 byte accesses at 8192 bytes below the stack pointer, use --ignore-range-below-sp=8192-8189. Only one range may be specified. --show-mismatched-frees=<yes|no> [default: yes] When enabled, Memcheck checks that heap blocks are deallocated using a function that matches the allocating function. That is, it expects free to be used to deallocate blocks allocated by malloc, delete for blocks allocated by new, and delete[] for blocks allocated by new[]. If a mismatch is detected, an error is reported. This is in general important because in some environments, freeing with a non-matching function can cause crashes. There is however a scenario where such mismatches cannot be avoided. That is when the user provides implementations of new/new[] that call malloc and of delete/delete[] that call free, and these functions are asymmetrically inlined. For example, imagine that delete[] is inlined but new[] is not. The result is that Memcheck "sees" all delete[] calls as direct calls to free, even when the program source contains no mismatched calls. This causes a lot of confusing and irrelevant error reports. --show-mismatched-frees=no disables these checks. It is not generally advisable to disable them, though, because you may miss real errors as a result. --ignore-ranges=0xPP-0xQQ[,0xRR-0xSS] Any ranges listed in this option (and multiple ranges can be specified, separated by commas) will be ignored by Memcheck's addressability checking. --malloc-fill=<hexnumber> Fills blocks allocated by malloc, new, etc, but not by calloc, with the specified byte. This can be useful when trying to shake out obscure memory corruption problems. The allocated area is still regarded by Memcheck as undefined -- this option only affects its contents. Note that --malloc-fill does not affect a block of memory when it is used as argument to client requests VALGRIND_MEMPOOL_ALLOC or VALGRIND_MALLOCLIKE_BLOCK. --free-fill=<hexnumber> Fills blocks freed by free, delete, etc, with the specified byte value. This can be useful when trying to shake out obscure memory corruption problems. The freed area is still regarded by Memcheck as not valid for access -- this option only affects its contents. Note that --free-fill does not affect a block of memory when it is used as argument to client requests VALGRIND_MEMPOOL_FREE or VALGRIND_FREELIKE_BLOCK. CACHEGRIND OPTIONS top --cachegrind-out-file=<file> Write the Cachegrind output file to file rather than to the default output file, cachegrind.out.<pid>. The %p and %q format specifiers can be used to embed the process ID and/or the contents of an environment variable in the name, as is the case for the core option --log-file. --cache-sim=no|yes [no] Enables or disables collection of cache access and miss counts. --branch-sim=no|yes [no] Enables or disables collection of branch instruction and misprediction counts. --instr-at-start=no|yes [yes] Enables or disables instrumentation at the start of execution. Use this in combination with CACHEGRIND_START_INSTRUMENTATION and CACHEGRIND_STOP_INSTRUMENTATION to measure only part of a client program's execution. --I1=<size>,<associativity>,<line size> Specify the size, associativity and line size of the level 1 instruction cache. Only useful with --cache-sim=yes. --D1=<size>,<associativity>,<line size> Specify the size, associativity and line size of the level 1 data cache. Only useful with --cache-sim=yes. --LL=<size>,<associativity>,<line size> Specify the size, associativity and line size of the last-level cache. Only useful with --cache-sim=yes. CALLGRIND OPTIONS top --callgrind-out-file=<file> Write the profile data to file rather than to the default output file, callgrind.out.<pid>. The %p and %q format specifiers can be used to embed the process ID and/or the contents of an environment variable in the name, as is the case for the core option --log-file. When multiple dumps are made, the file name is modified further; see below. --dump-line=<no|yes> [default: yes] This specifies that event counting should be performed at source line granularity. This allows source annotation for sources which are compiled with debug information (-g). --dump-instr=<no|yes> [default: no] This specifies that event counting should be performed at per-instruction granularity. This allows for assembly code annotation. Currently the results can only be displayed by KCachegrind. --compress-strings=<no|yes> [default: yes] This option influences the output format of the profile data. It specifies whether strings (file and function names) should be identified by numbers. This shrinks the file, but makes it more difficult for humans to read (which is not recommended in any case). --compress-pos=<no|yes> [default: yes] This option influences the output format of the profile data. It specifies whether numerical positions are always specified as absolute values or are allowed to be relative to previous numbers. This shrinks the file size. --combine-dumps=<no|yes> [default: no] When enabled, when multiple profile data parts are to be generated these parts are appended to the same output file. Not recommended. --dump-every-bb=<count> [default: 0, never] Dump profile data every count basic blocks. Whether a dump is needed is only checked when Valgrind's internal scheduler is run. Therefore, the minimum setting useful is about 100000. The count is a 64-bit value to make long dump periods possible. --dump-before=<function> Dump when entering function. --zero-before=<function> Zero all costs when entering function. --dump-after=<function> Dump when leaving function. --instr-atstart=<yes|no> [default: yes] Specify if you want Callgrind to start simulation and profiling from the beginning of the program. When set to no, Callgrind will not be able to collect any information, including calls, but it will have at most a slowdown of around 4, which is the minimum Valgrind overhead. Instrumentation can be interactively enabled via callgrind_control -i on. Note that the resulting call graph will most probably not contain main, but will contain all the functions executed after instrumentation was enabled. Instrumentation can also be programmatically enabled/disabled. See the Callgrind include file callgrind.h for the macro you have to use in your source code. For cache simulation, results will be less accurate when switching on instrumentation later in the program run, as the simulator starts with an empty cache at that moment. Switch on event collection later to cope with this error. --collect-atstart=<yes|no> [default: yes] Specify whether event collection is enabled at beginning of the profile run. To only look at parts of your program, you have two possibilities: 1. Zero event counters before entering the program part you want to profile, and dump the event counters to a file after leaving that program part. 2. Switch on/off collection state as needed to only see event counters happening while inside of the program part you want to profile. The second option can be used if the program part you want to profile is called many times. Option 1, i.e. creating a lot of dumps is not practical here. Collection state can be toggled at entry and exit of a given function with the option --toggle-collect. If you use this option, collection state should be disabled at the beginning. Note that the specification of --toggle-collect implicitly sets --collect-state=no. Collection state can be toggled also by inserting the client request CALLGRIND_TOGGLE_COLLECT ; at the needed code positions. --toggle-collect=<function> Toggle collection on entry/exit of function. --collect-jumps=<no|yes> [default: no] This specifies whether information for (conditional) jumps should be collected. As above, callgrind_annotate currently is not able to show you the data. You have to use KCachegrind to get jump arrows in the annotated code. --collect-systime=<no|yes|msec|usec|nsec> [default: no] This specifies whether information for system call times should be collected. The value no indicates to record no system call information. The other values indicate to record the number of system calls done (sysCount event) and the elapsed time (sysTime event) spent in system calls. The --collect-systime value gives the unit used for sysTime : milli seconds, micro seconds or nano seconds. With the value nsec, callgrind also records the cpu time spent during system calls (sysCpuTime). The value yes is a synonym of msec. The value nsec is not supported on Darwin. --collect-bus=<no|yes> [default: no] This specifies whether the number of global bus events executed should be collected. The event type "Ge" is used for these events. --cache-sim=<yes|no> [default: no] Specify if you want to do full cache simulation. By default, only instruction read accesses will be counted ("Ir"). With cache simulation, further event counters are enabled: Cache misses on instruction reads ("I1mr"/"ILmr"), data read accesses ("Dr") and related cache misses ("D1mr"/"DLmr"), data write accesses ("Dw") and related cache misses ("D1mw"/"DLmw"). For more information, see Cachegrind: a cache and branch-prediction profiler. --branch-sim=<yes|no> [default: no] Specify if you want to do branch prediction simulation. Further event counters are enabled: Number of executed conditional branches and related predictor misses ("Bc"/"Bcm"), executed indirect jumps and related misses of the jump address predictor ("Bi"/"Bim"). HELGRIND OPTIONS top --free-is-write=no|yes [default: no] When enabled (not the default), Helgrind treats freeing of heap memory as if the memory was written immediately before the free. This exposes races where memory is referenced by one thread, and freed by another, but there is no observable synchronisation event to ensure that the reference happens before the free. This functionality is new in Valgrind 3.7.0, and is regarded as experimental. It is not enabled by default because its interaction with custom memory allocators is not well understood at present. User feedback is welcomed. --track-lockorders=no|yes [default: yes] When enabled (the default), Helgrind performs lock order consistency checking. For some buggy programs, the large number of lock order errors reported can become annoying, particularly if you're only interested in race errors. You may therefore find it helpful to disable lock order checking. --history-level=none|approx|full [default: full] --history-level=full (the default) causes Helgrind collects enough information about "old" accesses that it can produce two stack traces in a race report -- both the stack trace for the current access, and the trace for the older, conflicting access. To limit memory usage, "old" accesses stack traces are limited to a maximum of --history-backtrace-size entries (default 8) or to --num-callers value if this value is smaller. Collecting such information is expensive in both speed and memory, particularly for programs that do many inter-thread synchronisation events (locks, unlocks, etc). Without such information, it is more difficult to track down the root causes of races. Nonetheless, you may not need it in situations where you just want to check for the presence or absence of races, for example, when doing regression testing of a previously race-free program. --history-level=none is the opposite extreme. It causes Helgrind not to collect any information about previous accesses. This can be dramatically faster than --history-level=full. --history-level=approx provides a compromise between these two extremes. It causes Helgrind to show a full trace for the later access, and approximate information regarding the earlier access. This approximate information consists of two stacks, and the earlier access is guaranteed to have occurred somewhere between program points denoted by the two stacks. This is not as useful as showing the exact stack for the previous access (as --history-level=full does), but it is better than nothing, and it is almost as fast as --history-level=none. --history-backtrace-size=<number> [default: 8] When --history-level=full is selected, --history-backtrace-size=number indicates how many entries to record in "old" accesses stack traces. --delta-stacktrace=no|yes [default: yes on linux amd64/x86] This flag only has any effect at --history-level=full. --delta-stacktrace configures the way Helgrind captures the stacktraces for the option --history-level=full. Such a stacktrace is typically needed each time a new piece of memory is read or written in a basic block of instructions. --delta-stacktrace=no causes Helgrind to compute a full history stacktrace from the unwind info each time a stacktrace is needed. --delta-stacktrace=yes indicates to Helgrind to derive a new stacktrace from the previous stacktrace, as long as there was no call instruction, no return instruction, or any other instruction changing the call stack since the previous stacktrace was captured. If no such instruction was executed, the new stacktrace can be derived from the previous stacktrace by just changing the top frame to the current program counter. This option can speed up Helgrind by 25% when using --history-level=full. The following aspects have to be considered when using --delta-stacktrace=yes : In some cases (for example in a function prologue), the valgrind unwinder might not properly unwind the stack, due to some limitations and/or due to wrong unwind info. When using --delta-stacktrace=yes, the wrong stack trace captured in the function prologue will be kept till the next call or return. On the other hand, --delta-stacktrace=yes sometimes helps to obtain a correct stacktrace, for example when the unwind info allows a correct stacktrace to be done in the beginning of the sequence, but not later on in the instruction sequence. Determining which instructions are changing the callstack is partially based on platform dependent heuristics, which have to be tuned/validated specifically for the platform. Also, unwinding in a function prologue must be good enough to allow using --delta-stacktrace=yes. Currently, the option --delta-stacktrace=yes has been reasonably validated only on linux x86 32 bits and linux amd64 64 bits. For more details about how to validate --delta-stacktrace=yes, see debug option --hg-sanity-flags and the function check_cached_rcec_ok in libhb_core.c. --conflict-cache-size=N [default: 1000000] This flag only has any effect at --history-level=full. Information about "old" conflicting accesses is stored in a cache of limited size, with LRU-style management. This is necessary because it isn't practical to store a stack trace for every single memory access made by the program. Historical information on not recently accessed locations is periodically discarded, to free up space in the cache. This option controls the size of the cache, in terms of the number of different memory addresses for which conflicting access information is stored. If you find that Helgrind is showing race errors with only one stack instead of the expected two stacks, try increasing this value. The minimum value is 10,000 and the maximum is 30,000,000 (thirty times the default value). Increasing the value by 1 increases Helgrind's memory requirement by very roughly 100 bytes, so the maximum value will easily eat up three extra gigabytes or so of memory. --check-stack-refs=no|yes [default: yes] By default Helgrind checks all data memory accesses made by your program. This flag enables you to skip checking for accesses to thread stacks (local variables). This can improve performance, but comes at the cost of missing races on stack-allocated data. --ignore-thread-creation=<yes|no> [default: no] Controls whether all activities during thread creation should be ignored. By default enabled only on Solaris. Solaris provides higher throughput, parallelism and scalability than other operating systems, at the cost of more fine-grained locking activity. This means for example that when a thread is created under glibc, just one big lock is used for all thread setup. Solaris libc uses several fine-grained locks and the creator thread resumes its activities as soon as possible, leaving for example stack and TLS setup sequence to the created thread. This situation confuses Helgrind as it assumes there is some false ordering in place between creator and created thread; and therefore many types of race conditions in the application would not be reported. To prevent such false ordering, this command line option is set to yes by default on Solaris. All activity (loads, stores, client requests) is therefore ignored during: pthread_create() call in the creator thread thread creation phase (stack and TLS setup) in the created thread Also new memory allocated during thread creation is untracked, that is race reporting is suppressed there. DRD does the same thing implicitly. This is necessary because Solaris libc caches many objects and reuses them for different threads and that confuses Helgrind. DRD OPTIONS top --check-stack-var=<yes|no> [default: no] Controls whether DRD detects data races on stack variables. Verifying stack variables is disabled by default because most programs do not share stack variables over threads. --exclusive-threshold=<n> [default: off] Print an error message if any mutex or writer lock has been held longer than the time specified in milliseconds. This option enables the detection of lock contention. --join-list-vol=<n> [default: 10] Data races that occur between a statement at the end of one thread and another thread can be missed if memory access information is discarded immediately after a thread has been joined. This option allows one to specify for how many joined threads memory access information should be retained. --first-race-only=<yes|no> [default: no] Whether to report only the first data race that has been detected on a memory location or all data races that have been detected on a memory location. --free-is-write=<yes|no> [default: no] Whether to report races between accessing memory and freeing memory. Enabling this option may cause DRD to run slightly slower. Notes: Don't enable this option when using custom memory allocators that use the VG_USERREQ__MALLOCLIKE_BLOCK and VG_USERREQ__FREELIKE_BLOCK because that would result in false positives. Don't enable this option when using reference-counted objects because that will result in false positives, even when that code has been annotated properly with ANNOTATE_HAPPENS_BEFORE and ANNOTATE_HAPPENS_AFTER. See e.g. the output of the following command for an example: valgrind --tool=drd --free-is-write=yes drd/tests/annotate_smart_pointer. --report-signal-unlocked=<yes|no> [default: yes] Whether to report calls to pthread_cond_signal and pthread_cond_broadcast where the mutex associated with the signal through pthread_cond_wait or pthread_cond_timed_waitis not locked at the time the signal is sent. Sending a signal without holding a lock on the associated mutex is a common programming error which can cause subtle race conditions and unpredictable behavior. There exist some uncommon synchronization patterns however where it is safe to send a signal without holding a lock on the associated mutex. --segment-merging=<yes|no> [default: yes] Controls segment merging. Segment merging is an algorithm to limit memory usage of the data race detection algorithm. Disabling segment merging may improve the accuracy of the so-called 'other segments' displayed in race reports but can also trigger an out of memory error. --segment-merging-interval=<n> [default: 10] Perform segment merging only after the specified number of new segments have been created. This is an advanced configuration option that allows one to choose whether to minimize DRD's memory usage by choosing a low value or to let DRD run faster by choosing a slightly higher value. The optimal value for this parameter depends on the program being analyzed. The default value works well for most programs. --shared-threshold=<n> [default: off] Print an error message if a reader lock has been held longer than the specified time (in milliseconds). This option enables the detection of lock contention. --show-confl-seg=<yes|no> [default: yes] Show conflicting segments in race reports. Since this information can help to find the cause of a data race, this option is enabled by default. Disabling this option makes the output of DRD more compact. --show-stack-usage=<yes|no> [default: no] Print stack usage at thread exit time. When a program creates a large number of threads it becomes important to limit the amount of virtual memory allocated for thread stacks. This option makes it possible to observe how much stack memory has been used by each thread of the client program. Note: the DRD tool itself allocates some temporary data on the client thread stack. The space necessary for this temporary data must be allocated by the client program when it allocates stack memory, but is not included in stack usage reported by DRD. --ignore-thread-creation=<yes|no> [default: no] Controls whether all activities during thread creation should be ignored. By default enabled only on Solaris. Solaris provides higher throughput, parallelism and scalability than other operating systems, at the cost of more fine-grained locking activity. This means for example that when a thread is created under glibc, just one big lock is used for all thread setup. Solaris libc uses several fine-grained locks and the creator thread resumes its activities as soon as possible, leaving for example stack and TLS setup sequence to the created thread. This situation confuses DRD as it assumes there is some false ordering in place between creator and created thread; and therefore many types of race conditions in the application would not be reported. To prevent such false ordering, this command line option is set to yes by default on Solaris. All activity (loads, stores, client requests) is therefore ignored during: pthread_create() call in the creator thread thread creation phase (stack and TLS setup) in the created thread --trace-addr=<address> [default: none] Trace all load and store activity for the specified address. This option may be specified more than once. --ptrace-addr=<address> [default: none] Trace all load and store activity for the specified address and keep doing that even after the memory at that address has been freed and reallocated. --trace-alloc=<yes|no> [default: no] Trace all memory allocations and deallocations. May produce a huge amount of output. --trace-barrier=<yes|no> [default: no] Trace all barrier activity. --trace-cond=<yes|no> [default: no] Trace all condition variable activity. --trace-fork-join=<yes|no> [default: no] Trace all thread creation and all thread termination events. --trace-hb=<yes|no> [default: no] Trace execution of the ANNOTATE_HAPPENS_BEFORE(), ANNOTATE_HAPPENS_AFTER() and ANNOTATE_HAPPENS_DONE() client requests. --trace-mutex=<yes|no> [default: no] Trace all mutex activity. --trace-rwlock=<yes|no> [default: no] Trace all reader-writer lock activity. --trace-semaphore=<yes|no> [default: no] Trace all semaphore activity. MASSIF OPTIONS top --heap=<yes|no> [default: yes] Specifies whether heap profiling should be done. --heap-admin=<size> [default: 8] If heap profiling is enabled, gives the number of administrative bytes per block to use. This should be an estimate of the average, since it may vary. For example, the allocator used by glibc on Linux requires somewhere between 4 to 15 bytes per block, depending on various factors. That allocator also requires admin space for freed blocks, but Massif cannot account for this. --stacks=<yes|no> [default: no] Specifies whether stack profiling should be done. This option slows Massif down greatly, and so is off by default. Note that Massif assumes that the main stack has size zero at start-up. This is not true, but doing otherwise accurately is difficult. Furthermore, starting at zero better indicates the size of the part of the main stack that a user program actually has control over. --pages-as-heap=<yes|no> [default: no] Tells Massif to profile memory at the page level rather than at the malloc'd block level. See above for details. --depth=<number> [default: 30] Maximum depth of the allocation trees recorded for detailed snapshots. Increasing it will make Massif run somewhat more slowly, use more memory, and produce bigger output files. --alloc-fn=<name> Functions specified with this option will be treated as though they were a heap allocation function such as malloc. This is useful for functions that are wrappers to malloc or new, which can fill up the allocation trees with uninteresting information. This option can be specified multiple times on the command line, to name multiple functions. Note that the named function will only be treated this way if it is the top entry in a stack trace, or just below another function treated this way. For example, if you have a function malloc1 that wraps malloc, and malloc2 that wraps malloc1, just specifying --alloc-fn=malloc2 will have no effect. You need to specify --alloc-fn=malloc1 as well. This is a little inconvenient, but the reason is that checking for allocation functions is slow, and it saves a lot of time if Massif can stop looking through the stack trace entries as soon as it finds one that doesn't match rather than having to continue through all the entries. Note that C++ names are demangled. Note also that overloaded C++ names must be written in full. Single quotes may be necessary to prevent the shell from breaking them up. For example: --alloc-fn='operator new(unsigned, std::nothrow_t const&)' Arguments of type size_t need to be replaced with unsigned long on 64bit platforms and unsigned on 32bit platforms. --alloc-fn will work with inline functions. Inline function names are not mangled, which means that you only need to provide the function name and not the argument list. --alloc-fn does not support wildcards. --ignore-fn=<name> Any direct heap allocation (i.e. a call to malloc, new, etc, or a call to a function named by an --alloc-fn option) that occurs in a function specified by this option will be ignored. This is mostly useful for testing purposes. This option can be specified multiple times on the command line, to name multiple functions. Any realloc of an ignored block will also be ignored, even if the realloc call does not occur in an ignored function. This avoids the possibility of negative heap sizes if ignored blocks are shrunk with realloc. The rules for writing C++ function names are the same as for --alloc-fn above. --threshold=<m.n> [default: 1.0] The significance threshold for heap allocations, as a percentage of total memory size. Allocation tree entries that account for less than this will be aggregated. Note that this should be specified in tandem with ms_print's option of the same name. --peak-inaccuracy=<m.n> [default: 1.0] Massif does not necessarily record the actual global memory allocation peak; by default it records a peak only when the global memory allocation size exceeds the previous peak by at least 1.0%. This is because there can be many local allocation peaks along the way, and doing a detailed snapshot for every one would be expensive and wasteful, as all but one of them will be later discarded. This inaccuracy can be changed (even to 0.0%) via this option, but Massif will run drastically slower as the number approaches zero. --time-unit=<i|ms|B> [default: i] The time unit used for the profiling. There are three possibilities: instructions executed (i), which is good for most cases; real (wallclock) time (ms, i.e. milliseconds), which is sometimes useful; and bytes allocated/deallocated on the heap and/or stack (B), which is useful for very short-run programs, and for testing purposes, because it is the most reproducible across different machines. --detailed-freq=<n> [default: 10] Frequency of detailed snapshots. With --detailed-freq=1, every snapshot is detailed. --max-snapshots=<n> [default: 100] The maximum number of snapshots recorded. If set to N, for all programs except very short-running ones, the final number of snapshots will be between N/2 and N. --massif-out-file=<file> [default: massif.out.%p] Write the profile data to file rather than to the default output file, massif.out.<pid>. The %p and %q format specifiers can be used to embed the process ID and/or the contents of an environment variable in the name, as is the case for the core option --log-file. BBV OPTIONS top --bb-out-file=<name> [default: bb.out.%p] This option selects the name of the basic block vector file. The %p and %q format specifiers can be used to embed the process ID and/or the contents of an environment variable in the name, as is the case for the core option --log-file. --pc-out-file=<name> [default: pc.out.%p] This option selects the name of the PC file. This file holds program counter addresses and function name info for the various basic blocks. This can be used in conjunction with the basic block vector file to fast-forward via function names instead of just instruction counts. The %p and %q format specifiers can be used to embed the process ID and/or the contents of an environment variable in the name, as is the case for the core option --log-file. --interval-size=<number> [default: 100000000] This option selects the size of the interval to use. The default is 100 million instructions, which is a commonly used value. Other sizes can be used; smaller intervals can help programs with finer-grained phases. However smaller interval size can lead to accuracy issues due to warm-up effects (When fast-forwarding the various architectural features will be un-initialized, and it will take some number of instructions before they "warm up" to the state a full simulation would be at without the fast-forwarding. Large interval sizes tend to mitigate this.) --instr-count-only [default: no] This option tells the tool to only display instruction count totals, and to not generate the actual basic block vector file. This is useful for debugging, and for gathering instruction count info without generating the large basic block vector files. LACKEY OPTIONS top --basic-counts=<no|yes> [default: yes] When enabled, Lackey prints the following statistics and information about the execution of the client program: 1. The number of calls to the function specified by the --fnname option (the default is main). If the program has had its symbols stripped, the count will always be zero. 2. The number of conditional branches encountered and the number and proportion of those taken. 3. The number of superblocks entered and completed by the program. Note that due to optimisations done by the JIT, this is not at all an accurate value. 4. The number of guest (x86, amd64, ppc, etc.) instructions and IR statements executed. IR is Valgrind's RISC-like intermediate representation via which all instrumentation is done. 5. Ratios between some of these counts. 6. The exit code of the client program. --detailed-counts=<no|yes> [default: no] When enabled, Lackey prints a table containing counts of loads, stores and ALU operations, differentiated by their IR types. The IR types are identified by their IR name ("I1", "I8", ... "I128", "F32", "F64", and "V128"). --trace-mem=<no|yes> [default: no] When enabled, Lackey prints the size and address of almost every memory access made by the program. See the comments at the top of the file lackey/lk_main.c for details about the output format, how it works, and inaccuracies in the address trace. Note that this option produces immense amounts of output. --trace-superblocks=<no|yes> [default: no] When enabled, Lackey prints out the address of every superblock (a single entry, multiple exit, linear chunk of code) executed by the program. This is primarily of interest to Valgrind developers. See the comments at the top of the file lackey/lk_main.c for details about the output format. Note that this option produces large amounts of output. --fnname=<name> [default: main] Changes the function for which calls are counted when --basic-counts=yes is specified. DEBUGINFOD top Valgrind supports the downloading of debuginfo files via debuginfod, an HTTP server for distributing ELF/DWARF debugging information. When a debuginfo file cannot be found locally, Valgrind is able to query debuginfod servers for the file using the file's build-id. In order to use this feature debuginfod-find must be installed and the $DEBUGINFOD_URLS environment variable must contain space-separated URLs of debuginfod servers. Valgrind does not support debuginfod-find verbose output that is normally enabled with $DEBUGINFOD_PROGRESS and $DEBUGINFOD_VERBOSE. These environment variables will be ignored. This feature is supported on Linux only. For more information regarding debuginfod, see Elfutils Debuginfod[1] . SEE ALSO top cg_annotate(1), callgrind_annotate(1), callgrind_control(1), ms_print(1), $INSTALL/share/doc/valgrind/html/index.html or http://www.valgrind.org/docs/manual/index.html, Debugging your program using Valgrind's gdbserver and GDB[2] vgdb[3], Valgrind monitor commands[4], The Commentary[5], Scheduling and Multi-Thread Performance[6], Cachegrind: a cache and branch-prediction profiler[7]. Execution Trees[8] AUTHOR top See the AUTHORS file in the valgrind distribution for a comprehensive list of authors. This manpage was written by Andres Roldan <[email protected]> and the Valgrind developers. NOTES top 1. Elfutils Debuginfod https://sourceware.org/elfutils/Debuginfod.html 2. Debugging your program using Valgrind's gdbserver and GDB http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.gdbserver 3. vgdb http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.vgdb 4. Valgrind monitor commands http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.valgrind-monitor-commands 5. The Commentary http://www.valgrind.org/docs/manual/manual-core.html#manual-core.comment 6. Scheduling and Multi-Thread Performance http://www.valgrind.org/docs/manual/manual-core.html#manual-core.pthreads_perf_sched 7. Cachegrind: a cache and branch-prediction profiler http://www.valgrind.org/docs/manual/cg-manual.html 8. Execution Trees http://www.valgrind.org/docs/manual/manual-core.html#manual-core.xtree COLOPHON top This page is part of the valgrind (a system for debugging and profiling Linux programs) project. Information about the project can be found at http://www.valgrind.org/. If you have a bug report for this manual page, see http://www.valgrind.org/support/bug_reports.html. This page was obtained from the project's upstream Git repository http://sourceware.org/git/valgrind.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-17.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] Release 3.23.0.GIT 12/22/2023 VALGRIND(1) Pages that refer to this page: callgrind_annotate(1), callgrind_control(1), cg_annotate(1), cg_diff(1), cg_merge(1), dbpmda(1), ms_print(1), valgrind-di-server(1), valgrind-listener(1), vgdb(1), malloc(3), ovs-ctl(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# valgrind\n\n> Wrapper for a set of expert tools for profiling, optimizing and debugging programs.\n> Commonly used tools include `memcheck`, `cachegrind`, `callgrind`, `massif`, `helgrind`, and `drd`.\n> More information: <http://www.valgrind.org>.\n\n- Use the (default) Memcheck tool to show a diagnostic of memory usage by `program`:\n\n`valgrind {{program}}`\n\n- Use Memcheck to report all possible memory leaks of `program` in full detail:\n\n`valgrind --leak-check=full --show-leak-kinds=all {{program}}`\n\n- Use the Cachegrind tool to profile and log CPU cache operations of `program`:\n\n`valgrind --tool=cachegrind {{program}}`\n\n- Use the Massif tool to profile and log heap memory and stack usage of `program`:\n\n`valgrind --tool=massif --stacks=yes {{program}}`\n
vdir
vdir(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training vdir(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON VDIR(1) User Commands VDIR(1) NAME top vdir - list directory contents SYNOPSIS top vdir [OPTION]... [FILE]... DESCRIPTION top List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor --sort is specified. Mandatory arguments to long options are mandatory for short options too. -a, --all do not ignore entries starting with . -A, --almost-all do not list implied . and .. --author with -l, print the author of each file -b, --escape print C-style escapes for nongraphic characters --block-size=SIZE with -l, scale sizes by SIZE when printing them; e.g., '--block-size=M'; see SIZE format below -B, --ignore-backups do not list implied entries ending with ~ -c with -lt: sort by, and show, ctime (time of last change of file status information); with -l: show ctime and sort by name; otherwise: sort by ctime, newest first -C list entries by columns --color[=WHEN] color the output WHEN; more info below -d, --directory list directories themselves, not their contents -D, --dired generate output designed for Emacs' dired mode -f list all entries in directory order -F, --classify[=WHEN] append indicator (one of */=>@|) to entries WHEN --file-type likewise, except do not append '*' --format=WORD across -x, commas -m, horizontal -x, long -l, single-column -1, verbose -l, vertical -C --full-time like -l --time-style=full-iso -g like -l, but do not list owner --group-directories-first group directories before files; can be augmented with a --sort option, but any use of --sort=none (-U) disables grouping -G, --no-group in a long listing, don't print group names -h, --human-readable with -l and -s, print sizes like 1K 234M 2G etc. --si likewise, but use powers of 1000 not 1024 -H, --dereference-command-line follow symbolic links listed on the command line --dereference-command-line-symlink-to-dir follow each command line symbolic link that points to a directory --hide=PATTERN do not list implied entries matching shell PATTERN (overridden by -a or -A) --hyperlink[=WHEN] hyperlink file names WHEN --indicator-style=WORD append indicator with style WORD to entry names: none (default), slash (-p), file-type (--file-type), classify (-F) -i, --inode print the index number of each file -I, --ignore=PATTERN do not list implied entries matching shell PATTERN -k, --kibibytes default to 1024-byte blocks for file system usage; used only with -s and per directory totals -l use a long listing format -L, --dereference when showing file information for a symbolic link, show information for the file the link references rather than for the link itself -m fill width with a comma separated list of entries -n, --numeric-uid-gid like -l, but list numeric user and group IDs -N, --literal print entry names without quoting -o like -l, but do not list group information -p, --indicator-style=slash append / indicator to directories -q, --hide-control-chars print ? instead of nongraphic characters --show-control-chars show nongraphic characters as-is (the default, unless program is 'ls' and output is a terminal) -Q, --quote-name enclose entry names in double quotes --quoting-style=WORD use quoting style WORD for entry names: literal, locale, shell, shell-always, shell-escape, shell-escape-always, c, escape (overrides QUOTING_STYLE environment variable) -r, --reverse reverse order while sorting -R, --recursive list subdirectories recursively -s, --size print the allocated size of each file, in blocks -S sort by file size, largest first --sort=WORD sort by WORD instead of name: none (-U), size (-S), time (-t), version (-v), extension (-X), width --time=WORD select which timestamp used to display or sort; access time (-u): atime, access, use; metadata change time (-c): ctime, status; modified time (default): mtime, modification; birth time: birth, creation; with -l, WORD determines which time to show; with --sort=time, sort by WORD (newest first) --time-style=TIME_STYLE time/date format with -l; see TIME_STYLE below -t sort by time, newest first; see --time -T, --tabsize=COLS assume tab stops at each COLS instead of 8 -u with -lt: sort by, and show, access time; with -l: show access time and sort by name; otherwise: sort by access time, newest first -U do not sort; list entries in directory order -v natural sort of (version) numbers within text -w, --width=COLS set output width to COLS. 0 means no limit -x list entries by lines instead of by columns -X sort alphabetically by entry extension -Z, --context print any security context of each file --zero end each output line with NUL, not newline -1 list one file per line --help display this help and exit --version output version information and exit The SIZE argument is an integer and optional unit (example: 10K is 10*1024). Units are K,M,G,T,P,E,Z,Y,R,Q (powers of 1024) or KB,MB,... (powers of 1000). Binary prefixes can be used, too: KiB=K, MiB=M, and so on. The TIME_STYLE argument can be full-iso, long-iso, iso, locale, or +FORMAT. FORMAT is interpreted like in date(1). If FORMAT is FORMAT1<newline>FORMAT2, then FORMAT1 applies to non-recent files and FORMAT2 to recent files. TIME_STYLE prefixed with 'posix-' takes effect only outside the POSIX locale. Also the TIME_STYLE environment variable sets the default style to use. The WHEN argument defaults to 'always' and can also be 'auto' or 'never'. Using color to distinguish file types is disabled both by default and with --color=never. With --color=auto, ls emits color codes only when standard output is connected to a terminal. The LS_COLORS environment variable can change the settings. Use the dircolors(1) command to set it. Exit status: 0 if OK, 1 if minor problems (e.g., cannot access subdirectory), 2 if serious trouble (e.g., cannot access command-line argument). AUTHOR top Written by Richard M. Stallman and David MacKenzie. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top Full documentation <https://www.gnu.org/software/coreutils/vdir> or available locally via: info '(coreutils) vdir invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 VDIR(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# vdir\n\n> List directory contents.\n> Drop-in replacement for `ls -l`.\n> More information: <https://www.gnu.org/software/coreutils/vdir>.\n\n- List files and directories in the current directory, one per line, with details:\n\n`vdir`\n\n- List with sizes displayed in human-readable units (KB, MB, GB):\n\n`vdir -h`\n\n- List including hidden files (starting with a dot):\n\n`vdir -a`\n\n- List files and directories sorting entries by size (largest first):\n\n`vdir -S`\n\n- List files and directories sorting entries by modification time (newest first):\n\n`vdir -t`\n\n- List grouping directories first:\n\n`vdir --group-directories-first`\n\n- Recursively list all files and directories in a specific directory:\n\n`vdir --recursive {{path/to/directory}}`\n
vgchange
vgchange(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training vgchange(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | USAGE | OPTIONS | VARIABLES | ENVIRONMENT VARIABLES | NOTES | EXAMPLES | SEE ALSO | COLOPHON VGCHANGE(8) System Manager's Manual VGCHANGE(8) NAME top vgchange Change volume group attributes SYNOPSIS top vgchange option_args position_args [ option_args ] [ position_args ] -a|--activate y|n|ay --activationmode partial|degraded|complete --addtag Tag --alloc contiguous|cling|cling_by_tags|normal|anywhere| inherit --autoactivation String -A|--autobackup y|n --commandprofile String --config String -d|--debug --deltag Tag --detachprofile --devices PV --devicesfile String --driverloaded y|n -f|--force -h|--help -K|--ignoreactivationskip --ignorelockingfailure --ignoremonitoring --journal String --lockopt String --lockstart --lockstop --locktype sanlock|dlm|none -l|--logicalvolume Number --longhelp -p|--maxphysicalvolumes Number --metadataprofile String --monitor y|n --nohints --nolocking --noudevsync -P|--partial -s|--physicalextentsize Size[m|UNIT] --poll y|n --profile String --pvmetadatacopies 0|1|2 -q|--quiet --readonly --refresh --reportformat basic|json -x|--resizeable y|n -S|--select String --setautoactivation y|n --sysinit --systemid String -t|--test -u|--uuid -v|--verbose --version --[vg]metadatacopies all|unmanaged|Number -y|--yes DESCRIPTION top vgchange changes VG attributes, changes LV activation in the kernel, and includes other utilities for VG maintenance. USAGE top Change a general VG attribute. For options listed in parentheses, any one is required, after which the others are optional. vgchange ( -l|--logicalvolume Number -p|--maxphysicalvolumes Number -u|--uuid -s|--physicalextentsize Size[m|UNIT] -x|--resizeable y|n --addtag Tag --deltag Tag --alloc contiguous|cling|cling_by_tags|normal|anywhere| inherit --pvmetadatacopies 0|1|2 --[vg]metadatacopies all|unmanaged|Number --profile String --detachprofile --metadataprofile String --setautoactivation y|n ) [ -A|--autobackup y|n ] [ -S|--select String ] [ -f|--force ] [ --poll y|n ] [ --ignoremonitoring ] [ --noudevsync ] [ --reportformat basic|json ] [ COMMON_OPTIONS ] [ VG|Tag|Select ... ] Start or stop monitoring LVs from dmeventd. vgchange --monitor y|n [ -A|--autobackup y|n ] [ -S|--select String ] [ -f|--force ] [ --sysinit ] [ --ignorelockingfailure ] [ --poll y|n ] [ --ignoremonitoring ] [ --noudevsync ] [ --reportformat basic|json ] [ COMMON_OPTIONS ] [ VG|Tag|Select ... ] Start or stop processing LV conversions. vgchange --poll y|n [ -A|--autobackup y|n ] [ -S|--select String ] [ -f|--force ] [ --ignorelockingfailure ] [ --ignoremonitoring ] [ --noudevsync ] [ --reportformat basic|json ] [ COMMON_OPTIONS ] [ VG|Tag|Select ... ] Activate or deactivate LVs. vgchange -a|--activate y|n|ay [ -K|--ignoreactivationskip ] [ -P|--partial ] [ -A|--autobackup y|n ] [ -S|--select String ] [ -f|--force ] [ --activationmode partial|degraded|complete ] [ --sysinit ] [ --readonly ] [ --ignorelockingfailure ] [ --monitor y|n ] [ --poll y|n ] [ --autoactivation String ] [ --ignoremonitoring ] [ --noudevsync ] [ --reportformat basic|json ] [ COMMON_OPTIONS ] [ VG|Tag|Select ... ] Reactivate LVs using the latest metadata. vgchange --refresh [ -A|--autobackup y|n ] [ -S|--select String ] [ -f|--force ] [ --sysinit ] [ --ignorelockingfailure ] [ --poll y|n ] [ --ignoremonitoring ] [ --noudevsync ] [ --reportformat basic|json ] [ COMMON_OPTIONS ] [ VG|Tag|Select ... ] Change the system ID of a VG. vgchange --systemid String VG [ COMMON_OPTIONS ] Start the lockspace of a shared VG in lvmlockd. vgchange --lockstart [ -S|--select String ] [ COMMON_OPTIONS ] [ VG|Tag|Select ... ] Stop the lockspace of a shared VG in lvmlockd. vgchange --lockstop [ -S|--select String ] [ COMMON_OPTIONS ] [ VG|Tag|Select ... ] Change the lock type for a shared VG. vgchange --locktype sanlock|dlm|none VG [ COMMON_OPTIONS ] Common options for lvm: [ -d|--debug ] [ -h|--help ] [ -q|--quiet ] [ -t|--test ] [ -v|--verbose ] [ -y|--yes ] [ --commandprofile String ] [ --config String ] [ --devices PV ] [ --devicesfile String ] [ --driverloaded y|n ] [ --journal String ] [ --lockopt String ] [ --longhelp ] [ --nohints ] [ --nolocking ] [ --profile String ] [ --version ] OPTIONS top -a|--activate y|n|ay Change the active state of LVs. An active LV can be used through a block device, allowing data on the LV to be accessed. y makes LVs active, or available. n makes LVs inactive, or unavailable. The block device for the LV is added or removed from the system using device-mapper in the kernel. A symbolic link /dev/VGName/LVName pointing to the device node is also added/removed. All software and scripts should access the device through the symbolic link and present this as the name of the device. The location and name of the underlying device node may depend on the distribution, configuration (e.g. udev), or release version. ay specifies autoactivation, which is used by system-generated activation commands. By default, LVs are autoactivated. An autoactivation property can be set on a VG or LV to disable autoactivation, see --setautoactivation y|n in vgchange, lvchange, vgcreate, and lvcreate. Display the property with vgs or lvs "-o autoactivation". The lvm.conf(5) auto_activation_volume_list includes names of VGs or LVs that should be autoactivated, and anything not listed is not autoactivated. When auto_activation_volume_list is undefined (the default), it has no effect. If auto_activation_volume_list is defined and empty, no LVs are autoactivated. Items included by auto_activation_volume_list will not be autoactivated if the autoactivation property has been disabled. See lvmlockd(8) for more information about activation options ey and sy for shared VGs. --activationmode partial|degraded|complete Determines if LV activation is allowed when PVs are missing, e.g. because of a device failure. complete only allows LVs with no missing PVs to be activated, and is the most restrictive mode. degraded allows RAID LVs with missing PVs to be activated. (This does not include the "mirror" type, see "raid1" instead.) partial allows any LV with missing PVs to be activated, and should only be used for recovery or repair. For default, see lvm.conf(5) activation_mode. See lvmraid(7) for more information. --addtag Tag Adds a tag to a PV, VG or LV. This option can be repeated to add multiple tags at once. See lvm(8) for information about tags. --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit Determines the allocation policy when a command needs to allocate Physical Extents (PEs) from the VG. Each VG and LV has an allocation policy which can be changed with vgchange/lvchange, or overridden on the command line. normal applies common sense rules such as not placing parallel stripes on the same PV. inherit applies the VG policy to an LV. contiguous requires new PEs be placed adjacent to existing PEs. cling places new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, but normal does not use them, anywhere will use them even if it reduces performance, e.g. by placing two stripes on the same PV. Optional positional PV args on the command line can also be used to limit which PVs the command will use for allocation. See lvm(8) for more information about allocation. --autoactivation String Specify if autoactivation is being used from an event. This allows the command to apply settings that are specific to event activation, such as device scanning optimizations using pvs_online files created by event- based pvscans. -A|--autobackup y|n Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information. --commandprofile String The command profile to use for command configuration. See lvm.conf(5) for more information about profiles. --config String Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.conf(5) for more information about config. -d|--debug ... Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured). --deltag Tag Deletes a tag from a PV, VG or LV. This option can be repeated to delete multiple tags at once. See lvm(8) for information about tags. --detachprofile Detaches a metadata profile from a VG or LV. See lvm.conf(5) for more information about profiles. --devices PV Devices that the command can use. This option can be repeated or accepts a comma separated list of devices. This overrides the devices file. --devicesfile String A file listing devices that LVM should use. The file must exist in /etc/lvm/devices/ and is managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings. --driverloaded y|n If set to no, the command will not attempt to use device- mapper. For testing and debugging. -f|--force ... Override various checks, confirmations and protections. Use with extreme caution. -h|--help Display help text. -K|--ignoreactivationskip Ignore the "activation skip" LV flag during activation to allow LVs with the flag set to be activated. --ignorelockingfailure Allows a command to continue with read-only metadata operations after locking failures. --ignoremonitoring Do not interact with dmeventd unless --monitor is specified. Do not use this if dmeventd is already monitoring a device. --journal String Record information in the systemd journal. This information is in addition to information enabled by the lvm.conf log/journal setting. command: record information about the command. output: record the default command output. debug: record full command debugging. --lockopt String Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information. --lockstart Start the lockspace of a shared VG in lvmlockd. lvmlockd locks becomes available for the VG, allowing LVM to use the VG. See lvmlockd(8) for more information. --lockstop Stop the lockspace of a shared VG in lvmlockd. lvmlockd locks become unavailable for the VG, preventing LVM from using the VG. See lvmlockd(8) for more information. --locktype sanlock|dlm|none Change the VG lock type to or from a shared lock type used with lvmlockd. See lvmlockd(8) for more information. -l|--logicalvolume Number Sets the maximum number of LVs allowed in a VG. --longhelp Display long help text. -p|--maxphysicalvolumes Number Sets the maximum number of PVs that can belong to the VG. The value 0 removes any limitation. For large numbers of PVs, also see options --pvmetadatacopies, and --vgmetadatacopies for improving performance. --metadataprofile String The metadata profile to use for command configuration. See lvm.conf(5) for more information about profiles. --monitor y|n Start (yes) or stop (no) monitoring an LV with dmeventd. dmeventd monitors kernel events for an LV, and performs automated maintenance for the LV in reponse to specific events. See dmeventd(8) for more information. --nohints Do not use the hints file to locate devices for PVs. A command may read more devices to find PVs when hints are not used. The command will still perform standard hint file invalidation where appropriate. --nolocking Disable locking. --noudevsync Disables udev synchronisation. The process will not wait for notification from udev. It will continue irrespective of any possible udev processing in the background. Only use this if udev is not running or has rules that ignore the devices LVM creates. -P|--partial Commands will do their best to activate LVs with missing PV extents. Missing extents may be replaced with error or zero segments according to the missing_stripe_filler setting. Metadata may not be changed with this option. -s|--physicalextentsize Size[m|UNIT] Sets the physical extent size of PVs in the VG. The value must be either a power of 2 of at least 1 sector (where the sector size is the largest sector size of the PVs currently used in the VG), or at least 128KiB. Once this value has been set, it is difficult to change without recreating the VG, unless no extents need moving. Before increasing the physical extent size, you might need to use lvresize, pvresize and/or pvmove so that everything fits. For example, every contiguous range of extents used in a LV must start and end on an extent boundary. --poll y|n When yes, start the background transformation of an LV. An incomplete transformation, e.g. pvmove or lvconvert interrupted by reboot or crash, can be restarted from the last checkpoint with --poll y. When no, background transformation of an LV will not occur, and the transformation will not complete. It may not be appropriate to immediately poll an LV after activation, in which case --poll n can be used to defer polling until a later --poll y command. --profile String An alias for --commandprofile or --metadataprofile, depending on the command. --pvmetadatacopies 0|1|2 The number of metadata areas to set aside on a PV for storing VG metadata. When 2, one copy of the VG metadata is stored at the front of the PV and a second copy is stored at the end. When 1, one copy of the VG metadata is stored at the front of the PV. When 0, no copies of the VG metadata are stored on the given PV. This may be useful in VGs containing many PVs (this places limitations on the ability to use vgsplit later.) -q|--quiet ... Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'. --readonly Run the command in a special read-only mode which will read on-disk metadata without needing to take any locks. This can be used to peek inside metadata used by a virtual machine image while the virtual machine is running. No attempt will be made to communicate with the device-mapper kernel driver, so this option is unable to report whether or not LVs are actually in use. --refresh If the LV is active, reload its metadata. This is not necessary in normal operation, but may be useful if something has gone wrong, or if some form of manual LV sharing is being used. --reportformat basic|json Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf(5). basic is the original format with columns and rows. If there is more than one report per command, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information. -x|--resizeable y|n Enables or disables the addition or removal of PVs to/from a VG (by vgextend/vgreduce). -S|--select String Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-reporting commands which process LVM entities, the selection is used to choose items to process. --setautoactivation y|n Set the autoactivation property on a VG or LV. Display the property with vgs or lvs "-o autoactivation". When the autoactivation property is disabled, the VG or LV will not be activated by a command doing autoactivation (vgchange, lvchange, or pvscan using -aay.) If autoactivation is disabled on a VG, no LVs will be autoactivated in that VG, and the LV autoactivation property has no effect. If autoactivation is enabled on a VG, autoactivation can be disabled for individual LVs. --sysinit Indicates that vgchange/lvchange is being invoked from early system initialisation scripts (e.g. rc.sysinit or an initrd), before writable filesystems are available. As such, some functionality needs to be disabled and this option acts as a shortcut which selects an appropriate set of options. Currently, this is equivalent to using --ignorelockingfailure, --ignoremonitoring, --poll n, and setting env var LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES. vgchange/lvchange skip autoactivation, and defer to pvscan autoactivation. --systemid String Changes the system ID of the VG. Using this option requires caution because the VG may become foreign to the host running the command, leaving the host unable to access it. See lvmsystemid(7) for more information. -t|--test Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't. -u|--uuid Generate new random UUID for specified VGs. -v|--verbose ... Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr. --version Display version information. --[vg]metadatacopies all|unmanaged|Number Number of copies of the VG metadata that are kept. VG metadata is kept in VG metadata areas on PVs in the VG, i.e. reserved space at the start and/or end of the PVs. Keeping a copy of the VG metadata on every PV can reduce performance in VGs containing a large number of PVs. When this number is set to a non-zero value, LVM will automatically choose PVs on which to store metadata, using the metadataignore flags on PVs to achieve the specified number. The number can also be replaced with special string values: unmanaged causes LVM to not automatically manage the PV metadataignore flags. all causes LVM to first clear the metadataignore flags on all PVs, and then to become unmanaged. -y|--yes Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.) VARIABLES top VG Volume Group name. See lvm(8) for valid names. Tag Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV. Select Select indicates that a required positional parameter can be omitted if the --select option is used. No arg appears in this position. String See the option description for information about the string content. Size[UNIT] Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.) ENVIRONMENT VARIABLES top See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter. NOTES top If vgchange recognizes COW snapshot LVs that were dropped because they ran out of space, it displays a message informing the administrator that the snapshots should be removed. EXAMPLES top Activate all LVs in all VGs on all existing devices. vgchange -a y Change the maximum number of LVs for an inactive VG. vgchange -l 128 vg00 SEE ALSO top lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8), pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8), pvremove(8), pvresize(8), pvs(8), pvscan(8), vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8), vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8), vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8), lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8), lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8), lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8), dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), cmirrord(8), lvmdbusd(8), fsadm(8), lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7) COLOPHON top This page is part of the lvm2 (Logical Volume Manager 2) project. Information about the project can be found at http://www.sourceware.org/lvm2/. If you have a bug report for this manual page, see https://github.com/lvmteam/lvm2/issues. This page was obtained from the project's upstream Git repository git://sourceware.org/git/lvm2.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-06.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] Red Hat, Inc. LVM TOOLS 2.03.24(2)-git (2023-11-21) VGCHANGE(8) Pages that refer to this page: lvmcache(7), lvmsystemid(7), lvchange(8), lvconvert(8), lvcreate(8), lvdisplay(8), lvextend(8), lvm(8), lvmconfig(8), lvmdevices(8), lvmdiskscan(8), lvm-fullreport(8), lvm-lvpoll(8), lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8), pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8), pvremove(8), pvresize(8), pvs(8), pvscan(8), vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgconvert(8), vgcreate(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8), vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# vgchange\n\n> Change the attributes of a Logical Volume Manager (LVM) volume group.\n> See also: `lvm`.\n> More information: <https://manned.org/vgchange>.\n\n- Change the activation status of logical volumes in all volume groups:\n\n`sudo vgchange --activate {{y|n}}`\n\n- Change the activation status of logical volumes in the specified volume group (determine with `vgscan`):\n\n`sudo vgchange --activate {{y|n}} {{volume_group}}`\n
vgcreate
vgcreate(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training vgcreate(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | USAGE | OPTIONS | VARIABLES | ENVIRONMENT VARIABLES | EXAMPLES | SEE ALSO | COLOPHON VGCREATE(8) System Manager's Manual VGCREATE(8) NAME top vgcreate Create a volume group SYNOPSIS top vgcreate position_args [ option_args ] DESCRIPTION top vgcreate creates a new VG on block devices. If the devices were not previously initialized as PVs with pvcreate(8), vgcreate will inititialize them, making them PVs. The pvcreate options for initializing devices are also available with vgcreate. When vgcreate uses an existing PV, that PV's existing values for metadata size, PE start, etc, are used, even if different values are specified in the vgcreate command. To change these values, first use pvremove on the device. USAGE top vgcreate VG_new PV ... [ -A|--autobackup y|n ] [ -c|--clustered y|n ] [ -l|--maxlogicalvolumes Number ] [ -p|--maxphysicalvolumes Number ] [ -M|--metadatatype lvm2 ] [ -s|--physicalextentsize Size[m|UNIT] ] [ -f|--force ] [ -Z|--zero y|n ] [ --addtag Tag ] [ --alloc contiguous|cling|cling_by_tags|normal|anywhere| inherit ] [ --metadataprofile String ] [ --labelsector Number ] [ --metadatasize Size[m|UNIT] ] [ --pvmetadatacopies 0|1|2 ] [ --[vg]metadatacopies all|unmanaged|Number ] [ --reportformat basic|json ] [ --dataalignment Size[k|UNIT] ] [ --dataalignmentoffset Size[k|UNIT] ] [ --shared ] [ --systemid String ] [ --locktype sanlock|dlm|none ] [ --setautoactivation y|n ] [ COMMON_OPTIONS ] Common options for lvm: [ -d|--debug ] [ -h|--help ] [ -q|--quiet ] [ -t|--test ] [ -v|--verbose ] [ -y|--yes ] [ --commandprofile String ] [ --config String ] [ --devices PV ] [ --devicesfile String ] [ --driverloaded y|n ] [ --journal String ] [ --lockopt String ] [ --longhelp ] [ --nohints ] [ --nolocking ] [ --profile String ] [ --version ] OPTIONS top --addtag Tag Adds a tag to a PV, VG or LV. This option can be repeated to add multiple tags at once. See lvm(8) for information about tags. --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit Determines the allocation policy when a command needs to allocate Physical Extents (PEs) from the VG. Each VG and LV has an allocation policy which can be changed with vgchange/lvchange, or overridden on the command line. normal applies common sense rules such as not placing parallel stripes on the same PV. inherit applies the VG policy to an LV. contiguous requires new PEs be placed adjacent to existing PEs. cling places new PEs on the same PV as existing PEs in the same stripe of the LV. If there are sufficient PEs for an allocation, but normal does not use them, anywhere will use them even if it reduces performance, e.g. by placing two stripes on the same PV. Optional positional PV args on the command line can also be used to limit which PVs the command will use for allocation. See lvm(8) for more information about allocation. -A|--autobackup y|n Specifies if metadata should be backed up automatically after a change. Enabling this is strongly advised! See vgcfgbackup(8) for more information. -c|--clustered y|n This option was specific to clvm and is now replaced by the --shared option with lvmlockd(8). --commandprofile String The command profile to use for command configuration. See lvm.conf(5) for more information about profiles. --config String Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.conf(5) for more information about config. --dataalignment Size[k|UNIT] Align the start of a PV data area with a multiple of this number. To see the location of the first Physical Extent (PE) of an existing PV, use pvs -o +pe_start. In addition, it may be shifted by an alignment offset, see --dataalignmentoffset. Also specify an appropriate PE size when creating a VG. --dataalignmentoffset Size[k|UNIT] Shift the start of the PV data area by this additional offset. -d|--debug ... Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured). --devices PV Devices that the command can use. This option can be repeated or accepts a comma separated list of devices. This overrides the devices file. --devicesfile String A file listing devices that LVM should use. The file must exist in /etc/lvm/devices/ and is managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings. --driverloaded y|n If set to no, the command will not attempt to use device- mapper. For testing and debugging. -f|--force ... Override various checks, confirmations and protections. Use with extreme caution. -h|--help Display help text. --journal String Record information in the systemd journal. This information is in addition to information enabled by the lvm.conf log/journal setting. command: record information about the command. output: record the default command output. debug: record full command debugging. --labelsector Number By default the PV is labelled with an LVM2 identifier in its second sector (sector 1). This lets you use a different sector near the start of the disk (between 0 and 3 inclusive - see LABEL_SCAN_SECTORS in the source). Use with care. --lockopt String Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information. --locktype sanlock|dlm|none Specify the VG lock type directly in place of using --shared. See lvmlockd(8) for more information. --longhelp Display long help text. -l|--maxlogicalvolumes Number Sets the maximum number of LVs allowed in a VG. -p|--maxphysicalvolumes Number Sets the maximum number of PVs that can belong to the VG. The value 0 removes any limitation. For large numbers of PVs, also see options --pvmetadatacopies, and --vgmetadatacopies for improving performance. --metadataprofile String The metadata profile to use for command configuration. See lvm.conf(5) for more information about profiles. --metadatasize Size[m|UNIT] The approximate amount of space used for each VG metadata area. The size may be rounded. -M|--metadatatype lvm2 Specifies the type of on-disk metadata to use. lvm2 (or just 2) is the current, standard format. lvm1 (or just 1) is no longer used. --nohints Do not use the hints file to locate devices for PVs. A command may read more devices to find PVs when hints are not used. The command will still perform standard hint file invalidation where appropriate. --nolocking Disable locking. -s|--physicalextentsize Size[m|UNIT] Sets the physical extent size of PVs in the VG. The value must be either a power of 2 of at least 1 sector (where the sector size is the largest sector size of the PVs currently used in the VG), or at least 128KiB. Once this value has been set, it is difficult to change without recreating the VG, unless no extents need moving. --profile String An alias for --commandprofile or --metadataprofile, depending on the command. --pvmetadatacopies 0|1|2 The number of metadata areas to set aside on a PV for storing VG metadata. When 2, one copy of the VG metadata is stored at the front of the PV and a second copy is stored at the end. When 1, one copy of the VG metadata is stored at the front of the PV. When 0, no copies of the VG metadata are stored on the given PV. This may be useful in VGs containing many PVs (this places limitations on the ability to use vgsplit later.) -q|--quiet ... Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'. --reportformat basic|json Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf(5). basic is the original format with columns and rows. If there is more than one report per command, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information. --setautoactivation y|n Set the autoactivation property on a VG or LV. Display the property with vgs or lvs "-o autoactivation". When the autoactivation property is disabled, the VG or LV will not be activated by a command doing autoactivation (vgchange, lvchange, or pvscan using -aay.) If autoactivation is disabled on a VG, no LVs will be autoactivated in that VG, and the LV autoactivation property has no effect. If autoactivation is enabled on a VG, autoactivation can be disabled for individual LVs. --shared Create a shared VG using lvmlockd if LVM is compiled with lockd support. lvmlockd will select lock type sanlock or dlm depending on which lock manager is running. This allows multiple hosts to share a VG on shared devices. lvmlockd and a lock manager must be configured and running. See lvmlockd(8) for more information about shared VGs. --systemid String Specifies the system ID that will be given to the new VG, overriding the system ID of the host running the command. A VG is normally created without this option, in which case the new VG is given the system ID of the host creating it. Using this option requires caution because the system ID of the new VG may not match the system ID of the host running the command, leaving the VG inaccessible to the host. See lvmsystemid(7) for more information. -t|--test Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't. -v|--verbose ... Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr. --version Display version information. --[vg]metadatacopies all|unmanaged|Number Number of copies of the VG metadata that are kept. VG metadata is kept in VG metadata areas on PVs in the VG, i.e. reserved space at the start and/or end of the PVs. Keeping a copy of the VG metadata on every PV can reduce performance in VGs containing a large number of PVs. When this number is set to a non-zero value, LVM will automatically choose PVs on which to store metadata, using the metadataignore flags on PVs to achieve the specified number. The number can also be replaced with special string values: unmanaged causes LVM to not automatically manage the PV metadataignore flags. all causes LVM to first clear the metadataignore flags on all PVs, and then to become unmanaged. -y|--yes Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.) -Z|--zero y|n Controls if the first 4 sectors (2048 bytes) of the device are wiped. The default is to wipe these sectors unless either or both of --restorefile or --uuid are specified. VARIABLES top VG Volume Group name. See lvm(8) for valid names. PV Physical Volume name, a device path under /dev. For commands managing physical extents, a PV positional arg generally accepts a suffix indicating a range (or multiple ranges) of physical extents (PEs). When the first PE is omitted, it defaults to the start of the device, and when the last PE is omitted it defaults to end. Start and end range (inclusive): PV[:PE-PE]... Start and length range (counting from 0): PV[:PE+PE]... String See the option description for information about the string content. Size[UNIT] Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.) ENVIRONMENT VARIABLES top See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter. EXAMPLES top Create a VG with two PVs, using the default physical extent size. vgcreate myvg /dev/sdk1 /dev/sdl1 SEE ALSO top lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8), pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8), pvremove(8), pvresize(8), pvs(8), pvscan(8), vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8), vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8), vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8), lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8), lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8), lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8), dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), cmirrord(8), lvmdbusd(8), fsadm(8), lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7) COLOPHON top This page is part of the lvm2 (Logical Volume Manager 2) project. Information about the project can be found at http://www.sourceware.org/lvm2/. If you have a bug report for this manual page, see https://github.com/lvmteam/lvm2/issues. This page was obtained from the project's upstream Git repository git://sourceware.org/git/lvm2.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-06.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] Red Hat, Inc. LVM TOOLS 2.03.24(2)-git (2023-11-21) VGCREATE(8) Pages that refer to this page: lvmsystemid(7), lvchange(8), lvconvert(8), lvcreate(8), lvdisplay(8), lvextend(8), lvm(8), lvmconfig(8), lvmdevices(8), lvmdiskscan(8), lvm-fullreport(8), lvm-lvpoll(8), lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8), pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8), pvremove(8), pvresize(8), pvs(8), pvscan(8), vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgconvert(8), vgcreate(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8), vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# vgcreate\n\n> Create volume groups combining multiple mass-storage devices.\n> See also: `lvm`.\n> More information: <https://man7.org/linux/man-pages/man8/vgcreate.8.html>.\n\n- Create a new volume group called vg1 using the `/dev/sda1` device:\n\n`vgcreate {{vg1}} {{/dev/sda1}}`\n\n- Create a new volume group called vg1 using multiple devices:\n\n`vgcreate {{vg1}} {{/dev/sda1}} {{/dev/sdb1}} {{/dev/sdc1}}`\n
vgdisplay
vgdisplay(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training vgdisplay(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | USAGE | OPTIONS | VARIABLES | ENVIRONMENT VARIABLES | SEE ALSO | COLOPHON VGDISPLAY(8) System Manager's Manual VGDISPLAY(8) NAME top vgdisplay Display volume group information SYNOPSIS top vgdisplay [ option_args ] [ position_args ] DESCRIPTION top vgdisplay shows the attributes of VGs, and the associated PVs and LVs. vgs(8) is a preferred alternative that shows the same information and more, using a more compact and configurable output format. USAGE top vgdisplay [ -A|--activevolumegroups ] [ -c|--colon ] [ -C|--columns ] [ -o|--options String ] [ -S|--select String ] [ -s|--short ] [ -O|--sort String ] [ --aligned ] [ --binary ] [ --configreport log|vg|lv|pv|pvseg|seg ] [ --foreign ] [ --ignorelockingfailure ] [ --logonly ] [ --noheadings ] [ --nosuffix ] [ --readonly ] [ --shared ] [ --separator String ] [ --unbuffered ] [ --units [Number]r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ] [ COMMON_OPTIONS ] [ VG|Tag ... ] Common options for lvm: [ -d|--debug ] [ -h|--help ] [ -q|--quiet ] [ -t|--test ] [ -v|--verbose ] [ -y|--yes ] [ --commandprofile String ] [ --config String ] [ --devices PV ] [ --devicesfile String ] [ --driverloaded y|n ] [ --journal String ] [ --lockopt String ] [ --longhelp ] [ --nohints ] [ --nolocking ] [ --profile String ] [ --version ] OPTIONS top -A|--activevolumegroups Only select active VGs. The VG is considered active if at least one of its LVs is active. --aligned Use with --separator to align the output columns --binary Use binary values "0" or "1" instead of descriptive literal values for columns that have exactly two valid values to report (not counting the "unknown" value which denotes that the value could not be determined). -c|--colon Generate colon separated output for easier parsing in scripts or programs. Also see vgs(8) which provides considerably more control over the output. -C|--columns Display output in columns, the equivalent of vgs(8). Options listed are the same as options given in vgs(8). --commandprofile String The command profile to use for command configuration. See lvm.conf(5) for more information about profiles. --config String Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.conf(5) for more information about config. --configreport log|vg|lv|pv|pvseg|seg See lvmreport(7). -d|--debug ... Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured). --devices PV Devices that the command can use. This option can be repeated or accepts a comma separated list of devices. This overrides the devices file. --devicesfile String A file listing devices that LVM should use. The file must exist in /etc/lvm/devices/ and is managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings. --driverloaded y|n If set to no, the command will not attempt to use device- mapper. For testing and debugging. --foreign Report/display foreign VGs that would otherwise be skipped. See lvmsystemid(7) for more information about foreign VGs. -h|--help Display help text. --ignorelockingfailure Allows a command to continue with read-only metadata operations after locking failures. --journal String Record information in the systemd journal. This information is in addition to information enabled by the lvm.conf log/journal setting. command: record information about the command. output: record the default command output. debug: record full command debugging. --lockopt String Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information. --logonly Suppress command report and display only log report. --longhelp Display long help text. --noheadings Suppress the headings line that is normally the first line of output. Useful if grepping the output. --nohints Do not use the hints file to locate devices for PVs. A command may read more devices to find PVs when hints are not used. The command will still perform standard hint file invalidation where appropriate. --nolocking Disable locking. --nosuffix Suppress the suffix on output sizes. Use with --units (except h and H) if processing the output. -o|--options String Comma-separated, ordered list of fields to display in columns. String arg syntax is: [+|-|#]Field1[,Field2 ...] The prefix + will append the specified fields to the default fields, - will remove the specified fields from the default fields, and # will compact specified fields (removing them when empty for all rows.) Use -o help to view the list of all available fields. Use separate lists of fields to add, remove or compact by repeating the -o option: -o+field1,field2 -o-field3,field4 -o#field5. These lists are evaluated from left to right. Use field name lv_all to view all LV fields, vg_all all VG fields, pv_all all PV fields, pvseg_all all PV segment fields, seg_all all LV segment fields, and pvseg_all all PV segment columns. See the lvm.conf(5) report section for more config options. See lvmreport(7) for more information about reporting. --profile String An alias for --commandprofile or --metadataprofile, depending on the command. -q|--quiet ... Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'. --readonly Run the command in a special read-only mode which will read on-disk metadata without needing to take any locks. This can be used to peek inside metadata used by a virtual machine image while the virtual machine is running. No attempt will be made to communicate with the device-mapper kernel driver, so this option is unable to report whether or not LVs are actually in use. -S|--select String Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-reporting commands which process LVM entities, the selection is used to choose items to process. --separator String String to use to separate each column. Useful if grepping the output. --shared Report/display shared VGs that would otherwise be skipped when lvmlockd is not being used on the host. See lvmlockd(8) for more information about shared VGs. -s|--short Give a short listing showing the existence of VGs. -O|--sort String Comma-separated ordered list of columns to sort by. Replaces the default selection. Precede any column with - for a reverse sort on that column. -t|--test Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't. --unbuffered Produce output immediately without sorting or aligning the columns properly. --units [Number]r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E All sizes are output in these units: human-(r)eadable with '<' rounding indicator, (h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to use multiples of 1000 (S.I.) instead of 1024. Custom units can be specified, e.g. --units 3M. -v|--verbose ... Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr. --version Display version information. -y|--yes Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.) VARIABLES top VG Volume Group name. See lvm(8) for valid names. Tag Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV. String See the option description for information about the string content. Size[UNIT] Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.) ENVIRONMENT VARIABLES top See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter. SEE ALSO top lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8), pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8), pvremove(8), pvresize(8), pvs(8), pvscan(8), vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8), vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8), vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8), lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8), lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8), lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8), dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), cmirrord(8), lvmdbusd(8), fsadm(8), lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7) COLOPHON top This page is part of the lvm2 (Logical Volume Manager 2) project. Information about the project can be found at http://www.sourceware.org/lvm2/. If you have a bug report for this manual page, see https://github.com/lvmteam/lvm2/issues. This page was obtained from the project's upstream Git repository git://sourceware.org/git/lvm2.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-06.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] Red Hat, Inc. LVM TOOLS 2.03.24(2)-git (2023-11-21) VGDISPLAY(8) Pages that refer to this page: lvchange(8), lvconvert(8), lvcreate(8), lvdisplay(8), lvextend(8), lvm(8), lvmconfig(8), lvmdevices(8), lvmdiskscan(8), lvm-fullreport(8), lvm-lvpoll(8), lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8), pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8), pvremove(8), pvresize(8), pvs(8), pvscan(8), vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgconvert(8), vgcreate(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8), vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# vgdisplay\n\n> Display information about Logical Volume Manager (LVM) volume groups.\n> See also: `lvm`.\n> More information: <https://man7.org/linux/man-pages/man8/vgdisplay.8.html>.\n\n- Display information about all volume groups:\n\n`sudo vgdisplay`\n\n- Display information about volume group vg1:\n\n`sudo vgdisplay {{vg1}}`\n
vgs
vgs(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training vgs(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | USAGE | OPTIONS | VARIABLES | ENVIRONMENT VARIABLES | NOTES | SEE ALSO | COLOPHON VGS(8) System Manager's Manual VGS(8) NAME top vgs Display information about volume groups SYNOPSIS top vgs [ option_args ] [ position_args ] DESCRIPTION top vgs produces formatted output about VGs. USAGE top vgs [ -a|--all ] [ -o|--options String ] [ -S|--select String ] [ -O|--sort String ] [ --aligned ] [ --binary ] [ --configreport log|vg|lv|pv|pvseg|seg ] [ --foreign ] [ --ignorelockingfailure ] [ --logonly ] [ --nameprefixes ] [ --noheadings ] [ --nosuffix ] [ --readonly ] [ --reportformat basic|json ] [ --rows ] [ --separator String ] [ --shared ] [ --unbuffered ] [ --units [Number]r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ] [ --unquoted ] [ COMMON_OPTIONS ] [ VG|Tag ... ] Common options for lvm: [ -d|--debug ] [ -h|--help ] [ -q|--quiet ] [ -t|--test ] [ -v|--verbose ] [ -y|--yes ] [ --commandprofile String ] [ --config String ] [ --devices PV ] [ --devicesfile String ] [ --driverloaded y|n ] [ --journal String ] [ --lockopt String ] [ --longhelp ] [ --nohints ] [ --nolocking ] [ --profile String ] [ --version ] OPTIONS top --aligned Use with --separator to align the output columns -a|--all List all VGs. Equivalent to not specifying any VGs. --binary Use binary values "0" or "1" instead of descriptive literal values for columns that have exactly two valid values to report (not counting the "unknown" value which denotes that the value could not be determined). --commandprofile String The command profile to use for command configuration. See lvm.conf(5) for more information about profiles. --config String Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.conf(5) for more information about config. --configreport log|vg|lv|pv|pvseg|seg See lvmreport(7). -d|--debug ... Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured). --devices PV Devices that the command can use. This option can be repeated or accepts a comma separated list of devices. This overrides the devices file. --devicesfile String A file listing devices that LVM should use. The file must exist in /etc/lvm/devices/ and is managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings. --driverloaded y|n If set to no, the command will not attempt to use device- mapper. For testing and debugging. --foreign Report/display foreign VGs that would otherwise be skipped. See lvmsystemid(7) for more information about foreign VGs. -h|--help Display help text. --ignorelockingfailure Allows a command to continue with read-only metadata operations after locking failures. --journal String Record information in the systemd journal. This information is in addition to information enabled by the lvm.conf log/journal setting. command: record information about the command. output: record the default command output. debug: record full command debugging. --lockopt String Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information. --logonly Suppress command report and display only log report. --longhelp Display long help text. --nameprefixes Add an "LVM2_" prefix plus the field name to the output. Useful with --noheadings to produce a list of field=value pairs that can be used to set environment variables (for example, in udev rules). --noheadings Suppress the headings line that is normally the first line of output. Useful if grepping the output. --nohints Do not use the hints file to locate devices for PVs. A command may read more devices to find PVs when hints are not used. The command will still perform standard hint file invalidation where appropriate. --nolocking Disable locking. --nosuffix Suppress the suffix on output sizes. Use with --units (except h and H) if processing the output. -o|--options String Comma-separated, ordered list of fields to display in columns. String arg syntax is: [+|-|#]Field1[,Field2 ...] The prefix + will append the specified fields to the default fields, - will remove the specified fields from the default fields, and # will compact specified fields (removing them when empty for all rows.) Use -o help to view the list of all available fields. Use separate lists of fields to add, remove or compact by repeating the -o option: -o+field1,field2 -o-field3,field4 -o#field5. These lists are evaluated from left to right. Use field name lv_all to view all LV fields, vg_all all VG fields, pv_all all PV fields, pvseg_all all PV segment fields, seg_all all LV segment fields, and pvseg_all all PV segment columns. See the lvm.conf(5) report section for more config options. See lvmreport(7) for more information about reporting. --profile String An alias for --commandprofile or --metadataprofile, depending on the command. -q|--quiet ... Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'. --readonly Run the command in a special read-only mode which will read on-disk metadata without needing to take any locks. This can be used to peek inside metadata used by a virtual machine image while the virtual machine is running. No attempt will be made to communicate with the device-mapper kernel driver, so this option is unable to report whether or not LVs are actually in use. --reportformat basic|json Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf(5). basic is the original format with columns and rows. If there is more than one report per command, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information. --rows Output columns as rows. -S|--select String Select objects for processing and reporting based on specified criteria. The criteria syntax is described by --select help and lvmreport(7). For reporting commands, one row is displayed for each object matching the criteria. See --options help for selectable object fields. Rows can be displayed with an additional "selected" field (-o selected) showing 1 if the row matches the selection and 0 otherwise. For non-reporting commands which process LVM entities, the selection is used to choose items to process. --separator String String to use to separate each column. Useful if grepping the output. --shared Report/display shared VGs that would otherwise be skipped when lvmlockd is not being used on the host. See lvmlockd(8) for more information about shared VGs. -O|--sort String Comma-separated ordered list of columns to sort by. Replaces the default selection. Precede any column with - for a reverse sort on that column. -t|--test Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't. --unbuffered Produce output immediately without sorting or aligning the columns properly. --units [Number]r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E All sizes are output in these units: human-(r)eadable with '<' rounding indicator, (h)uman-readable, (b)ytes, (s)ectors, (k)ilobytes, (m)egabytes, (g)igabytes, (t)erabytes, (p)etabytes, (e)xabytes. Capitalise to use multiples of 1000 (S.I.) instead of 1024. Custom units can be specified, e.g. --units 3M. --unquoted When used with --nameprefixes, output values in the field=value pairs are not quoted. -v|--verbose ... Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr. --version Display version information. -y|--yes Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.) VARIABLES top VG Volume Group name. See lvm(8) for valid names. Tag Tag name. See lvm(8) for information about tag names and using tags in place of a VG, LV or PV. String See the option description for information about the string content. Size[UNIT] Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.) ENVIRONMENT VARIABLES top See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter. NOTES top The vg_attr bits are: 1 Permissions: (w)riteable, (r)ead-only 2 Resi(z)eable 3 E(x)ported 4 (p)artial: one or more physical volumes belonging to the volume group are missing from the system 5 Allocation policy: (c)ontiguous, c(l)ing, (n)ormal, (a)nywhere 6 (c)lustered, (s)hared SEE ALSO top lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8), pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8), pvremove(8), pvresize(8), pvs(8), pvscan(8), vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8), vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8), vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8), lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8), lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8), lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8), dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), cmirrord(8), lvmdbusd(8), fsadm(8), lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7) COLOPHON top This page is part of the lvm2 (Logical Volume Manager 2) project. Information about the project can be found at http://www.sourceware.org/lvm2/. If you have a bug report for this manual page, see https://github.com/lvmteam/lvm2/issues. This page was obtained from the project's upstream Git repository git://sourceware.org/git/lvm2.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-06.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] Red Hat, Inc. LVM TOOLS 2.03.24(2)-git (2023-11-21) VGS(8) Pages that refer to this page: lvmreport(7), lvmsystemid(7), lvchange(8), lvconvert(8), lvcreate(8), lvdisplay(8), lvextend(8), lvm(8), lvmconfig(8), lvmdevices(8), lvmdiskscan(8), lvm-fullreport(8), lvm-lvpoll(8), lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8), pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8), pvremove(8), pvresize(8), pvs(8), pvscan(8), vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgconvert(8), vgcreate(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8), vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# vgs\n\n> Display information about volume groups.\n> See also: `lvm`.\n> More information: <https://man7.org/linux/man-pages/man8/vgs.8.html>.\n\n- Display information about volume groups:\n\n`vgs`\n\n- Display all volume groups:\n\n`vgs -a`\n\n- Change default display to show more details:\n\n`vgs -v`\n\n- Display only specific fields:\n\n`vgs -o {{field_name_1}},{{field_name_2}}`\n\n- Append field to default display:\n\n`vgs -o +{{field_name}}`\n\n- Suppress heading line:\n\n`vgs --noheadings`\n\n- Use separator to separate fields:\n\n`vgs --separator =`\n
vgscan
vgscan(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training vgscan(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | USAGE | OPTIONS | VARIABLES | ENVIRONMENT VARIABLES | SEE ALSO | COLOPHON VGSCAN(8) System Manager's Manual VGSCAN(8) NAME top vgscan Search for all volume groups SYNOPSIS top vgscan [ option_args ] DESCRIPTION top vgscan scans all supported LVM block devices in the system for VGs. USAGE top vgscan [ --ignorelockingfailure ] [ --mknodes ] [ --notifydbus ] [ --reportformat basic|json ] [ COMMON_OPTIONS ] Common options for lvm: [ -d|--debug ] [ -h|--help ] [ -q|--quiet ] [ -t|--test ] [ -v|--verbose ] [ -y|--yes ] [ --commandprofile String ] [ --config String ] [ --devices PV ] [ --devicesfile String ] [ --driverloaded y|n ] [ --journal String ] [ --lockopt String ] [ --longhelp ] [ --nohints ] [ --nolocking ] [ --profile String ] [ --version ] OPTIONS top --commandprofile String The command profile to use for command configuration. See lvm.conf(5) for more information about profiles. --config String Config settings for the command. These override lvm.conf(5) settings. The String arg uses the same format as lvm.conf(5), or may use section/field syntax. See lvm.conf(5) for more information about config. -d|--debug ... Set debug level. Repeat from 1 to 6 times to increase the detail of messages sent to the log file and/or syslog (if configured). --devices PV Devices that the command can use. This option can be repeated or accepts a comma separated list of devices. This overrides the devices file. --devicesfile String A file listing devices that LVM should use. The file must exist in /etc/lvm/devices/ and is managed with the lvmdevices(8) command. This overrides the lvm.conf(5) devices/devicesfile and devices/use_devicesfile settings. --driverloaded y|n If set to no, the command will not attempt to use device- mapper. For testing and debugging. -h|--help Display help text. --ignorelockingfailure Allows a command to continue with read-only metadata operations after locking failures. --journal String Record information in the systemd journal. This information is in addition to information enabled by the lvm.conf log/journal setting. command: record information about the command. output: record the default command output. debug: record full command debugging. --lockopt String Used to pass options for special cases to lvmlockd. See lvmlockd(8) for more information. --longhelp Display long help text. --mknodes Also checks the LVM special files in /dev that are needed for active LVs and creates any missing ones and removes unused ones. --nohints Do not use the hints file to locate devices for PVs. A command may read more devices to find PVs when hints are not used. The command will still perform standard hint file invalidation where appropriate. --nolocking Disable locking. --notifydbus Send a notification to D-Bus. The command will exit with an error if LVM is not built with support for D-Bus notification, or if the notify_dbus config setting is disabled. --profile String An alias for --commandprofile or --metadataprofile, depending on the command. -q|--quiet ... Suppress output and log messages. Overrides --debug and --verbose. Repeat once to also suppress any prompts with answer 'no'. --reportformat basic|json Overrides current output format for reports which is defined globally by the report/output_format setting in lvm.conf(5). basic is the original format with columns and rows. If there is more than one report per command, each report is prefixed with the report name for identification. json produces report output in JSON format. See lvmreport(7) for more information. -t|--test Run in test mode. Commands will not update metadata. This is implemented by disabling all metadata writing but nevertheless returning success to the calling function. This may lead to unusual error messages in multi-stage operations if a tool relies on reading back metadata it believes has changed but hasn't. -v|--verbose ... Set verbose level. Repeat from 1 to 4 times to increase the detail of messages sent to stdout and stderr. --version Display version information. -y|--yes Do not prompt for confirmation interactively but always assume the answer yes. Use with extreme caution. (For automatic no, see -qq.) VARIABLES top String See the option description for information about the string content. Size[UNIT] Size is an input number that accepts an optional unit. Input units are always treated as base two values, regardless of capitalization, e.g. 'k' and 'K' both refer to 1024. The default input unit is specified by letter, followed by |UNIT. UNIT represents other possible input units: b|B is bytes, s|S is sectors of 512 bytes, k|K is KiB, m|M is MiB, g|G is GiB, t|T is TiB, p|P is PiB, e|E is EiB. (This should not be confused with the output control --units, where capital letters mean multiple of 1000.) ENVIRONMENT VARIABLES top See lvm(8) for information about environment variables used by lvm. For example, LVM_VG_NAME can generally be substituted for a required VG parameter. SEE ALSO top lvm(8), lvm.conf(5), lvmconfig(8), lvmdevices(8), pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8), pvremove(8), pvresize(8), pvs(8), pvscan(8), vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgcreate(8), vgconvert(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8), vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8), lvcreate(8), lvchange(8), lvconvert(8), lvdisplay(8), lvextend(8), lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8), lvm-fullreport(8), lvm-lvpoll(8), blkdeactivate(8), lvmdump(8), dmeventd(8), lvmpolld(8), lvmlockd(8), lvmlockctl(8), cmirrord(8), lvmdbusd(8), fsadm(8), lvmsystemid(7), lvmreport(7), lvmcache(7), lvmraid(7), lvmthin(7), lvmvdo(7), lvmautoactivation(7) COLOPHON top This page is part of the lvm2 (Logical Volume Manager 2) project. Information about the project can be found at http://www.sourceware.org/lvm2/. If you have a bug report for this manual page, see https://github.com/lvmteam/lvm2/issues. This page was obtained from the project's upstream Git repository git://sourceware.org/git/lvm2.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-06.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] Red Hat, Inc. LVM TOOLS 2.03.24(2)-git (2023-11-21) VGSCAN(8) Pages that refer to this page: lvchange(8), lvconvert(8), lvcreate(8), lvdisplay(8), lvextend(8), lvm(8), lvmconfig(8), lvmdevices(8), lvmdiskscan(8), lvm-fullreport(8), lvm-lvpoll(8), lvreduce(8), lvremove(8), lvrename(8), lvresize(8), lvs(8), lvscan(8), pvchange(8), pvck(8), pvcreate(8), pvdisplay(8), pvmove(8), pvremove(8), pvresize(8), pvs(8), pvscan(8), vgcfgbackup(8), vgcfgrestore(8), vgchange(8), vgck(8), vgconvert(8), vgcreate(8), vgdisplay(8), vgexport(8), vgextend(8), vgimport(8), vgimportclone(8), vgimportdevices(8), vgmerge(8), vgmknodes(8), vgreduce(8), vgremove(8), vgrename(8), vgs(8), vgscan(8), vgsplit(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# vgscan\n\n> Scan for volume groups on all supported Logical Volume Manager (LVM) block devices.\n> See also: `lvm` and `vgchange`.\n> More information: <https://manned.org/vgscan>.\n\n- Scan for volume groups and print information about each group found:\n\n`sudo vgscan`\n\n- Scan for volume groups and add the special files in `/dev`, if they don't already exist, needed to access the logical volumes in the found groups:\n\n`sudo vgscan --mknodes`\n
vi
vi(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training vi(1p) Linux manual page PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES OF ERRORS | APPLICATION USAGE | EXAMPLES | RATIONALE | FUTURE DIRECTIONS | SEE ALSO | COPYRIGHT VI(1P) POSIX Programmer's Manual VI(1P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME top vi screen-oriented (visual) display editor SYNOPSIS top vi [-rR] [-c command] [-t tagstring] [-w size] [file...] DESCRIPTION top This utility shall be provided on systems that both support the User Portability Utilities option and define the POSIX2_CHAR_TERM symbol. On other systems it is optional. The vi (visual) utility is a screen-oriented text editor. Only the open and visual modes of the editor are described in POSIX.12008; see the line editor ex for additional editing capabilities used in vi. The user can switch back and forth between vi and ex and execute ex commands from within vi. This reference page uses the term edit buffer to describe the current working text. No specific implementation is implied by this term. All editing changes are performed on the edit buffer, and no changes to it shall affect any file until an editor command writes the file. When using vi, the terminal screen acts as a window into the editing buffer. Changes made to the editing buffer shall be reflected in the screen display; the position of the cursor on the screen shall indicate the position within the editing buffer. Certain terminals do not have all the capabilities necessary to support the complete vi definition. When these commands cannot be supported on such terminals, this condition shall not produce an error message such as ``not an editor command'' or report a syntax error. The implementation may either accept the commands and produce results on the screen that are the result of an unsuccessful attempt to meet the requirements of this volume of POSIX.12017 or report an error describing the terminal-related deficiency. OPTIONS top The vi utility shall conform to the Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines, except that '+' may be recognized as an option delimiter as well as '-'. The following options shall be supported: -c command See the ex command description of the -c option. -r See the ex command description of the -r option. -R See the ex command description of the -R option. -t tagstring See the ex command description of the -t option. -w size See the ex command description of the -w option. OPERANDS top See the OPERANDS section of the ex command for a description of the operands supported by the vi command. STDIN top If standard input is not a terminal device, the results are undefined. The standard input consists of a series of commands and input text, as described in the EXTENDED DESCRIPTION section. If a read from the standard input returns an error, or if the editor detects an end-of-file condition from the standard input, it shall be equivalent to a SIGHUP asynchronous event. INPUT FILES top See the INPUT FILES section of the ex command for a description of the input files supported by the vi command. ENVIRONMENT VARIABLES top See the ENVIRONMENT VARIABLES section of the ex command for the environment variables that affect the execution of the vi command. ASYNCHRONOUS EVENTS top See the ASYNCHRONOUS EVENTS section of the ex for the asynchronous events that affect the execution of the vi command. STDOUT top If standard output is not a terminal device, undefined results occur. Standard output may be used for writing prompts to the user, for informational messages, and for writing lines from the file. STDERR top If standard output is not a terminal device, undefined results occur. The standard error shall be used only for diagnostic messages. OUTPUT FILES top See the OUTPUT FILES section of the ex command for a description of the output files supported by the vi command. EXTENDED DESCRIPTION top If the terminal does not have the capabilities necessary to support an unspecified portion of the vi definition, implementations shall start initially in ex mode or open mode. Otherwise, after initialization, vi shall be in command mode; text input mode can be entered by one of several commands used to insert or change text. In text input mode, <ESC> can be used to return to command mode; other uses of <ESC> are described later in this section; see Terminate Command or Input Mode. Initialization in ex and vi See Initialization in ex and vi for a description of ex and vi initialization for the vi utility. Command Descriptions in vi The following symbols are used in this reference page to represent arguments to commands. buffer See the description of buffer in the EXTENDED DESCRIPTION section of the ex utility; see Command Descriptions in ex. In open and visual mode, when a command synopsis shows both [buffer] and [count] preceding the command name, they can be specified in either order. count A positive integer used as an optional argument to most commands, either to give a repeat count or as a size. This argument is optional and shall default to 1 unless otherwise specified. The Synopsis lines for the vi commands <control>G, <control>L, <control>R, <control>], %, &, ^, D, m, M, Q, u, U, and ZZ do not have count as an optional argument. Regardless, it shall not be an error to specify a count to these commands, and any specified count shall be ignored. motion An optional trailing argument used by the !, <, >, c, d, and y commands, which is used to indicate the region of text that shall be affected by the command. The motion can be either one of the command characters repeated or one of several other vi commands (listed in the following table). Each of the applicable commands specifies the region of text matched by repeating the command; each command that can be used as a motion command specifies the region of text it affects. Commands that take motion arguments operate on either lines or characters, depending on the circumstances. When operating on lines, all lines that fall partially or wholly within the text region specified for the command shall be affected. When operating on characters, only the exact characters in the specified text region shall be affected. Each motion command specifies this individually. When commands that may be motion commands are not used as motion commands, they shall set the current position to the current line and column as specified. The following commands shall be valid cursor motion commands: <apostrophe> ( - j H <carriage-return> ) $ k L <comma> [[ % l M <control>-H ]] _ n N <control>-N { ; t T <control>-P } ? w W <grave-accent> ^ b B <newline> + e E <space> | f F <zero> / h G Any count that is specified to a command that has an associated motion command shall be applied to the motion command. If a count is applied to both the command and its associated motion command, the effect shall be multiplicative. The following symbols are used in this section to specify locations in the edit buffer: current character The character that is currently indicated by the cursor. end of a line The point located between the last non-<newline> (if any) and the terminating <newline> of a line. For an empty line, this location coincides with the beginning of the line. end of the edit buffer The location corresponding to the end of the last line in the edit buffer. The following symbols are used in this section to specify command actions: bigword In the POSIX locale, vi shall recognize four kinds of bigwords: 1. A maximal sequence of non-<blank> characters preceded and followed by <blank> characters or the beginning or end of a line or the edit buffer 2. One or more sequential blank lines 3. The first character in the edit buffer 4. The last non-<newline> in the edit buffer word In the POSIX locale, vi shall recognize five kinds of words: 1. A maximal sequence of letters, digits, and underscores, delimited at both ends by: -- Characters other than letters, digits, or underscores -- The beginning or end of a line -- The beginning or end of the edit buffer 2. A maximal sequence of characters other than letters, digits, underscores, or <blank> characters, delimited at both ends by: -- A letter, digit, underscore -- <blank> characters -- The beginning or end of a line -- The beginning or end of the edit buffer 3. One or more sequential blank lines 4. The first character in the edit buffer 5. The last non-<newline> in the edit buffer section boundary A section boundary is one of the following: 1. A line whose first character is a <form-feed> 2. A line whose first character is an open curly brace ('{') 3. A line whose first character is a <period> and whose second and third characters match a two-character pair in the sections edit option (see ex) 4. A line whose first character is a <period> and whose only other character matches the first character of a two-character pair in the sections edit option, where the second character of the two-character pair is a <space> 5. The first line of the edit buffer 6. The last line of the edit buffer if the last line of the edit buffer is empty or if it is a ]] or } command; otherwise, the last non-<newline> of the last line of the edit buffer paragraph boundary A paragraph boundary is one of the following: 1. A section boundary 2. A line whose first character is a <period> and whose second and third characters match a two-character pair in the paragraphs edit option (see ex) 3. A line whose first character is a <period> and whose only other character matches the first character of a two-character pair in the paragraphs edit option, where the second character of the two-character pair is a <space> 4. One or more sequential blank lines remembered search direction See the description of remembered search direction in ex. sentence boundary A sentence boundary is one of the following: 1. A paragraph boundary 2. The first non-<blank> that occurs after a paragraph boundary 3. The first non-<blank> that occurs after a <period> ('.'), <exclamation-mark> ('!'), or <question-mark> ('?'), followed by two <space> characters or the end of a line; any number of closing parenthesis (')'), closing brackets (']'), double-quote ('"'), or single-quote (<apostrophe>) characters can appear between the punctuation mark and the two <space> characters or end-of-line In the remainder of the description of the vi utility, the term ``buffer line'' refers to a line in the edit buffer and the term ``display line'' refers to the line or lines on the display screen used to display one buffer line. The term ``current line'' refers to a specific ``buffer line''. If there are display lines on the screen for which there are no corresponding buffer lines because they correspond to lines that would be after the end of the file, they shall be displayed as a single <tilde> ('~') character, plus the terminating <newline>. The last line of the screen shall be used to report errors or display informational messages. It shall also be used to display the input for ``line-oriented commands'' (/, ?, :, and !). When a line-oriented command is executed, the editor shall enter text input mode on the last line on the screen, using the respective command characters as prompt characters. (In the case of the ! command, the associated motion shall be entered by the user before the editor enters text input mode.) The line entered by the user shall be terminated by a <newline>, a non-<control>V- escaped <carriage-return>, or unescaped <ESC>. It is unspecified if more characters than require a display width minus one column number of screen columns can be entered. If any command is executed that overwrites a portion of the screen other than the last line of the screen (for example, the ex suspend or ! commands), other than the ex shell command, the user shall be prompted for a character before the screen is refreshed and the edit session continued. <tab> characters shall take up the number of columns on the screen set by the tabstop edit option (see ex), unless there are less than that number of columns before the display margin that will cause the displayed line to be folded; in this case, they shall only take up the number of columns up to that boundary. The cursor shall be placed on the current line and relative to the current column as specified by each command described in the following sections. In open mode, if the current line is not already displayed, then it shall be displayed. In visual mode, if the current line is not displayed, then the lines that are displayed shall be expanded, scrolled, or redrawn to cause an unspecified portion of the current line to be displayed. If the screen is redrawn, no more than the number of display lines specified by the value of the window edit option shall be displayed (unless the current line cannot be completely displayed in the number of display lines specified by the window edit option) and the current line shall be positioned as close to the center of the displayed lines as possible (within the constraints imposed by the distance of the line from the beginning or end of the edit buffer). If the current line is before the first line in the display and the screen is scrolled, an unspecified portion of the current line shall be placed on the first line of the display. If the current line is after the last line in the display and the screen is scrolled, an unspecified portion of the current line shall be placed on the last line of the display. In visual mode, if a line from the edit buffer (other than the current line) does not entirely fit into the lines at the bottom of the display that are available for its presentation, the editor may choose not to display any portion of the line. The lines of the display that do not contain text from the edit buffer for this reason shall each consist of a single '@' character. In visual mode, the editor may choose for unspecified reasons to not update lines in the display to correspond to the underlying edit buffer text. The lines of the display that do not correctly correspond to text from the edit buffer for this reason shall consist of a single '@' character (plus the terminating <newline>), and the <control>R command shall cause the editor to update the screen to correctly represent the edit buffer. Open and visual mode commands that set the current column set it to a column position in the display, and not a character position in the line. In this case, however, the column position in the display shall be calculated for an infinite width display; for example, the column related to a character that is part of a line that has been folded onto additional screen lines will be offset from the display line column where the buffer line begins, not from the beginning of a particular display line. The display cursor column in the display is based on the value of the current column, as follows, with each rule applied in turn: 1. If the current column is after the last display line column used by the displayed line, the display cursor column shall be set to the last display line column occupied by the last non-<newline> in the current line; otherwise, the display cursor column shall be set to the current column. 2. If the character of which some portion is displayed in the display line column specified by the display cursor column requires more than a single display line column: a. If in text input mode, the display cursor column shall be adjusted to the first display line column in which any portion of that character is displayed. b. Otherwise, the display cursor column shall be adjusted to the last display line column in which any portion of that character is displayed. The current column shall not be changed by these adjustments to the display cursor column. If an error occurs during the parsing or execution of a vi command: * The terminal shall be alerted. Execution of the vi command shall stop, and the cursor (for example, the current line and column) shall not be further modified. * Unless otherwise specified by the following command sections, it is unspecified whether an informational message shall be displayed. * Any partially entered vi command shall be discarded. * If the vi command resulted from a map expansion, all characters from that map expansion shall be discarded, except as otherwise specified by the map command (see ex). * If the vi command resulted from the execution of a buffer, no further commands caused by the execution of the buffer shall be executed. Page Backwards Synopsis: [count] <control>-B If in open mode, the <control>B command shall behave identically to the z command. Otherwise, if the current line is the first line of the edit buffer, it shall be an error. If the window edit option is less than 3, display a screen where the last line of the display shall be some portion of: (current first line) -1 otherwise, display a screen where the first line of the display shall be some portion of: (current first line) - count x ((window edit option) -2) If this calculation would result in a line that is before the first line of the edit buffer, the first line of the display shall display some portion of the first line of the edit buffer. Current line: If no lines from the previous display remain on the screen, set to the last line of the display; otherwise, set to (line - the number of new lines displayed on this screen). Current column: Set to non-<blank>. Scroll Forward Synopsis: [count] <control>-D If the current line is the last line of the edit buffer, it shall be an error. If no count is specified, count shall default to the count associated with the previous <control>D or <control>U command. If there was no previous <control>D or <control>U command, count shall default to the value of the scroll edit option. If in open mode, write lines starting with the line after the current line, until count lines or the last line of the file have been written. Current line: If the current line + count is past the last line of the edit buffer, set to the last line of the edit buffer; otherwise, set to the current line + count. Current column: Set to non-<blank>. Scroll Forward by Line Synopsis: [count] <control>-E Display the line count lines after the last line currently displayed. If the last line of the edit buffer is displayed, it shall be an error. If there is no line count lines after the last line currently displayed, the last line of the display shall display some portion of the last line of the edit buffer. Current line: Unchanged if the previous current character is displayed; otherwise, set to the first line displayed. Current column: Unchanged. Page Forward Synopsis: [count] <control>-F If in open mode, the <control>F command shall behave identically to the z command. Otherwise, if the current line is the last line of the edit buffer, it shall be an error. If the window edit option is less than 3, display a screen where the first line of the display shall be some portion of: (current last line) +1 otherwise, display a screen where the first line of the display shall be some portion of: (current first line) + count x ((window edit option) -2) If this calculation would result in a line that is after the last line of the edit buffer, the last line of the display shall display some portion of the last line of the edit buffer. Current line: If no lines from the previous display remain on the screen, set to the first line of the display; otherwise, set to (line + the number of new lines displayed on this screen). Current column: Set to non-<blank>. Display Information Synopsis: <control>-G This command shall be equivalent to the ex file command. Move Cursor Backwards Synopsis: [count] <control>-H [count] h the current erase character (see stty) If there are no characters before the current character on the current line, it shall be an error. If there are less than count previous characters on the current line, count shall be adjusted to the number of previous characters on the line. If used as a motion command: 1. The text region shall be from the character before the starting cursor up to and including the countth character before the starting cursor. 2. Any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Unchanged. Current column: Set to (column - the number of columns occupied by count characters ending with the previous current column). Move Down Synopsis: [count] <newline> [count] <control>-J [count] <control>-M [count] <control>-N [count] j [count] <carriage-return> [count] + If there are less than count lines after the current line in the edit buffer, it shall be an error. If used as a motion command: 1. The text region shall include the starting line and the next count - 1 lines. 2. Any text copied to a buffer shall be in line mode. If not used as a motion command: Current line: Set to current line+ count. Current column: Set to non-<blank> for the <carriage-return>, <control>M, and + commands; otherwise, unchanged. Clear and Redisplay Synopsis: <control>-L If in open mode, clear the screen and redisplay the current line. Otherwise, clear and redisplay the screen. Current line: Unchanged. Current column: Unchanged. Move Up Synopsis: [count] <control>-P [count] k [count] - If there are less than count lines before the current line in the edit buffer, it shall be an error. If used as a motion command: 1. The text region shall include the starting line and the previous count lines. 2. Any text copied to a buffer shall be in line mode. If not used as a motion command: Current line: Set to current line - count. Current column: Set to non-<blank> for the - command; otherwise, unchanged. Redraw Screen Synopsis: <control>-R If any lines have been deleted from the display screen and flagged as deleted on the terminal using the @ convention (see the beginning of the EXTENDED DESCRIPTION section), they shall be redisplayed to match the contents of the edit buffer. It is unspecified whether lines flagged with @ because they do not fit on the terminal display shall be affected. Current line: Unchanged. Current column: Unchanged. Scroll Backward Synopsis: [count] <control>-U If the current line is the first line of the edit buffer, it shall be an error. If no count is specified, count shall default to the count associated with the previous <control>D or <control>U command. If there was no previous <control>D or <control>U command, count shall default to the value of the scroll edit option. Current line: If count is greater than the current line, set to 1; otherwise, set to the current line - count. Current column: Set to non-<blank>. Scroll Backward by Line Synopsis: [count] <control>-Y Display the line count lines before the first line currently displayed. If the current line is the first line of the edit buffer, it shall be an error. If this calculation would result in a line that is before the first line of the edit buffer, the first line of the display shall display some portion of the first line of the edit buffer. Current line: Unchanged if the previous current character is displayed; otherwise, set to the first line displayed. Current column: Unchanged. Edit the Alternate File Synopsis: <control>-^ This command shall be equivalent to the ex edit command, with the alternate pathname as its argument. Terminate Command or Input Mode Synopsis: <ESC> If a partial vi command (as defined by at least one, non-count character) has been entered, discard the count and the command character(s). Otherwise, if no command characters have been entered, and the <ESC> was the result of a map expansion, the terminal shall be alerted and the <ESC> character shall be discarded, but it shall not be an error. Otherwise, it shall be an error. Current line: Unchanged. Current column: Unchanged. Search for tagstring Synopsis: <control>-] If the current character is not a word or <blank>, it shall be an error. This command shall be equivalent to the ex tag command, with the argument to that command defined as follows. If the current character is a <blank>: 1. Skip all <blank> characters after the cursor up to the end of the line. 2. If the end of the line is reached, it shall be an error. Then, the argument to the ex tag command shall be the current character and all subsequent characters, up to the first non-word character or the end of the line. Move Cursor Forward Synopsis: [count] <space> [count] l (ell) If there are less than count non-<newline> characters after the cursor on the current line, count shall be adjusted to the number of non-<newline> characters after the cursor on the line. If used as a motion command: 1. If the current or countth character after the cursor is the last non-<newline> in the line, the text region shall be comprised of the current character up to and including the last non-<newline> in the line. Otherwise, the text region shall be from the current character up to, but not including, the countth character after the cursor. 2. Any text copied to a buffer shall be in character mode. If not used as a motion command: If there are no non-<newline> characters after the current character on the current line, it shall be an error. Current line: Unchanged. Current column: Set to the last column that displays any portion of the countth character after the current character. Replace Text with Results from Shell Command Synopsis: [count] ! motion shell-commands <newline> If the motion command is the ! command repeated: 1. If the edit buffer is empty and no count was supplied, the command shall be the equivalent of the ex :read ! command, with the text input, and no text shall be copied to any buffer. 2. Otherwise: a. If there are less than count -1 lines after the current line in the edit buffer, it shall be an error. b. The text region shall be from the current line up to and including the next count -1 lines. Otherwise, the text region shall be the lines in which any character of the text region specified by the motion command appear. Any text copied to a buffer shall be in line mode. This command shall be equivalent to the ex ! command for the specified lines. Move Cursor to End-of-Line Synopsis: [count] $ It shall be an error if there are less than (count -1) lines after the current line in the edit buffer. If used as a motion command: 1. If count is 1: a. It shall be an error if the line is empty. b. Otherwise, the text region shall consist of all characters from the starting cursor to the last non-<newline> in the line, inclusive, and any text copied to a buffer shall be in character mode. 2. Otherwise, if the starting cursor position is at or before the first non-<blank> in the line, the text region shall consist of the current and the next count -1 lines, and any text saved to a buffer shall be in line mode. 3. Otherwise, the text region shall consist of all characters from the starting cursor to the last non-<newline> in the line that is count -1 lines forward from the current line, and any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Set to the current line + count-1. Current column: The current column is set to the last display line column of the last non-<newline> in the line, or column position 1 if the line is empty. The current column shall be adjusted to be on the last display line column of the last non-<newline> of the current line as subsequent commands change the current line, until a command changes the current column. Move to Matching Character Synopsis: % If the character at the current position is not a parenthesis, bracket, or curly brace, search forward in the line to the first one of those characters. If no such character is found, it shall be an error. The matching character shall be the parenthesis, bracket, or curly brace matching the parenthesis, bracket, or curly brace, respectively, that was at the current position or that was found on the current line. Matching shall be determined as follows, for an open parenthesis: 1. Set a counter to 1. 2. Search forwards until a parenthesis is found or the end of the edit buffer is reached. 3. If the end of the edit buffer is reached, it shall be an error. 4. If an open parenthesis is found, increment the counter by 1. 5. If a close parenthesis is found, decrement the counter by 1. 6. If the counter is zero, the current character is the matching character. Matching for a close parenthesis shall be equivalent, except that the search shall be backwards, from the starting character to the beginning of the buffer, a close parenthesis shall increment the counter by 1, and an open parenthesis shall decrement the counter by 1. Matching for brackets and curly braces shall be equivalent, except that searching shall be done for open and close brackets or open and close curly braces. It is implementation-defined whether other characters are searched for and matched as well. If used as a motion command: 1. If the matching cursor was after the starting cursor in the edit buffer, and the starting cursor position was at or before the first non-<blank> non-<newline> in the starting line, and the matching cursor position was at or after the last non-<blank> non-<newline> in the matching line, the text region shall consist of the current line to the matching line, inclusive, and any text copied to a buffer shall be in line mode. 2. If the matching cursor was before the starting cursor in the edit buffer, and the starting cursor position was at or after the last non-<blank> non-<newline> in the starting line, and the matching cursor position was at or before the first non-<blank> non-<newline> in the matching line, the text region shall consist of the current line to the matching line, inclusive, and any text copied to a buffer shall be in line mode. 3. Otherwise, the text region shall consist of the starting character to the matching character, inclusive, and any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Set to the line where the matching character is located. Current column: Set to the last column where any portion of the matching character is displayed. Repeat Substitution Synopsis: & Repeat the previous substitution command. This command shall be equivalent to the ex & command with the current line as its addresses, and without options, count, or flags. Return to Previous Context at Beginning of Line Synopsis: ' character It shall be an error if there is no line in the edit buffer marked by character. If used as a motion command: 1. If the starting cursor is after the marked cursor, then the locations of the starting cursor and the marked cursor in the edit buffer shall be logically swapped. 2. The text region shall consist of the starting line up to and including the marked line, and any text copied to a buffer shall be in line mode. If not used as a motion command: Current line: Set to the line referenced by the mark. Current column: Set to non-<blank>. Return to Previous Context Synopsis: ` character It shall be an error if the marked line is no longer in the edit buffer. If the marked line no longer contains a character in the saved numbered character position, it shall be as if the marked position is the first non-<blank>. If used as a motion command: 1. It shall be an error if the marked cursor references the same character in the edit buffer as the starting cursor. 2. If the starting cursor is after the marked cursor, then the locations of the starting cursor and the marked cursor in the edit buffer shall be logically swapped. 3. If the starting line is empty or the starting cursor is at or before the first non-<blank> non-<newline> of the starting line, and the marked cursor line is empty or the marked cursor references the first character of the marked cursor line, the text region shall consist of all lines containing characters from the starting cursor to the line before the marked cursor line, inclusive, and any text copied to a buffer shall be in line mode. 4. Otherwise, if the marked cursor line is empty or the marked cursor references a character at or before the first non-<blank> non-<newline> of the marked cursor line, the region of text shall be from the starting cursor to the last non-<newline> of the line before the marked cursor line, inclusive, and any text copied to a buffer shall be in character mode. 5. Otherwise, the region of text shall be from the starting cursor (inclusive), to the marked cursor (exclusive), and any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Set to the line referenced by the mark. Current column: Set to the last column in which any portion of the character referenced by the mark is displayed. Return to Previous Section Synopsis: [count] [[ Move the cursor backward through the edit buffer to the first character of the previous section boundary, count times. If used as a motion command: 1. If the starting cursor was at the first character of the starting line or the starting line was empty, and the first character of the boundary was the first character of the boundary line, the text region shall consist of the current line up to and including the line where the countth next boundary starts, and any text copied to a buffer shall be in line mode. 2. If the boundary was the last line of the edit buffer or the last non-<newline> of the last line of the edit buffer, the text region shall consist of the last character in the edit buffer up to and including the starting character, and any text saved to a buffer shall be in character mode. 3. Otherwise, the text region shall consist of the starting character up to but not including the first character in the countth next boundary, and any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Set to the line where the countth next boundary in the edit buffer starts. Current column: Set to the last column in which any portion of the first character of the countth next boundary is displayed, or column position 1 if the line is empty. Move to Next Section Synopsis: [count] ]] Move the cursor forward through the edit buffer to the first character of the next section boundary, count times. If used as a motion command: 1. If the starting cursor was at the first character of the starting line or the starting line was empty, and the first character of the boundary was the first character of the boundary line, the text region shall consist of the current line up to and including the line where the countth previous boundary starts, and any text copied to a buffer shall be in line mode. 2. If the boundary was the first line of the edit buffer, the text region shall consist of the first character in the edit buffer up to but not including the starting character, and any text copied to a buffer shall be in character mode. 3. Otherwise, the text region shall consist of the first character in the countth previous section boundary up to but not including the starting character, and any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Set to the line where the countth previous boundary in the edit buffer starts. Current column: Set to the last column in which any portion of the first character of the countth previous boundary is displayed, or column position 1 if the line is empty. Move to First Non-<blank> Position on Current Line Synopsis: ^ If used as a motion command: 1. If the line has no non-<blank> non-<newline> characters, or if the cursor is at the first non-<blank> non-<newline> of the line, it shall be an error. 2. If the cursor is before the first non-<blank> non-<newline> of the line, the text region shall be comprised of the current character, up to, but not including, the first non-<blank> non-<newline> of the line. 3. If the cursor is after the first non-<blank> non-<newline> of the line, the text region shall be from the character before the starting cursor up to and including the first non-<blank> non-<newline> of the line. 4. Any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Unchanged. Current column: Set to non-<blank>. Current and Line Above Synopsis: [count] _ If there are less than count -1 lines after the current line in the edit buffer, it shall be an error. If used as a motion command: 1. If count is less than 2, the text region shall be the current line. 2. Otherwise, the text region shall include the starting line and the next count -1 lines. 3. Any text copied to a buffer shall be in line mode. If not used as a motion command: Current line: Set to current line + count -1. Current column: Set to non-<blank>. Move Back to Beginning of Sentence Synopsis: [count] ( Move backward to the beginning of a sentence. This command shall be equivalent to the [[ command, with the exception that sentence boundaries shall be used instead of section boundaries. Move Forward to Beginning of Sentence Synopsis: [count] ) Move forward to the beginning of a sentence. This command shall be equivalent to the ]] command, with the exception that sentence boundaries shall be used instead of section boundaries. Move Back to Preceding Paragraph Synopsis: [count] { Move back to the beginning of the preceding paragraph. This command shall be equivalent to the [[ command, with the exception that paragraph boundaries shall be used instead of section boundaries. Move Forward to Next Paragraph Synopsis: [count] } Move forward to the beginning of the next paragraph. This command shall be equivalent to the ]] command, with the exception that paragraph boundaries shall be used instead of section boundaries. Move to Specific Column Position Synopsis: [count] | For the purposes of this command, lines that are too long for the current display and that have been folded shall be treated as having a single, 1-based, number of columns. If there are less than count columns in which characters from the current line are displayed on the screen, count shall be adjusted to be the last column in which any portion of the line is displayed on the screen. If used as a motion command: 1. If the line is empty, or the cursor character is the same as the character on the countth column of the line, it shall be an error. 2. If the cursor is before the countth column of the line, the text region shall be comprised of the current character, up to but not including the character on the countth column of the line. 3. If the cursor is after the countth column of the line, the text region shall be from the character before the starting cursor up to and including the character on the countth column of the line. 4. Any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Unchanged. Current column: Set to the last column in which any portion of the character that is displayed in the count column of the line is displayed. Reverse Find Character Synopsis: [count] , If the last F, f, T, or t command was F, f, T, or t, this command shall be equivalent to an f, F, t, or T command, respectively, with the specified count and the same search character. If there was no previous F, f, T, or t command, it shall be an error. Repeat Synopsis: [count] . Repeat the last !, <, >, A, C, D, I, J, O, P, R, S, X, Y, a, c, d, i, o, p, r, s, x, y, or ~ command. It shall be an error if none of these commands have been executed. Commands (other than commands that enter text input mode) executed as a result of map expansions, shall not change the value of the last repeatable command. Repeated commands with associated motion commands shall repeat the motion command as well; however, any specified count shall replace the count(s) that were originally specified to the repeated command or its associated motion command. If the motion component of the repeated command is f, F, t, or T, the repeated command shall not set the remembered search character for the ; and , commands. If the repeated command is p or P, and the buffer associated with that command was a numeric buffer named with a number less than 9, the buffer associated with the repeated command shall be set to be the buffer named by the name of the previous buffer logically incremented by 1. If the repeated character is a text input command, the input text associated with that command is repeated literally: * Input characters are neither macro or abbreviation-expanded. * Input characters are not interpreted in any special way with the exception that <newline>, <carriage-return>, and <control>T behave as described in Input Mode Commands in vi. Current line: Set as described for the repeated command. Current column: Set as described for the repeated command. Find Regular Expression Synopsis: / If the input line contains no non-<newline> characters, it shall be equivalent to a line containing only the last regular expression encountered. The enhanced regular expressions supported by vi are described in Regular Expressions in ex. Otherwise, the line shall be interpreted as one or more regular expressions, optionally followed by an address offset or a vi z command. If the regular expression is not the last regular expression on the line, or if a line offset or z command is specified, the regular expression shall be terminated by an unescaped '/' character, which shall not be used as part of the regular expression. If the regular expression is not the first regular expression on the line, it shall be preceded by zero or more <blank> characters, a <semicolon>, zero or more <blank> characters, and a leading '/' character, which shall not be interpreted as part of the regular expression. It shall be an error to precede any regular expression with any characters other than these. Each search shall begin from the character after the first character of the last match (or, if it is the first search, after the cursor). If the wrapscan edit option is set, the search shall continue to the character before the starting cursor character; otherwise, to the end of the edit buffer. It shall be an error if any search fails to find a match, and an informational message to this effect shall be displayed. An optional address offset (see Addressing in ex) can be specified after the last regular expression by including a trailing '/' character after the regular expression and specifying the address offset. This offset will be from the line containing the match for the last regular expression specified. It shall be an error if the line offset would indicate a line address less than 1 or greater than the last line in the edit buffer. An address offset of zero shall be supported. It shall be an error to follow the address offset with any other characters than <blank> characters. If not used as a motion command, an optional z command (see Redraw Window) can be specified after the last regular expression by including a trailing '/' character after the regular expression, zero or more <blank> characters, a 'z', zero or more <blank> characters, an optional new window edit option value, zero or more <blank> characters, and a location character. The effect shall be as if the z command was executed after the / command. It shall be an error to follow the z command with any other characters than <blank> characters. The remembered search direction shall be set to forward. If used as a motion command: 1. It shall be an error if the last match references the same character in the edit buffer as the starting cursor. 2. If any address offset is specified, the last match shall be adjusted by the specified offset as described previously. 3. If the starting cursor is after the last match, then the locations of the starting cursor and the last match in the edit buffer shall be logically swapped. 4. If any address offset is specified, the text region shall consist of all lines containing characters from the starting cursor to the last match line, inclusive, and any text copied to a buffer shall be in line mode. 5. Otherwise, if the starting line is empty or the starting cursor is at or before the first non-<blank> non-<newline> of the starting line, and the last match line is empty or the last match starts at the first character of the last match line, the text region shall consist of all lines containing characters from the starting cursor to the line before the last match line, inclusive, and any text copied to a buffer shall be in line mode. 6. Otherwise, if the last match line is empty or the last match begins at a character at or before the first non-<blank> non-<newline> of the last match line, the region of text shall be from the current cursor to the last non-<newline> of the line before the last match line, inclusive, and any text copied to a buffer shall be in character mode. 7. Otherwise, the region of text shall be from the current cursor (inclusive), to the first character of the last match (exclusive), and any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: If a match is found, set to the last matched line plus the address offset, if any; otherwise, unchanged. Current column: Set to the last column on which any portion of the first character in the last matched string is displayed, if a match is found; otherwise, unchanged. Move to First Character in Line Synopsis: 0 (zero) Move to the first character on the current line. The character '0' shall not be interpreted as a command if it is immediately preceded by a digit. If used as a motion command: 1. If the cursor character is the first character in the line, it shall be an error. 2. The text region shall be from the character before the cursor character up to and including the first character in the line. 3. Any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Unchanged. Current column: The last column in which any portion of the first character in the line is displayed, or if the line is empty, unchanged. Execute an ex Command Synopsis: : Execute one or more ex commands. If any portion of the screen other than the last line of the screen was overwritten by any ex command (except shell), vi shall display a message indicating that it is waiting for an input from the user, and shall then read a character. This action may also be taken for other, unspecified reasons. If the next character entered is a ':', another ex command shall be accepted and executed. Any other character shall cause the screen to be refreshed and vi shall return to command mode. Current line: As specified for the ex command. Current column: As specified for the ex command. Repeat Find Synopsis: [count] ; This command shall be equivalent to the last F, f, T, or t command, with the specified count, and with the same search character used for the last F, f, T, or t command. If there was no previous F, f, T, or t command, it shall be an error. Shift Left Synopsis: [count] < motion If the motion command is the < command repeated: 1. If there are less than count -1 lines after the current line in the edit buffer, it shall be an error. 2. The text region shall be from the current line, up to and including the next count -1 lines. Shift any line in the text region specified by the count and motion command one shiftwidth (see the ex shiftwidth option) toward the start of the line, as described by the ex < command. The unshifted lines shall be copied to the unnamed buffer in line mode. Current line: If the motion was from the current cursor position toward the end of the edit buffer, unchanged. Otherwise, set to the first line in the edit buffer that is part of the text region specified by the motion command. Current column: Set to non-<blank>. Shift Right Synopsis: [count] > motion If the motion command is the > command repeated: 1. If there are less than count -1 lines after the current line in the edit buffer, it shall be an error. 2. The text region shall be from the current line, up to and including the next count -1 lines. Shift any line with characters in the text region specified by the count and motion command one shiftwidth (see the ex shiftwidth option) away from the start of the line, as described by the ex > command. The unshifted lines shall be copied into the unnamed buffer in line mode. Current line: If the motion was from the current cursor position toward the end of the edit buffer, unchanged. Otherwise, set to the first line in the edit buffer that is part of the text region specified by the motion command. Current column: Set to non-<blank>. Scan Backwards for Regular Expression Synopsis: ? Scan backwards; the ? command shall be equivalent to the / command (see Find Regular Expression) with the following exceptions: 1. The input prompt shall be a '?'. 2. Each search shall begin from the character before the first character of the last match (or, if it is the first search, the character before the cursor character). 3. The search direction shall be from the cursor toward the beginning of the edit buffer, and the wrapscan edit option shall affect whether the search wraps to the end of the edit buffer and continues. 4. The remembered search direction shall be set to backward. Execute Synopsis: @buffer If the buffer is specified as @, the last buffer executed shall be used. If no previous buffer has been executed, it shall be an error. Behave as if the contents of the named buffer were entered as standard input. After each line of a line-mode buffer, and all but the last line of a character mode buffer, behave as if a <newline> were entered as standard input. If an error occurs during this process, an error message shall be written, and no more characters resulting from the execution of this command shall be processed. If a count is specified, behave as if that count were entered as user input before the characters from the @ buffer were entered. Current line: As specified for the individual commands. Current column: As specified for the individual commands. Reverse Case Synopsis: [count] ~ Reverse the case of the current character and the next count -1 characters, such that lowercase characters that have uppercase counterparts shall be changed to uppercase characters, and uppercase characters that have lowercase counterparts shall be changed to lowercase characters, as prescribed by the current locale. No other characters shall be affected by this command. If there are less than count -1 characters after the cursor in the edit buffer, count shall be adjusted to the number of characters after the cursor in the edit buffer minus 1. For the purposes of this command, the next character after the last non-<newline> on the line shall be the next character in the edit buffer. Current line: Set to the line including the (count-1)th character after the cursor. Current column: Set to the last column in which any portion of the (count-1)th character after the cursor is displayed. Append Synopsis: [count] a Enter text input mode after the current cursor position. No characters already in the edit buffer shall be affected by this command. A count shall cause the input text to be appended count -1 more times to the end of the input. Current line/column: As specified for the text input commands (see Input Mode Commands in vi). Append at End-of-Line Synopsis: [count] A This command shall be equivalent to the vi command: $ [ count ] a (see Append). Move Backward to Preceding Word Synopsis: [count] b With the exception that words are used as the delimiter instead of bigwords, this command shall be equivalent to the B command. Move Backward to Preceding Bigword Synopsis: [count] B If the edit buffer is empty or the cursor is on the first character of the edit buffer, it shall be an error. If less than count bigwords begin between the cursor and the start of the edit buffer, count shall be adjusted to the number of bigword beginnings between the cursor and the start of the edit buffer. If used as a motion command: 1. The text region shall be from the first character of the countth previous bigword beginning up to but not including the cursor character. 2. Any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Set to the line containing the current column. Current column: Set to the last column upon which any part of the first character of the countth previous bigword is displayed. Change Synopsis: [buffer][count] c motion If the motion command is the c command repeated: 1. The buffer text shall be in line mode. 2. If there are less than count -1 lines after the current line in the edit buffer, it shall be an error. 3. The text region shall be from the current line up to and including the next count -1 lines. Otherwise, the buffer text mode and text region shall be as specified by the motion command. The replaced text shall be copied into buffer, if specified, and into the unnamed buffer. If the text to be replaced contains characters from more than a single line, or the buffer text is in line mode, the replaced text shall be copied into the numeric buffers as well. If the buffer text is in line mode: 1. Any lines that contain characters in the region shall be deleted, and the editor shall enter text input mode at the beginning of a new line which shall replace the first line deleted. 2. If the autoindent edit option is set, autoindent characters equal to the autoindent characters on the first line deleted shall be inserted as if entered by the user. Otherwise, if characters from more than one line are in the region of text: 1. The text shall be deleted. 2. Any text remaining in the last line in the text region shall be appended to the first line in the region, and the last line in the region shall be deleted. 3. The editor shall enter text input mode after the last character not deleted from the first line in the text region, if any; otherwise, on the first column of the first line in the region. Otherwise: 1. If the glyph for '$' is smaller than the region, the end of the region shall be marked with a '$'. 2. The editor shall enter text input mode, overwriting the region of text. Current line/column: As specified for the text input commands (see Input Mode Commands in vi). Change to End-of-Line Synopsis: [buffer][count] C This command shall be equivalent to the vi command: [buffer][count] c$ See the c command. Delete Synopsis: [buffer][count] d motion If the motion command is the d command repeated: 1. The buffer text shall be in line mode. 2. If there are less than count -1 lines after the current line in the edit buffer, it shall be an error. 3. The text region shall be from the current line up to and including the next count -1 lines. Otherwise, the buffer text mode and text region shall be as specified by the motion command. If in open mode, and the current line is deleted, and the line remains on the display, an '@' character shall be displayed as the first glyph of that line. Delete the region of text into buffer, if specified, and into the unnamed buffer. If the text to be deleted contains characters from more than a single line, or the buffer text is in line mode, the deleted text shall be copied into the numeric buffers, as well. Current line: Set to the first text region line that appears in the edit buffer, unless that line has been deleted, in which case it shall be set to the last line in the edit buffer, or line 1 if the edit buffer is empty. Current column: 1. If the line is empty, set to column position 1. 2. Otherwise, if the buffer text is in line mode or the motion was from the cursor toward the end of the edit buffer: a. If a character from the current line is displayed in the current column, set to the last column that displays any portion of that character. b. Otherwise, set to the last column in which any portion of any character in the line is displayed. 3. Otherwise, if a character is displayed in the column that began the text region, set to the last column that displays any portion of that character. 4. Otherwise, set to the last column in which any portion of any character in the line is displayed. Delete to End-of-Line Synopsis: [buffer] D Delete the text from the current position to the end of the current line; equivalent to the vi command: [buffer] d$ Move to End-of-Word Synopsis: [count] e With the exception that words are used instead of bigwords as the delimiter, this command shall be equivalent to the E command. Move to End-of-Bigword Synopsis: [count] E If the edit buffer is empty it shall be an error. If less than count bigwords end between the cursor and the end of the edit buffer, count shall be adjusted to the number of bigword endings between the cursor and the end of the edit buffer. If used as a motion command: 1. The text region shall be from the last character of the countth next bigword up to and including the cursor character. 2. Any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Set to the line containing the current column. Current column: Set to the last column upon which any part of the last character of the countth next bigword is displayed. Find Character in Current Line (Forward) Synopsis: [count] f character It shall be an error if count occurrences of the character do not occur after the cursor in the line. If used as a motion command: 1. The text range shall be from the cursor character up to and including the countth occurrence of the specified character after the cursor. 2. Any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Unchanged. Current column: Set to the last column in which any portion of the countth occurrence of the specified character after the cursor appears in the line. Find Character in Current Line (Reverse) Synopsis: [count] F character It shall be an error if count occurrences of the character do not occur before the cursor in the line. If used as a motion command: 1. The text region shall be from the countth occurrence of the specified character before the cursor, up to, but not including the cursor character. 2. Any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Unchanged. Current column: Set to the last column in which any portion of the countth occurrence of the specified character before the cursor appears in the line. Move to Line Synopsis: [count] G If count is not specified, it shall default to the last line of the edit buffer. If count is greater than the last line of the edit buffer, it shall be an error. If used as a motion command: 1. The text region shall be from the cursor line up to and including the specified line. 2. Any text copied to a buffer shall be in line mode. If not used as a motion command: Current line: Set to count if count is specified; otherwise, the last line. Current column: Set to non-<blank>. Move to Top of Screen Synopsis: [count] H If the beginning of the line count greater than the first line of which any portion appears on the display does not exist, it shall be an error. If used as a motion command: 1. If in open mode, the text region shall be the current line. 2. Otherwise, the text region shall be from the starting line up to and including (the first line of the display + count -1). 3. Any text copied to a buffer shall be in line mode. If not used as a motion command: If in open mode, this command shall set the current column to non-<blank> and do nothing else. Otherwise, it shall set the current line and current column as follows. Current line: Set to (the first line of the display + count -1). Current column: Set to non-<blank>. Insert Before Cursor Synopsis: [count] i Enter text input mode before the current cursor position. No characters already in the edit buffer shall be affected by this command. A count shall cause the input text to be appended count -1 more times to the end of the input. Current line/column: As specified for the text input commands (see Input Mode Commands in vi). Insert at Beginning of Line Synopsis: [count] I This command shall be equivalent to the vi command ^[count]i. Join Synopsis: [count] J If the current line is the last line in the edit buffer, it shall be an error. This command shall be equivalent to the ex join command with no addresses, and an ex command count value of 1 if count was not specified or if a count of 1 was specified, and an ex command count value of count -1 for any other value of count, except that the current line and column shall be set as follows. Current line: Unchanged. Current column: The last column in which any portion of the character following the last character in the initial line is displayed, or the last non-<newline> in the line if no characters were appended. Move to Bottom of Screen Synopsis: [count] L If the beginning of the line count less than the last line of which any portion appears on the display does not exist, it shall be an error. If used as a motion command: 1. If in open mode, the text region shall be the current line. 2. Otherwise, the text region shall include all lines from the starting cursor line to (the last line of the display -(count -1)). 3. Any text copied to a buffer shall be in line mode. If not used as a motion command: 1. If in open mode, this command shall set the current column to non-<blank> and do nothing else. 2. Otherwise, it shall set the current line and current column as follows. Current line: Set to (the last line of the display -(count -1)). Current column: Set to non-<blank>. Mark Position Synopsis: m letter This command shall be equivalent to the ex mark command with the specified character as an argument. Move to Middle of Screen Synopsis: M The middle line of the display shall be calculated as follows: (the top line of the display) + (((number of lines displayed) +1) /2) -1 If used as a motion command: 1. If in open mode, the text region shall be the current line. 2. Otherwise, the text region shall include all lines from the starting cursor line up to and including the middle line of the display. 3. Any text copied to a buffer shall be in line mode. If not used as a motion command: If in open mode, this command shall set the current column to non-<blank> and do nothing else. Otherwise, it shall set the current line and current column as follows. Current line: Set to the middle line of the display. Current column: Set to non-<blank>. Repeat Regular Expression Find (Forward) Synopsis: n If the remembered search direction was forward, the n command shall be equivalent to the vi / command with no characters entered by the user. Otherwise, it shall be equivalent to the vi ? command with no characters entered by the user. If the n command is used as a motion command for the ! command, the editor shall not enter text input mode on the last line on the screen, and shall behave as if the user entered a single '!' character as the text input. Repeat Regular Expression Find (Reverse) Synopsis: N Scan for the next match of the last pattern given to / or ?, but in the reverse direction; this is the reverse of n. If the remembered search direction was forward, the N command shall be equivalent to the vi ? command with no characters entered by the user. Otherwise, it shall be equivalent to the vi / command with no characters entered by the user. If the N command is used as a motion command for the ! command, the editor shall not enter text input mode on the last line on the screen, and shall behave as if the user entered a single ! character as the text input. Insert Empty Line Below Synopsis: o Enter text input mode in a new line appended after the current line. A count shall cause the input text to be appended count -1 more times to the end of the already added text, each time starting on a new, appended line. Current line/column: As specified for the text input commands (see Input Mode Commands in vi). Insert Empty Line Above Synopsis: O Enter text input mode in a new line inserted before the current line. A count shall cause the input text to be appended count -1 more times to the end of the already added text, each time starting on a new, appended line. Current line/column: As specified for the text input commands (see Input Mode Commands in vi). Put from Buffer Following Synopsis: [buffer] p If no buffer is specified, the unnamed buffer shall be used. If the buffer text is in line mode, the text shall be appended below the current line, and each line of the buffer shall become a new line in the edit buffer. A count shall cause the buffer text to be appended count -1 more times to the end of the already added text, each time starting on a new, appended line. If the buffer text is in character mode, the text shall be appended into the current line after the cursor, and each line of the buffer other than the first and last shall become a new line in the edit buffer. A count shall cause the buffer text to be appended count -1 more times to the end of the already added text, each time starting after the last added character. Current line: If the buffer text is in line mode, set the line to line +1; otherwise, unchanged. Current column: If the buffer text is in line mode: 1. If there is a non-<blank> in the first line of the buffer, set to the last column on which any portion of the first non-<blank> in the line is displayed. 2. If there is no non-<blank> in the first line of the buffer, set to the last column on which any portion of the last non-<newline> in the first line of the buffer is displayed. If the buffer text is in character mode: 1. If the text in the buffer is from more than a single line, then set to the last column on which any portion of the first character from the buffer is displayed. 2. Otherwise, if the buffer is the unnamed buffer, set to the last column on which any portion of the last character from the buffer is displayed. 3. Otherwise, set to the first column on which any portion of the first character from the buffer is displayed. Put from Buffer Before Synopsis: [buffer] P If no buffer is specified, the unnamed buffer shall be used. If the buffer text is in line mode, the text shall be inserted above the current line, and each line of the buffer shall become a new line in the edit buffer. A count shall cause the buffer text to be appended count -1 more times to the end of the already added text, each time starting on a new, appended line. If the buffer text is in character mode, the text shall be inserted into the current line before the cursor, and each line of the buffer other than the first and last shall become a new line in the edit buffer. A count shall cause the buffer text to be appended count -1 more times to the end of the already added text, each time starting after the last added character. Current line: Unchanged. Current column: If the buffer text is in line mode: 1. If there is a non-<blank> in the first line of the buffer, set to the last column on which any portion of that character is displayed. 2. If there is no non-<blank> in the first line of the buffer, set to the last column on which any portion of the last non-<newline> in the first line of the buffer is displayed. If the buffer text is in character mode: 1. If the text in the buffer is from more than a single line, then set to the last column on which any portion of the first character from the buffer is displayed. 2. Otherwise, if the buffer is the unnamed buffer, set to the last column on which any portion of the last character from the buffer is displayed. 3. Otherwise, set to the first column on which any portion of the first character from the buffer is displayed. Enter ex Mode Synopsis: Q Leave visual or open mode and enter ex command mode. Current line: Unchanged. Current column: Unchanged. Replace Character Synopsis: [count] r character Replace the count characters at and after the cursor with the specified character. If there are less than count non-<newline> characters at and after the cursor on the line, it shall be an error. If character is <control>V, any next character other than the <newline> shall be stripped of any special meaning and used as a literal character. If character is <ESC>, no replacement shall be made and the current line and current column shall be unchanged. If character is <carriage-return> or <newline>, count new lines shall be appended to the current line. All but the last of these lines shall be empty. count characters at and after the cursor shall be discarded, and any remaining characters after the cursor in the current line shall be moved to the last of the new lines. If the autoindent edit option is set, they shall be preceded by the same number of autoindent characters found on the line from which the command was executed. Current line: Unchanged unless the replacement character is a <carriage-return> or <newline>, in which case it shall be set to line + count. Current column: Set to the last column position on which a portion of the last replaced character is displayed, or if the replacement character caused new lines to be created, set to non-<blank>. Replace Characters Synopsis: R Enter text input mode at the current cursor position possibly replacing text on the current line. A count shall cause the input text to be appended count -1 more times to the end of the input. Current line/column: As specified for the text input commands (see Input Mode Commands in vi). Substitute Character Synopsis: [buffer][count] s This command shall be equivalent to the vi command: [buffer][count] c<space> Substitute Lines Synopsis: [buffer][count] S This command shall be equivalent to the vi command: [buffer][count] c_ Move Cursor to Before Character (Forward) Synopsis: [count] t character It shall be an error if count occurrences of the character do not occur after the cursor in the line. If used as a motion command: 1. The text region shall be from the cursor up to but not including the countth occurrence of the specified character after the cursor. 2. Any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Unchanged. Current column: Set to the last column in which any portion of the character before the countth occurrence of the specified character after the cursor appears in the line. Move Cursor to After Character (Reverse) Synopsis: [count] T character It shall be an error if count occurrences of the character do not occur before the cursor in the line. If used as a motion command: 1. If the character before the cursor is the specified character, it shall be an error. 2. The text region shall be from the character before the cursor up to but not including the countth occurrence of the specified character before the cursor. 3. Any text copied to a buffer shall be in character mode. If not used as a motion command: Current line: Unchanged. Current column: Set to the last column in which any portion of the character after the countth occurrence of the specified character before the cursor appears in the line. Undo Synopsis: u This command shall be equivalent to the ex undo command except that the current line and current column shall be set as follows: Current line: Set to the first line added or changed if any; otherwise, move to the line preceding any deleted text if one exists; otherwise, move to line 1. Current column: If undoing an ex command, set to the first non-<blank>. Otherwise, if undoing a text input command: 1. If the command was a C, c, O, o, R, S, or s command, the current column shall be set to the value it held when the text input command was entered. 2. Otherwise, set to the last column in which any portion of the first character after the deleted text is displayed, or, if no non-<newline> characters follow the text deleted from this line, set to the last column in which any portion of the last non-<newline> in the line is displayed, or 1 if the line is empty. Otherwise, if a single line was modified (that is, not added or deleted) by the u command: 1. If text was added or changed, set to the last column in which any portion of the first character added or changed is displayed. 2. If text was deleted, set to the last column in which any portion of the first character after the deleted text is displayed, or, if no non-<newline> characters follow the deleted text, set to the last column in which any portion of the last non-<newline> in the line is displayed, or 1 if the line is empty. Otherwise, set to non-<blank>. Undo Current Line Synopsis: U Restore the current line to its state immediately before the most recent time that it became the current line. Current line: Unchanged. Current column: Set to the first column in the line in which any portion of the first character in the line is displayed. Move to Beginning of Word Synopsis: [count] w With the exception that words are used as the delimiter instead of bigwords, this command shall be equivalent to the W command. Move to Beginning of Bigword Synopsis: [count] W If the edit buffer is empty, it shall be an error. If there are less than count bigwords between the cursor and the end of the edit buffer, count shall be adjusted to move the cursor to the last bigword in the edit buffer. If used as a motion command: 1. If the associated command is c, count is 1, and the cursor is on a <blank>, the region of text shall be the current character and no further action shall be taken. 2. If there are less than count bigwords between the cursor and the end of the edit buffer, then the command shall succeed, and the region of text shall include the last character of the edit buffer. 3. If there are <blank> characters or an end-of-line that precede the countth bigword, and the associated command is c, the region of text shall be up to and including the last character before the preceding <blank> characters or end-of- line. 4. If there are <blank> characters or an end-of-line that precede the bigword, and the associated command is d or y, the region of text shall be up to and including the last <blank> before the start of the bigword or end-of-line. 5. Any text copied to a buffer shall be in character mode. If not used as a motion command: 1. If the cursor is on the last character of the edit buffer, it shall be an error. Current line: Set to the line containing the current column. Current column: Set to the last column in which any part of the first character of the countth next bigword is displayed. Delete Character at Cursor Synopsis: [buffer][count] x Delete the count characters at and after the current character into buffer, if specified, and into the unnamed buffer. If the line is empty, it shall be an error. If there are less than count non-<newline> characters at and after the cursor on the current line, count shall be adjusted to the number of non-<newline> characters at and after the cursor. Current line: Unchanged. Current column: If the line is empty, set to column position 1. Otherwise, if there were count or less non-<newline> characters at and after the cursor on the current line, set to the last column that displays any part of the last non-<newline> of the line. Otherwise, unchanged. Delete Character Before Cursor Synopsis: [buffer][count] X Delete the count characters before the current character into buffer, if specified, and into the unnamed buffer. If there are no characters before the current character on the current line, it shall be an error. If there are less than count previous characters on the current line, count shall be adjusted to the number of previous characters on the line. Current line: Unchanged. Current column: Set to (current column - the width of the deleted characters). Yank Synopsis: [buffer][count] y motion Copy (yank) the region of text into buffer, if specified, and into the unnamed buffer. If the motion command is the y command repeated: 1. The buffer shall be in line mode. 2. If there are less than count -1 lines after the current line in the edit buffer, it shall be an error. 3. The text region shall be from the current line up to and including the next count -1 lines. Otherwise, the buffer text mode and text region shall be as specified by the motion command. Current line: If the motion was from the current cursor position toward the end of the edit buffer, unchanged. Otherwise, set to the first line in the edit buffer that is part of the text region specified by the motion command. Current column: 1. If the motion was from the current cursor position toward the end of the edit buffer, unchanged. 2. Otherwise, if the current line is empty, set to column position 1. 3. Otherwise, set to the last column that displays any part of the first character in the file that is part of the text region specified by the motion command. Yank Current Line Synopsis: [buffer][count] Y This command shall be equivalent to the vi command: [buffer][count] y_ Redraw Window If in open mode, the z command shall have the Synopsis: Synopsis: [count] z If count is not specified, it shall default to the window edit option -1. The z command shall be equivalent to the ex z command, with a type character of = and a count of count -2, except that the current line and current column shall be set as follows, and the window edit option shall not be affected. If the calculation for the count argument would result in a negative number, the count argument to the ex z command shall be zero. A blank line shall be written after the last line is written. Current line: Unchanged. Current column: Unchanged. If not in open mode, the z command shall have the following Synopsis: Synopsis: [line] z [count] character If line is not specified, it shall default to the current line. If line is specified, but is greater than the number of lines in the edit buffer, it shall default to the number of lines in the edit buffer. If count is specified, the value of the window edit option shall be set to count (as described in the ex window command), and the screen shall be redrawn. line shall be placed as specified by the following characters: <newline>, <carriage-return> Place the beginning of the line on the first line of the display. . Place the beginning of the line in the center of the display. The middle line of the display shall be calculated as described for the M command. - Place an unspecified portion of the line on the last line of the display. + If line was specified, equivalent to the <newline> case. If line was not specified, display a screen where the first line of the display shall be (current last line) +1. If there are no lines after the last line in the display, it shall be an error. ^ If line was specified, display a screen where the last line of the display shall contain an unspecified portion of the first line of a display that had an unspecified portion of the specified line on the last line of the display. If this calculation results in a line before the beginning of the edit buffer, display the first screen of the edit buffer. Otherwise, display a screen where the last line of the display shall contain an unspecified portion of (current first line -1). If this calculation results in a line before the beginning of the edit buffer, it shall be an error. Current line: If line and the '^' character were specified: 1. If the first screen was displayed as a result of the command attempting to display lines before the beginning of the edit buffer: if the first screen was already displayed, unchanged; otherwise, set to (current first line -1). 2. Otherwise, set to the last line of the display. If line and the '+' character were specified, set to the first line of the display. Otherwise, if line was specified, set to line. Otherwise, unchanged. Current column: Set to non-<blank>. Exit Synopsis: ZZ This command shall be equivalent to the ex xit command with no addresses, trailing !, or filename (see the ex xit command). Input Mode Commands in vi In text input mode, the current line shall consist of zero or more of the following categories, plus the terminating <newline>: 1. Characters preceding the text input entry point Characters in this category shall not be modified during text input mode. 2. autoindent characters autoindent characters shall be automatically inserted into each line that is created in text input mode, either as a result of entering a <newline> or <carriage-return> while in text input mode, or as an effect of the command itself; for example, O or o (see the ex autoindent command), as if entered by the user. It shall be possible to erase autoindent characters with the <control>D command; it is unspecified whether they can be erased by <control>H, <control>U, and <control>W characters. Erasing any autoindent character turns the glyph into erase-columns and deletes the character from the edit buffer, but does not change its representation on the screen. 3. Text input characters Text input characters are the characters entered by the user. Erasing any text input character turns the glyph into erase- columns and deletes the character from the edit buffer, but does not change its representation on the screen. Each text input character entered by the user (that does not have a special meaning) shall be treated as follows: a. The text input character shall be appended to the last character in the edit buffer from the first, second, or third categories. b. If there are no erase-columns on the screen, the text input command was the R command, and characters in the fifth category from the original line follow the cursor, the next such character shall be deleted from the edit buffer. If the slowopen edit option is not set, the corresponding glyph on the screen shall become erase- columns. c. If there are erase-columns on the screen, as many columns as they occupy, or as are necessary, shall be overwritten to display the text input character. (If only part of a multi-column glyph is overwritten, the remainder shall be left on the screen, and continue to be treated as erase- columns; it is unspecified whether the remainder of the glyph is modified in any way.) d. If additional display line columns are needed to display the text input character: i. If the slowopen edit option is set, the text input characters shall be displayed on subsequent display line columns, overwriting any characters displayed in those columns. ii. Otherwise, any characters currently displayed on or after the column on the display line where the text input character is to be displayed shall be pushed ahead the number of display line columns necessary to display the rest of the text input character. 4. Erase-columns Erase-columns are not logically part of the edit buffer, appearing only on the screen, and may be overwritten on the screen by subsequent text input characters. When text input mode ends, all erase-columns shall no longer appear on the screen. Erase-columns are initially the region of text specified by the c command (see Change); however, erasing autoindent or text input characters causes the glyphs of the erased characters to be treated as erase-columns. 5. Characters following the text region for the c command, or the text input entry point for all other commands Characters in this category shall not be modified during text input mode, except as specified in category 3.b. for the R text input command, or as <blank> characters deleted when a <newline> or <carriage-return> is entered. It is unspecified whether it is an error to attempt to erase past the beginning of a line that was created by the entry of a <newline> or <carriage-return> during text input mode. If it is not an error, the editor shall behave as if the erasing character was entered immediately after the last text input character entered on the previous line, and all of the non-<newline> characters on the current line shall be treated as erase-columns. When text input mode is entered, or after a text input mode character is entered (except as specified for the special characters below), the cursor shall be positioned as follows: 1. On the first column that displays any part of the first erase-column, if one exists 2. Otherwise, if the slowopen edit option is set, on the first display line column after the last character in the first, second, or third categories, if one exists 3. Otherwise, the first column that displays any part of the first character in the fifth category, if one exists 4. Otherwise, the display line column after the last character in the first, second, or third categories, if one exists 5. Otherwise, on column position 1 The characters that are updated on the screen during text input mode are unspecified, other than that the last text input character shall always be updated, and, if the slowopen edit option is not set, the current cursor character shall always be updated. The following specifications are for command characters entered during text input mode. NUL Synopsis: NUL If the first character of the text input is a NUL, the most recently input text shall be input as if entered by the user, and then text input mode shall be exited. The text shall be input literally; that is, characters are neither macro or abbreviation expanded, nor are any characters interpreted in any special manner. It is unspecified whether implementations shall support more than 256 bytes of remembered input text. <control>-D Synopsis: <control>-D The <control>D character shall have no special meaning when in text input mode for a line-oriented command (see Command Descriptions in vi). This command need not be supported on block-mode terminals. If the cursor does not follow an autoindent character, or an autoindent character and a '0' or '^' character: 1. If the cursor is in column position 1, the <control>D character shall be discarded and no further action taken. 2. Otherwise, the <control>D character shall have no special meaning. If the last input character was a '0', the cursor shall be moved to column position 1. Otherwise, if the last input character was a '^', the cursor shall be moved to column position 1. In addition, the autoindent level for the next input line shall be derived from the same line from which the autoindent level for the current input line was derived. Otherwise, the cursor shall be moved back to the column after the previous shiftwidth (see the ex shiftwidth command) boundary. All of the glyphs on columns between the starting cursor position and (inclusively) the ending cursor position shall become erase- columns as described in Input Mode Commands in vi. Current line: Unchanged. Current column: Set to 1 if the <control>D was preceded by a '^' or '0'; otherwise, set to (column -1) -((column -2) % shiftwidth). <control>-H Synopsis: <control>-H If in text input mode for a line-oriented command, and there are no characters to erase, text input mode shall be terminated, no further action shall be done for this command, and the current line and column shall be unchanged. If there are characters other than autoindent characters that have been input on the current line before the cursor, the cursor shall move back one character. Otherwise, if there are autoindent characters on the current line before the cursor, it is implementation-defined whether the <control>H command is an error or if the cursor moves back one autoindent character. Otherwise, if the cursor is in column position 1 and there are previous lines that have been input, it is implementation-defined whether the <control>H command is an error or if it is equivalent to entering <control>H after the last input character on the previous input line. Otherwise, it shall be an error. All of the glyphs on columns between the starting cursor position and (inclusively) the ending cursor position shall become erase- columns as described in Input Mode Commands in vi. The current erase character (see stty) shall cause an equivalent action to the <control>H command, unless the previously inserted character was a <backslash>, in which case it shall be as if the literal current erase character had been inserted instead of the <backslash>. Current line: Unchanged, unless previously input lines are erased, in which case it shall be set to line -1. Current column: Set to the first column that displays any portion of the character backed up over. <newline> Synopsis: <newline> <carriage-return> <control>-J <control>-M If input was part of a line-oriented command, text input mode shall be terminated and the command shall continue execution with the input provided. Otherwise, terminate the current line. If there are no characters other than autoindent characters on the line, all characters on the line shall be discarded. Otherwise, it is unspecified whether the autoindent characters in the line are modified by entering these characters. Continue text input mode on a new line appended after the current line. If the slowopen edit option is set, the lines on the screen below the current line shall not be pushed down, but the first of them shall be cleared and shall appear to be overwritten. Otherwise, the lines of the screen below the current line shall be pushed down. If the autoindent edit option is set, an appropriate number of autoindent characters shall be added as a prefix to the line as described by the ex autoindent edit option. All columns after the cursor that are erase-columns (as described in Input Mode Commands in vi) shall be discarded. If the autoindent edit option is set, all <blank> characters immediately following the cursor shall be discarded. All remaining characters after the cursor shall be transferred to the new line, positioned after any autoindent characters. Current line: Set to current line +1. Current column: Set to the first column that displays any portion of the first character after the autoindent characters on the new line, if any, or the first column position after the last autoindent character, if any, or column position 1. <control>-T Synopsis: <control>-T The <control>T character shall have no special meaning when in text input mode for a line-oriented command (see Command Descriptions in vi). This command need not be supported on block-mode terminals. Behave as if the user entered the minimum number of <blank> characters necessary to move the cursor forward to the column position after the next shiftwidth (see the ex shiftwidth command) boundary. Current line: Unchanged. Current column: Set to column + shiftwidth - ((column -1) % shiftwidth). <control>-U Synopsis: <control>-U If there are characters other than autoindent characters that have been input on the current line before the cursor, the cursor shall move to the first character input after the autoindent characters. Otherwise, if there are autoindent characters on the current line before the cursor, it is implementation-defined whether the <control>U command is an error or if the cursor moves to the first column position on the line. Otherwise, if the cursor is in column position 1 and there are previous lines that have been input, it is implementation-defined whether the <control>U command is an error or if it is equivalent to entering <control>U after the last input character on the previous input line. Otherwise, it shall be an error. All of the glyphs on columns between the starting cursor position and (inclusively) the ending cursor position shall become erase- columns as described in Input Mode Commands in vi. The current kill character (see stty) shall cause an equivalent action to the <control>U command, unless the previously inserted character was a <backslash>, in which case it shall be as if the literal current kill character had been inserted instead of the <backslash>. Current line: Unchanged, unless previously input lines are erased, in which case it shall be set to line -1. Current column: Set to the first column that displays any portion of the last character backed up over. <control>-V Synopsis: <control>-V <control>-Q Allow the entry of any subsequent character, other than <control>J or the <newline>, as a literal character, removing any special meaning that it may have to the editor in text input mode. If a <control>V or <control>Q is entered before a <control>J or <newline>, the <control>V or <control>Q character shall be discarded, and the <control>J or <newline> shall behave as described in the <newline> command character during input mode. For purposes of the display only, the editor shall behave as if a '^' character was entered, and the cursor shall be positioned as if overwriting the '^' character. When a subsequent character is entered, the editor shall behave as if that character was entered instead of the original <control>V or <control>Q character. Current line: Unchanged. Current column: Unchanged. <control>-W Synopsis: <control>-W If there are characters other than autoindent characters that have been input on the current line before the cursor, the cursor shall move back over the last word preceding the cursor (including any <blank> characters between the end of the last word and the current cursor); the cursor shall not move to before the first character after the end of any autoindent characters. Otherwise, if there are autoindent characters on the current line before the cursor, it is implementation-defined whether the <control>W command is an error or if the cursor moves to the first column position on the line. Otherwise, if the cursor is in column position 1 and there are previous lines that have been input, it is implementation-defined whether the <control>W command is an error or if it is equivalent to entering <control>W after the last input character on the previous input line. Otherwise, it shall be an error. All of the glyphs on columns between the starting cursor position and (inclusively) the ending cursor position shall become erase- columns as described in Input Mode Commands in vi. Current line: Unchanged, unless previously input lines are erased, in which case it shall be set to line -1. Current column: Set to the first column that displays any portion of the last character backed up over. <ESC> Synopsis: <ESC> If input was part of a line-oriented command: 1. If interrupt was entered, text input mode shall be terminated and the editor shall return to command mode. The terminal shall be alerted. 2. If <ESC> was entered, text input mode shall be terminated and the command shall continue execution with the input provided. Otherwise, terminate text input mode and return to command mode. Any autoindent characters entered on newly created lines that have no other non-<newline> characters shall be deleted. Any leading autoindent and <blank> characters on newly created lines shall be rewritten to be the minimum number of <blank> characters possible. The screen shall be redisplayed as necessary to match the contents of the edit buffer. Current line: Unchanged. Current column: 1. If there are text input characters on the current line, the column shall be set to the last column where any portion of the last text input character is displayed. 2. Otherwise, if a character is displayed in the current column, unchanged. 3. Otherwise, set to column position 1. EXIT STATUS top The following exit values shall be returned: 0 Successful completion. >0 An error occurred. CONSEQUENCES OF ERRORS top When any error is encountered and the standard input is not a terminal device file, vi shall not write the file or return to command or text input mode, and shall terminate with a non-zero exit status. Otherwise, when an unrecoverable error is encountered it shall be equivalent to a SIGHUP asynchronous event. Otherwise, when an error is encountered, the editor shall behave as specified in Command Descriptions in vi. The following sections are informative. APPLICATION USAGE top None. EXAMPLES top None. RATIONALE top See the RATIONALE for ex(1p) for more information on vi. Major portions of the vi utility specification point to ex to avoid inadvertent divergence. While ex and vi have historically been implemented as a single utility, this is not required by POSIX.12008. It is recognized that portions of vi would be difficult, if not impossible, to implement satisfactorily on a block-mode terminal, or a terminal without any form of cursor addressing, thus it is not a mandatory requirement that such features should work on all terminals. It is the intention, however, that a vi implementation should provide the full set of capabilities on all terminals capable of supporting them. Historically, vi exited immediately if the standard input was not a terminal. POSIX.12008 permits, but does not require, this behavior. An end-of-file condition is not equivalent to an end- of-file character. A common end-of-file character, <control>D, is historically a vi command. The text in the STDOUT section reflects the usage of the verb display in this section; some implementations of vi use standard output to write to the terminal, but POSIX.12008 does not require that to be the case. Historically, implementations reverted to open mode if the terminal was incapable of supporting full visual mode. POSIX.12008 requires this behavior. Historically, the open mode of vi behaved roughly equivalently to the visual mode, with the exception that only a single line from the edit buffer (one ``buffer line'') was kept current at any time. This line was normally displayed on the next-to-last line of a terminal with cursor addressing (and the last line performed its normal visual functions for line-oriented commands and messages). In addition, some few commands behaved differently in open mode than in visual mode. POSIX.12008 requires conformance to historical practice. Historically, ex and vi implementations have expected text to proceed in the usual European/Latin order of left to right, top to bottom. There is no requirement in POSIX.12008 that this be the case. The specification was deliberately written using words like ``before'', ``after'', ``first'', and ``last'' in order to permit implementations to support the natural text order of the language. Historically, lines past the end of the edit buffer were marked with single <tilde> ('~') characters; that is, if the one-based display was 20 lines in length, and the last line of the file was on line one, then lines 2-20 would contain only a single '~' character. Historically, the vi editor attempted to display only complete lines at the bottom of the screen (it did display partial lines at the top of the screen). If a line was too long to fit in its entirety at the bottom of the screen, the screen lines where the line would have been displayed were displayed as single '@' characters, instead of displaying part of the line. POSIX.12008 permits, but does not require, this behavior. Implementations are encouraged to attempt always to display a complete line at the bottom of the screen when doing scrolling or screen positioning by buffer lines. Historically, lines marked with '@' were also used to minimize output to dumb terminals over slow lines; that is, changes local to the cursor were updated, but changes to lines on the screen that were not close to the cursor were simply marked with an '@' sign instead of being updated to match the current text. POSIX.12008 permits, but does not require this feature because it is used ever less frequently as terminals become smarter and connections are faster. Initialization in ex and vi Historically, vi always had a line in the edit buffer, even if the edit buffer was ``empty''. For example: 1. The ex command = executed from visual mode wrote ``1'' when the buffer was empty. 2. Writes from visual mode of an empty edit buffer wrote files of a single character (a <newline>), while writes from ex mode of an empty edit buffer wrote empty files. 3. Put and read commands into an empty edit buffer left an empty line at the top of the edit buffer. For consistency, POSIX.12008 does not permit any of these behaviors. Historically, vi did not always return the terminal to its original modes; for example, ICRNL was modified if it was not originally set. POSIX.12008 does not permit this behavior. Command Descriptions in vi Motion commands are among the most complicated aspects of vi to describe. With some exceptions, the text region and buffer type effect of a motion command on a vi command are described on a case-by-case basis. The descriptions of text regions in POSIX.12008 are not intended to imply direction; that is, an inclusive region from line n to line n+5 is identical to a region from line n+5 to line n. This is of more than academic interest movements to marks can be in either direction, and, if the wrapscan option is set, so can movements to search points. Historically, lines are always stored into buffers in text order; that is, from the start of the edit buffer to the end. POSIX.12008 requires conformance to historical practice. Historically, command counts were applied to any associated motion, and were multiplicative to any supplied motion count. For example, 2cw is the same as c2w, and 2c3w is the same as c6w. POSIX.12008 requires this behavior. Historically, vi commands that used bigwords, words, paragraphs, and sentences as objects treated groups of empty lines, or lines that contained only <blank> characters, inconsistently. Some commands treated them as a single entity, while others treated each line separately. For example, the w, W, and B commands treated groups of empty lines as individual words; that is, the command would move the cursor to each new empty line. The e and E commands treated groups of empty lines as a single word; that is, the first use would move past the group of lines. The b command would just beep at the user, or if done from the start of the line as a motion command, fail in unexpected ways. If the lines contained only (or ended with) <blank> characters, the w and W commands would just beep at the user, the E and e commands would treat the group as a single word, and the B and b commands would treat the lines as individual words. For consistency and simplicity of specification, POSIX.12008 requires that all vi commands treat groups of empty or blank lines as a single entity, and that movement through lines ending with <blank> characters be consistent with other movements. Historically, vi documentation indicated that any number of double-quotes were skipped after punctuation marks at sentence boundaries; however, implementations only skipped single-quotes. POSIX.12008 requires both to be skipped. Historically, the first and last characters in the edit buffer were word boundaries. This historical practice is required by POSIX.12008. Historically, vi attempted to update the minimum number of columns on the screen possible, which could lead to misleading information being displayed. POSIX.12008 makes no requirements other than that the current character being entered is displayed correctly, leaving all other decisions in this area up to the implementation. Historically, lines were arbitrarily folded between columns of any characters that required multiple column positions on the screen, with the exception of tabs, which terminated at the right-hand margin. POSIX.12008 permits the former and requires the latter. Implementations that do not arbitrarily break lines between columns of characters that occupy multiple column positions should not permit the cursor to rest on a column that does not contain any part of a character. The historical vi had a problem in that all movements were by buffer lines, not by display or screen lines. This is often the right thing to do; for example, single line movements, such as j or k, should work on buffer lines. Commands like dj, or j., where . is a change command, only make sense for buffer lines. It is not, however, the right thing to do for screen motion or scrolling commands like <control>D, <control>F, and H. If the window is fairly small, using buffer lines in these cases can result in completely random motion; for example, 1<control>D can result in a completely changed screen, without any overlap. This is clearly not what the user wanted. The problem is even worse in the case of the H, L, and M commandsas they position the cursor at the first non-<blank> of the line, they may all refer to the same location in large lines, and will result in no movement at all. In addition, if the line is larger than the screen, using buffer lines can make it impossible to display parts of the linethere are not any commands that do not display the beginning of the line in historical vi, and if both the beginning and end of the line cannot be on the screen at the same time, the user suffers. Finally, the page and half-page scrolling commands historically moved to the first non-<blank> in the new line. If the line is approximately the same size as the screen, this is inadequate because the cursor before and after a <control>D command will refer to the same location on the screen. Implementations of ex and vi exist that do not have these problems because the relevant commands (<control>B, <control>D, <control>F, <control>U, <control>Y, <control>E, H, L, and M) operate on display (screen) lines, not (edit) buffer lines. POSIX.12008 does not permit this behavior by default because the standard developers believed that users would find it too confusing. However, historical practice has been relaxed. For example, ex and vi historically attempted, albeit sometimes unsuccessfully, to never put part of a line on the last lines of a screen; for example, if a line would not fit in its entirety, no part of the line was displayed, and the screen lines corresponding to the line contained single '@' characters. This behavior is permitted, but not required by POSIX.12008, so that it is possible for implementations to support long lines in small screens more reasonably without changing the commands to be oriented to the display (instead of oriented to the buffer). POSIX.12008 also permits implementations to refuse to edit any edit buffer containing a line that will not fit on the screen in its entirety. The display area (for example, the value of the window edit option) has historically been ``grown'', or expanded, to display new text when local movements are done in displays where the number of lines displayed is less than the maximum possible. Expansion has historically been the first choice, when the target line is less than the maximum possible expansion value away. Scrolling has historically been the next choice, done when the target line is less than half a display away, and otherwise, the screen was redrawn. There were exceptions, however, in that ex commands generally always caused the screen to be redrawn. POSIX.12008 does not specify a standard behavior because there may be external issues, such as connection speed, the number of characters necessary to redraw as opposed to scroll, or terminal capabilities that implementations will have to accommodate. The current line in POSIX.12008 maps one-to-one to a buffer line in the file. The current column does not. There are two different column values that are described by POSIX.12008. The first is the current column value as set by many of the vi commands. This value is remembered for the lifetime of the editor. The second column value is the actual position on the screen where the cursor rests. The two are not always the same. For example, when the cursor is backed by a multi-column character, the actual cursor position on the screen has historically been the last column of the character in command mode, and the first column of the character in input mode. Commands that set the current line, but that do not set the current cursor value (for example, j and k) attempt to get as close as possible to the remembered column position, so that the cursor tends to restrict itself to a vertical column as the user moves around in the edit buffer. POSIX.12008 requires conformance to historical practice, requiring that the display location of the cursor on the display line be adjusted from the current column value as necessary to support this historical behavior. Historically, only a single line (and for some terminals, a single line minus 1 column) of characters could be entered by the user for the line-oriented commands; that is, :, !, /, or ?. POSIX.12008 permits, but does not require, this limitation. Historically, ``soft'' errors in vi caused the terminal to be alerted, but no error message was displayed. As a general rule, no error message was displayed for errors in command execution in vi, when the error resulted from the user attempting an invalid or impossible action, or when a searched-for object was not found. Examples of soft errors included h at the left margin, <control>B or [[ at the beginning of the file, 2G at the end of the file, and so on. In addition, errors such as %, ]], }, ), N, n, f, F, t, and T failing to find the searched-for object were soft as well. Less consistently, / and ? displayed an error message if the pattern was not found, /, ?, N, and n displayed an error message if no previous regular expression had been specified, and ; did not display an error message if no previous f, F, t, or T command had occurred. Also, behavior in this area might reasonably be based on a runtime evaluation of the speed of a network connection. Finally, some implementations have provided error messages for soft errors in order to assist naive users, based on the value of a verbose edit option. POSIX.12008 does not list specific errors for which an error message shall be displayed. Implementations should conform to historical practice in the absence of any strong reason to diverge. Page Backwards The <control>B and <control>F commands historically considered it an error to attempt to page past the beginning or end of the file, whereas the <control>D and <control>U commands simply moved to the beginning or end of the file. For consistency, POSIX.12008 requires the latter behavior for all four commands. All four commands still consider it an error if the current line is at the beginning (<control>B, <control>U) or end (<control>F, <control>D) of the file. Historically, the <control>B and <control>F commands skip two lines in order to include overlapping lines when a single command is entered. This makes less sense in the presence of a count, as there will be, by definition, no overlapping lines. The actual calculation used by historical implementations of the vi editor for <control>B was: ((current first line) - count x (window edit option)) +2 and for <control>F was: ((current first line) + count x (window edit option)) -2 This calculation does not work well when intermixing commands with and without counts; for example, 3<control>F is not equivalent to entering the <control>F command three times, and is not reversible by entering the <control>B command three times. For consistency with other vi commands that take counts, POSIX.12008 requires a different calculation. Scroll Forward The 4BSD and System V implementations of vi differed on the initial value used by the scroll command. 4BSD used: ((window edit option) +1) /2 while System V used the value of the scroll edit option. The System V version is specified by POSIX.12008 because the standard developers believed that it was more intuitive and permitted the user a method of setting the scroll value initially without also setting the number of lines that are displayed. Scroll Forward by Line Historically, the <control>E and <control>Y commands considered it an error if the last and first lines, respectively, were already on the screen. POSIX.12008 requires conformance to historical practice. Historically, the <control>E and <control>Y commands had no effect in open mode. For simplicity and consistency of specification, POSIX.12008 requires that they behave as usual, albeit with a single line screen. Clear and Redisplay The historical <control>L command refreshed the screen exactly as it was supposed to be currently displayed, replacing any '@' characters for lines that had been deleted but not updated on the screen with refreshed '@' characters. The intent of the <control>L command is to refresh when the screen has been accidentally overwritten; for example, by a write command from another user, or modem noise. Redraw Screen The historical <control>R command redisplayed only when necessary to update lines that had been deleted but not updated on the screen and that were flagged with '@' characters. There is no requirement that the screen be in any way refreshed if no lines of this form are currently displayed. POSIX.12008 permits implementations to extend this command to refresh lines on the screen flagged with '@' characters because they are too long to be displayed in the current framework; however, the current line and column need not be modified. Search for tagstring Historically, the first non-<blank> at or after the cursor was the first character, and all subsequent characters that were word characters, up to the end of the line, were included. For example, with the cursor on the leading <space> or on the '#' character in the text "#bar@", the tag was "#bar". On the character 'b' it was "bar", and on the 'a' it was "ar". POSIX.12008 requires this behavior. Replace Text with Results from Shell Command Historically, the <, >, and ! commands considered most cursor motions other than line-oriented motions an error; for example, the command >/foo<CR> succeeded, while the command >l failed, even though the text region described by the two commands might be identical. For consistency, all three commands only consider entire lines and not partial lines, and the region is defined as any line that contains a character that was specified by the motion. Move to Matching Character Other matching characters have been left implementation-defined in order to allow extensions such as matching '<' and '>' for searching HTML, or #ifdef, #else, and #endif for searching C source. Repeat Substitution POSIX.12008 requires that any c and g flags specified to the previous substitute command be ignored; however, the r flag may still apply, if supported by the implementation. Return to Previous (Context or Section) The [[, ]], (, ), {, and } commands are all affected by ``section boundaries'', but in some historical implementations not all of the commands recognize the same section boundaries. This is a bug, not a feature, and a unique section-boundary algorithm was not described for each command. One special case that is preserved is that the sentence command moves to the end of the last line of the edit buffer while the other commands go to the beginning, in order to preserve the traditional character cut semantics of the sentence command. Historically, vi section boundaries at the beginning and end of the edit buffer were the first non-<blank> on the first and last lines of the edit buffer if one exists; otherwise, the last character of the first and last lines of the edit buffer if one exists. To increase consistency with other section locations, this has been simplified by POSIX.12008 to the first character of the first and last lines of the edit buffer, or the first and the last lines of the edit buffer if they are empty. Sentence boundaries were problematic in the historical vi. They were not only the boundaries as defined for the section and paragraph commands, but they were the first non-<blank> that occurred after those boundaries, as well. Historically, the vi section commands were documented as taking an optional window size as a count preceding the command. This was not implemented in historical versions, so POSIX.12008 requires that the count repeat the command, for consistency with other vi commands. Repeat Historically, mapped commands other than text input commands could not be repeated using the period command. POSIX.12008 requires conformance to historical practice. The restrictions on the interpretation of special characters (for example, <control>H) in the repetition of text input mode commands is intended to match historical practice. For example, given the input sequence: iab<control>-H<control>-H<control>-Hdef<escape> the user should be informed of an error when the sequence is first entered, but not during a command repetition. The character <control>T is specifically exempted from this restriction. Historical implementations of vi ignored <control>T characters that were input in the original command during command repetition. POSIX.12008 prohibits this behavior. Find Regular Expression Historically, commands did not affect the line searched to or from if the motion command was a search (/, ?, N, n) and the final position was the start/end of the line. There were some special cases and vi was not consistent. POSIX.12008 does not permit this behavior, for consistency. Historical implementations permitted but were unable to handle searches as motion commands that wrapped (that is, due to the edit option wrapscan) to the original location. POSIX.12008 requires that this behavior be treated as an error. Historically, the syntax "/RE/0" was used to force the command to cut text in line mode. POSIX.12008 requires conformance to historical practice. Historically, in open mode, a z specified to a search command redisplayed the current line instead of displaying the current screen with the current line highlighted. For consistency and simplicity of specification, POSIX.12008 does not permit this behavior. Historically, trailing z commands were permitted and ignored if entered as part of a search used as a motion command. For consistency and simplicity of specification, POSIX.12008 does not permit this behavior. Execute an ex Command Historically, vi implementations restricted the commands that could be entered on the colon command line (for example, append and change), and some other commands were known to cause them to fail catastrophically. For consistency, POSIX.12008 does not permit these restrictions. When executing an ex command by entering :, it is not possible to enter a <newline> as part of the command because it is considered the end of the command. A different approach is to enter ex command mode by using the vi Q command (and later resuming visual mode with the ex vi command). In ex command mode, the single-line limitation does not exist. So, for example, the following is valid: Q s/break here/break\ here/ vi POSIX.12008 requires that, if the ex command overwrites any part of the screen that would be erased by a refresh, vi pauses for a character from the user. Historically, this character could be any character; for example, a character input by the user before the message appeared, or even a mapped character. This is probably a bug, but implementations that have tried to be more rigorous by requiring that the user enter a specific character, or that the user enter a character after the message was displayed, have been forced by user indignation back into historical behavior. POSIX.12008 requires conformance to historical practice. Shift Left (Right) Refer to the Rationale for the ! and / commands. Historically, the < and > commands sometimes moved the cursor to the first non-<blank> (for example if the command was repeated or with _ as the motion command), and sometimes left it unchanged. POSIX.12008 does not permit this inconsistency, requiring instead that the cursor always move to the first non-<blank>. Historically, the < and > commands did not support buffer arguments, although some implementations allow the specification of an optional buffer. This behavior is neither required nor disallowed by POSIX.12008. Execute Historically, buffers could execute other buffers, and loops, infinite and otherwise, were possible. POSIX.12008 requires conformance to historical practice. The *buffer syntax of ex is not required in vi, because it is not historical practice and has been used in some vi implementations to support additional scripting languages. Reverse Case Historically, the ~ command ignored any associated count, and acted only on the characters in the current line. For consistency with other vi commands, POSIX.12008 requires that an associated count act on the next count characters, and that the command move to subsequent lines if warranted by count, to make it possible to modify large pieces of text in a reasonably efficient manner. There exist vi implementations that optionally require an associated motion command for the ~ command. Implementations supporting this functionality are encouraged to base it on the tildedop edit option and handle the text regions and cursor positioning identically to the yank command. Append Historically, counts specified to the A, a, I, and i commands repeated the input of the first line count times, and did not repeat the subsequent lines of the input text. POSIX.12008 requires that the entire text input be repeated count times. Move Backward to Preceding Word Historically, vi became confused if word commands were used as motion commands in empty files. POSIX.12008 requires that this be an error. Historical implementations of vi had a large number of bugs in the word movement commands, and they varied greatly in behavior in the presence of empty lines, ``words'' made up of a single character, and lines containing only <blank> characters. For consistency and simplicity of specification, POSIX.12008 does not permit this behavior. Change to End-of-Line Some historical implementations of the C command did not behave as described by POSIX.12008 when the $ key was remapped because they were implemented by pushing the $ key onto the input queue and reprocessing it. POSIX.12008 does not permit this behavior. Historically, the C, S, and s commands did not copy replaced text into the numeric buffers. For consistency and simplicity of specification, POSIX.12008 requires that they behave like their respective c commands in all respects. Delete Historically, lines in open mode that were deleted were scrolled up, and an @ glyph written over the beginning of the line. In the case of terminals that are incapable of the necessary cursor motions, the editor erased the deleted line from the screen. POSIX.12008 requires conformance to historical practice; that is, if the terminal cannot display the '@' character, the line cannot remain on the screen. Delete to End-of-Line Some historical implementations of the D command did not behave as described by POSIX.12008 when the $ key was remapped because they were implemented by pushing the $ key onto the input queue and reprocessing it. POSIX.12008 does not permit this behavior. Join An historical oddity of vi is that the commands J, 1J, and 2J are all equivalent. POSIX.12008 requires conformance to historical practice. The vi J command is specified in terms of the ex join command with an ex command count value. The address correction for a count that is past the end of the edit buffer is necessary for historical compatibility for both ex and vi. Mark Position Historical practice is that only lowercase letters, plus backquote and single-quote, could be used to mark a cursor position. POSIX.12008 requires conformance to historical practice, but encourages implementations to support other characters as marks as well. Repeat Regular Expression Find (Forward and Reverse) Historically, the N and n commands could not be used as motion components for the c command. With the exception of the cN command, which worked if the search crossed a line boundary, the text region would be discarded, and the user would not be in text input mode. For consistency and simplicity of specification, POSIX.12008 does not permit this behavior. Insert Empty Line (Below and Above) Historically, counts to the O and o commands were used as the number of physical lines to open, if the terminal was dumb and the slowopen option was not set. This was intended to minimize traffic over slow connections and repainting for dumb terminals. POSIX.12008 does not permit this behavior, requiring that a count to the open command behave as for other text input commands. This change to historical practice was made for consistency, and because a superset of the functionality is provided by the slowopen edit option. Put from Buffer (Following and Before) Historically, counts to the p and P commands were ignored if the buffer was a line mode buffer, but were (mostly) implemented as described in POSIX.12008 if the buffer was a character mode buffer. Because implementations exist that do not have this limitation, and because pasting lines multiple times is generally useful, POSIX.12008 requires that count be supported for all p and P commands. Historical implementations of vi were widely known to have major problems in the p and P commands, particularly when unusual regions of text were copied into the edit buffer. The standard developers viewed these as bugs, and they are not permitted for consistency and simplicity of specification. Historically, a P or p command (or an ex put command executed from open or visual mode) executed in an empty file, left an empty line as the first line of the file. For consistency and simplicity of specification, POSIX.12008 does not permit this behavior. Replace Character Historically, the r command did not correctly handle the erase and word erase characters as arguments, nor did it handle an associated count greater than 1 with a <carriage-return> argument, for which it replaced count characters with a single <newline>. POSIX.12008 does not permit these inconsistencies. Historically, the r command permitted the <control>V escaping of entered characters, such as <ESC> and the <carriage-return>; however, it required two leading <control>V characters instead of one. POSIX.12008 requires that this be changed for consistency with the other text input commands of vi. Historically, it is an error to enter the r command if there are less than count characters at or after the cursor in the line. While a reasonable and unambiguous extension would be to permit the r command on empty lines, it would require that too large a count be adjusted to match the number of characters at or after the cursor for consistency, which is sufficiently different from historical practice to be avoided. POSIX.12008 requires conformance to historical practice. Replace Characters Historically, if there were autoindent characters in the line on which the R command was run, and autoindent was set, the first <newline> would be properly indented and no characters would be replaced by the <newline>. Each additional <newline> would replace n characters, where n was the number of characters that were needed to indent the rest of the line to the proper indentation level. This behavior is a bug and is not permitted by POSIX.12008. Undo Historical practice for cursor positioning after undoing commands was mixed. In most cases, when undoing commands that affected a single line, the cursor was moved to the start of added or changed text, or immediately after deleted text. However, if the user had moved from the line being changed, the column was either set to the first non-<blank>, returned to the origin of the command, or remained unchanged. When undoing commands that affected multiple lines or entire lines, the cursor was moved to the first character in the first line restored. As an example of how inconsistent this was, a search, followed by an o text input command, followed by an undo would return the cursor to the location where the o command was entered, but a cw command followed by an o command followed by an undo would return the cursor to the first non-<blank> of the line. POSIX.12008 requires the most useful of these behaviors, and discards the least useful, in the interest of consistency and simplicity of specification. Yank Historically, the yank command did not move to the end of the motion if the motion was in the forward direction. It moved to the end of the motion if the motion was in the backward direction, except for the _ command, or for the G and ' commands when the end of the motion was on the current line. This was further complicated by the fact that for a number of motion commands, the yank command moved the cursor but did not update the screen; for example, a subsequent command would move the cursor from the end of the motion, even though the cursor on the screen had not reflected the cursor movement for the yank command. POSIX.12008 requires that all yank commands associated with backward motions move the cursor to the end of the motion for consistency, and specifically, to make ' commands as motions consistent with search patterns as motions. Yank Current Line Some historical implementations of the Y command did not behave as described by POSIX.12008 when the '_' key was remapped because they were implemented by pushing the '_' key onto the input queue and reprocessing it. POSIX.12008 does not permit this behavior. Redraw Window Historically, the z command always redrew the screen. This is permitted but not required by POSIX.12008, because of the frequent use of the z command in macros such as map n nz. for screen positioning, instead of its use to change the screen size. The standard developers believed that expanding or scrolling the screen offered a better interface for users. The ability to redraw the screen is preserved if the optional new window size is specified, and in the <control>L and <control>R commands. The semantics of z^ are confusing at best. Historical practice is that the screen before the screen that ended with the specified line is displayed. POSIX.12008 requires conformance to historical practice. Historically, the z command would not display a partial line at the top or bottom of the screen. If the partial line would normally have been displayed at the bottom of the screen, the command worked, but the partial line was replaced with '@' characters. If the partial line would normally have been displayed at the top of the screen, the command would fail. For consistency and simplicity of specification, POSIX.12008 does not permit this behavior. Historically, the z command with a line specification of 1 ignored the command. For consistency and simplicity of specification, POSIX.12008 does not permit this behavior. Historically, the z command did not set the cursor column to the first non-<blank> for the character if the first screen was to be displayed, and was already displayed. For consistency and simplicity of specification, POSIX.12008 does not permit this behavior. Input Mode Commands in vi Historical implementations of vi did not permit the user to erase more than a single line of input, or to use normal erase characters such as line erase, worderase, and erase to erase autoindent characters. As there exist implementations of vi that do not have these limitations, both behaviors are permitted, but only historical practice is required. In the case of these extensions, vi is required to pause at the autoindent and previous line boundaries. Historical implementations of vi updated only the portion of the screen where the current cursor character was displayed. For example, consider the vi input keystrokes: iabcd<escape>0C<tab> Historically, the <tab> would overwrite the characters "abcd" when it was displayed. Other implementations replace only the 'a' character with the <tab>, and then push the rest of the characters ahead of the cursor. Both implementations have problems. The historical implementation is probably visually nicer for the above example; however, for the keystrokes: iabcd<ESC>0R<tab><ESC> the historical implementation results in the string "bcd" disappearing and then magically reappearing when the <ESC> character is entered. POSIX.12008 requires the former behavior when overwriting erase-columnsthat is, overwriting characters that are no longer logically part of the edit bufferand the latter behavior otherwise. Historical implementations of vi discarded the <control>D and <control>T characters when they were entered at places where their command functionality was not appropriate. POSIX.12008 requires that the <control>T functionality always be available, and that <control>D be treated as any other key when not operating on autoindent characters. NUL Some historical implementations of vi limited the number of characters entered using the NUL input character to 256 bytes. POSIX.12008 permits this limitation; however, implementations are encouraged to remove this limit. <control>D See also Rationale for the input mode command <newline>. The hidden assumptions in the <control>D command (and in the vi autoindent specification in general) is that <space> characters take up a single column on the screen and that <tab> characters are comprised of an integral number of <space> characters. <newline> Implementations are permitted to rewrite autoindent characters in the line when <newline>, <carriage-return>, <control>D, and <control>T are entered, or when the shift commands are used, because historical implementations have both done so and found it necessary to do so. For example, a <control>D when the cursor is preceded by a single <tab>, with tabstop set to 8, and shiftwidth set to 3, will result in the <tab> being replaced by several <space> characters. <control>T See also the Rationale for the input mode command <newline>. Historically, <control>T only worked if no non-<blank> characters had yet been input in the current input line. In addition, the characters inserted by <control>T were treated as autoindent characters, and could not be erased using normal user erase characters. Because implementations exist that do not have these limitations, and as moving to a column boundary is generally useful, POSIX.12008 requires that both limitations be removed. <control>V Historically, vi used ^V, regardless of the value of the literal- next character of the terminal. POSIX.12008 requires conformance to historical practice. The uses described for <control>V can also be accomplished with <control>Q, which is useful on terminals that use <control>V for the down-arrow function. However, most historical implementations use <control>Q for the termios START character, so the editor will generally not receive the <control>Q unless stty ixon mode is set to off. (In addition, some historical implementations of vi explicitly set ixon mode to on, so it was difficult for the user to set it to off.) Any of the command characters described in POSIX.12008 can be made ineffective by their selection as termios control characters, using the stty utility or other methods described in the System Interfaces volume of POSIX.12017. <ESC> Historically, SIGINT alerted the terminal when used to end input mode. This behavior is permitted, but not required, by POSIX.12008. FUTURE DIRECTIONS top None. SEE ALSO top ed(1p), ex(1p), stty(1p) The Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines COPYRIGHT top Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE/The Open Group 2017 VI(1P) Pages that refer to this page: ctags(1p), ed(1p), ex(1p), mailx(1p), more(1p), sh(1p) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# vi\n\n> This command is an alias of `vim`.\n\n- View documentation for the original command:\n\n`tldr vim`\n
vigr
vipw(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training vipw(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | ENVIRONMENT | FILES | SEE ALSO | COLOPHON VIPW(8) System Management Commands VIPW(8) NAME top vipw, vigr - edit the password, group, shadow-password or shadow-group file SYNOPSIS top vipw [options] vigr [options] DESCRIPTION top The vipw and vigr commands edit the files /etc/passwd and /etc/group, respectively. With the -s flag, they will edit the shadow versions of those files, /etc/shadow and /etc/gshadow, respectively. The programs will set the appropriate locks to prevent file corruption. When looking for an editor, the programs will first try the environment variable $VISUAL, then the environment variable $EDITOR, and finally the default editor, vi(1). OPTIONS top The options which apply to the vipw and vigr commands are: -g, --group Edit group database. -h, --help Display help message and exit. -p, --passwd Edit passwd database. -q, --quiet Quiet mode. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. Only absolute paths are supported. -s, --shadow Edit shadow or gshadow database. ENVIRONMENT top VISUAL Editor to be used. EDITOR Editor to be used if VISUAL is not set. FILES top /etc/group Group account information. /etc/gshadow Secure group account information. /etc/passwd User account information. /etc/shadow Secure user account information. SEE ALSO top vi(1), group(5), gshadow(5) , passwd(5), , shadow(5). COLOPHON top This page is part of the shadow-utils (utilities for managing accounts and shadow password files) project. Information about the project can be found at https://github.com/shadow-maint/shadow. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository https://github.com/shadow-maint/shadow on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-15.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] shadow-utils 4.11.1 12/22/2023 VIPW(8) Pages that refer to this page: group(5), passwd(5) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# vigr\n\n> Edit the group file.\n> More information: <https://manned.org/vigr>.\n\n- Edit the group file:\n\n`vigr`\n\n- Display version:\n\n`vigr --version`\n
vipw
vipw(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training vipw(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | ENVIRONMENT | FILES | SEE ALSO | COLOPHON VIPW(8) System Management Commands VIPW(8) NAME top vipw, vigr - edit the password, group, shadow-password or shadow-group file SYNOPSIS top vipw [options] vigr [options] DESCRIPTION top The vipw and vigr commands edit the files /etc/passwd and /etc/group, respectively. With the -s flag, they will edit the shadow versions of those files, /etc/shadow and /etc/gshadow, respectively. The programs will set the appropriate locks to prevent file corruption. When looking for an editor, the programs will first try the environment variable $VISUAL, then the environment variable $EDITOR, and finally the default editor, vi(1). OPTIONS top The options which apply to the vipw and vigr commands are: -g, --group Edit group database. -h, --help Display help message and exit. -p, --passwd Edit passwd database. -q, --quiet Quiet mode. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. Only absolute paths are supported. -s, --shadow Edit shadow or gshadow database. ENVIRONMENT top VISUAL Editor to be used. EDITOR Editor to be used if VISUAL is not set. FILES top /etc/group Group account information. /etc/gshadow Secure group account information. /etc/passwd User account information. /etc/shadow Secure user account information. SEE ALSO top vi(1), group(5), gshadow(5) , passwd(5), , shadow(5). COLOPHON top This page is part of the shadow-utils (utilities for managing accounts and shadow password files) project. Information about the project can be found at https://github.com/shadow-maint/shadow. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository https://github.com/shadow-maint/shadow on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-15.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] shadow-utils 4.11.1 12/22/2023 VIPW(8) Pages that refer to this page: group(5), passwd(5) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# vipw\n\n> Edit the password file.\n> More information: <https://manned.org/vipw>.\n\n- Edit the password file:\n\n`vipw`\n\n- Display version:\n\n`vipw --version`\n
visudo
visudo(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training visudo(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | ENVIRONMENT | FILES | DIAGNOSTICS | SEE ALSO | AUTHORS | CAVEATS | BUGS | SUPPORT | DISCLAIMER | COLOPHON VISUDO(8) System Manager's Manual VISUDO(8) NAME top visudo edit the sudoers file SYNOPSIS top visudo [-chIOPqsV] [[-f] sudoers] DESCRIPTION top edits the sudoers file in a safe fashion, analogous to vipw(8). locks the sudoers file against multiple simultaneous edits, performs basic validity checks, and checks for syntax errors before installing the edited file. If the sudoers file is currently being edited you will receive a message to try again later. If the sudoers file does not exist, it will be created unless the editor exits without writing to the file. parses the sudoers file after editing and will not save the changes if there is a syntax error. Upon finding an error, will print a message stating the line number(s) where the error occurred and the user will receive the What now? prompt. At this point the user may enter e to re-edit the sudoers file, x to exit without saving the changes, or Q to quit and save changes. The Q option should be used with extreme caution because if believes there to be a syntax error, so will sudo. If e is typed to edit the sudoers file after a syntax error has been detected, the cursor will be placed on the line where the error occurred (if the editor supports this feature). There are two sudoers settings that determine which editor visudo will run. editor A colon (:) separated list of editors allowed to be used with . will choose the editor that matches the user's SUDO_EDITOR, VISUAL, or EDITOR environment variable if possible, or the first editor in the list that exists and is executable. sudo does not preserve the SUDO_EDITOR, VISUAL, or EDITOR environment variables unless they are present in the env_keep list or the env_reset option is disabled in the sudoers file. The default editor path is /usr/bin/vi which can be set at compile time via the --with-editor configure option. env_editor If set, will use the value of the SUDO_EDITOR, VISUAL, or EDITOR environment variables before falling back on the default editor list. visudo is typically run as root so this option may allow a user with visudo privileges to run arbitrary commands as root without logging. An alternative is to place a colon-separated list of safe editors in the editor variable. will then only use SUDO_EDITOR, VISUAL, or EDITOR if they match a value specified in editor. If the env_reset flag is enabled, the SUDO_EDITOR, VISUAL, and/or EDITOR environment variables must be present in the env_keep list for the env_editor flag to function when is invoked via sudo. The default value is on, which can be set at compile time via the --with-env-editor configure option. The options are as follows: -c, --check Enable check-only mode. The existing sudoers file (and any other files it includes) will be checked for syntax errors. If the path to the sudoers file was not specified, will also check the file ownership and permissions (see the -O and -P options). A message will be printed to the standard output describing the status of sudoers unless the -q option was specified. If the check completes successfully, will exit with a value of 0. If an error is encountered, will exit with a value of 1. -f sudoers, --file=sudoers Specify an alternate sudoers file location, see below. As of version 1.8.27, the sudoers path can be specified without using the -f option. -h, --help Display a short help message to the standard output and exit. -I, --no-includes Disable the editing of include files unless there is a pre-existing syntax error. By default, will edit the main sudoers file and any files included via @include or #include directives. Files included via @includedir or #includedir are never edited unless they contain a syntax error. -O, --owner Enforce the default ownership (user and group) of the sudoers file. In edit mode, the owner of the edited file will be set to the default. In check mode (-c), an error will be reported if the owner is incorrect. This option is enabled by default if the sudoers file was not specified. -P, --perms Enforce the default permissions (mode) of the sudoers file. In edit mode, the permissions of the edited file will be set to the default. In check mode (-c), an error will be reported if the file permissions are incorrect. This option is enabled by default if the sudoers file was not specified. -q, --quiet Enable quiet mode. In this mode details about syntax errors are not printed. This option is only useful when combined with the -c option. -s, --strict Enable strict checking of the sudoers file. If an alias is referenced but not actually defined or if there is a cycle in an alias, will consider this a syntax error. It is not possible to differentiate between an alias and a host name or user name that consists solely of uppercase letters, digits, and the underscore (_) character. -V, --version Print the and sudoers grammar versions and exit. A sudoers file may be specified instead of the default, /etc/sudoers. The temporary file used is the specified sudoers file with .tmp appended to it. In check-only mode only, - may be used to indicate that sudoers will be read from the standard input. Because the policy is evaluated in its entirety, it is not sufficient to check an individual sudoers include file for syntax errors. Debugging and sudoers plugin arguments versions 1.8.4 and higher support a flexible debugging framework that is configured via Debug lines in the sudo.conf(5) file. Starting with sudo 1.8.12, will also parse the arguments to the sudoers plugin to override the default sudoers path name, user- ID, group-ID, and file mode. These arguments, if present, should be listed after the path to the plugin (i.e., after sudoers.so). Multiple arguments may be specified, separated by white space. For example: Plugin sudoers_policy sudoers.so sudoers_mode=0400 The following arguments are supported: sudoers_file=pathname The sudoers_file argument can be used to override the default path to the sudoers file. sudoers_uid=user-ID The sudoers_uid argument can be used to override the default owner of the sudoers file. It should be specified as a numeric user-ID. sudoers_gid=group-ID The sudoers_gid argument can be used to override the default group of the sudoers file. It must be specified as a numeric group-ID (not a group name). sudoers_mode=mode The sudoers_mode argument can be used to override the default file mode for the sudoers file. It should be specified as an octal value. For more information on configuring sudo.conf(5), refer to its manual. ENVIRONMENT top The following environment variables may be consulted depending on the value of the editor and env_editor sudoers settings: SUDO_EDITOR Invoked by as the editor to use VISUAL Used by if SUDO_EDITOR is not set EDITOR Used by if neither SUDO_EDITOR nor VISUAL is set FILES top /etc/sudo.conf Sudo front-end configuration /etc/sudoers List of who can run what /etc/sudoers.tmp Default temporary file used by visudo DIAGNOSTICS top In addition to reporting sudoers syntax errors, may produce the following messages: sudoers file busy, try again later. Someone else is currently editing the sudoers file. /etc/sudoers: Permission denied You didn't run as root. you do not exist in the passwd database Your user-ID does not appear in the system passwd database. Warning: {User,Runas,Host,Cmnd}_Alias referenced but not defined Either you are trying to use an undeclared {User,Runas,Host,Cmnd}_Alias or you have a user or host name listed that consists solely of uppercase letters, digits, and the underscore (_) character. In the latter case, you can ignore the warnings (sudo will not complain). The message is prefixed with the path name of the sudoers file and the line number where the undefined alias was used. In -s (strict) mode these are errors, not warnings. Warning: unused {User,Runas,Host,Cmnd}_Alias The specified {User,Runas,Host,Cmnd}_Alias was defined but never used. The message is prefixed with the path name of the sudoers file and the line number where the unused alias was defined. You may wish to comment out or remove the unused alias. Warning: cycle in {User,Runas,Host,Cmnd}_Alias The specified {User,Runas,Host,Cmnd}_Alias includes a reference to itself, either directly or through an alias it includes. The message is prefixed with the path name of the sudoers file and the line number where the cycle was detected. This is only a warning unless is run in -s (strict) mode as sudo will ignore cycles when parsing the sudoers file. ignoring editor backup file While processing a @includedir or #includedir, a file was found with a name that ends in ~ or .bak. Such files are skipped by sudo and . ignoring file name containing '.' While processing a @includedir or #includedir, a file was found with a name that contains a . character. Such files are skipped by sudo and . unknown defaults entry "name" The sudoers file contains a Defaults setting not recognized by . SEE ALSO top vi(1), sudo.conf(5), sudoers(5), sudo(8), vipw(8) AUTHORS top Many people have worked on sudo over the years; this version consists of code written primarily by: Todd C. Miller See the CONTRIBUTORS.md file in the sudo distribution (https://www.sudo.ws/about/contributors/) for an exhaustive list of people who have contributed to sudo. CAVEATS top There is no easy way to prevent a user from gaining a root shell if the editor used by allows shell escapes. BUGS top If you believe you have found a bug in , you can submit a bug report at https://bugzilla.sudo.ws/ SUPPORT top Limited free support is available via the sudo-users mailing list, see https://www.sudo.ws/mailman/listinfo/sudo-users to subscribe or search the archives. DISCLAIMER top is provided AS IS and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. See the LICENSE.md file distributed with sudo or https://www.sudo.ws/about/license/ for complete details. COLOPHON top This page is part of the sudo (execute a command as another user) project. Information about the project can be found at https://www.sudo.ws/. If you have a bug report for this manual page, see https://bugzilla.sudo.ws/. This page was obtained from the project's upstream Git repository https://github.com/sudo-project/sudo on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-21.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] Sudo 1.9.15p4 July 27, 2023 VISUDO(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# visudo\n\n> Safely edit the sudoers file.\n> More information: <https://www.sudo.ws/docs/man/visudo.man>.\n\n- Edit the sudoers file:\n\n`sudo visudo`\n\n- Check the sudoers file for errors:\n\n`sudo visudo -c`\n\n- Edit the sudoers file using a specific editor:\n\n`sudo EDITOR={{editor}} visudo`\n\n- Display version information:\n\n`visudo --version`\n
vmstat
vmstat(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training vmstat(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | FIELD DESCRIPTION FOR VM MODE | FIELD DESCRIPTION FOR DISK MODE | FIELD DESCRIPTION FOR DISK PARTITION MODE | FIELD DESCRIPTION FOR SLAB MODE | NOTES | SEE ALSO | REPORTING BUGS | COLOPHON VMSTAT(8) System Administration VMSTAT(8) NAME top vmstat - Report virtual memory statistics SYNOPSIS top vmstat [options] [delay [count]] DESCRIPTION top 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. OPTIONS top 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 swap (si/so) or block (bi/bo) fields. -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. -y, --no-first Omits first report with statistics since system boot. -V, --version Display version information and exit. -h, --help Display help and exit. FIELD DESCRIPTION FOR VM MODE top 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: Kibibyte received from a block device (KiB/s). bo: Kibibyte sent to a block device (KiB/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. gu: Time spent running KVM guest code (guest time, including guest nice). FIELD DESCRIPTION FOR DISK MODE top 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 FIELD DESCRIPTION FOR DISK PARTITION MODE top 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 FIELD DESCRIPTION FOR SLAB MODE top Slab mode shows statistics per slab, for more information about this information see slabinfo(5) 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 NOTES top vmstat requires read access to files under /proc. The -m requires read access to /proc/slabinfo which may not be available to standard users. Mount options for /proc such as subset=pid may also impact what is visible. SEE ALSO top free(1), iostat(1), mpstat(1), ps(1), sar(1), top(1), slabinfo(5) REPORTING BUGS top Please send bug reports to [email protected] COLOPHON top This page is part of the procps-ng (/proc filesystem utilities) project. Information about the project can be found at https://gitlab.com/procps-ng/procps. If you have a bug report for this manual page, see https://gitlab.com/procps-ng/procps/blob/master/Documentation/bugs.md. This page was obtained from the project's upstream Git repository https://gitlab.com/procps-ng/procps.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-10-16.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] procps-ng 2023-01-18 VMSTAT(8) Pages that refer to this page: cifsiostat(1), free(1), iostat(1), mpstat(1), pidstat(1), pmrep(1), sar(1), slabtop(1), top(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# vmstat\n\n> Report information about processes, memory, paging, block IO, traps, disks and CPU activity.\n> More information: <https://manned.org/vmstat>.\n\n- Display virtual memory statistics:\n\n`vmstat`\n\n- Display reports every 2 seconds for 5 times:\n\n`vmstat {{2}} {{5}}`\n
w
w(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training w(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COMMAND-LINE OPTIONS | ENVIRONMENT | FILES | SEE ALSO | AUTHORS | REPORTING BUGS | COLOPHON W(1) User Commands W(1) NAME top w - Show who is logged on and what they are doing. SYNOPSIS top w [options] [user] DESCRIPTION top w displays information about the users currently on the machine, and their processes. The header shows, in this order, 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. The following entries are displayed for each user: login name, the tty name, the remote host, login time, idle time, JCPU, PCPU, and the command line of their current process. The JCPU time is the time used by all processes attached to the tty. It does not include past background jobs, but does include currently running background jobs. The PCPU time is the time used by the current process, named in the "what" field. COMMAND-LINE OPTIONS top -h, --no-header Don't print the header. -u, --no-current Ignores the username while figuring out the current process and cpu times. To demonstrate this, do a su and do a w and a w -u. -s, --short Use the short format. Don't print the login time, JCPU or PCPU times. -f, --from Toggle printing the from (remote hostname) field. The default as released is for the from field to not be printed, although your system administrator or distribution maintainer may have compiled a version in which the from field is shown by default. --help Display help text and exit. -i, --ip-addr Display IP address instead of hostname for from field. -p, --pids Display pid of the login process/the "what" process in the "what" field. -V, --version Display version information. -o, --old-style Old style output. Prints blank space for idle times less than one minute. user Show information about the specified user only. ENVIRONMENT top PROCPS_USERLEN Override the default width of the username column. Defaults to 8. PROCPS_FROMLEN Override the default width of the from column. Defaults to 16. FILES top /var/run/utmp information about who is currently logged on /proc process information SEE ALSO top free(1), ps(1), top(1), uptime(1), utmp(5), who(1) AUTHORS top w was re-written almost entirely by Charles Blake, based on the version by Larry Greenfield [email protected] and Michael K. Johnson [email protected] REPORTING BUGS top Please send bug reports to [email protected] COLOPHON top This page is part of the procps-ng (/proc filesystem utilities) project. Information about the project can be found at https://gitlab.com/procps-ng/procps. If you have a bug report for this manual page, see https://gitlab.com/procps-ng/procps/blob/master/Documentation/bugs.md. This page was obtained from the project's upstream Git repository https://gitlab.com/procps-ng/procps.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-10-16.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] procps-ng 2023-01-15 W(1) Pages that refer to this page: tload(1), top(1), uptime(1), utmpdump(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# w\n\n> Display who is logged in and their processes.\n> More information: <https://www.geeksforgeeks.org/w-command-in-linux-with-examples/>.\n\n- Display information about all users who are currently logged in:\n\n`w`\n\n- Display information about a specific user:\n\n`w {{username}}`\n\n- Display information without including the header:\n\n`w --no-header`\n\n- Display information without including the login, JCPU and PCPU columns:\n\n`w --short`\n
wait
wait(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training wait(1p) Linux manual page PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES OF ERRORS | APPLICATION USAGE | EXAMPLES | RATIONALE | FUTURE DIRECTIONS | SEE ALSO | COPYRIGHT WAIT(1P) POSIX Programmer's Manual WAIT(1P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME top wait await process completion SYNOPSIS top wait [pid...] DESCRIPTION top When an asynchronous list (see Section 2.9.3.1, Examples) is started by the shell, the process ID of the last command in each element of the asynchronous list shall become known in the current shell execution environment; see Section 2.12, Shell Execution Environment. If the wait utility is invoked with no operands, it shall wait until all process IDs known to the invoking shell have terminated and exit with a zero exit status. If one or more pid operands are specified that represent known process IDs, the wait utility shall wait until all of them have terminated. If one or more pid operands are specified that represent unknown process IDs, wait shall treat them as if they were known process IDs that exited with exit status 127. The exit status returned by the wait utility shall be the exit status of the process requested by the last pid operand. The known process IDs are applicable only for invocations of wait in the current shell execution environment. OPTIONS top None. OPERANDS top The following operand shall be supported: pid One of the following: 1. The unsigned decimal integer process ID of a command, for which the utility is to wait for the termination. 2. A job control job ID (see the Base Definitions volume of POSIX.12017, Section 3.204, Job Control Job ID) that identifies a background process group to be waited for. The job control job ID notation is applicable only for invocations of wait in the current shell execution environment; see Section 2.12, Shell Execution Environment. The exit status of wait shall be determined by the last command in the pipeline. Note: The job control job ID type of pid is only available on systems supporting the User Portability Utilities option. STDIN top Not used. INPUT FILES top None. ENVIRONMENT VARIABLES top The following environment variables shall affect the execution of wait: LANG Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.12017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments). LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. ASYNCHRONOUS EVENTS top Default. STDOUT top Not used. STDERR top The standard error shall be used only for diagnostic messages. OUTPUT FILES top None. EXTENDED DESCRIPTION top None. EXIT STATUS top If one or more operands were specified, all of them have terminated or were not known by the invoking shell, and the status of the last operand specified is known, then the exit status of wait shall be the exit status information of the command indicated by the last operand specified. If the process terminated abnormally due to the receipt of a signal, the exit status shall be greater than 128 and shall be distinct from the exit status generated by other signals, but the exact value is unspecified. (See the kill -l option.) Otherwise, the wait utility shall exit with one of the following values: 0 The wait utility was invoked with no operands and all process IDs known by the invoking shell have terminated. 1126 The wait utility detected an error. 127 The command identified by the last pid operand specified is unknown. CONSEQUENCES OF ERRORS top Default. The following sections are informative. APPLICATION USAGE top On most implementations, wait is a shell built-in. If it is called in a subshell or separate utility execution environment, such as one of the following: (wait) nohup wait ... find . -exec wait ... \; it returns immediately because there are no known process IDs to wait for in those environments. Historical implementations of interactive shells have discarded the exit status of terminated background processes before each shell prompt. Therefore, the status of background processes was usually lost unless it terminated while wait was waiting for it. This could be a serious problem when a job that was expected to run for a long time actually terminated quickly with a syntax or initialization error because the exit status returned was usually zero if the requested process ID was not found. This volume of POSIX.12017 requires the implementation to keep the status of terminated jobs available until the status is requested, so that scripts like: j1& p1=$! j2& wait $p1 echo Job 1 exited with status $? wait $! echo Job 2 exited with status $? work without losing status on any of the jobs. The shell is allowed to discard the status of any process if it determines that the application cannot get the process ID for that process from the shell. It is also required to remember only {CHILD_MAX} number of processes in this way. Since the only way to get the process ID from the shell is by using the '!' shell parameter, the shell is allowed to discard the status of an asynchronous list if "$!" was not referenced before another asynchronous list was started. (This means that the shell only has to keep the status of the last asynchronous list started if the application did not reference "$!". If the implementation of the shell is smart enough to determine that a reference to "$!" was not saved anywhere that the application can retrieve it later, it can use this information to trim the list of saved information. Note also that a successful call to wait with no operands discards the exit status of all asynchronous lists.) If the exit status of wait is greater than 128, there is no way for the application to know if the waited-for process exited with that value or was killed by a signal. Since most utilities exit with small values, there is seldom any ambiguity. Even in the ambiguous cases, most applications just need to know that the asynchronous job failed; it does not matter whether it detected an error and failed or was killed and did not complete its job normally. EXAMPLES top Although the exact value used when a process is terminated by a signal is unspecified, if it is known that a signal terminated a process, a script can still reliably determine which signal by using kill as shown by the following script: sleep 1000& pid=$! kill -kill $pid wait $pid echo $pid was terminated by a SIG$(kill -l $?) signal. If the following sequence of commands is run in less than 31 seconds: sleep 257 | sleep 31 & jobs -l %% either of the following commands returns the exit status of the second sleep in the pipeline: wait <pid of sleep 31> wait %% RATIONALE top The description of wait does not refer to the waitpid() function from the System Interfaces volume of POSIX.12017 because that would needlessly overspecify this interface. However, the wording means that wait is required to wait for an explicit process when it is given an argument so that the status information of other processes is not consumed. Historical implementations use the wait() function defined in the System Interfaces volume of POSIX.12017 until wait() returns the requested process ID or finds that the requested process does not exist. Because this means that a shell script could not reliably get the status of all background children if a second background job was ever started before the first job finished, it is recommended that the wait utility use a method such as the functionality provided by the waitpid() function. The ability to wait for multiple pid operands was adopted from the KornShell. This new functionality was added because it is needed to determine the exit status of any asynchronous list accurately. The only compatibility problem that this change creates is for a script like while sleep 60 do job& echo Job started $(date) as $! done which causes the shell to monitor all of the jobs started until the script terminates or runs out of memory. This would not be a problem if the loop did not reference "$!" or if the script would occasionally wait for jobs it started. FUTURE DIRECTIONS top None. SEE ALSO top Chapter 2, Shell Command Language, kill(1p), sh(1p) The Base Definitions volume of POSIX.12017, Section 3.204, Job Control Job ID, Chapter 8, Environment Variables The System Interfaces volume of POSIX.12017, wait(3p) COPYRIGHT top Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE/The Open Group 2017 WAIT(1P) Pages that refer to this page: bg(1p), fg(1p), jobs(1p), kill(1p), sleep(1p) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# wait\n\n> Wait for a process to complete before proceeding.\n> More information: <https://manned.org/wait>.\n\n- Wait for a process to finish given its process ID (PID) and return its exit status:\n\n`wait {{pid}}`\n\n- Wait for all processes known to the invoking shell to finish:\n\n`wait`\n
waitpid
waitpid(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training waitpid(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXIT STATUS | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY WAITPID(1) User Commands WAITPID(1) NAME top waitpid - utility to wait for arbitrary processes SYNOPSIS top waitpid [-v] [--timeout|-t seconds] pid... DESCRIPTION top waitpid is a simple command to wait for arbitrary non-child processes. It exits after all processes whose PIDs have been passed as arguments have exited. OPTIONS top -v, --verbose Be more verbose. -t, --timeout seconds Maximum wait time. -e, --exited Dont error on already exited PIDs. -c, --count count Number of process exits to wait for. -h, --help Display help text and exit. -V, --version Print version and exit. EXIT STATUS top waitpid has the following exit status values: 0 success 1 unspecified failure 2 system does not provide necessary functionality 3 timeout expired AUTHORS top Thomas Weischuh <[email protected]> SEE ALSO top waitpid(2) wait(1P) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The waitpid command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is part of the util-linux (a random collection of Linux utilities) project. Information about the project can be found at https://www.kernel.org/pub/linux/utils/util-linux/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-14.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] util-linux 2.39.594-1e0ad 2023-07-19 WAITPID(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# waitpid\n\n> Wait for the termination of arbitrary processes.\n> See also: `wait`.\n> More information: <https://manned.org/waitpid.1>.\n\n- Sleep until all processes whose PIDs have been specified have exited:\n\n`waitpid {{pid1 pid2 ...}}`\n\n- Sleep for at most `n` seconds:\n\n`waitpid --timeout {{n}} {{pid1 pid2 ...}}`\n\n- Do not error if specified PIDs have already exited:\n\n`waitpid --exited {{pid1 pid2 ...}}`\n\n- Sleep until `n` of the specified processes have exited:\n\n`waitpid --count {{n}} {{pid1 pid2 ...}}`\n\n- Display help:\n\n`waitpid -h`\n
wall
wall(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training wall(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | NOTES | HISTORY | SEE ALSO | REPORTING BUGS | AVAILABILITY WALL(1) User Commands WALL(1) NAME top wall - write a message to all users SYNOPSIS top wall [-n] [-t timeout] [-g group] [message | file] DESCRIPTION top wall displays a message, or the contents of a file, or otherwise its standard input, on the terminals of all currently logged in users. The command will wrap lines that are longer than 79 characters. Short lines are whitespace padded to have 79 characters. The command will always put a carriage return and new line at the end of each line. Only the superuser can write on the terminals of users who have chosen to deny messages or are using a program which automatically denies messages. Reading from a file is refused when the invoker is not superuser and the program is set-user-ID or set-group-ID. OPTIONS top -n, --nobanner Suppress the banner. -t, --timeout timeout Abandon the write attempt to the terminals after timeout seconds. This timeout must be a positive integer. The default value is 300 seconds, which is a legacy from the time when people ran terminals over modem lines. -g, --group group Limit printing message to members of group defined as a group argument. The argument can be group name or GID. -h, --help Display help text and exit. -V, --version Print version and exit. NOTES top Some sessions, such as wdm(1x), that have in the beginning of utmp(5) ut_type data a ':' character will not get the message from wall. This is done to avoid write errors. HISTORY top A wall command appeared in Version 7 AT&T UNIX. SEE ALSO top mesg(1), talk(1), write(1), shutdown(8) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The wall command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is part of the util-linux (a random collection of Linux utilities) project. Information about the project can be found at https://www.kernel.org/pub/linux/utils/util-linux/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-14.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] util-linux 2.39.594-1e0ad 2023-07-19 WALL(1) Pages that refer to this page: mesg(1), systemctl(1), systemd-ask-password(1), systemd-tty-ask-password-agent(1), poweroff(8), shutdown(8), systemd-ask-password-console.service(8), telinit(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# wall\n\n> Write a message on the terminals of users currently logged in.\n> More information: <https://manned.org/wall>.\n\n- Send a message:\n\n`wall {{message}}`\n\n- Send a message to users that belong to a specific group:\n\n`wall --group {{group_name}} {{message}}`\n\n- Send a message from a file:\n\n`wall {{file}}`\n\n- Send a message with timeout (default 300):\n\n`wall --timeout {{seconds}} {{file}}`\n
watch
watch(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training watch(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | KEY CONTROL | EXIT STATUS | ENVIRONMENT | NOTES | EXAMPLES | BUGS | REPORTING BUGS | COLOPHON WATCH(1) User Commands WATCH(1) NAME top watch - execute a program periodically, showing output fullscreen SYNOPSIS top watch [options] command DESCRIPTION top watch runs command repeatedly, displaying its output and errors (the first screenful). This allows you to watch the program output change over time. By default, command is run every 2 seconds and watch will run until interrupted. A header informs of the start and running time of command as well as its exit code. OPTIONS top -b, --beep Beep if command has a non-zero exit. -c, --color Interpret ANSI color and style sequences. -C, --no-color Do not interpret ANSI color and style sequences. -d, --differences[=permanent] Highlight the differences between successive updates. If the optional permanent argument is specified then watch will show all changes since the first iteration. -e, --errexit Freeze updates on command error, and exit after a key press. The exit code of watch will be the code command exits with. If signal n is the cause of command termination, the exit code will be 128 + n. -g, --chgexit Exit when the output of command changes. -n, --interval seconds Specify update interval. Values smaller than 0.1 and larger than 2678400 (31 days) are converted into these respective bounds. Both '.' and ',' work for any locale. The WATCH_INTERVAL environment variable can be used to persistently set a non-default interval (following the same rules and formatting). -p, --precise Execute command --interval seconds after its previous run started, instead of --interval seconds after its previous run finished. If it's taking longer than --interval seconds for command to complete, it is waited for in either case. -q, --equexit <cycles> Exit when output of command does not change for the given number of cycles. -r, --no-rerun Do not run the program on terminal resize, the output of the program will re-appear at the next regular run time. -s, --shotsdir Directory to save screenshots into. -t, --no-title Turn off the header normally shown at the top of the screen. -w, --no-wrap Turn off line wrapping. Long lines will be truncated instead of wrapped to the next line. -x, --exec Pass command to an exec(3) call instead of sh -c. The program will start a bit quicker. Shell features (environment setup, variable and pathname expansion, etc.) will be unavailable. -h, --help Display help text and exit. -v, --version Display version information and exit. KEY CONTROL top spacebar Issue command immediately. If it's running at the moment, it is not interrupted and its next round will start without delay. q Quit watch. It currently does not interrupt a running command (as opposed to terminating signals, such as the SIGKILL following Ctrl+C). s Take a screenshot. It will be saved in the working directory, unless specified otherwise by --shotsdir. If command is running at the moment, the screenshot will be taken as soon as it finishes. EXIT STATUS top 0 Success. Does not represent command exit code. 1 Errors unrelated to command operation. 2 Errors related to command execution and management (not its exit code). any non-zero (--errexit) With --errexit the last exit code of command is returned. ENVIRONMENT top The behavior of watch is affected by the following environment variables. WATCH_INTERVAL Update interval, follows the same rules as the --interval command line option. COLUMNS Terminal screen character width. Set to override autodetection. LINES Terminal screen character height. Set to override autodetection. NOTES top POSIX option processing is used (i.e., option processing stops at the first non-option argument). This means that flags after command don't get interpreted by watch itself. Non-printing characters are stripped from program output. Use cat -v as part of the command pipeline if you want to see them. EXAMPLES top To watch the contents of a directory change, you could use watch -d ls -l If you have CPUs with a dynamic frequency and want to observe it change, try the following. The command is passed to the shell, which allows you to make the pipeline. The quotes are a feature of the shell too. watch -n1 'grep "^cpu MHz" /proc/cpuinfo | sort -nrk4' To monitor the up status of your servers, saving a copy of the output of each run to a file, you may use this. The -p makes the command execute every 10 seconds regardless of how long it took to complete the previous run. watch -n10 -p -d '{ date; for i in 10.0.0.31 10.0.0.32 10.0.0.33; do R=OK; ping -c2 -W2 "$i" &>/dev/null || R=FAIL; echo "$i: $R"; done } | tee -a ~/log' You can watch for your administrator to install the latest kernel with watch uname -r BUGS top When the terminal dimensions change, its contents changes are not registered on the next command run. --chgexit will not trigger that turn and the counter of --equexit will not restart even if command output changes meanwhile. --differences highlighting is reset. REPORTING BUGS top Please send bug reports to [email protected] COLOPHON top This page is part of the procps-ng (/proc filesystem utilities) project. Information about the project can be found at https://gitlab.com/procps-ng/procps. If you have a bug report for this manual page, see https://gitlab.com/procps-ng/procps/blob/master/Documentation/bugs.md. This page was obtained from the project's upstream Git repository https://gitlab.com/procps-ng/procps.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-10-16.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] procps-ng 2023-07-31 WATCH(1) Pages that refer to this page: lsblk(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# watch\n\n> Execute a command repeatedly, and monitor the output in full-screen mode.\n> More information: <https://manned.org/watch>.\n\n- Monitor files in the current directory:\n\n`watch {{ls}}`\n\n- Monitor disk space and highlight the changes:\n\n`watch -d {{df}}`\n\n- Monitor "node" processes, refreshing every 3 seconds:\n\n`watch -n {{3}} "{{ps aux | grep node}}"`\n\n- Monitor disk space and if it changes, stop monitoring:\n\n`watch -g {{df}}`\n
wc
wc(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training wc(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON WC(1) User Commands WC(1) NAME top wc - print newline, word, and byte counts for each file SYNOPSIS top wc [OPTION]... [FILE]... wc [OPTION]... --files0-from=F DESCRIPTION top Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is specified. A word is a non-zero-length sequence of printable characters delimited by white space. With no FILE, or when FILE is -, read standard input. The options below may be used to select which counts are printed, always in the following order: newline, word, character, byte, maximum line length. -c, --bytes print the byte counts -m, --chars print the character counts -l, --lines print the newline counts --files0-from=F read input from the files specified by NUL-terminated names in file F; If F is - then read names from standard input -L, --max-line-length print the maximum display width -w, --words print the word counts --total=WHEN when to print a line with total counts; WHEN can be: auto, always, only, never --help display this help and exit --version output version information and exit AUTHOR top Written by Paul Rubin and David MacKenzie. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top Full documentation <https://www.gnu.org/software/coreutils/wc> or available locally via: info '(coreutils) wc invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 WC(1) Pages that refer to this page: bridge(8), ip(8), tc(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# wc\n\n> Count lines, words, and bytes.\n> More information: <https://www.gnu.org/software/coreutils/wc>.\n\n- Count all lines in a file:\n\n`wc --lines {{path/to/file}}`\n\n- Count all words in a file:\n\n`wc --words {{path/to/file}}`\n\n- Count all bytes in a file:\n\n`wc --bytes {{path/to/file}}`\n\n- Count all characters in a file (taking multi-byte characters into account):\n\n`wc --chars {{path/to/file}}`\n\n- Count all lines, words and bytes from `stdin`:\n\n`{{find .}} | wc`\n\n- Count the length of the longest line in number of characters:\n\n`wc --max-line-length {{path/to/file}}`\n
wdctl
wdctl(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training wdctl(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | AUTHORS | REPORTING BUGS | AVAILABILITY WDCTL(8) System Administration WDCTL(8) NAME top wdctl - show hardware watchdog status SYNOPSIS top wdctl [options] [device...] DESCRIPTION top Show hardware watchdog status. The default device is /dev/watchdog. If more than one device is specified then the output is separated by one blank line. If the device is already used or user has no permissions to read from the device, then wdctl reads data from sysfs. In this case information about supported features (flags) might be missing. Note that the number of supported watchdog features is hardware specific. OPTIONS top -f, --flags list Print only the specified flags. -F, --noflags Do not print information about flags. -I, --noident Do not print watchdog identity information. -n, --noheadings Do not print a header line for flags table. -o, --output list Define the output columns to use in table of watchdog flags. If no output arrangement is specified, then a default set is used. Use --help to get list of all supported columns. -O, --oneline Print all wanted information on one line in key="value" output format. -p, --setpretimeout seconds Set the watchdog pre-timeout in seconds. A watchdog pre-timeout is a notification generated by the watchdog before the watchdog reset might occur in the event the watchdog has not been serviced. This notification is handled by the kernel and can be configured to take an action using sysfs or by --setpregovernor. -g, --setpregovernor governor Set pre-timeout governor name. For available governors see default wdctl output. -r, --raw Use the raw output format. -s, --settimeout seconds Set the watchdog timeout in seconds. -T, --notimeouts Do not print watchdog timeouts. -x, --flags-only Same as -I -T. -h, --help Display help text and exit. -V, --version Print version and exit. AUTHORS top Karel Zak <[email protected]>, Lennart Poettering <[email protected]> REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The wdctl command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is part of the util-linux (a random collection of Linux utilities) project. Information about the project can be found at https://www.kernel.org/pub/linux/utils/util-linux/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-14.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] util-linux 2.39.594-1e0ad 2023-07-19 WDCTL(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# wdctl\n\n> Show the hardware watchdog status.\n> More information: <https://manned.org/wdctl>.\n\n- Display the watchdog status:\n\n`wdctl`\n\n- Display the watchdog status in a single line in key-value pairs:\n\n`wdctl --oneline`\n\n- Display only specific watchdog flags (list is driver specific):\n\n`wdctl --flags {{flag_list}}`\n
wg
wg(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training wg(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COMMANDS | CONFIGURATION FILE FORMAT | CONFIGURATION FILE FORMAT EXAMPLE | DEBUGGING INFORMATION | ENVIRONMENT VARIABLES | SEE ALSO | AUTHOR | COLOPHON WG(8) WireGuard WG(8) NAME top wg - set and retrieve configuration of WireGuard interfaces SYNOPSIS top wg [ COMMAND ] [ OPTIONS ]... [ ARGS ]... DESCRIPTION top wg is the configuration utility for getting and setting the configuration of WireGuard tunnel interfaces. The interfaces themselves can be added and removed using ip-link(8) and their IP addresses and routing tables can be set using ip-address(8) and ip-route(8). The wg utility provides a series of sub-commands for changing WireGuard-specific aspects of WireGuard interfaces. If no COMMAND is specified, COMMAND defaults to show. Sub- commands that take an INTERFACE must be passed a WireGuard interface. COMMANDS top show { <interface> | all | interfaces } [public-key | private-key | listen-port | fwmark | peers | preshared-keys | endpoints | allowed-ips | latest-handshakes | persistent-keepalive | transfer | dump] Shows current WireGuard configuration and runtime information of specified <interface>. If no <interface> is specified, <interface> defaults to all. If interfaces is specified, prints a list of all WireGuard interfaces, one per line, and quits. If no options are given after the interface specification, then prints a list of all attributes in a visually pleasing way meant for the terminal. Otherwise, prints specified information grouped by newlines and tabs, meant to be used in scripts. For this script-friendly display, if all is specified, then the first field for all categories of information is the interface name. If dump is specified, then several lines are printed; the first contains in order separated by tab: private-key, public-key, listen-port, fwmark. Subsequent lines are printed for each peer and contain in order separated by tab: public-key, preshared-key, endpoint, allowed-ips, latest-handshake, transfer-rx, transfer-tx, persistent-keepalive. showconf <interface> Shows the current configuration of <interface> in the format described by CONFIGURATION FILE FORMAT below. set <interface> [listen-port <port>] [fwmark <fwmark>] [private- key <file-path>] [peer <base64-public-key> [remove] [preshared- key <file-path>] [endpoint <ip>:<port>] [persistent-keepalive <interval seconds>] [allowed-ips <ip1>/<cidr1>[,<ip2>/<cidr2>]...] ]... Sets configuration values for the specified <interface>. Multiple peers may be specified, and if the remove argument is given for a peer, that peer is removed, not configured. If listen-port is not specified, or set to 0, the port will be chosen randomly when the interface comes up. Both private-key and preshared-key must be files, because command line arguments are not considered private on most systems but if you are using bash(1), you may safely pass in a string by specifying as private-key or preshared-key the expression: <(echo PRIVATEKEYSTRING). If /dev/null or another empty file is specified as the filename for either private-key or preshared-key, the key is removed from the device. The use of preshared-key is optional, and may be omitted; it adds an additional layer of symmetric-key cryptography to be mixed into the already existing public-key cryptography, for post-quantum resistance. If allowed-ips is specified, but the value is the empty string, all allowed ips are removed from the peer. The use of persistent-keepalive is optional and is by default off; setting it to 0 or "off" disables it. Otherwise it represents, in seconds, between 1 and 65535 inclusive, how often to send an authenticated empty packet to the peer, for the purpose of keeping a stateful firewall or NAT mapping valid persistently. For example, if the interface very rarely sends traffic, but it might at anytime receive traffic from a peer, and it is behind NAT, the interface might benefit from having a persistent keepalive interval of 25 seconds; however, most users will not need this. The use of fwmark is optional and is by default off; setting it to 0 or "off" disables it. Otherwise it is a 32-bit fwmark for outgoing packets and may be specified in hexadecimal by prepending "0x". setconf <interface> <configuration-filename> Sets the current configuration of <interface> to the contents of <configuration-filename>, which must be in the format described by CONFIGURATION FILE FORMAT below. addconf <interface> <configuration-filename> Appends the contents of <configuration-filename>, which must be in the format described by CONFIGURATION FILE FORMAT below, to the current configuration of <interface>. syncconf <interface> <configuration-filename> Like setconf, but reads back the existing configuration first and only makes changes that are explicitly different between the configuration file and the interface. This is much less efficient than setconf, but has the benefit of not disrupting current peer sessions. The contents of <configuration-filename> must be in the format described by CONFIGURATION FILE FORMAT below. genkey Generates a random private key in base64 and prints it to standard output. genpsk Generates a random preshared key in base64 and prints it to standard output. pubkey Calculates a public key and prints it in base64 to standard output from a corresponding private key (generated with genkey) given in base64 on standard input. A private key and a corresponding public key may be generated at once by calling: $ umask 077 $ wg genkey | tee private.key | wg pubkey > public.key help Shows usage message. CONFIGURATION FILE FORMAT top The configuration file format is based on INI. There are two top level sections -- Interface and Peer. Multiple Peer sections may be specified, but only one Interface section may be specified. The Interface section may contain the following fields: PrivateKey a base64 private key generated by wg genkey. Required. ListenPort a 16-bit port for listening. Optional; if not specified, chosen randomly. FwMark a 32-bit fwmark for outgoing packets. If set to 0 or "off", this option is disabled. May be specified in hexadecimal by prepending "0x". Optional. The Peer sections may contain the following fields: PublicKey a base64 public key calculated by wg pubkey from a private key, and usually transmitted out of band to the author of the configuration file. Required. PresharedKey a base64 preshared key generated by wg genpsk. Optional, and may be omitted. This option adds an additional layer of symmetric-key cryptography to be mixed into the already existing public-key cryptography, for post-quantum resistance. AllowedIPs a comma-separated list of IP (v4 or v6) addresses with CIDR masks from which incoming traffic for this peer is allowed and to which outgoing traffic for this peer is directed. The catch-all 0.0.0.0/0 may be specified for matching all IPv4 addresses, and ::/0 may be specified for matching all IPv6 addresses. May be specified multiple times. Endpoint an endpoint IP or hostname, followed by a colon, and then a port number. This endpoint will be updated automatically to the most recent source IP address and port of correctly authenticated packets from the peer. Optional. PersistentKeepalive a seconds interval, between 1 and 65535 inclusive, of how often to send an authenticated empty packet to the peer for the purpose of keeping a stateful firewall or NAT mapping valid persistently. For example, if the interface very rarely sends traffic, but it might at anytime receive traffic from a peer, and it is behind NAT, the interface might benefit from having a persistent keepalive interval of 25 seconds. If set to 0 or "off", this option is disabled. By default or when unspecified, this option is off. Most users will not need this. Optional. CONFIGURATION FILE FORMAT EXAMPLE top This example may be used as a model for writing configuration files, following an INI-like syntax. Characters after and including a '#' are considered comments and are thus ignored. [Interface] PrivateKey = yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk= ListenPort = 51820 [Peer] PublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg= Endpoint = 192.95.5.67:1234 AllowedIPs = 10.192.122.3/32, 10.192.124.1/24 [Peer] PublicKey = TrMvSoP4jYQlY6RIzBgbssQqY3vxI2Pi+y71lOWWXX0= Endpoint = [2607:5300:60:6b0::c05f:543]:2468 AllowedIPs = 10.192.122.4/32, 192.168.0.0/16 [Peer] PublicKey = gN65BkIKy1eCE9pP1wdc8ROUtkHLF2PfAqYdyYBz6EA= Endpoint = test.wireguard.com:18981 AllowedIPs = 10.10.10.230/32 DEBUGGING INFORMATION top Sometimes it is useful to have information on the current runtime state of a tunnel. When using the Linux kernel module on a kernel that supports dynamic debugging, debugging information can be written into dmesg(1) by running as root: # modprobe wireguard && echo module wireguard +p > /sys/kernel/debug/dynamic_debug/control On OpenBSD and FreeBSD, debugging information can be written into dmesg(1) on a per-interface basis by using ifconfig(1): # ifconfig wg0 debug On userspace implementations, it is customary to set the LOG_LEVEL environment variable to verbose. ENVIRONMENT VARIABLES top WG_COLOR_MODE If set to always, always print ANSI colorized output. If set to never, never print ANSI colorized output. If set to auto, something invalid, or unset, then print ANSI colorized output only when writing to a TTY. WG_HIDE_KEYS If set to never, then the pretty-printing show sub-command will show private and preshared keys in the output. If set to always, something invalid, or unset, then private and preshared keys will be printed as "(hidden)". WG_ENDPOINT_RESOLUTION_RETRIES If set to an integer or to infinity, DNS resolution for each peer's endpoint will be retried that many times for non-permanent errors, with an increasing delay between retries. If unset, the default is 15 retries. SEE ALSO top wg-quick(8), ip(8), ip-link(8), ip-address(8), ip-route(8). AUTHOR top wg was written by Jason A. Donenfeld [email protected]. For updates and more information, a project page is available on the World Wide Web https://www.wireguard.com/. COLOPHON top This page is part of the wireguard-tools (WireGuard Tools) project. Information about the project can be found at https://www.wireguard.com/. If you have a bug report for this manual page, see https://lists.zx2c4.com/mailman/listinfo/wireguard. This page was obtained from the project's upstream Git repository https://git.zx2c4.com/wireguard-tools/ on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-08-04.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] ZX2C4 2015 August 13 WG(8) Pages that refer to this page: systemd.netdev(5), wg-quick(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# wg\n\n> Manage the configuration of WireGuard interfaces.\n> More information: <https://www.wireguard.com/quickstart/>.\n\n- Check status of currently active interfaces:\n\n`sudo wg`\n\n- Generate a new private key:\n\n`wg genkey`\n\n- Generate a public key from a private key:\n\n`wg pubkey < {{path/to/private_key}} > {{path/to/public_key}}`\n\n- Generate a public and private key:\n\n`wg genkey | tee {{path/to/private_key}} | wg pubkey > {{path/to/public_key}}`\n\n- Show the current configuration of a wireguard interface:\n\n`sudo wg showconf {{wg0}}`\n
wg-quick
wg-quick(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training wg-quick(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | CONFIGURATION | EXAMPLES | SEE ALSO | AUTHOR | COLOPHON WG-QUICK(8) WireGuard WG-QUICK(8) NAME top wg-quick - set up a WireGuard interface simply SYNOPSIS top wg-quick [ up | down | save | strip ] [ CONFIG_FILE | INTERFACE ] DESCRIPTION top This is an extremely simple script for easily bringing up a WireGuard interface, suitable for a few common use cases. Use up to add and set up an interface, and use down to tear down and remove an interface. Running up adds a WireGuard interface, brings up the interface with the supplied IP addresses, sets up mtu and routes, and optionally runs pre/post up scripts. Running down optionally saves the current configuration, removes the WireGuard interface, and optionally runs pre/post down scripts. Running save saves the configuration of an existing interface without bringing the interface down. Use strip to output a configuration file with all wg-quick(8)-specific options removed, suitable for use with wg(8). CONFIG_FILE is a configuration file, whose filename is the interface name followed by `.conf'. Otherwise, INTERFACE is an interface name, with configuration found at `/etc/wireguard/INTERFACE.conf', searched first, followed by distro-specific search paths. Generally speaking, this utility is just a simple script that wraps invocations to wg(8) and ip(8) in order to set up a WireGuard interface. It is designed for users with simple needs, and users with more advanced needs are highly encouraged to use a more specific tool, a more complete network manager, or otherwise just use wg(8) and ip(8), as usual. CONFIGURATION top The configuration file adds a few extra configuration values to the format understood by wg(8) in order to configure additional attributes of an interface. It handles the values that it understands, and then it passes the remaining ones directly to wg(8) for further processing. It infers all routes from the list of peers' allowed IPs, and automatically adds them to the system routing table. If one of those routes is the default route (0.0.0.0/0 or ::/0), then it uses ip-rule(8) to handle overriding of the default gateway. The configuration file will be passed directly to wg(8)'s `setconf' sub-command, with the exception of the following additions to the Interface section, which are handled by this tool: Address a comma-separated list of IP (v4 or v6) addresses (optionally with CIDR masks) to be assigned to the interface. May be specified multiple times. DNS a comma-separated list of IP (v4 or v6) addresses to be set as the interface's DNS servers, or non-IP hostnames to be set as the interface's DNS search domains. May be specified multiple times. Upon bringing the interface up, this runs `resolvconf -a tun.INTERFACE -m 0 -x` and upon bringing it down, this runs `resolvconf -d tun.INTERFACE`. If these particular invocations of resolvconf(8) are undesirable, the PostUp and PostDown keys below may be used instead. MTU if not specified, the MTU is automatically determined from the endpoint addresses or the system default route, which is usually a sane choice. However, to manually specify an MTU to override this automatic discovery, this value may be specified explicitly. Table Controls the routing table to which routes are added. There are two special values: `off' disables the creation of routes altogether, and `auto' (the default) adds routes to the default table and enables special handling of default routes. PreUp, PostUp, PreDown, PostDown script snippets which will be executed by bash(1) before/after setting up/tearing down the interface, most commonly used to configure custom DNS options or firewall rules. The special string `%i' is expanded to INTERFACE. Each one may be specified multiple times, in which case the commands are executed in order. SaveConfig if set to `true', the configuration is saved from the current state of the interface upon shutdown. Any changes made to the configuration file before the interface is removed will therefore be overwritten. Recommended INTERFACE names include `wg0' or `wgvpn0' or even `wgmgmtlan0'. However, the number at the end is in fact optional, and really any free-form string [a-zA-Z0-9_=+.-]{1,15} will work. So even interface names corresponding to geographic locations would suffice, such as `cincinnati', `nyc', or `paris', if that's somehow desirable. EXAMPLES top These examples draw on the same syntax found for wg(8), and a more complete description may be found there. Bold lines below are for options that extend wg(8). The following might be used for connecting as a client to a VPN gateway for tunneling all traffic: [Interface] Address = 10.200.100.8/24 DNS = 10.200.100.1 PrivateKey = oK56DE9Ue9zK76rAc8pBl6opph+1v36lm7cXXsQKrQM= [Peer] PublicKey = GtL7fZc/bLnqZldpVofMCD6hDjrK28SsdLxevJ+qtKU= PresharedKey = /UwcSPg38hW/D9Y3tcS1FOV0K1wuURMbS0sesJEP5ak= AllowedIPs = 0.0.0.0/0 Endpoint = demo.wireguard.com:51820 The `Address` field is added here in order to set up the address for the interface. The `DNS` field indicates that a DNS server for the interface should be configured via resolvconf(8). The peer's allowed IPs entry implies that this interface should be configured as the default gateway, which this script does. Building on the last example, one might attempt the so-called ``kill-switch'', in order to prevent the flow of unencrypted packets through the non-WireGuard interfaces, by adding the following two lines `PostUp` and `PreDown` lines to the `[Interface]` section: PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT PreDown = iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL -j REJECT The `PostUp' and `PreDown' fields have been added to specify an iptables(8) command which, when used with interfaces that have a peer that specifies 0.0.0.0/0 as part of the `AllowedIPs', works together with wg-quick's fwmark usage in order to drop all packets that are either not coming out of the tunnel encrypted or not going through the tunnel itself. (Note that this continues to allow most DHCP traffic through, since most DHCP clients make use of PF_PACKET sockets, which bypass Netfilter.) When IPv6 is in use, additional similar lines could be added using ip6tables(8). Or, perhaps it is desirable to store private keys in encrypted form, such as through use of pass(1): PreUp = wg set %i private-key <(pass WireGuard/private- keys/%i) For use on a server, the following is a more complicated example involving multiple peers: [Interface] Address = 10.192.122.1/24 Address = 10.10.0.1/16 SaveConfig = true PrivateKey = yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk= ListenPort = 51820 [Peer] PublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg= AllowedIPs = 10.192.122.3/32, 10.192.124.1/24 [Peer] PublicKey = TrMvSoP4jYQlY6RIzBgbssQqY3vxI2Pi+y71lOWWXX0= AllowedIPs = 10.192.122.4/32, 192.168.0.0/16 [Peer] PublicKey = gN65BkIKy1eCE9pP1wdc8ROUtkHLF2PfAqYdyYBz6EA= AllowedIPs = 10.10.10.230/32 Notice the two `Address' lines at the top, and that `SaveConfig' is set to `true', indicating that the configuration file should be saved on shutdown using the current status of the interface. A combination of the `Table', `PostUp', and `PreDown' fields may be used for policy routing as well. For example, the following may be used to send SSH traffic (TCP port 22) traffic through the tunnel: [Interface] Address = 10.192.122.1/24 PrivateKey = yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk= ListenPort = 51820 Table = 1234 PostUp = ip rule add ipproto tcp dport 22 table 1234 PreDown = ip rule delete ipproto tcp dport 22 table 1234 [Peer] PublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg= AllowedIPs = 0.0.0.0/0 These configuration files may be placed in any directory, putting the desired interface name in the filename: # wg-quick up /path/to/wgnet0.conf For convenience, if only an interface name is supplied, it automatically chooses a path in `/etc/wireguard/': # wg-quick up wgnet0 This will load the configuration file `/etc/wireguard/wgnet0.conf'. The strip command is useful for reloading configuration files without disrupting active sessions: # wg syncconf wgnet0 <(wg-quick strip wgnet0) SEE ALSO top wg(8), ip(8), ip-link(8), ip-address(8), ip-route(8), ip-rule(8), resolvconf(8). AUTHOR top wg-quick was written by Jason A. Donenfeld [email protected]. For updates and more information, a project page is available on the World Wide Web https://www.wireguard.com/. COLOPHON top This page is part of the wireguard-tools (WireGuard Tools) project. Information about the project can be found at https://www.wireguard.com/. If you have a bug report for this manual page, see https://lists.zx2c4.com/mailman/listinfo/wireguard. This page was obtained from the project's upstream Git repository https://git.zx2c4.com/wireguard-tools/ on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-08-04.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] ZX2C4 2016 January 1 WG-QUICK(8) Pages that refer to this page: wg(8), wg-quick(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# wg-quick\n\n> Quickly set up WireGuard tunnels based on config files.\n> More information: <https://www.wireguard.com/quickstart/>.\n\n- Set up a VPN tunnel:\n\n`wg-quick up {{interface_name}}`\n\n- Delete a VPN tunnel:\n\n`wg-quick down {{interface_name}}`\n
wget
wget(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training wget(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | ENVIRONMENT | EXIT STATUS | FILES | BUGS | SEE ALSO | AUTHOR | COPYRIGHT | COLOPHON WGET(1) GNU Wget WGET(1) NAME top Wget - The non-interactive network downloader. SYNOPSIS top wget [option]... [URL]... DESCRIPTION top GNU Wget is a free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies. Wget is non-interactive, meaning that it can work in the background, while the user is not logged on. This allows you to start a retrieval and disconnect from the system, letting Wget finish the work. By contrast, most of the Web browsers require constant user's presence, which can be a great hindrance when transferring a lot of data. Wget can follow links in HTML, XHTML, and CSS pages, to create local versions of remote web sites, fully recreating the directory structure of the original site. This is sometimes referred to as "recursive downloading." While doing that, Wget respects the Robot Exclusion Standard (/robots.txt). Wget can be instructed to convert the links in downloaded files to point at the local files, for offline viewing. Wget has been designed for robustness over slow or unstable network connections; if a download fails due to a network problem, it will keep retrying until the whole file has been retrieved. If the server supports regetting, it will instruct the server to continue the download from where it left off. OPTIONS top Option Syntax Since Wget uses GNU getopt to process command-line arguments, every option has a long form along with the short one. Long options are more convenient to remember, but take time to type. You may freely mix different option styles, or specify options after the command-line arguments. Thus you may write: wget -r --tries=10 http://fly.srk.fer.hr/ -o log The space between the option accepting an argument and the argument may be omitted. Instead of -o log you can write -olog. You may put several options that do not require arguments together, like: wget -drc <URL> This is completely equivalent to: wget -d -r -c <URL> Since the options can be specified after the arguments, you may terminate them with --. So the following will try to download URL -x, reporting failure to log: wget -o log -- -x The options that accept comma-separated lists all respect the convention that specifying an empty list clears its value. This can be useful to clear the .wgetrc settings. For instance, if your .wgetrc sets "exclude_directories" to /cgi-bin, the following example will first reset it, and then set it to exclude /~nobody and /~somebody. You can also clear the lists in .wgetrc. wget -X "" -X /~nobody,/~somebody Most options that do not accept arguments are boolean options, so named because their state can be captured with a yes-or-no ("boolean") variable. For example, --follow-ftp tells Wget to follow FTP links from HTML files and, on the other hand, --no-glob tells it not to perform file globbing on FTP URLs. A boolean option is either affirmative or negative (beginning with --no). All such options share several properties. Unless stated otherwise, it is assumed that the default behavior is the opposite of what the option accomplishes. For example, the documented existence of --follow-ftp assumes that the default is to not follow FTP links from HTML pages. Affirmative options can be negated by prepending the --no- to the option name; negative options can be negated by omitting the --no- prefix. This might seem superfluous---if the default for an affirmative option is to not do something, then why provide a way to explicitly turn it off? But the startup file may in fact change the default. For instance, using "follow_ftp = on" in .wgetrc makes Wget follow FTP links by default, and using --no-follow-ftp is the only way to restore the factory default from the command line. Basic Startup Options -V --version Display the version of Wget. -h --help Print a help message describing all of Wget's command-line options. -b --background Go to background immediately after startup. If no output file is specified via the -o, output is redirected to wget- log. -e command --execute command Execute command as if it were a part of .wgetrc. A command thus invoked will be executed after the commands in .wgetrc, thus taking precedence over them. If you need to specify more than one wgetrc command, use multiple instances of -e. Logging and Input File Options -o logfile --output-file=logfile Log all messages to logfile. The messages are normally reported to standard error. -a logfile --append-output=logfile Append to logfile. This is the same as -o, only it appends to logfile instead of overwriting the old log file. If logfile does not exist, a new file is created. -d --debug Turn on debug output, meaning various information important to the developers of Wget if it does not work properly. Your system administrator may have chosen to compile Wget without debug support, in which case -d will not work. Please note that compiling with debug support is always safe---Wget compiled with the debug support will not print any debug info unless requested with -d. -q --quiet Turn off Wget's output. -v --verbose Turn on verbose output, with all the available data. The default output is verbose. -nv --no-verbose Turn off verbose without being completely quiet (use -q for that), which means that error messages and basic information still get printed. --report-speed=type Output bandwidth as type. The only accepted value is bits. -i file --input-file=file Read URLs from a local or external file. If - is specified as file, URLs are read from the standard input. (Use ./- to read from a file literally named -.) If this function is used, no URLs need be present on the command line. If there are URLs both on the command line and in an input file, those on the command lines will be the first ones to be retrieved. If --force-html is not specified, then file should consist of a series of URLs, one per line. However, if you specify --force-html, the document will be regarded as html. In that case you may have problems with relative links, which you can solve either by adding "<base href="url">" to the documents or by specifying --base=url on the command line. If the file is an external one, the document will be automatically treated as html if the Content-Type matches text/html. Furthermore, the file's location will be implicitly used as base href if none was specified. --input-metalink=file Downloads files covered in local Metalink file. Metalink version 3 and 4 are supported. --keep-badhash Keeps downloaded Metalink's files with a bad hash. It appends .badhash to the name of Metalink's files which have a checksum mismatch, except without overwriting existing files. --metalink-over-http Issues HTTP HEAD request instead of GET and extracts Metalink metadata from response headers. Then it switches to Metalink download. If no valid Metalink metadata is found, it falls back to ordinary HTTP download. Enables Content-Type: application/metalink4+xml files download/processing. --metalink-index=number Set the Metalink application/metalink4+xml metaurl ordinal NUMBER. From 1 to the total number of "application/metalink4+xml" available. Specify 0 or inf to choose the first good one. Metaurls, such as those from a --metalink-over-http, may have been sorted by priority key's value; keep this in mind to choose the right NUMBER. --preferred-location Set preferred location for Metalink resources. This has effect if multiple resources with same priority are available. --xattr Enable use of file system's extended attributes to save the original URL and the Referer HTTP header value if used. Be aware that the URL might contain private information like access tokens or credentials. -F --force-html When input is read from a file, force it to be treated as an HTML file. This enables you to retrieve relative links from existing HTML files on your local disk, by adding "<base href="url">" to HTML, or using the --base command-line option. -B URL --base=URL Resolves relative links using URL as the point of reference, when reading links from an HTML file specified via the -i/--input-file option (together with --force-html, or when the input file was fetched remotely from a server describing it as HTML). This is equivalent to the presence of a "BASE" tag in the HTML input file, with URL as the value for the "href" attribute. For instance, if you specify http://foo/bar/a.html for URL, and Wget reads ../baz/b.html from the input file, it would be resolved to http://foo/baz/b.html . --config=FILE Specify the location of a startup file you wish to use instead of the default one(s). Use --no-config to disable reading of config files. If both --config and --no-config are given, --no-config is ignored. --rejected-log=logfile Logs all URL rejections to logfile as comma separated values. The values include the reason of rejection, the URL and the parent URL it was found in. Download Options --bind-address=ADDRESS When making client TCP/IP connections, bind to ADDRESS on the local machine. ADDRESS may be specified as a hostname or IP address. This option can be useful if your machine is bound to multiple IPs. --bind-dns-address=ADDRESS [libcares only] This address overrides the route for DNS requests. If you ever need to circumvent the standard settings from /etc/resolv.conf, this option together with --dns-servers is your friend. ADDRESS must be specified either as IPv4 or IPv6 address. Wget needs to be built with libcares for this option to be available. --dns-servers=ADDRESSES [libcares only] The given address(es) override the standard nameserver addresses, e.g. as configured in /etc/resolv.conf. ADDRESSES may be specified either as IPv4 or IPv6 addresses, comma-separated. Wget needs to be built with libcares for this option to be available. -t number --tries=number Set number of tries to number. Specify 0 or inf for infinite retrying. The default is to retry 20 times, with the exception of fatal errors like "connection refused" or "not found" (404), which are not retried. -O file --output-document=file The documents will not be written to the appropriate files, but all will be concatenated together and written to file. If - is used as file, documents will be printed to standard output, disabling link conversion. (Use ./- to print to a file literally named -.) Use of -O is not intended to mean simply "use the name file instead of the one in the URL;" rather, it is analogous to shell redirection: wget -O file http://foo is intended to work like wget -O - http://foo > file; file will be truncated immediately, and all downloaded content will be written there. For this reason, -N (for timestamp-checking) is not supported in combination with -O: since file is always newly created, it will always have a very new timestamp. A warning will be issued if this combination is used. Similarly, using -r or -p with -O may not work as you expect: Wget won't just download the first file to file and then download the rest to their normal names: all downloaded content will be placed in file. This was disabled in version 1.11, but has been reinstated (with a warning) in 1.11.2, as there are some cases where this behavior can actually have some use. A combination with -nc is only accepted if the given output file does not exist. Note that a combination with -k is only permitted when downloading a single document, as in that case it will just convert all relative URIs to external ones; -k makes no sense for multiple URIs when they're all being downloaded to a single file; -k can be used only when the output is a regular file. -nc --no-clobber If a file is downloaded more than once in the same directory, Wget's behavior depends on a few options, including -nc. In certain cases, the local file will be clobbered, or overwritten, upon repeated download. In other cases it will be preserved. When running Wget without -N, -nc, -r, or -p, downloading the same file in the same directory will result in the original copy of file being preserved and the second copy being named file.1. If that file is downloaded yet again, the third copy will be named file.2, and so on. (This is also the behavior with -nd, even if -r or -p are in effect.) When -nc is specified, this behavior is suppressed, and Wget will refuse to download newer copies of file. Therefore, ""no-clobber"" is actually a misnomer in this mode---it's not clobbering that's prevented (as the numeric suffixes were already preventing clobbering), but rather the multiple version saving that's prevented. When running Wget with -r or -p, but without -N, -nd, or -nc, re-downloading a file will result in the new copy simply overwriting the old. Adding -nc will prevent this behavior, instead causing the original version to be preserved and any newer copies on the server to be ignored. When running Wget with -N, with or without -r or -p, the decision as to whether or not to download a newer copy of a file depends on the local and remote timestamp and size of the file. -nc may not be specified at the same time as -N. A combination with -O/--output-document is only accepted if the given output file does not exist. Note that when -nc is specified, files with the suffixes .html or .htm will be loaded from the local disk and parsed as if they had been retrieved from the Web. --backups=backups Before (over)writing a file, back up an existing file by adding a .1 suffix (_1 on VMS) to the file name. Such backup files are rotated to .2, .3, and so on, up to backups (and lost beyond that). --no-netrc Do not try to obtain credentials from .netrc file. By default .netrc file is searched for credentials in case none have been passed on command line and authentication is required. -c --continue Continue getting a partially-downloaded file. This is useful when you want to finish up a download started by a previous instance of Wget, or by another program. For instance: wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z If there is a file named ls-lR.Z in the current directory, Wget will assume that it is the first portion of the remote file, and will ask the server to continue the retrieval from an offset equal to the length of the local file. Note that you don't need to specify this option if you just want the current invocation of Wget to retry downloading a file should the connection be lost midway through. This is the default behavior. -c only affects resumption of downloads started prior to this invocation of Wget, and whose local files are still sitting around. Without -c, the previous example would just download the remote file to ls-lR.Z.1, leaving the truncated ls-lR.Z file alone. If you use -c on a non-empty file, and the server does not support continued downloading, Wget will restart the download from scratch and overwrite the existing file entirely. Beginning with Wget 1.7, if you use -c on a file which is of equal size as the one on the server, Wget will refuse to download the file and print an explanatory message. The same happens when the file is smaller on the server than locally (presumably because it was changed on the server since your last download attempt)---because "continuing" is not meaningful, no download occurs. On the other side of the coin, while using -c, any file that's bigger on the server than locally will be considered an incomplete download and only "(length(remote) - length(local))" bytes will be downloaded and tacked onto the end of the local file. This behavior can be desirable in certain cases---for instance, you can use wget -c to download just the new portion that's been appended to a data collection or log file. However, if the file is bigger on the server because it's been changed, as opposed to just appended to, you'll end up with a garbled file. Wget has no way of verifying that the local file is really a valid prefix of the remote file. You need to be especially careful of this when using -c in conjunction with -r, since every file will be considered as an "incomplete download" candidate. Another instance where you'll get a garbled file if you try to use -c is if you have a lame HTTP proxy that inserts a "transfer interrupted" string into the local file. In the future a "rollback" option may be added to deal with this case. Note that -c only works with FTP servers and with HTTP servers that support the "Range" header. --start-pos=OFFSET Start downloading at zero-based position OFFSET. Offset may be expressed in bytes, kilobytes with the `k' suffix, or megabytes with the `m' suffix, etc. --start-pos has higher precedence over --continue. When --start-pos and --continue are both specified, wget will emit a warning then proceed as if --continue was absent. Server support for continued download is required, otherwise --start-pos cannot help. See -c for details. --progress=type Select the type of the progress indicator you wish to use. Legal indicators are "dot" and "bar". The "bar" indicator is used by default. It draws an ASCII progress bar graphics (a.k.a "thermometer" display) indicating the status of retrieval. If the output is not a TTY, the "dot" bar will be used by default. Use --progress=dot to switch to the "dot" display. It traces the retrieval by printing dots on the screen, each dot representing a fixed amount of downloaded data. The progress type can also take one or more parameters. The parameters vary based on the type selected. Parameters to type are passed by appending them to the type sperated by a colon (:) like this: --progress=type:parameter1:parameter2. When using the dotted retrieval, you may set the style by specifying the type as dot:style. Different styles assign different meaning to one dot. With the "default" style each dot represents 1K, there are ten dots in a cluster and 50 dots in a line. The "binary" style has a more "computer"-like orientation---8K dots, 16-dots clusters and 48 dots per line (which makes for 384K lines). The "mega" style is suitable for downloading large files---each dot represents 64K retrieved, there are eight dots in a cluster, and 48 dots on each line (so each line contains 3M). If "mega" is not enough then you can use the "giga" style---each dot represents 1M retrieved, there are eight dots in a cluster, and 32 dots on each line (so each line contains 32M). With --progress=bar, there are currently two possible parameters, force and noscroll. When the output is not a TTY, the progress bar always falls back to "dot", even if --progress=bar was passed to Wget during invocation. This behaviour can be overridden and the "bar" output forced by using the "force" parameter as --progress=bar:force. By default, the bar style progress bar scroll the name of the file from left to right for the file being downloaded if the filename exceeds the maximum length allotted for its display. In certain cases, such as with --progress=bar:force, one may not want the scrolling filename in the progress bar. By passing the "noscroll" parameter, Wget can be forced to display as much of the filename as possible without scrolling through it. Note that you can set the default style using the "progress" command in .wgetrc. That setting may be overridden from the command line. For example, to force the bar output without scrolling, use --progress=bar:force:noscroll. --show-progress Force wget to display the progress bar in any verbosity. By default, wget only displays the progress bar in verbose mode. One may however, want wget to display the progress bar on screen in conjunction with any other verbosity modes like --no-verbose or --quiet. This is often a desired a property when invoking wget to download several small/large files. In such a case, wget could simply be invoked with this parameter to get a much cleaner output on the screen. This option will also force the progress bar to be printed to stderr when used alongside the --output-file option. -N --timestamping Turn on time-stamping. --no-if-modified-since Do not send If-Modified-Since header in -N mode. Send preliminary HEAD request instead. This has only effect in -N mode. --no-use-server-timestamps Don't set the local file's timestamp by the one on the server. By default, when a file is downloaded, its timestamps are set to match those from the remote file. This allows the use of --timestamping on subsequent invocations of wget. However, it is sometimes useful to base the local file's timestamp on when it was actually downloaded; for that purpose, the --no-use-server-timestamps option has been provided. -S --server-response Print the headers sent by HTTP servers and responses sent by FTP servers. --spider When invoked with this option, Wget will behave as a Web spider, which means that it will not download the pages, just check that they are there. For example, you can use Wget to check your bookmarks: wget --spider --force-html -i bookmarks.html This feature needs much more work for Wget to get close to the functionality of real web spiders. -T seconds --timeout=seconds Set the network timeout to seconds seconds. This is equivalent to specifying --dns-timeout, --connect-timeout, and --read-timeout, all at the same time. When interacting with the network, Wget can check for timeout and abort the operation if it takes too long. This prevents anomalies like hanging reads and infinite connects. The only timeout enabled by default is a 900-second read timeout. Setting a timeout to 0 disables it altogether. Unless you know what you are doing, it is best not to change the default timeout settings. All timeout-related options accept decimal values, as well as subsecond values. For example, 0.1 seconds is a legal (though unwise) choice of timeout. Subsecond timeouts are useful for checking server response times or for testing network latency. --dns-timeout=seconds Set the DNS lookup timeout to seconds seconds. DNS lookups that don't complete within the specified time will fail. By default, there is no timeout on DNS lookups, other than that implemented by system libraries. --connect-timeout=seconds Set the connect timeout to seconds seconds. TCP connections that take longer to establish will be aborted. By default, there is no connect timeout, other than that implemented by system libraries. --read-timeout=seconds Set the read (and write) timeout to seconds seconds. The "time" of this timeout refers to idle time: if, at any point in the download, no data is received for more than the specified number of seconds, reading fails and the download is restarted. This option does not directly affect the duration of the entire download. Of course, the remote server may choose to terminate the connection sooner than this option requires. The default read timeout is 900 seconds. --limit-rate=amount Limit the download speed to amount bytes per second. Amount may be expressed in bytes, kilobytes with the k suffix, or megabytes with the m suffix. For example, --limit-rate=20k will limit the retrieval rate to 20KB/s. This is useful when, for whatever reason, you don't want Wget to consume the entire available bandwidth. This option allows the use of decimal numbers, usually in conjunction with power suffixes; for example, --limit-rate=2.5k is a legal value. Note that Wget implements the limiting by sleeping the appropriate amount of time after a network read that took less time than specified by the rate. Eventually this strategy causes the TCP transfer to slow down to approximately the specified rate. However, it may take some time for this balance to be achieved, so don't be surprised if limiting the rate doesn't work well with very small files. -w seconds --wait=seconds Wait the specified number of seconds between the retrievals. Use of this option is recommended, as it lightens the server load by making the requests less frequent. Instead of in seconds, the time can be specified in minutes using the "m" suffix, in hours using "h" suffix, or in days using "d" suffix. Specifying a large value for this option is useful if the network or the destination host is down, so that Wget can wait long enough to reasonably expect the network error to be fixed before the retry. The waiting interval specified by this function is influenced by "--random-wait", which see. --waitretry=seconds If you don't want Wget to wait between every retrieval, but only between retries of failed downloads, you can use this option. Wget will use linear backoff, waiting 1 second after the first failure on a given file, then waiting 2 seconds after the second failure on that file, up to the maximum number of seconds you specify. By default, Wget will assume a value of 10 seconds. --random-wait Some web sites may perform log analysis to identify retrieval programs such as Wget by looking for statistically significant similarities in the time between requests. This option causes the time between requests to vary between 0.5 and 1.5 * wait seconds, where wait was specified using the --wait option, in order to mask Wget's presence from such analysis. A 2001 article in a publication devoted to development on a popular consumer platform provided code to perform this analysis on the fly. Its author suggested blocking at the class C address level to ensure automated retrieval programs were blocked despite changing DHCP-supplied addresses. The --random-wait option was inspired by this ill-advised recommendation to block many unrelated users from a web site due to the actions of one. --no-proxy Don't use proxies, even if the appropriate *_proxy environment variable is defined. -Q quota --quota=quota Specify download quota for automatic retrievals. The value can be specified in bytes (default), kilobytes (with k suffix), or megabytes (with m suffix). Note that quota will never affect downloading a single file. So if you specify wget -Q10k https://example.com/ls-lR.gz, all of the ls-lR.gz will be downloaded. The same goes even when several URLs are specified on the command-line. The quota is checked only at the end of each downloaded file, so it will never result in a partially downloaded file. Thus you may safely type wget -Q2m -i sites---download will be aborted after the file that exhausts the quota is completely downloaded. Setting quota to 0 or to inf unlimits the download quota. --no-dns-cache Turn off caching of DNS lookups. Normally, Wget remembers the IP addresses it looked up from DNS so it doesn't have to repeatedly contact the DNS server for the same (typically small) set of hosts it retrieves from. This cache exists in memory only; a new Wget run will contact DNS again. However, it has been reported that in some situations it is not desirable to cache host names, even for the duration of a short-running application like Wget. With this option Wget issues a new DNS lookup (more precisely, a new call to "gethostbyname" or "getaddrinfo") each time it makes a new connection. Please note that this option will not affect caching that might be performed by the resolving library or by an external caching layer, such as NSCD. If you don't understand exactly what this option does, you probably won't need it. --restrict-file-names=modes Change which characters found in remote URLs must be escaped during generation of local filenames. Characters that are restricted by this option are escaped, i.e. replaced with %HH, where HH is the hexadecimal number that corresponds to the restricted character. This option may also be used to force all alphabetical cases to be either lower- or uppercase. By default, Wget escapes the characters that are not valid or safe as part of file names on your operating system, as well as control characters that are typically unprintable. This option is useful for changing these defaults, perhaps because you are downloading to a non-native partition, or because you want to disable escaping of the control characters, or you want to further restrict characters to only those in the ASCII range of values. The modes are a comma-separated set of text values. The acceptable values are unix, windows, nocontrol, ascii, lowercase, and uppercase. The values unix and windows are mutually exclusive (one will override the other), as are lowercase and uppercase. Those last are special cases, as they do not change the set of characters that would be escaped, but rather force local file paths to be converted either to lower- or uppercase. When "unix" is specified, Wget escapes the character / and the control characters in the ranges 0--31 and 128--159. This is the default on Unix-like operating systems. When "windows" is given, Wget escapes the characters \, |, /, :, ?, ", *, <, >, and the control characters in the ranges 0--31 and 128--159. In addition to this, Wget in Windows mode uses + instead of : to separate host and port in local file names, and uses @ instead of ? to separate the query portion of the file name from the rest. Therefore, a URL that would be saved as www.xemacs.org:4300/search.pl?input=blah in Unix mode would be saved as www.xemacs.org+4300/search.pl@input=blah in Windows mode. This mode is the default on Windows. If you specify nocontrol, then the escaping of the control characters is also switched off. This option may make sense when you are downloading URLs whose names contain UTF-8 characters, on a system which can save and display filenames in UTF-8 (some possible byte values used in UTF-8 byte sequences fall in the range of values designated by Wget as "controls"). The ascii mode is used to specify that any bytes whose values are outside the range of ASCII characters (that is, greater than 127) shall be escaped. This can be useful when saving filenames whose encoding does not match the one used locally. -4 --inet4-only -6 --inet6-only Force connecting to IPv4 or IPv6 addresses. With --inet4-only or -4, Wget will only connect to IPv4 hosts, ignoring AAAA records in DNS, and refusing to connect to IPv6 addresses specified in URLs. Conversely, with --inet6-only or -6, Wget will only connect to IPv6 hosts and ignore A records and IPv4 addresses. Neither options should be needed normally. By default, an IPv6-aware Wget will use the address family specified by the host's DNS record. If the DNS responds with both IPv4 and IPv6 addresses, Wget will try them in sequence until it finds one it can connect to. (Also see "--prefer-family" option described below.) These options can be used to deliberately force the use of IPv4 or IPv6 address families on dual family systems, usually to aid debugging or to deal with broken network configuration. Only one of --inet6-only and --inet4-only may be specified at the same time. Neither option is available in Wget compiled without IPv6 support. --prefer-family=none/IPv4/IPv6 When given a choice of several addresses, connect to the addresses with specified address family first. The address order returned by DNS is used without change by default. This avoids spurious errors and connect attempts when accessing hosts that resolve to both IPv6 and IPv4 addresses from IPv4 networks. For example, www.kame.net resolves to 2001:200:0:8002:203:47ff:fea5:3085 and to 203.178.141.194. When the preferred family is "IPv4", the IPv4 address is used first; when the preferred family is "IPv6", the IPv6 address is used first; if the specified value is "none", the address order returned by DNS is used without change. Unlike -4 and -6, this option doesn't inhibit access to any address family, it only changes the order in which the addresses are accessed. Also note that the reordering performed by this option is stable---it doesn't affect order of addresses of the same family. That is, the relative order of all IPv4 addresses and of all IPv6 addresses remains intact in all cases. --retry-connrefused Consider "connection refused" a transient error and try again. Normally Wget gives up on a URL when it is unable to connect to the site because failure to connect is taken as a sign that the server is not running at all and that retries would not help. This option is for mirroring unreliable sites whose servers tend to disappear for short periods of time. --user=user --password=password Specify the username user and password password for both FTP and HTTP file retrieval. These parameters can be overridden using the --ftp-user and --ftp-password options for FTP connections and the --http-user and --http-password options for HTTP connections. --ask-password Prompt for a password for each connection established. Cannot be specified when --password is being used, because they are mutually exclusive. --use-askpass=command Prompt for a user and password using the specified command. If no command is specified then the command in the environment variable WGET_ASKPASS is used. If WGET_ASKPASS is not set then the command in the environment variable SSH_ASKPASS is used. You can set the default command for use-askpass in the .wgetrc. That setting may be overridden from the command line. --no-iri Turn off internationalized URI (IRI) support. Use --iri to turn it on. IRI support is activated by default. You can set the default state of IRI support using the "iri" command in .wgetrc. That setting may be overridden from the command line. --local-encoding=encoding Force Wget to use encoding as the default system encoding. That affects how Wget converts URLs specified as arguments from locale to UTF-8 for IRI support. Wget use the function nl_langinfo() and then the "CHARSET" environment variable to get the locale. If it fails, ASCII is used. You can set the default local encoding using the "local_encoding" command in .wgetrc. That setting may be overridden from the command line. --remote-encoding=encoding Force Wget to use encoding as the default remote server encoding. That affects how Wget converts URIs found in files from remote encoding to UTF-8 during a recursive fetch. This options is only useful for IRI support, for the interpretation of non-ASCII characters. For HTTP, remote encoding can be found in HTTP "Content-Type" header and in HTML "Content-Type http-equiv" meta tag. You can set the default encoding using the "remoteencoding" command in .wgetrc. That setting may be overridden from the command line. --unlink Force Wget to unlink file instead of clobbering existing file. This option is useful for downloading to the directory with hardlinks. Directory Options -nd --no-directories Do not create a hierarchy of directories when retrieving recursively. With this option turned on, all files will get saved to the current directory, without clobbering (if a name shows up more than once, the filenames will get extensions .n). -x --force-directories The opposite of -nd---create a hierarchy of directories, even if one would not have been created otherwise. E.g. wget -x http://fly.srk.fer.hr/robots.txt will save the downloaded file to fly.srk.fer.hr/robots.txt. -nH --no-host-directories Disable generation of host-prefixed directories. By default, invoking Wget with -r http://fly.srk.fer.hr/ will create a structure of directories beginning with fly.srk.fer.hr/. This option disables such behavior. --protocol-directories Use the protocol name as a directory component of local file names. For example, with this option, wget -r http://host will save to http/host/... rather than just to host/.... --cut-dirs=number Ignore number directory components. This is useful for getting a fine-grained control over the directory where recursive retrieval will be saved. Take, for example, the directory at ftp://ftp.xemacs.org/pub/xemacs/. If you retrieve it with -r, it will be saved locally under ftp.xemacs.org/pub/xemacs/. While the -nH option can remove the ftp.xemacs.org/ part, you are still stuck with pub/xemacs. This is where --cut-dirs comes in handy; it makes Wget not "see" number remote directory components. Here are several examples of how --cut-dirs option works. No options -> ftp.xemacs.org/pub/xemacs/ -nH -> pub/xemacs/ -nH --cut-dirs=1 -> xemacs/ -nH --cut-dirs=2 -> . --cut-dirs=1 -> ftp.xemacs.org/xemacs/ ... If you just want to get rid of the directory structure, this option is similar to a combination of -nd and -P. However, unlike -nd, --cut-dirs does not lose with subdirectories---for instance, with -nH --cut-dirs=1, a beta/ subdirectory will be placed to xemacs/beta, as one would expect. -P prefix --directory-prefix=prefix Set directory prefix to prefix. The directory prefix is the directory where all other files and subdirectories will be saved to, i.e. the top of the retrieval tree. The default is . (the current directory). HTTP Options --default-page=name Use name as the default file name when it isn't known (i.e., for URLs that end in a slash), instead of index.html. -E --adjust-extension If a file of type application/xhtml+xml or text/html is downloaded and the URL does not end with the regexp \.[Hh][Tt][Mm][Ll]?, this option will cause the suffix .html to be appended to the local filename. This is useful, for instance, when you're mirroring a remote site that uses .asp pages, but you want the mirrored pages to be viewable on your stock Apache server. Another good use for this is when you're downloading CGI-generated materials. A URL like http://site.com/article.cgi?25 will be saved as article.cgi?25.html. Note that filenames changed in this way will be re-downloaded every time you re-mirror a site, because Wget can't tell that the local X.html file corresponds to remote URL X (since it doesn't yet know that the URL produces output of type text/html or application/xhtml+xml. As of version 1.12, Wget will also ensure that any downloaded files of type text/css end in the suffix .css, and the option was renamed from --html-extension, to better reflect its new behavior. The old option name is still acceptable, but should now be considered deprecated. As of version 1.19.2, Wget will also ensure that any downloaded files with a "Content-Encoding" of br, compress, deflate or gzip end in the suffix .br, .Z, .zlib and .gz respectively. At some point in the future, this option may well be expanded to include suffixes for other types of content, including content types that are not parsed by Wget. --http-user=user --http-password=password Specify the username user and password password on an HTTP server. According to the type of the challenge, Wget will encode them using either the "basic" (insecure), the "digest", or the Windows "NTLM" authentication scheme. Another way to specify username and password is in the URL itself. Either method reveals your password to anyone who bothers to run "ps". To prevent the passwords from being seen, use the --use-askpass or store them in .wgetrc or .netrc, and make sure to protect those files from other users with "chmod". If the passwords are really important, do not leave them lying in those files either---edit the files and delete them after Wget has started the download. --no-http-keep-alive Turn off the "keep-alive" feature for HTTP downloads. Normally, Wget asks the server to keep the connection open so that, when you download more than one document from the same server, they get transferred over the same TCP connection. This saves time and at the same time reduces the load on the server. This option is useful when, for some reason, persistent (keep-alive) connections don't work for you, for example due to a server bug or due to the inability of server-side scripts to cope with the connections. --no-cache Disable server-side cache. In this case, Wget will send the remote server appropriate directives (Cache-Control: no-cache and Pragma: no-cache) to get the file from the remote service, rather than returning the cached version. This is especially useful for retrieving and flushing out-of-date documents on proxy servers. Caching is allowed by default. --no-cookies Disable the use of cookies. Cookies are a mechanism for maintaining server-side state. The server sends the client a cookie using the "Set-Cookie" header, and the client responds with the same cookie upon further requests. Since cookies allow the server owners to keep track of visitors and for sites to exchange this information, some consider them a breach of privacy. The default is to use cookies; however, storing cookies is not on by default. --load-cookies file Load cookies from file before the first HTTP retrieval. file is a textual file in the format originally used by Netscape's cookies.txt file. You will typically use this option when mirroring sites that require that you be logged in to access some or all of their content. The login process typically works by the web server issuing an HTTP cookie upon receiving and verifying your credentials. The cookie is then resent by the browser when accessing that part of the site, and so proves your identity. Mirroring such a site requires Wget to send the same cookies your browser sends when communicating with the site. This is achieved by --load-cookies---simply point Wget to the location of the cookies.txt file, and it will send the same cookies your browser would send in the same situation. Different browsers keep textual cookie files in different locations: "Netscape 4.x." The cookies are in ~/.netscape/cookies.txt. "Mozilla and Netscape 6.x." Mozilla's cookie file is also named cookies.txt, located somewhere under ~/.mozilla, in the directory of your profile. The full path usually ends up looking somewhat like ~/.mozilla/default/some-weird-string/cookies.txt. "Internet Explorer." You can produce a cookie file Wget can use by using the File menu, Import and Export, Export Cookies. This has been tested with Internet Explorer 5; it is not guaranteed to work with earlier versions. "Other browsers." If you are using a different browser to create your cookies, --load-cookies will only work if you can locate or produce a cookie file in the Netscape format that Wget expects. If you cannot use --load-cookies, there might still be an alternative. If your browser supports a "cookie manager", you can use it to view the cookies used when accessing the site you're mirroring. Write down the name and value of the cookie, and manually instruct Wget to send those cookies, bypassing the "official" cookie support: wget --no-cookies --header "Cookie: <name>=<value>" --save-cookies file Save cookies to file before exiting. This will not save cookies that have expired or that have no expiry time (so- called "session cookies"), but also see --keep-session-cookies. --keep-session-cookies When specified, causes --save-cookies to also save session cookies. Session cookies are normally not saved because they are meant to be kept in memory and forgotten when you exit the browser. Saving them is useful on sites that require you to log in or to visit the home page before you can access some pages. With this option, multiple Wget runs are considered a single browser session as far as the site is concerned. Since the cookie file format does not normally carry session cookies, Wget marks them with an expiry timestamp of 0. Wget's --load-cookies recognizes those as session cookies, but it might confuse other browsers. Also note that cookies so loaded will be treated as other session cookies, which means that if you want --save-cookies to preserve them again, you must use --keep-session-cookies again. --ignore-length Unfortunately, some HTTP servers (CGI programs, to be more precise) send out bogus "Content-Length" headers, which makes Wget go wild, as it thinks not all the document was retrieved. You can spot this syndrome if Wget retries getting the same document again and again, each time claiming that the (otherwise normal) connection has closed on the very same byte. With this option, Wget will ignore the "Content-Length" header---as if it never existed. --header=header-line Send header-line along with the rest of the headers in each HTTP request. The supplied header is sent as-is, which means it must contain name and value separated by colon, and must not contain newlines. You may define more than one additional header by specifying --header more than once. wget --header='Accept-Charset: iso-8859-2' \ --header='Accept-Language: hr' \ http://fly.srk.fer.hr/ Specification of an empty string as the header value will clear all previous user-defined headers. As of Wget 1.10, this option can be used to override headers otherwise generated automatically. This example instructs Wget to connect to localhost, but to specify foo.bar in the "Host" header: wget --header="Host: foo.bar" http://localhost/ In versions of Wget prior to 1.10 such use of --header caused sending of duplicate headers. --compression=type Choose the type of compression to be used. Legal values are auto, gzip and none. If auto or gzip are specified, Wget asks the server to compress the file using the gzip compression format. If the server compresses the file and responds with the "Content-Encoding" header field set appropriately, the file will be decompressed automatically. If none is specified, wget will not ask the server to compress the file and will not decompress any server responses. This is the default. Compression support is currently experimental. In case it is turned on, please report any bugs to "[email protected]". --max-redirect=number Specifies the maximum number of redirections to follow for a resource. The default is 20, which is usually far more than necessary. However, on those occasions where you want to allow more (or fewer), this is the option to use. --proxy-user=user --proxy-password=password Specify the username user and password password for authentication on a proxy server. Wget will encode them using the "basic" authentication scheme. Security considerations similar to those with --http-password pertain here as well. --referer=url Include `Referer: url' header in HTTP request. Useful for retrieving documents with server-side processing that assume they are always being retrieved by interactive web browsers and only come out properly when Referer is set to one of the pages that point to them. --save-headers Save the headers sent by the HTTP server to the file, preceding the actual contents, with an empty line as the separator. -U agent-string --user-agent=agent-string Identify as agent-string to the HTTP server. The HTTP protocol allows the clients to identify themselves using a "User-Agent" header field. This enables distinguishing the WWW software, usually for statistical purposes or for tracing of protocol violations. Wget normally identifies as Wget/version, version being the current version number of Wget. However, some sites have been known to impose the policy of tailoring the output according to the "User-Agent"-supplied information. While this is not such a bad idea in theory, it has been abused by servers denying information to clients other than (historically) Netscape or, more frequently, Microsoft Internet Explorer. This option allows you to change the "User-Agent" line issued by Wget. Use of this option is discouraged, unless you really know what you are doing. Specifying empty user agent with --user-agent="" instructs Wget not to send the "User-Agent" header in HTTP requests. --post-data=string --post-file=file Use POST as the method for all HTTP requests and send the specified data in the request body. --post-data sends string as data, whereas --post-file sends the contents of file. Other than that, they work in exactly the same way. In particular, they both expect content of the form "key1=value1&key2=value2", with percent-encoding for special characters; the only difference is that one expects its content as a command-line parameter and the other accepts its content from a file. In particular, --post-file is not for transmitting files as form attachments: those must appear as "key=value" data (with appropriate percent-coding) just like everything else. Wget does not currently support "multipart/form-data" for transmitting POST data; only "application/x-www-form-urlencoded". Only one of --post-data and --post-file should be specified. Please note that wget does not require the content to be of the form "key1=value1&key2=value2", and neither does it test for it. Wget will simply transmit whatever data is provided to it. Most servers however expect the POST data to be in the above format when processing HTML Forms. When sending a POST request using the --post-file option, Wget treats the file as a binary file and will send every character in the POST request without stripping trailing newline or formfeed characters. Any other control characters in the text will also be sent as-is in the POST request. Please be aware that Wget needs to know the size of the POST data in advance. Therefore the argument to "--post-file" must be a regular file; specifying a FIFO or something like /dev/stdin won't work. It's not quite clear how to work around this limitation inherent in HTTP/1.0. Although HTTP/1.1 introduces chunked transfer that doesn't require knowing the request length in advance, a client can't use chunked unless it knows it's talking to an HTTP/1.1 server. And it can't know that until it receives a response, which in turn requires the request to have been completed -- a chicken-and-egg problem. Note: As of version 1.15 if Wget is redirected after the POST request is completed, its behaviour will depend on the response code returned by the server. In case of a 301 Moved Permanently, 302 Moved Temporarily or 307 Temporary Redirect, Wget will, in accordance with RFC2616, continue to send a POST request. In case a server wants the client to change the Request method upon redirection, it should send a 303 See Other response code. This example shows how to log in to a server using POST and then proceed to download the desired pages, presumably only accessible to authorized users: # Log in to the server. This can be done only once. wget --save-cookies cookies.txt \ --post-data 'user=foo&password=bar' \ http://example.com/auth.php # Now grab the page or pages we care about. wget --load-cookies cookies.txt \ -p http://example.com/interesting/article.php If the server is using session cookies to track user authentication, the above will not work because --save-cookies will not save them (and neither will browsers) and the cookies.txt file will be empty. In that case use --keep-session-cookies along with --save-cookies to force saving of session cookies. --method=HTTP-Method For the purpose of RESTful scripting, Wget allows sending of other HTTP Methods without the need to explicitly set them using --header=Header-Line. Wget will use whatever string is passed to it after --method as the HTTP Method to the server. --body-data=Data-String --body-file=Data-File Must be set when additional data needs to be sent to the server along with the Method specified using --method. --body-data sends string as data, whereas --body-file sends the contents of file. Other than that, they work in exactly the same way. Currently, --body-file is not for transmitting files as a whole. Wget does not currently support "multipart/form-data" for transmitting data; only "application/x-www-form-urlencoded". In the future, this may be changed so that wget sends the --body-file as a complete file instead of sending its contents to the server. Please be aware that Wget needs to know the contents of BODY Data in advance, and hence the argument to --body-file should be a regular file. See --post-file for a more detailed explanation. Only one of --body-data and --body-file should be specified. If Wget is redirected after the request is completed, Wget will suspend the current method and send a GET request till the redirection is completed. This is true for all redirection response codes except 307 Temporary Redirect which is used to explicitly specify that the request method should not change. Another exception is when the method is set to "POST", in which case the redirection rules specified under --post-data are followed. --content-disposition If this is set to on, experimental (not fully-functional) support for "Content-Disposition" headers is enabled. This can currently result in extra round-trips to the server for a "HEAD" request, and is known to suffer from a few bugs, which is why it is not currently enabled by default. This option is useful for some file-downloading CGI programs that use "Content-Disposition" headers to describe what the name of a downloaded file should be. When combined with --metalink-over-http and --trust-server-names, a Content-Type: application/metalink4+xml file is named using the "Content-Disposition" filename field, if available. --content-on-error If this is set to on, wget will not skip the content when the server responds with a http status code that indicates error. --trust-server-names If this is set, on a redirect, the local file name will be based on the redirection URL. By default the local file name is based on the original URL. When doing recursive retrieving this can be helpful because in many web sites redirected URLs correspond to an underlying file structure, while link URLs do not. --auth-no-challenge If this option is given, Wget will send Basic HTTP authentication information (plaintext username and password) for all requests, just like Wget 1.10.2 and prior did by default. Use of this option is not recommended, and is intended only to support some few obscure servers, which never send HTTP authentication challenges, but accept unsolicited auth info, say, in addition to form-based authentication. --retry-on-host-error Consider host errors, such as "Temporary failure in name resolution", as non-fatal, transient errors. --retry-on-http-error=code[,code,...] Consider given HTTP response codes as non-fatal, transient errors. Supply a comma-separated list of 3-digit HTTP response codes as argument. Useful to work around special circumstances where retries are required, but the server responds with an error code normally not retried by Wget. Such errors might be 503 (Service Unavailable) and 429 (Too Many Requests). Retries enabled by this option are performed subject to the normal retry timing and retry count limitations of Wget. Using this option is intended to support special use cases only and is generally not recommended, as it can force retries even in cases where the server is actually trying to decrease its load. Please use wisely and only if you know what you are doing. HTTPS (SSL/TLS) Options To support encrypted HTTP (HTTPS) downloads, Wget must be compiled with an external SSL library. The current default is GnuTLS. In addition, Wget also supports HSTS (HTTP Strict Transport Security). If Wget is compiled without SSL support, none of these options are available. --secure-protocol=protocol Choose the secure protocol to be used. Legal values are auto, SSLv2, SSLv3, TLSv1, TLSv1_1, TLSv1_2, TLSv1_3 and PFS. If auto is used, the SSL library is given the liberty of choosing the appropriate protocol automatically, which is achieved by sending a TLSv1 greeting. This is the default. Specifying SSLv2, SSLv3, TLSv1, TLSv1_1, TLSv1_2 or TLSv1_3 forces the use of the corresponding protocol. This is useful when talking to old and buggy SSL server implementations that make it hard for the underlying SSL library to choose the correct protocol version. Fortunately, such servers are quite rare. Specifying PFS enforces the use of the so-called Perfect Forward Security cipher suites. In short, PFS adds security by creating a one-time key for each SSL connection. It has a bit more CPU impact on client and server. We use known to be secure ciphers (e.g. no MD4) and the TLS protocol. This mode also explicitly excludes non-PFS key exchange methods, such as RSA. --https-only When in recursive mode, only HTTPS links are followed. --ciphers Set the cipher list string. Typically this string sets the cipher suites and other SSL/TLS options that the user wish should be used, in a set order of preference (GnuTLS calls it 'priority string'). This string will be fed verbatim to the SSL/TLS engine (OpenSSL or GnuTLS) and hence its format and syntax is dependent on that. Wget will not process or manipulate it in any way. Refer to the OpenSSL or GnuTLS documentation for more information. --no-check-certificate Don't check the server certificate against the available certificate authorities. Also don't require the URL host name to match the common name presented by the certificate. As of Wget 1.10, the default is to verify the server's certificate against the recognized certificate authorities, breaking the SSL handshake and aborting the download if the verification fails. Although this provides more secure downloads, it does break interoperability with some sites that worked with previous Wget versions, particularly those using self-signed, expired, or otherwise invalid certificates. This option forces an "insecure" mode of operation that turns the certificate verification errors into warnings and allows you to proceed. If you encounter "certificate verification" errors or ones saying that "common name doesn't match requested host name", you can use this option to bypass the verification and proceed with the download. Only use this option if you are otherwise convinced of the site's authenticity, or if you really don't care about the validity of its certificate. It is almost always a bad idea not to check the certificates when transmitting confidential or important data. For self-signed/internal certificates, you should download the certificate and verify against that instead of forcing this insecure mode. If you are really sure of not desiring any certificate verification, you can specify --check-certificate=quiet to tell wget to not print any warning about invalid certificates, albeit in most cases this is the wrong thing to do. --certificate=file Use the client certificate stored in file. This is needed for servers that are configured to require certificates from the clients that connect to them. Normally a certificate is not required and this switch is optional. --certificate-type=type Specify the type of the client certificate. Legal values are PEM (assumed by default) and DER, also known as ASN1. --private-key=file Read the private key from file. This allows you to provide the private key in a file separate from the certificate. --private-key-type=type Specify the type of the private key. Accepted values are PEM (the default) and DER. --ca-certificate=file Use file as the file with the bundle of certificate authorities ("CA") to verify the peers. The certificates must be in PEM format. Without this option Wget looks for CA certificates at the system-specified locations, chosen at OpenSSL installation time. --ca-directory=directory Specifies directory containing CA certificates in PEM format. Each file contains one CA certificate, and the file name is based on a hash value derived from the certificate. This is achieved by processing a certificate directory with the "c_rehash" utility supplied with OpenSSL. Using --ca-directory is more efficient than --ca-certificate when many certificates are installed because it allows Wget to fetch certificates on demand. Without this option Wget looks for CA certificates at the system-specified locations, chosen at OpenSSL installation time. --crl-file=file Specifies a CRL file in file. This is needed for certificates that have been revocated by the CAs. --pinnedpubkey=file/hashes Tells wget to use the specified public key file (or hashes) to verify the peer. This can be a path to a file which contains a single public key in PEM or DER format, or any number of base64 encoded sha256 hashes preceded by "sha256//" and separated by ";" When negotiating a TLS or SSL connection, the server sends a certificate indicating its identity. A public key is extracted from this certificate and if it does not exactly match the public key(s) provided to this option, wget will abort the connection before sending or receiving any data. --random-file=file [OpenSSL and LibreSSL only] Use file as the source of random data for seeding the pseudo-random number generator on systems without /dev/urandom. On such systems the SSL library needs an external source of randomness to initialize. Randomness may be provided by EGD (see --egd-file below) or read from an external source specified by the user. If this option is not specified, Wget looks for random data in $RANDFILE or, if that is unset, in $HOME/.rnd. If you're getting the "Could not seed OpenSSL PRNG; disabling SSL." error, you should provide random data using some of the methods described above. --egd-file=file [OpenSSL only] Use file as the EGD socket. EGD stands for Entropy Gathering Daemon, a user-space program that collects data from various unpredictable system sources and makes it available to other programs that might need it. Encryption software, such as the SSL library, needs sources of non- repeating randomness to seed the random number generator used to produce cryptographically strong keys. OpenSSL allows the user to specify his own source of entropy using the "RAND_FILE" environment variable. If this variable is unset, or if the specified file does not produce enough randomness, OpenSSL will read random data from EGD socket specified using this option. If this option is not specified (and the equivalent startup command is not used), EGD is never contacted. EGD is not needed on modern Unix systems that support /dev/urandom. --no-hsts Wget supports HSTS (HTTP Strict Transport Security, RFC 6797) by default. Use --no-hsts to make Wget act as a non-HSTS- compliant UA. As a consequence, Wget would ignore all the "Strict-Transport-Security" headers, and would not enforce any existing HSTS policy. --hsts-file=file By default, Wget stores its HSTS database in ~/.wget-hsts. You can use --hsts-file to override this. Wget will use the supplied file as the HSTS database. Such file must conform to the correct HSTS database format used by Wget. If Wget cannot parse the provided file, the behaviour is unspecified. The Wget's HSTS database is a plain text file. Each line contains an HSTS entry (ie. a site that has issued a "Strict-Transport-Security" header and that therefore has specified a concrete HSTS policy to be applied). Lines starting with a dash ("#") are ignored by Wget. Please note that in spite of this convenient human-readability hand- hacking the HSTS database is generally not a good idea. An HSTS entry line consists of several fields separated by one or more whitespace: "<hostname> SP [<port>] SP <include subdomains> SP <created> SP <max-age>" The hostname and port fields indicate the hostname and port to which the given HSTS policy applies. The port field may be zero, and it will, in most of the cases. That means that the port number will not be taken into account when deciding whether such HSTS policy should be applied on a given request (only the hostname will be evaluated). When port is different to zero, both the target hostname and the port will be evaluated and the HSTS policy will only be applied if both of them match. This feature has been included for testing/development purposes only. The Wget testsuite (in testenv/) creates HSTS databases with explicit ports with the purpose of ensuring Wget's correct behaviour. Applying HSTS policies to ports other than the default ones is discouraged by RFC 6797 (see Appendix B "Differences between HSTS Policy and Same-Origin Policy"). Thus, this functionality should not be used in production environments and port will typically be zero. The last three fields do what they are expected to. The field include_subdomains can either be 1 or 0 and it signals whether the subdomains of the target domain should be part of the given HSTS policy as well. The created and max-age fields hold the timestamp values of when such entry was created (first seen by Wget) and the HSTS-defined value 'max-age', which states how long should that HSTS policy remain active, measured in seconds elapsed since the timestamp stored in created. Once that time has passed, that HSTS policy will no longer be valid and will eventually be removed from the database. If you supply your own HSTS database via --hsts-file, be aware that Wget may modify the provided file if any change occurs between the HSTS policies requested by the remote servers and those in the file. When Wget exits, it effectively updates the HSTS database by rewriting the database file with the new entries. If the supplied file does not exist, Wget will create one. This file will contain the new HSTS entries. If no HSTS entries were generated (no "Strict-Transport-Security" headers were sent by any of the servers) then no file will be created, not even an empty one. This behaviour applies to the default database file (~/.wget-hsts) as well: it will not be created until some server enforces an HSTS policy. Care is taken not to override possible changes made by other Wget processes at the same time over the HSTS database. Before dumping the updated HSTS entries on the file, Wget will re-read it and merge the changes. Using a custom HSTS database and/or modifying an existing one is discouraged. For more information about the potential security threats arose from such practice, see section 14 "Security Considerations" of RFC 6797, specially section 14.9 "Creative Manipulation of HSTS Policy Store". --warc-file=file Use file as the destination WARC file. --warc-header=string Use string into as the warcinfo record. --warc-max-size=size Set the maximum size of the WARC files to size. --warc-cdx Write CDX index files. --warc-dedup=file Do not store records listed in this CDX file. --no-warc-compression Do not compress WARC files with GZIP. --no-warc-digests Do not calculate SHA1 digests. --no-warc-keep-log Do not store the log file in a WARC record. --warc-tempdir=dir Specify the location for temporary files created by the WARC writer. FTP Options --ftp-user=user --ftp-password=password Specify the username user and password password on an FTP server. Without this, or the corresponding startup option, the password defaults to -wget@, normally used for anonymous FTP. Another way to specify username and password is in the URL itself. Either method reveals your password to anyone who bothers to run "ps". To prevent the passwords from being seen, store them in .wgetrc or .netrc, and make sure to protect those files from other users with "chmod". If the passwords are really important, do not leave them lying in those files either---edit the files and delete them after Wget has started the download. --no-remove-listing Don't remove the temporary .listing files generated by FTP retrievals. Normally, these files contain the raw directory listings received from FTP servers. Not removing them can be useful for debugging purposes, or when you want to be able to easily check on the contents of remote server directories (e.g. to verify that a mirror you're running is complete). Note that even though Wget writes to a known filename for this file, this is not a security hole in the scenario of a user making .listing a symbolic link to /etc/passwd or something and asking "root" to run Wget in his or her directory. Depending on the options used, either Wget will refuse to write to .listing, making the globbing/recursion/time-stamping operation fail, or the symbolic link will be deleted and replaced with the actual .listing file, or the listing will be written to a .listing.number file. Even though this situation isn't a problem, though, "root" should never run Wget in a non-trusted user's directory. A user could do something as simple as linking index.html to /etc/passwd and asking "root" to run Wget with -N or -r so the file will be overwritten. --no-glob Turn off FTP globbing. Globbing refers to the use of shell- like special characters (wildcards), like *, ?, [ and ] to retrieve more than one file from the same directory at once, like: wget ftp://gnjilux.srk.fer.hr/*.msg By default, globbing will be turned on if the URL contains a globbing character. This option may be used to turn globbing on or off permanently. You may have to quote the URL to protect it from being expanded by your shell. Globbing makes Wget look for a directory listing, which is system-specific. This is why it currently works only with Unix FTP servers (and the ones emulating Unix "ls" output). --no-passive-ftp Disable the use of the passive FTP transfer mode. Passive FTP mandates that the client connect to the server to establish the data connection rather than the other way around. If the machine is connected to the Internet directly, both passive and active FTP should work equally well. Behind most firewall and NAT configurations passive FTP has a better chance of working. However, in some rare firewall configurations, active FTP actually works when passive FTP doesn't. If you suspect this to be the case, use this option, or set "passive_ftp=off" in your init file. --preserve-permissions Preserve remote file permissions instead of permissions set by umask. --retr-symlinks By default, when retrieving FTP directories recursively and a symbolic link is encountered, the symbolic link is traversed and the pointed-to files are retrieved. Currently, Wget does not traverse symbolic links to directories to download them recursively, though this feature may be added in the future. When --retr-symlinks=no is specified, the linked-to file is not downloaded. Instead, a matching symbolic link is created on the local file system. The pointed-to file will not be retrieved unless this recursive retrieval would have encountered it separately and downloaded it anyway. This option poses a security risk where a malicious FTP Server may cause Wget to write to files outside of the intended directories through a specially crafted .LISTING file. Note that when retrieving a file (not a directory) because it was specified on the command-line, rather than because it was recursed to, this option has no effect. Symbolic links are always traversed in this case. FTPS Options --ftps-implicit This option tells Wget to use FTPS implicitly. Implicit FTPS consists of initializing SSL/TLS from the very beginning of the control connection. This option does not send an "AUTH TLS" command: it assumes the server speaks FTPS and directly starts an SSL/TLS connection. If the attempt is successful, the session continues just like regular FTPS ("PBSZ" and "PROT" are sent, etc.). Implicit FTPS is no longer a requirement for FTPS implementations, and thus many servers may not support it. If --ftps-implicit is passed and no explicit port number specified, the default port for implicit FTPS, 990, will be used, instead of the default port for the "normal" (explicit) FTPS which is the same as that of FTP, 21. --no-ftps-resume-ssl Do not resume the SSL/TLS session in the data channel. When starting a data connection, Wget tries to resume the SSL/TLS session previously started in the control connection. SSL/TLS session resumption avoids performing an entirely new handshake by reusing the SSL/TLS parameters of a previous session. Typically, the FTPS servers want it that way, so Wget does this by default. Under rare circumstances however, one might want to start an entirely new SSL/TLS session in every data connection. This is what --no-ftps-resume-ssl is for. --ftps-clear-data-connection All the data connections will be in plain text. Only the control connection will be under SSL/TLS. Wget will send a "PROT C" command to achieve this, which must be approved by the server. --ftps-fallback-to-ftp Fall back to FTP if FTPS is not supported by the target server. For security reasons, this option is not asserted by default. The default behaviour is to exit with an error. If a server does not successfully reply to the initial "AUTH TLS" command, or in the case of implicit FTPS, if the initial SSL/TLS connection attempt is rejected, it is considered that such server does not support FTPS. Recursive Retrieval Options -r --recursive Turn on recursive retrieving. The default maximum depth is 5. -l depth --level=depth Set the maximum number of subdirectories that Wget will recurse into to depth. In order to prevent one from accidentally downloading very large websites when using recursion this is limited to a depth of 5 by default, i.e., it will traverse at most 5 directories deep starting from the provided URL. Set -l 0 or -l inf for infinite recursion depth. wget -r -l 0 http://<site>/1.html Ideally, one would expect this to download just 1.html. but unfortunately this is not the case, because -l 0 is equivalent to -l inf---that is, infinite recursion. To download a single HTML page (or a handful of them), specify them all on the command line and leave away -r and -l. To download the essential items to view a single HTML page, see page requisites. --delete-after This option tells Wget to delete every single file it downloads, after having done so. It is useful for pre- fetching popular pages through a proxy, e.g.: wget -r -nd --delete-after http://whatever.com/~popular/page/ The -r option is to retrieve recursively, and -nd to not create directories. Note that --delete-after deletes files on the local machine. It does not issue the DELE command to remote FTP sites, for instance. Also note that when --delete-after is specified, --convert-links is ignored, so .orig files are simply not created in the first place. -k --convert-links After the download is complete, convert the links in the document to make them suitable for local viewing. This affects not only the visible hyperlinks, but any part of the document that links to external content, such as embedded images, links to style sheets, hyperlinks to non-HTML content, etc. Each link will be changed in one of the two ways: The links to files that have been downloaded by Wget will be changed to refer to the file they point to as a relative link. Example: if the downloaded file /foo/doc.html links to /bar/img.gif, also downloaded, then the link in doc.html will be modified to point to ../bar/img.gif. This kind of transformation works reliably for arbitrary combinations of directories. The links to files that have not been downloaded by Wget will be changed to include host name and absolute path of the location they point to. Example: if the downloaded file /foo/doc.html links to /bar/img.gif (or to ../bar/img.gif), then the link in doc.html will be modified to point to http://hostname/bar/img.gif . Because of this, local browsing works reliably: if a linked file was downloaded, the link will refer to its local name; if it was not downloaded, the link will refer to its full Internet address rather than presenting a broken link. The fact that the former links are converted to relative links ensures that you can move the downloaded hierarchy to another directory. Note that only at the end of the download can Wget know which links have been downloaded. Because of that, the work done by -k will be performed at the end of all the downloads. --convert-file-only This option converts only the filename part of the URLs, leaving the rest of the URLs untouched. This filename part is sometimes referred to as the "basename", although we avoid that term here in order not to cause confusion. It works particularly well in conjunction with --adjust-extension, although this coupling is not enforced. It proves useful to populate Internet caches with files downloaded from different hosts. Example: if some link points to //foo.com/bar.cgi?xyz with --adjust-extension asserted and its local destination is intended to be ./foo.com/bar.cgi?xyz.css, then the link would be converted to //foo.com/bar.cgi?xyz.css. Note that only the filename part has been modified. The rest of the URL has been left untouched, including the net path ("//") which would otherwise be processed by Wget and converted to the effective scheme (ie. "http://"). -K --backup-converted When converting a file, back up the original version with a .orig suffix. Affects the behavior of -N. -m --mirror Turn on options suitable for mirroring. This option turns on recursion and time-stamping, sets infinite recursion depth and keeps FTP directory listings. It is currently equivalent to -r -N -l inf --no-remove-listing. -p --page-requisites This option causes Wget to download all the files that are necessary to properly display a given HTML page. This includes such things as inlined images, sounds, and referenced stylesheets. Ordinarily, when downloading a single HTML page, any requisite documents that may be needed to display it properly are not downloaded. Using -r together with -l can help, but since Wget does not ordinarily distinguish between external and inlined documents, one is generally left with "leaf documents" that are missing their requisites. For instance, say document 1.html contains an "<IMG>" tag referencing 1.gif and an "<A>" tag pointing to external document 2.html. Say that 2.html is similar but that its image is 2.gif and it links to 3.html. Say this continues up to some arbitrarily high number. If one executes the command: wget -r -l 2 http://<site>/1.html then 1.html, 1.gif, 2.html, 2.gif, and 3.html will be downloaded. As you can see, 3.html is without its requisite 3.gif because Wget is simply counting the number of hops (up to 2) away from 1.html in order to determine where to stop the recursion. However, with this command: wget -r -l 2 -p http://<site>/1.html all the above files and 3.html's requisite 3.gif will be downloaded. Similarly, wget -r -l 1 -p http://<site>/1.html will cause 1.html, 1.gif, 2.html, and 2.gif to be downloaded. One might think that: wget -r -l 0 -p http://<site>/1.html would download just 1.html and 1.gif, but unfortunately this is not the case, because -l 0 is equivalent to -l inf---that is, infinite recursion. To download a single HTML page (or a handful of them, all specified on the command-line or in a -i URL input file) and its (or their) requisites, simply leave off -r and -l: wget -p http://<site>/1.html Note that Wget will behave as if -r had been specified, but only that single page and its requisites will be downloaded. Links from that page to external documents will not be followed. Actually, to download a single page and all its requisites (even if they exist on separate websites), and make sure the lot displays properly locally, this author likes to use a few options in addition to -p: wget -E -H -k -K -p http://<site>/<document> To finish off this topic, it's worth knowing that Wget's idea of an external document link is any URL specified in an "<A>" tag, an "<AREA>" tag, or a "<LINK>" tag other than "<LINK REL="stylesheet">". --strict-comments Turn on strict parsing of HTML comments. The default is to terminate comments at the first occurrence of -->. According to specifications, HTML comments are expressed as SGML declarations. Declaration is special markup that begins with <! and ends with >, such as <!DOCTYPE ...>, that may contain comments between a pair of -- delimiters. HTML comments are "empty declarations", SGML declarations without any non-comment text. Therefore, <!--foo--> is a valid comment, and so is <!--one-- --two-->, but <!--1--2--> is not. On the other hand, most HTML writers don't perceive comments as anything other than text delimited with <!-- and -->, which is not quite the same. For example, something like <!------------> works as a valid comment as long as the number of dashes is a multiple of four (!). If not, the comment technically lasts until the next --, which may be at the other end of the document. Because of this, many popular browsers completely ignore the specification and implement what users have come to expect: comments delimited with <!-- and -->. Until version 1.9, Wget interpreted comments strictly, which resulted in missing links in many web pages that displayed fine in browsers, but had the misfortune of containing non- compliant comments. Beginning with version 1.9, Wget has joined the ranks of clients that implements "naive" comments, terminating each comment at the first occurrence of -->. If, for whatever reason, you want strict comment parsing, use this option to turn it on. Recursive Accept/Reject Options -A acclist --accept acclist -R rejlist --reject rejlist Specify comma-separated lists of file name suffixes or patterns to accept or reject. Note that if any of the wildcard characters, *, ?, [ or ], appear in an element of acclist or rejlist, it will be treated as a pattern, rather than a suffix. In this case, you have to enclose the pattern into quotes to prevent your shell from expanding it, like in -A "*.mp3" or -A '*.mp3'. --accept-regex urlregex --reject-regex urlregex Specify a regular expression to accept or reject the complete URL. --regex-type regextype Specify the regular expression type. Possible types are posix or pcre. Note that to be able to use pcre type, wget has to be compiled with libpcre support. -D domain-list --domains=domain-list Set domains to be followed. domain-list is a comma-separated list of domains. Note that it does not turn on -H. --exclude-domains domain-list Specify the domains that are not to be followed. --follow-ftp Follow FTP links from HTML documents. Without this option, Wget will ignore all the FTP links. --follow-tags=list Wget has an internal table of HTML tag / attribute pairs that it considers when looking for linked documents during a recursive retrieval. If a user wants only a subset of those tags to be considered, however, he or she should be specify such tags in a comma-separated list with this option. --ignore-tags=list This is the opposite of the --follow-tags option. To skip certain HTML tags when recursively looking for documents to download, specify them in a comma-separated list. In the past, this option was the best bet for downloading a single page and its requisites, using a command-line like: wget --ignore-tags=a,area -H -k -K -r http://<site>/<document> However, the author of this option came across a page with tags like "<LINK REL="home" HREF="/">" and came to the realization that specifying tags to ignore was not enough. One can't just tell Wget to ignore "<LINK>", because then stylesheets will not be downloaded. Now the best bet for downloading a single page and its requisites is the dedicated --page-requisites option. --ignore-case Ignore case when matching files and directories. This influences the behavior of -R, -A, -I, and -X options, as well as globbing implemented when downloading from FTP sites. For example, with this option, -A "*.txt" will match file1.txt, but also file2.TXT, file3.TxT, and so on. The quotes in the example are to prevent the shell from expanding the pattern. -H --span-hosts Enable spanning across hosts when doing recursive retrieving. -L --relative Follow relative links only. Useful for retrieving a specific home page without any distractions, not even those from the same hosts. -I list --include-directories=list Specify a comma-separated list of directories you wish to follow when downloading. Elements of list may contain wildcards. -X list --exclude-directories=list Specify a comma-separated list of directories you wish to exclude from download. Elements of list may contain wildcards. -np --no-parent Do not ever ascend to the parent directory when retrieving recursively. This is a useful option, since it guarantees that only the files below a certain hierarchy will be downloaded. ENVIRONMENT top Wget supports proxies for both HTTP and FTP retrievals. The standard way to specify proxy location, which Wget recognizes, is using the following environment variables: http_proxy https_proxy If set, the http_proxy and https_proxy variables should contain the URLs of the proxies for HTTP and HTTPS connections respectively. ftp_proxy This variable should contain the URL of the proxy for FTP connections. It is quite common that http_proxy and ftp_proxy are set to the same URL. no_proxy This variable should contain a comma-separated list of domain extensions proxy should not be used for. For instance, if the value of no_proxy is .mit.edu, proxy will not be used to retrieve documents from MIT. EXIT STATUS top Wget may return one of several error codes if it encounters problems. 0 No problems occurred. 1 Generic error code. 2 Parse error---for instance, when parsing command-line options, the .wgetrc or .netrc... 3 File I/O error. 4 Network failure. 5 SSL verification failure. 6 Username/password authentication failure. 7 Protocol errors. 8 Server issued an error response. With the exceptions of 0 and 1, the lower-numbered exit codes take precedence over higher-numbered ones, when multiple types of errors are encountered. In versions of Wget prior to 1.12, Wget's exit status tended to be unhelpful and inconsistent. Recursive downloads would virtually always return 0 (success), regardless of any issues encountered, and non-recursive fetches only returned the status corresponding to the most recently-attempted download. FILES top /usr/local/etc/wgetrc Default location of the global startup file. .wgetrc User startup file. BUGS top You are welcome to submit bug reports via the GNU Wget bug tracker (see <https://savannah.gnu.org/bugs/?func=additem&group=wget >) or to our mailing list <[email protected]>. Visit <https://lists.gnu.org/mailman/listinfo/bug-wget > to get more info (how to subscribe, list archives, ...). Before actually submitting a bug report, please try to follow a few simple guidelines. 1. Please try to ascertain that the behavior you see really is a bug. If Wget crashes, it's a bug. If Wget does not behave as documented, it's a bug. If things work strange, but you are not sure about the way they are supposed to work, it might well be a bug, but you might want to double-check the documentation and the mailing lists. 2. Try to repeat the bug in as simple circumstances as possible. E.g. if Wget crashes while downloading wget -rl0 -kKE -t5 --no-proxy http://example.com -o /tmp/log, you should try to see if the crash is repeatable, and if will occur with a simpler set of options. You might even try to start the download at the page where the crash occurred to see if that page somehow triggered the crash. Also, while I will probably be interested to know the contents of your .wgetrc file, just dumping it into the debug message is probably a bad idea. Instead, you should first try to see if the bug repeats with .wgetrc moved out of the way. Only if it turns out that .wgetrc settings affect the bug, mail me the relevant parts of the file. 3. Please start Wget with -d option and send us the resulting output (or relevant parts thereof). If Wget was compiled without debug support, recompile it---it is much easier to trace bugs with debug support on. Note: please make sure to remove any potentially sensitive information from the debug log before sending it to the bug address. The "-d" won't go out of its way to collect sensitive information, but the log will contain a fairly complete transcript of Wget's communication with the server, which may include passwords and pieces of downloaded data. Since the bug address is publicly archived, you may assume that all bug reports are visible to the public. 4. If Wget has crashed, try to run it in a debugger, e.g. "gdb `which wget` core" and type "where" to get the backtrace. This may not work if the system administrator has disabled core files, but it is safe to try. SEE ALSO top This is not the complete manual for GNU Wget. For more complete information, including more detailed explanations of some of the options, and a number of commands available for use with .wgetrc files and the -e option, see the GNU Info entry for wget. Also see wget2(1), the updated version of GNU Wget with even better support for recursive downloading and modern protocols like HTTP/2. AUTHOR top Originally written by Hrvoje Niki <[email protected]>. Currently maintained by Darshit Shah <[email protected]> and Tim Rhsen <[email protected]>. COPYRIGHT top Copyright (c) 1996--2011, 2015, 2018--2023 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". COLOPHON top This page is part of the wget (interactive network downloader) project. Information about the project can be found at http://www.gnu.org/software/wget/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the tarball wget-1.21.4.tar.gz fetched from https://www.gnu.org/software/wget/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU Wget 1.21.4 2023-12-22 WGET(1) Pages that refer to this page: curl(1), update-pciids(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# wget\n\n> Download files from the Web.\n> Supports HTTP, HTTPS, and FTP.\n> More information: <https://www.gnu.org/software/wget>.\n\n- Download the contents of a URL to a file (named "foo" in this case):\n\n`wget {{https://example.com/foo}}`\n\n- Download the contents of a URL to a file (named "bar" in this case):\n\n`wget --output-document {{bar}} {{https://example.com/foo}}`\n\n- Download a single web page and all its resources with 3-second intervals between requests (scripts, stylesheets, images, etc.):\n\n`wget --page-requisites --convert-links --wait=3 {{https://example.com/somepage.html}}`\n\n- Download all listed files within a directory and its sub-directories (does not download embedded page elements):\n\n`wget --mirror --no-parent {{https://example.com/somepath/}}`\n\n- Limit the download speed and the number of connection retries:\n\n`wget --limit-rate={{300k}} --tries={{100}} {{https://example.com/somepath/}}`\n\n- Download a file from an HTTP server using Basic Auth (also works for FTP):\n\n`wget --user={{username}} --password={{password}} {{https://example.com}}`\n\n- Continue an incomplete download:\n\n`wget --continue {{https://example.com}}`\n\n- Download all URLs stored in a text file to a specific directory:\n\n`wget --directory-prefix {{path/to/directory}} --input-file {{URLs.txt}}`\n
whatis
whatis(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training whatis(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXIT STATUS | ENVIRONMENT | FILES | SEE ALSO | AUTHOR | BUGS | COLOPHON WHATIS(1) Manual pager utils WHATIS(1) NAME top whatis - display one-line manual page descriptions SYNOPSIS top whatis [-dlv?V] [-r|-w] [-s list] [-m system[,...]] [-M path] [-L locale] [-C file] name ... DESCRIPTION top Each manual page has a short description available within it. whatis searches the manual page names and displays the manual page descriptions of any name matched. name may contain wildcards (-w) or be a regular expression (-r). Using these options, it may be necessary to quote the name or escape (\) the special characters to stop the shell from interpreting them. index databases are used during the search, and are updated by the mandb program. Depending on your installation, this may be run by a periodic cron job, or may need to be run manually after new manual pages have been installed. To produce an old style text whatis database from the relative index database, issue the command: whatis -M manpath -w '*' | sort > manpath/whatis where manpath is a manual page hierarchy such as /usr/man. OPTIONS top -d, --debug Print debugging information. -v, --verbose Print verbose warning messages. -r, --regex Interpret each name as a regular expression. If a name matches any part of a page name, a match will be made. This option causes whatis to be somewhat slower due to the nature of database searches. -w, --wildcard Interpret each name as a pattern containing shell style wildcards. For a match to be made, an expanded name must match the entire page name. This option causes whatis to be somewhat slower due to the nature of database searches. -l, --long Do not trim output to the terminal width. Normally, output will be truncated to the terminal width to avoid ugly results from poorly-written NAME sections. -s list, --sections=list, --section=list Search only the given manual sections. list is a colon- or comma-separated list of sections. If an entry in list is a simple section, for example "3", then the displayed list of descriptions will include pages in sections "3", "3perl", "3x", and so on; while if an entry in list has an extension, for example "3perl", then the list will only include pages in that exact part of the manual section. -m system[,...], --systems=system[,...] If this system has access to other operating systems' manual page names, they can be accessed using this option. To search NewOS's manual page names, use the option -m NewOS. The system specified can be a combination of comma delimited operating system names. To include a search of the native operating system's manual page names, include the system name man in the argument string. This option will override the $SYSTEM environment variable. -M path, --manpath=path Specify an alternate set of colon-delimited manual page hierarchies to search. By default, whatis uses the $MANPATH environment variable, unless it is empty or unset, in which case it will determine an appropriate manpath based on your $PATH environment variable. This option overrides the contents of $MANPATH. -L locale, --locale=locale whatis will normally determine your current locale by a call to the C function setlocale(3) which interrogates various environment variables, possibly including $LC_MESSAGES and $LANG. To temporarily override the determined value, use this option to supply a locale string directly to whatis. Note that it will not take effect until the search for pages actually begins. Output such as the help message will always be displayed in the initially determined locale. -C file, --config-file=file Use this user configuration file rather than the default of ~/.manpath. -?, --help Print a help message and exit. --usage Print a short usage message and exit. -V, --version Display version information. EXIT STATUS top 0 Successful program execution. 1 Usage, syntax or configuration file error. 2 Operational error. 16 Nothing was found that matched the criteria specified. ENVIRONMENT top SYSTEM If $SYSTEM is set, it will have the same effect as if it had been specified as the argument to the -m option. MANPATH If $MANPATH is set, its value is interpreted as the colon- delimited manual page hierarchy search path to use. See the SEARCH PATH section of manpath(5) for the default behaviour and details of how this environment variable is handled. MANWIDTH If $MANWIDTH is set, its value is used as the terminal width (see the --long option). If it is not set, the terminal width will be calculated using the value of $COLUMNS, and ioctl(2) if available, or falling back to 80 characters if all else fails. FILES top /usr/share/man/index.(bt|db|dir|pag) A traditional global index database cache. /var/cache/man/index.(bt|db|dir|pag) An FHS compliant global index database cache. /usr/share/man/.../whatis A traditional whatis text database. SEE ALSO top apropos(1), man(1), mandb(8) AUTHOR top Wilf. ([email protected]). Fabrizio Polacco ([email protected]). Colin Watson ([email protected]). BUGS top https://gitlab.com/man-db/man-db/-/issues https://savannah.nongnu.org/bugs/?group=man-db COLOPHON top This page is part of the man-db (manual pager suite) project. Information about the project can be found at http://www.nongnu.org/man-db/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository https://gitlab.com/cjwatson/man-db on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-18.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] 2.12.0 2023-09-23 WHATIS(1) Pages that refer to this page: apropos(1), lexgrog(1), man(1), manpath(1), man(7), uri(7) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# whatis\n\n> Display one-line descriptions from manual pages.\n> More information: <https://manned.org/whatis>.\n\n- Display a description from a man page:\n\n`whatis {{command}}`\n\n- Don't cut the description off at the end of the line:\n\n`whatis --long {{command}}`\n\n- Display descriptions for all commands matching a glob:\n\n`whatis --wildcard {{net*}}`\n\n- Search man page descriptions with a regular expression:\n\n`whatis --regex '{{wish[0-9]\.[0-9]}}'`\n\n- Display descriptions in a specific language:\n\n`whatis --locale={{en}} {{command}}`\n
whereis
whereis(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training whereis(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | FILE SEARCH PATHS | ENVIRONMENT | EXAMPLES | REPORTING BUGS | AVAILABILITY WHEREIS(1) User Commands WHEREIS(1) NAME top whereis - locate the binary, source, and manual page files for a command SYNOPSIS top whereis [options] [-BMS directory... -f] name... DESCRIPTION top whereis locates the binary, source and manual files for the specified command names. The supplied names are first stripped of leading pathname components. Prefixes of s. resulting from use of source code control are also dealt with. whereis then attempts to locate the desired program in the standard Linux places, and in the places specified by $PATH and $MANPATH. The search restrictions (options -b, -m and -s) are cumulative and apply to the subsequent name patterns on the command line. Any new search restriction resets the search mask. For example, whereis -bm ls tr -m gcc searches for "ls" and "tr" binaries and man pages, and for "gcc" man pages only. The options -B, -M and -S reset search paths for the subsequent name patterns. For example, whereis -m ls -M /usr/share/man/man1 -f cal searches for "ls" man pages in all default paths, but for "cal" in the /usr/share/man/man1 directory only. OPTIONS top -b Search for binaries. -m Search for manuals. -s Search for sources. -u Only show the command names that have unusual entries. A command is said to be unusual if it does not have just one entry of each explicitly requested type. Thus 'whereis -m -u *' asks for those files in the current directory which have no documentation file, or more than one. -B list Limit the places where whereis searches for binaries, by a whitespace-separated list of directories. -M list Limit the places where whereis searches for manuals and documentation in Info format, by a whitespace-separated list of directories. -S list Limit the places where whereis searches for sources, by a whitespace-separated list of directories. -f Terminates the directory list and signals the start of filenames. It must be used when any of the -B, -M, or -S options is used. -l Output the list of effective lookup paths that whereis is using. When none of -B, -M, or -S is specified, the option will output the hard-coded paths that the command was able to find on the system. -g Interpret the next names as a glob(7) patterns. whereis always compares only filenames (aka basename) and never complete path. Using directory names in the pattern has no effect. Dont forget that the shell interprets the pattern when specified on the command line without quotes. Its necessary to use quotes for the name, for example: whereis -g 'find*' -h, --help Display help text and exit. -V, --version Print version and exit. FILE SEARCH PATHS top By default whereis tries to find files from hard-coded paths, which are defined with glob patterns. The command attempts to use the contents of $PATH and $MANPATH environment variables as default search path. The easiest way to know what paths are in use is to add the -l listing option. Effects of the -B, -M, and -S are displayed with -l. ENVIRONMENT top WHEREIS_DEBUG=all enables debug output. EXAMPLES top To find all files in /usr/bin which are not documented in /usr/man/man1 or have no source in /usr/src: cd /usr/bin whereis -u -ms -M /usr/man/man1 -S /usr/src -f * REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The whereis command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is part of the util-linux (a random collection of Linux utilities) project. Information about the project can be found at https://www.kernel.org/pub/linux/utils/util-linux/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-14.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] util-linux 2.39.594-1e0ad 2023-07-19 WHEREIS(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# whereis\n\n> Locate the binary, source, and manual page files for a command.\n> More information: <https://manned.org/whereis>.\n\n- Locate binary, source and man pages for SSH:\n\n`whereis {{ssh}}`\n\n- Locate binary and man pages for ls:\n\n`whereis -bm {{ls}}`\n\n- Locate source of gcc and man pages for Git:\n\n`whereis -s {{gcc}} -m {{git}}`\n\n- Locate binaries for gcc in `/usr/bin/` only:\n\n`whereis -b -B {{/usr/bin/}} -f {{gcc}}`\n\n- Locate unusual binaries (those that have more or less than one binary on the system):\n\n`whereis -u *`\n\n- Locate binaries that have unusual manual entries (binaries that have more or less than one manual installed):\n\n`whereis -u -m *`\n
who
who(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training who(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON WHO(1) User Commands WHO(1) NAME top who - show who is logged on SYNOPSIS top who [OPTION]... [ FILE | ARG1 ARG2 ] DESCRIPTION top Print information about users who are currently logged in. -a, --all same as -b -d --login -p -r -t -T -u -b, --boot time of last system boot -d, --dead print dead processes -H, --heading print line of column headings -l, --login print system login processes --lookup attempt to canonicalize hostnames via DNS -m only hostname and user associated with stdin -p, --process print active processes spawned by init -q, --count all login names and number of users logged on -r, --runlevel print current runlevel -s, --short print only name, line, and time (default) -t, --time print last system clock change -T, -w, --mesg add user's message status as +, - or ? -u, --users list users logged in --message same as -T --writable same as -T --help display this help and exit --version output version information and exit If FILE is not specified, use /var/run/utmp. /var/log/wtmp as FILE is common. If ARG1 ARG2 given, -m presumed: 'am i' or 'mom likes' are usual. AUTHOR top Written by Joseph Arceneaux, David MacKenzie, and Michael Stone. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top Full documentation <https://www.gnu.org/software/coreutils/who> or available locally via: info '(coreutils) who invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 WHO(1) Pages that refer to this page: last(1), users(1), utmpdump(1), w(1), utmp(5) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# who\n\n> Display who is logged in and related data (processes, boot time).\n> More information: <https://www.gnu.org/software/coreutils/who>.\n\n- Display the username, line, and time of all currently logged-in sessions:\n\n`who`\n\n- Display information only for the current terminal session:\n\n`who am i`\n\n- Display all available information:\n\n`who -a`\n\n- Display all available information with table headers:\n\n`who -a -H`\n
whoami
whoami(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training whoami(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON WHOAMI(1) User Commands WHOAMI(1) NAME top whoami - print effective user name SYNOPSIS top whoami [OPTION]... DESCRIPTION top Print the user name associated with the current effective user ID. Same as id -un. --help display this help and exit --version output version information and exit AUTHOR top Written by Richard Mlynarik. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top Full documentation <https://www.gnu.org/software/coreutils/whoami> or available locally via: info '(coreutils) whoami invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 WHOAMI(1) Pages that refer to this page: seccomp(2) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# whoami\n\n> Print the username associated with the current effective user ID.\n> More information: <https://www.gnu.org/software/coreutils/whoami>.\n\n- Display currently logged username:\n\n`whoami`\n\n- Display the username after a change in the user ID:\n\n`sudo whoami`\n
wipefs
wipefs(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training wipefs(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | ENVIRONMENT | EXAMPLES | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY WIPEFS(8) System Administration WIPEFS(8) NAME top wipefs - wipe a signature from a device SYNOPSIS top wipefs [options] device... wipefs [--backup] -o offset device... wipefs [--backup] -a device... DESCRIPTION top wipefs can erase filesystem, raid or partition-table signatures (magic strings) from the specified device to make the signatures invisible for libblkid. wipefs does not erase the filesystem itself nor any other data from the device. When used without any options, wipefs lists all visible filesystems and the offsets of their basic signatures. The default output is subject to change. So whenever possible, you should avoid using default outputs in your scripts. Always explicitly define expected columns by using --output columns-list in environments where a stable output is required. wipefs calls the BLKRRPART ioctl when it has erased a partition-table signature to inform the kernel about the change. The ioctl is called as the last step and when all specified signatures from all specified devices are already erased. This feature can be used to wipe content on partitions devices as well as partition table on a disk device, for example by wipefs -a /dev/sdc1 /dev/sdc2 /dev/sdc. Note that some filesystems and some partition tables store more magic strings on the device (e.g., FAT, ZFS, GPT). The wipefs command (since v2.31) lists all the offset where a magic strings have been detected. When option -a is used, all magic strings that are visible for libblkid(3) are erased. In this case the wipefs scans the device again after each modification (erase) until no magic string is found. Note that by default wipefs does not erase nested partition tables on non-whole disk devices. For this the option --force is required. OPTIONS top -a, --all Erase all available signatures. The set of erased signatures can be restricted with the -t option. -b, --backup Create a signature backup to the file $HOME/wipefs-<devname>-<offset>.bak. For more details see the EXAMPLE section. -f, --force Force erasure, even if the filesystem is mounted. This is required in order to erase a partition-table signature on a block device. -J, --json Use JSON output format. --lock[=mode] Use exclusive BSD lock for device or file it operates. The optional argument mode can be yes, no (or 1 and 0) or nonblock. If the mode argument is omitted, it defaults to "yes". This option overwrites environment variable $LOCK_BLOCK_DEVICE. The default is not to use any lock at all, but its recommended to avoid collisions with udevd or other tools. -i, --noheadings Do not print a header line. -O, --output list Specify which output columns to print. Use --help to get a list of all supported columns. -n, --no-act Causes everything to be done except for the write(2) call. -o, --offset offset Specify the location (in bytes) of the signature which should be erased from the device. The offset number may include a "0x" prefix; then the number will be interpreted as a hex value. It is possible to specify multiple -o options. The offset argument may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB"), or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB. -p, --parsable Print out in parsable instead of printable format. Encode all potentially unsafe characters of a string to the corresponding hex value prefixed by '\x'. -q, --quiet Suppress any messages after a successful signature wipe. -t, --types list Limit the set of printed or erased signatures. More than one type may be specified in a comma-separated list. The list or individual types can be prefixed with 'no' to specify the types on which no action should be taken. For more details see mount(8). -h, --help Display help text and exit. -V, --version Print version and exit. ENVIRONMENT top LIBBLKID_DEBUG=all enables libblkid(3) debug output. LOCK_BLOCK_DEVICE=<mode> use exclusive BSD lock. The mode is "1" or "0". See --lock for more details. EXAMPLES top wipefs /dev/sda* Prints information about sda and all partitions on sda. wipefs --all --backup /dev/sdb Erases all signatures from the device /dev/sdb and creates a signature backup file ~/wipefs-sdb-<offset>.bak for each signature. dd if=~/wipefs-sdb-0x00000438.bak of=/dev/sdb seek=$((0x00000438)) bs=1 conv=notrunc Restores an ext2 signature from the backup file ~/wipefs-sdb-0x00000438.bak. AUTHORS top Karel Zak <[email protected]> SEE ALSO top blkid(8), findfs(8) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The wipefs command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is part of the util-linux (a random collection of Linux utilities) project. Information about the project can be found at https://www.kernel.org/pub/linux/utils/util-linux/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-14.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] util-linux 2.39.594-1e0ad 2023-07-19 WIPEFS(8) Pages that refer to this page: systemd.mount(5), systemd.swap(5), blkid(8), btrfs-device(8), cfdisk(8), cryptsetup(8), fdisk(8), mkfs.btrfs(8), sfdisk(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# wipefs\n\n> Wipe filesystem, raid, or partition-table signatures from a device.\n> More information: <https://manned.org/wipefs>.\n\n- Display signatures for specified device:\n\n`sudo wipefs {{/dev/sdX}}`\n\n- Wipe all available signature types for a specific device with no recursion into partitions:\n\n`sudo wipefs --all {{/dev/sdX}}`\n\n- Wipe all available signature types for the device and partitions using a glob pattern:\n\n`sudo wipefs --all {{/dev/sdX}}*`\n\n- Perform dry run:\n\n`sudo wipefs --all --no-act {{/dev/sdX}}`\n\n- Force wipe, even if the filesystem is mounted:\n\n`sudo wipefs --all --force {{/dev/sdX}}`\n
write
write(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training write(1p) Linux manual page PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES OF ERRORS | APPLICATION USAGE | EXAMPLES | RATIONALE | FUTURE DIRECTIONS | SEE ALSO | COPYRIGHT WRITE(1P) POSIX Programmer's Manual WRITE(1P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME top write write to another user SYNOPSIS top write user_name [terminal] DESCRIPTION top The write utility shall read lines from the standard input and write them to the terminal of the specified user. When first invoked, it shall write the message: Message from sender-login-id (sending-terminal) [date]... to user_name. When it has successfully completed the connection, the sender's terminal shall be alerted twice to indicate that what the sender is typing is being written to the recipient's terminal. If the recipient wants to reply, this can be accomplished by typing: write sender-login-id [sending-terminal] upon receipt of the initial message. Whenever a line of input as delimited by an NL, EOF, or EOL special character (see the Base Definitions volume of POSIX.12017, Chapter 11, General Terminal Interface) is accumulated while in canonical input mode, the accumulated data shall be written on the other user's terminal. Characters shall be processed as follows: * Typing <alert> shall write the <alert> character to the recipient's terminal. * Typing the erase and kill characters shall affect the sender's terminal in the manner described by the termios interface in the Base Definitions volume of POSIX.12017, Chapter 11, General Terminal Interface. * Typing the interrupt or end-of-file characters shall cause write to write an appropriate message ("EOT\n" in the POSIX locale) to the recipient's terminal and exit. * Typing characters from LC_CTYPE classifications print or space shall cause those characters to be sent to the recipient's terminal. * When and only when the stty iexten local mode is enabled, the existence and processing of additional special control characters and multi-byte or single-byte functions is implementation-defined. * Typing other non-printable characters shall cause implementation-defined sequences of printable characters to be written to the recipient's terminal. To write to a user who is logged in more than once, the terminal argument can be used to indicate which terminal to write to; otherwise, the recipient's terminal is selected in an implementation-defined manner and an informational message is written to the sender's standard output, indicating which terminal was chosen. Permission to be a recipient of a write message can be denied or granted by use of the mesg utility. However, a user's privilege may further constrain the domain of accessibility of other users' terminals. The write utility shall fail when the user lacks appropriate privileges to perform the requested action. OPTIONS top None. OPERANDS top The following operands shall be supported: user_name Login name of the person to whom the message shall be written. The application shall ensure that this operand is of the form returned by the who utility. terminal Terminal identification in the same format provided by the who utility. STDIN top Lines to be copied to the recipient's terminal are read from standard input. INPUT FILES top None. ENVIRONMENT VARIABLES top The following environment variables shall affect the execution of write: LANG Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.12017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files). If the recipient's locale does not use an LC_CTYPE equivalent to the sender's, the results are undefined. LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error and informative messages written to standard output. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. ASYNCHRONOUS EVENTS top If an interrupt signal is received, write shall write an appropriate message on the recipient's terminal and exit with a status of zero. It shall take the standard action for all other signals. STDOUT top An informational message shall be written to standard output if a recipient is logged in more than once. STDERR top The standard error shall be used only for diagnostic messages. OUTPUT FILES top The recipient's terminal is used for output. EXTENDED DESCRIPTION top None. EXIT STATUS top The following exit values shall be returned: 0 Successful completion. >0 The addressed user is not logged on or the addressed user denies permission. CONSEQUENCES OF ERRORS top Default. The following sections are informative. APPLICATION USAGE top The talk utility is considered by some users to be a more usable utility on full-screen terminals. EXAMPLES top None. RATIONALE top The write utility was included in this volume of POSIX.12017 since it can be implemented on all terminal types. The standard developers considered the talk utility, which cannot be implemented on certain terminals, to be a ``better'' communications interface. Both of these programs are in widespread use on historical implementations. Therefore, the standard developers decided that both utilities should be specified. The format of the terminal name is unspecified, but the descriptions of ps, talk, who, and write require that they all use or accept the same format. FUTURE DIRECTIONS top None. SEE ALSO top mesg(1p), talk(1p), who(1p) The Base Definitions volume of POSIX.12017, Chapter 8, Environment Variables, Chapter 11, General Terminal Interface COPYRIGHT top Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE/The Open Group 2017 WRITE(1P) Pages that refer to this page: logger(1p), mesg(1p), talk(1p) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# write\n\n> Write a message on the terminal of a specified logged in user (ctrl-C to stop writing messages).\n> Use the `who` command to find out all terminal_ids of all active users active on the system. See also `mesg`.\n> More information: <https://manned.org/write>.\n\n- Send a message to a given user on a given terminal ID:\n\n`write {{username}} {{terminal_id}}`\n\n- Send message to "testuser" on terminal `/dev/tty/5`:\n\n`write {{testuser}} {{tty/5}}`\n\n- Send message to "johndoe" on pseudo terminal `/dev/pts/5`:\n\n`write {{johndoe}} {{pts/5}}`\n
xargs
xargs(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training xargs(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLES | EXIT STATUS | STANDARDS CONFORMANCE | HISTORY | BUGS | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON XARGS(1) General Commands Manual XARGS(1) NAME top xargs - build and execute command lines from standard input SYNOPSIS top xargs [options] [command [initial-arguments]] DESCRIPTION top This manual page documents the GNU version of xargs. xargs reads items from the standard input, delimited by blanks (which can be protected with double or single quotes or a backslash) or newlines, and executes the command (default is echo) one or more times with any initial-arguments followed by items read from standard input. Blank lines on the standard input are ignored. The command line for command is built up until it reaches a system-defined limit (unless the -n and -L options are used). The specified command will be invoked as many times as necessary to use up the list of input items. In general, there will be many fewer invocations of command than there were items in the input. This will normally have significant performance benefits. Some commands can usefully be executed in parallel too; see the -P option. Because Unix filenames can contain blanks and newlines, this default behaviour is often problematic; filenames containing blanks and/or newlines are incorrectly processed by xargs. In these situations it is better to use the -0 option, which prevents such problems. When using this option you will need to ensure that the program which produces the input for xargs also uses a null character as a separator. If that program is GNU find for example, the -print0 option does this for you. If any invocation of the command exits with a status of 255, xargs will stop immediately without reading any further input. An error message is issued on stderr when this happens. OPTIONS top -0, --null Input items are terminated by a null character instead of by whitespace, and the quotes and backslash are not special (every character is taken literally). Disables the end-of-file string, which is treated like any other argument. Useful when input items might contain white space, quote marks, or backslashes. The GNU find -print0 option produces input suitable for this mode. -a file, --arg-file=file Read items from file instead of standard input. If you use this option, stdin remains unchanged when commands are run. Otherwise, stdin is redirected from /dev/null. --delimiter=delim, -d delim Input items are terminated by the specified character. The specified delimiter may be a single character, a C- style character escape such as \n, or an octal or hexadecimal escape code. Octal and hexadecimal escape codes are understood as for the printf command. Multibyte characters are not supported. When processing the input, quotes and backslash are not special; every character in the input is taken literally. The -d option disables any end-of-file string, which is treated like any other argument. You can use this option when the input consists of simply newline-separated items, although it is almost always better to design your program to use --null where this is possible. -E eof-str Set the end-of-file string to eof-str. If the end-of-file string occurs as a line of input, the rest of the input is ignored. If neither -E nor -e is used, no end-of-file string is used. -e[eof-str], --eof[=eof-str] This option is a synonym for the -E option. Use -E instead, because it is POSIX compliant while this option is not. If eof-str is omitted, there is no end-of-file string. If neither -E nor -e is used, no end-of-file string is used. -I replace-str Replace occurrences of replace-str in the initial- arguments with names read from standard input. Also, unquoted blanks do not terminate input items; instead the separator is the newline character. Implies -x and -L 1. -i[replace-str], --replace[=replace-str] This option is a synonym for -Ireplace-str if replace-str is specified. If the replace-str argument is missing, the effect is the same as -I{}. The -i option is deprecated; use -I instead. -L max-lines Use at most max-lines nonblank input lines per command line. Trailing blanks cause an input line to be logically continued on the next input line. Implies -x. -l[max-lines], --max-lines[=max-lines] Synonym for the -L option. Unlike -L, the max-lines argument is optional. If max-lines is not specified, it defaults to one. The -l option is deprecated since the POSIX standard specifies -L instead. -n max-args, --max-args=max-args Use at most max-args arguments per command line. Fewer than max-args arguments will be used if the size (see the -s option) is exceeded, unless the -x option is given, in which case xargs will exit. -P max-procs, --max-procs=max-procs Run up to max-procs processes at a time; the default is 1. If max-procs is 0, xargs will run as many processes as possible at a time. Use the -n option or the -L option with -P; otherwise chances are that only one exec will be done. While xargs is running, you can send its process a SIGUSR1 signal to increase the number of commands to run simultaneously, or a SIGUSR2 to decrease the number. You cannot increase it above an implementation-defined limit (which is shown with --show-limits). You cannot decrease it below 1. xargs never terminates its commands; when asked to decrease, it merely waits for more than one existing command to terminate before starting another. Please note that it is up to the called processes to properly manage parallel access to shared resources. For example, if more than one of them tries to print to stdout, the output will be produced in an indeterminate order (and very likely mixed up) unless the processes collaborate in some way to prevent this. Using some kind of locking scheme is one way to prevent such problems. In general, using a locking scheme will help ensure correct output but reduce performance. If you don't want to tolerate the performance difference, simply arrange for each process to produce a separate output file (or otherwise use separate resources). -o, --open-tty Reopen stdin as /dev/tty in the child process before executing the command. This is useful if you want xargs to run an interactive application. -p, --interactive Prompt the user about whether to run each command line and read a line from the terminal. Only run the command line if the response starts with `y' or `Y'. Implies -t. --process-slot-var=name Set the environment variable name to a unique value in each running child process. Values are reused once child processes exit. This can be used in a rudimentary load distribution scheme, for example. -r, --no-run-if-empty If the standard input does not contain any nonblanks, do not run the command. Normally, the command is run once even if there is no input. This option is a GNU extension. -s max-chars, --max-chars=max-chars Use at most max-chars characters per command line, including the command and initial-arguments and the terminating nulls at the ends of the argument strings. The largest allowed value is system-dependent, and is calculated as the argument length limit for exec, less the size of your environment, less 2048 bytes of headroom. If this value is more than 128 KiB, 128 KiB is used as the default value; otherwise, the default value is the maximum. 1 KiB is 1024 bytes. xargs automatically adapts to tighter constraints. --show-limits Display the limits on the command-line length which are imposed by the operating system, xargs' choice of buffer size and the -s option. Pipe the input from /dev/null (and perhaps specify --no-run-if-empty) if you don't want xargs to do anything. -t, --verbose Print the command line on the standard error output before executing it. -x, --exit Exit if the size (see the -s option) is exceeded. -- Delimit the option list. Later arguments, if any, are treated as operands even if they begin with -. For example, xargs -- --help runs the command --help (found in PATH) instead of printing the usage text, and xargs -- --mycommand runs the command --mycommand instead of rejecting this as unrecognized option. --help Print a summary of the options to xargs and exit. --version Print the version number of xargs and exit. The options --max-lines (-L, -l), --replace (-I, -i) and --max- args (-n) are mutually exclusive. If some of them are specified at the same time, then xargs will generally use the option specified last on the command line, i.e., it will reset the value of the offending option (given before) to its default value. Additionally, xargs will issue a warning diagnostic on stderr. The exception to this rule is that the special max-args value 1 ('-n1') is ignored after the --replace option and its aliases -I and -i, because it would not actually conflict. EXAMPLES top find /tmp -name core -type f -print | xargs /bin/rm -f Find files named core in or below the directory /tmp and delete them. Note that this will work incorrectly if there are any filenames containing newlines or spaces. find /tmp -name core -type f -print0 | xargs -0 /bin/rm -f Find files named core in or below the directory /tmp and delete them, processing filenames in such a way that file or directory names containing spaces or newlines are correctly handled. find /tmp -depth -name core -type f -delete Find files named core in or below the directory /tmp and delete them, but more efficiently than in the previous example (because we avoid the need to use fork(2) and exec(2) to launch rm and we don't need the extra xargs process). cut -d: -f1 < /etc/passwd | sort | xargs echo Generates a compact listing of all the users on the system. EXIT STATUS top xargs exits with the following status: 0 if it succeeds 123 if any invocation of the command exited with status 1125 124 if the command exited with status 255 125 if the command is killed by a signal 126 if the command cannot be run 127 if the command is not found 1 if some other error occurred. Exit codes greater than 128 are used by the shell to indicate that a program died due to a fatal signal. STANDARDS CONFORMANCE top As of GNU xargs version 4.2.9, the default behaviour of xargs is not to have a logical end-of-file marker. POSIX (IEEE Std 1003.1, 2004 Edition) allows this. The -l and -i options appear in the 1997 version of the POSIX standard, but do not appear in the 2004 version of the standard. Therefore you should use -L and -I instead, respectively. The -o option is an extension to the POSIX standard for better compatibility with BSD. The POSIX standard allows implementations to have a limit on the size of arguments to the exec functions. This limit could be as low as 4096 bytes including the size of the environment. For scripts to be portable, they must not rely on a larger value. However, I know of no implementation whose actual limit is that small. The --show-limits option can be used to discover the actual limits in force on the current system. HISTORY top The xargs program was invented by Herb Gellis at Bell Labs. See the Texinfo manual for findutils, Finding Files, for more information. BUGS top It is not possible for xargs to be used securely, since there will always be a time gap between the production of the list of input files and their use in the commands that xargs issues. If other users have access to the system, they can manipulate the filesystem during this time window to force the action of the commands xargs runs to apply to files that you didn't intend. For a more detailed discussion of this and related problems, please refer to the ``Security Considerations'' chapter in the findutils Texinfo documentation. The -execdir option of find can often be used as a more secure alternative. When you use the -I option, each line read from the input is buffered internally. This means that there is an upper limit on the length of input line that xargs will accept when used with the -I option. To work around this limitation, you can use the -s option to increase the amount of buffer space that xargs uses, and you can also use an extra invocation of xargs to ensure that very long lines do not occur. For example: somecommand | xargs -s 50000 echo | xargs -I '{}' -s 100000 rm '{}' Here, the first invocation of xargs has no input line length limit because it doesn't use the -i option. The second invocation of xargs does have such a limit, but we have ensured that it never encounters a line which is longer than it can handle. This is not an ideal solution. Instead, the -i option should not impose a line length limit, which is why this discussion appears in the BUGS section. The problem doesn't occur with the output of find(1) because it emits just one filename per line. REPORTING BUGS top GNU findutils online help: <https://www.gnu.org/software/findutils/#get-help> Report any translation bugs to <https://translationproject.org/team/> Report any other issue via the form at the GNU Savannah bug tracker: <https://savannah.gnu.org/bugs/?group=findutils> General topics about the GNU findutils package are discussed at the bug-findutils mailing list: <https://lists.gnu.org/mailman/listinfo/bug-findutils> COPYRIGHT top Copyright 19902023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top find(1), kill(1), locate(1), updatedb(1), fork(2), execvp(3), locatedb(5), signal(7) Full documentation <https://www.gnu.org/software/findutils/xargs> or available locally via: info xargs COLOPHON top This page is part of the findutils (find utilities) project. Information about the project can be found at http://www.gnu.org/software/findutils/. If you have a bug report for this manual page, see https://savannah.gnu.org/bugs/?group=findutils. This page was obtained from the project's upstream Git repository git://git.savannah.gnu.org/findutils.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-11-11.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] XARGS(1) Pages that refer to this page: dpkg-name(1), find(1), grep(1), locate(1), updatedb(1), lsof(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# xargs\n\n> Execute a command with piped arguments coming from another command, a file, etc.\n> The input is treated as a single block of text and split into separate pieces on spaces, tabs, newlines and end-of-file.\n> More information: <https://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html>.\n\n- Run a command using the input data as arguments:\n\n`{{arguments_source}} | xargs {{command}}`\n\n- Run multiple chained commands on the input data:\n\n`{{arguments_source}} | xargs sh -c "{{command1}} && {{command2}} | {{command3}}"`\n\n- Delete all files with a `.backup` extension (`-print0` uses a null character to split file names, and `-0` uses it as delimiter):\n\n`find . -name {{'*.backup'}} -print0 | xargs -0 rm -v`\n\n- Execute the command once for each input line, replacing any occurrences of the placeholder (here marked as `_`) with the input line:\n\n`{{arguments_source}} | xargs -I _ {{command}} _ {{optional_extra_arguments}}`\n\n- Parallel runs of up to `max-procs` processes at a time; the default is 1. If `max-procs` is 0, xargs will run as many processes as possible at a time:\n\n`{{arguments_source}} | xargs -P {{max-procs}} {{command}}`\n
xgettext
xgettext(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training xgettext(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON XGETTEXT(1) User Commands XGETTEXT(1) NAME top xgettext - extract gettext strings from source SYNOPSIS top xgettext [OPTION] [INPUTFILE]... DESCRIPTION top Extract translatable strings from given input files. Mandatory arguments to long options are mandatory for short options too. Similarly for optional arguments. Input file location: INPUTFILE ... input files -f, --files-from=FILE get list of input files from FILE -D, --directory=DIRECTORY add DIRECTORY to list for input files search If input file is -, standard input is read. Output file location: -d, --default-domain=NAME use NAME.po for output (instead of messages.po) -o, --output=FILE write output to specified file -p, --output-dir=DIR output files will be placed in directory DIR If output file is -, output is written to standard output. Choice of input file language: -L, --language=NAME recognise the specified language (C, C++, ObjectiveC, PO, Shell, Python, Lisp, EmacsLisp, librep, Scheme, Smalltalk, Java, JavaProperties, C#, awk, YCP, Tcl, Perl, PHP, Ruby, GCC-source, NXStringTable, RST, RSJ, Glade, Lua, JavaScript, Vala, Desktop) -C, --c++ shorthand for --language=C++ By default the language is guessed depending on the input file name extension. Input file interpretation: --from-code=NAME encoding of input files (except for Python, Tcl, Glade) By default the input files are assumed to be in ASCII. Operation mode: -j, --join-existing join messages with existing file -x, --exclude-file=FILE.po entries from FILE.po are not extracted -cTAG, --add-comments=TAG place comment blocks starting with TAG and preceding keyword lines in output file -c, --add-comments place all comment blocks preceding keyword lines in output file --check=NAME perform syntax check on messages (ellipsis-unicode, space-ellipsis, quote-unicode, bullet-unicode) --sentence-end=TYPE type describing the end of sentence (single-space, which is the default, or double-space) Language specific options: -a, --extract-all extract all strings (only languages C, C++, ObjectiveC, Shell, Python, Lisp, EmacsLisp, librep, Scheme, Java, C#, awk, Tcl, Perl, PHP, GCC-source, Glade, Lua, JavaScript, Vala) -kWORD, --keyword=WORD look for WORD as an additional keyword -k, --keyword do not to use default keywords (only languages C, C++, ObjectiveC, Shell, Python, Lisp, EmacsLisp, librep, Scheme, Java, C#, awk, Tcl, Perl, PHP, GCC-source, Glade, Lua, JavaScript, Vala, Desktop) --flag=WORD:ARG:FLAG additional flag for strings inside the argument number ARG of keyword WORD (only languages C, C++, ObjectiveC, Shell, Python, Lisp, EmacsLisp, librep, Scheme, Java, C#, awk, YCP, Tcl, Perl, PHP, GCC-source, Lua, JavaScript, Vala) -T, --trigraphs understand ANSI C trigraphs for input (only languages C, C++, ObjectiveC) --its=FILE apply ITS rules from FILE (only XML based languages) --qt recognize Qt format strings (only language C++) --kde recognize KDE 4 format strings (only language C++) --boost recognize Boost format strings (only language C++) --debug more detailed formatstring recognition result Output details: --color use colors and other text attributes always --color=WHEN use colors and other text attributes if WHEN. WHEN may be 'always', 'never', 'auto', or 'html'. --style=STYLEFILE specify CSS style rule file for --color -e, --no-escape do not use C escapes in output (default) -E, --escape use C escapes in output, no extended chars --force-po write PO file even if empty -i, --indent write the .po file using indented style --no-location do not write '#: filename:line' lines -n, --add-location generate '#: filename:line' lines (default) --strict write out strict Uniforum conforming .po file --properties-output write out a Java .properties file --stringtable-output write out a NeXTstep/GNUstep .strings file --itstool write out itstool comments -w, --width=NUMBER set output page width --no-wrap do not break long message lines, longer than the output page width, into several lines -s, --sort-output generate sorted output (deprecated) -F, --sort-by-file sort output by file location --omit-header don't write header with 'msgid ""' entry --copyright-holder=STRING set copyright holder in output --foreign-user omit FSF copyright in output for foreign user --package-name=PACKAGE set package name in output --package-version=VERSION set package version in output --msgid-bugs-address=EMAIL@ADDRESS set report address for msgid bugs -m[STRING], --msgstr-prefix[=STRING] use STRING or "" as prefix for msgstr values -M[STRING], --msgstr-suffix[=STRING] use STRING or "" as suffix for msgstr values Informative output: -h, --help display this help and exit -V, --version output version information and exit -v, --verbose increase verbosity level AUTHOR top Written by Ulrich Drepper. REPORTING BUGS top Report bugs in the bug tracker at <https://savannah.gnu.org/projects/gettext> or by email to <[email protected]>. COPYRIGHT top Copyright 1995-2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top The full documentation for xgettext is maintained as a Texinfo manual. If the info and xgettext programs are properly installed at your site, the command info xgettext should give you access to the complete manual. COLOPHON top This page is part of the gettext (message translation) project. Information about the project can be found at http://www.gnu.org/software/gettext/. If you have a bug report for this manual page, see http://savannah.gnu.org/projects/gettext/. This page was obtained from the tarball gettext-0.22.4.tar.gz fetched from https://ftp.gnu.org/gnu/gettext/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU gettext-tools 0.22.2 September 2023 XGETTEXT(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# xgettext\n\n> Extract gettext strings from code files.\n> More information: <https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html>.\n\n- Scan file and output strings to `messages.po`:\n\n`xgettext {{path/to/input_file}}`\n\n- Use a different output filename:\n\n`xgettext --output {{path/to/output_file}} {{path/to/input_file}}`\n\n- Append new strings to an existing file:\n\n`xgettext --join-existing --output {{path/to/output_file}} {{path/to/input_file}}`\n\n- Don't add a header containing metadata to the output file:\n\n`xgettext --omit-header {{path/to/input_file}}`\n
yacc
yacc(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training yacc(1p) Linux manual page PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES OF ERRORS | APPLICATION USAGE | EXAMPLES | RATIONALE | FUTURE DIRECTIONS | SEE ALSO | COPYRIGHT YACC(1P) POSIX Programmer's Manual YACC(1P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME top yacc yet another compiler compiler (DEVELOPMENT) SYNOPSIS top yacc [-dltv] [-b file_prefix] [-p sym_prefix] grammar DESCRIPTION top The yacc utility shall read a description of a context-free grammar in grammar and write C source code, conforming to the ISO C standard, to a code file, and optionally header information into a header file, in the current directory. The generated source code shall not depend on any undefined, unspecified, or implementation-defined behavior, except in cases where it is copied directly from the supplied grammar, or in cases that are documented by the implementation. The C code shall define a function and related routines and macros for an automaton that executes a parsing algorithm meeting the requirements in Algorithms. The form and meaning of the grammar are described in the EXTENDED DESCRIPTION section. The C source code and header file shall be produced in a form suitable as input for the C compiler (see c99(1p)). OPTIONS top The yacc utility shall conform to the Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines, except for Guideline 9. The following options shall be supported: -b file_prefix Use file_prefix instead of y as the prefix for all output filenames. The code file y.tab.c, the header file y.tab.h (created when -d is specified), and the description file y.output (created when -v is specified), shall be changed to file_prefix.tab.c, file_prefix.tab.h, and file_prefix.output, respectively. -d Write the header file; by default only the code file is written. See the OUTPUT FILES section. -l Produce a code file that does not contain any #line constructs. If this option is not present, it is unspecified whether the code file or header file contains #line directives. This should only be used after the grammar and the associated actions are fully debugged. -p sym_prefix Use sym_prefix instead of yy as the prefix for all external names produced by yacc. The names affected shall include the functions yyparse(), yylex(), and yyerror(), and the variables yylval, yychar, and yydebug. (In the remainder of this section, the six symbols cited are referenced using their default names only as a notational convenience.) Local names may also be affected by the -p option; however, the -p option shall not affect #define symbols generated by yacc. -t Modify conditional compilation directives to permit compilation of debugging code in the code file. Runtime debugging statements shall always be contained in the code file, but by default conditional compilation directives prevent their compilation. -v Write a file containing a description of the parser and a report of conflicts generated by ambiguities in the grammar. OPERANDS top The following operand is required: grammar A pathname of a file containing instructions, hereafter called grammar, for which a parser is to be created. The format for the grammar is described in the EXTENDED DESCRIPTION section. STDIN top Not used. INPUT FILES top The file grammar shall be a text file formatted as specified in the EXTENDED DESCRIPTION section. ENVIRONMENT VARIABLES top The following environment variables shall affect the execution of yacc: LANG Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.12017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files). LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. The LANG and LC_* variables affect the execution of the yacc utility as stated. The main() function defined in Yacc Library shall call: setlocale(LC_ALL, "") and thus the program generated by yacc shall also be affected by the contents of these variables at runtime. ASYNCHRONOUS EVENTS top Default. STDOUT top Not used. STDERR top If shift/reduce or reduce/reduce conflicts are detected in grammar, yacc shall write a report of those conflicts to the standard error in an unspecified format. Standard error shall also be used for diagnostic messages. OUTPUT FILES top The code file, the header file, and the description file shall be text files. All are described in the following sections. Code File This file shall contain the C source code for the yyparse() function. It shall contain code for the various semantic actions with macro substitution performed on them as described in the EXTENDED DESCRIPTION section. It also shall contain a copy of the #define statements in the header file. If a %union declaration is used, the declaration for YYSTYPE shall also be included in this file. Header File The header file shall contain #define statements that associate the token numbers with the token names. This allows source files other than the code file to access the token codes. If a %union declaration is used, the declaration for YYSTYPE and an extern YYSTYPE yylval declaration shall also be included in this file. Description File The description file shall be a text file containing a description of the state machine corresponding to the parser, using an unspecified format. Limits for internal tables (see Limits) shall also be reported, in an implementation-defined manner. (Some implementations may use dynamic allocation techniques and have no specific limit values to report.) EXTENDED DESCRIPTION top The yacc command accepts a language that is used to define a grammar for a target language to be parsed by the tables and code generated by yacc. The language accepted by yacc as a grammar for the target language is described below using the yacc input language itself. The input grammar includes rules describing the input structure of the target language and code to be invoked when these rules are recognized to provide the associated semantic action. The code to be executed shall appear as bodies of text that are intended to be C-language code. These bodies of text shall not contain C-language trigraphs. The C-language inclusions are presumed to form a correct function when processed by yacc into its output files. The code included in this way shall be executed during the recognition of the target language. Given a grammar, the yacc utility generates the files described in the OUTPUT FILES section. The code file can be compiled and linked using c99. If the declaration and programs sections of the grammar file did not include definitions of main(), yylex(), and yyerror(), the compiled output requires linking with externally supplied versions of those functions. Default versions of main() and yyerror() are supplied in the yacc library and can be linked in by using the -l y operand to c99. The yacc library interfaces need not support interfaces with other than the default yy symbol prefix. The application provides the lexical analyzer function, yylex(); the lex utility is specifically designed to generate such a routine. Input Language The application shall ensure that every specification file consists of three sections in order: declarations, grammar rules, and programs, separated by double <percent-sign> characters ("%%"). The declarations and programs sections can be empty. If the latter is empty, the preceding "%%" mark separating it from the rules section can be omitted. The input is free form text following the structure of the grammar defined below. Lexical Structure of the Grammar The <blank>, <newline>, and <form-feed> character shall be ignored, except that the application shall ensure that they do not appear in names or multi-character reserved symbols. Comments shall be enclosed in "/* ... */", and can appear wherever a name is valid. Names are of arbitrary length, made up of letters, periods ('.'), underscores ('_'), and non-initial digits. Uppercase and lowercase letters are distinct. Conforming applications shall not use names beginning in yy or YY since the yacc parser uses such names. Many of the names appear in the final output of yacc, and thus they should be chosen to conform with any additional rules created by the C compiler to be used. In particular they appear in #define statements. A literal shall consist of a single character enclosed in single- quote characters. All of the escape sequences supported for character constants by the ISO C standard shall be supported by yacc. The relationship with the lexical analyzer is discussed in detail below. The application shall ensure that the NUL character is not used in grammar rules or literals. Declarations Section The declarations section is used to define the symbols used to define the target language and their relationship with each other. In particular, much of the additional information required to resolve ambiguities in the context-free grammar for the target language is provided here. Usually yacc assigns the relationship between the symbolic names it generates and their underlying numeric value. The declarations section makes it possible to control the assignment of these values. It is also possible to keep semantic information associated with the tokens currently on the parse stack in a user-defined C- language union, if the members of the union are associated with the various names in the grammar. The declarations section provides for this as well. The first group of declarators below all take a list of names as arguments. That list can optionally be preceded by the name of a C union member (called a tag below) appearing within '<' and '>'. (As an exception to the typographical conventions of the rest of this volume of POSIX.12017, in this case <tag> does not represent a metavariable, but the literal angle bracket characters surrounding a symbol.) The use of tag specifies that the tokens named on this line shall be of the same C type as the union member referenced by tag. This is discussed in more detail below. For lists used to define tokens, the first appearance of a given token can be followed by a positive integer (as a string of decimal digits). If this is done, the underlying value assigned to it for lexical purposes shall be taken to be that number. The following declares name to be a token: %token [<tag>] name [number] [name [number]]... If tag is present, the C type for all tokens on this line shall be declared to be the type referenced by tag. If a positive integer, number, follows a name, that value shall be assigned to the token. The following declares name to be a token, and assigns precedence to it: %left [<tag>] name [number] [name [number]]... %right [<tag>] name [number] [name [number]]... One or more lines, each beginning with one of these symbols, can appear in this section. All tokens on the same line have the same precedence level and associativity; the lines are in order of increasing precedence or binding strength. %left denotes that the operators on that line are left associative, and %right similarly denotes right associative operators. If tag is present, it shall declare a C type for names as described for %token. The following declares name to be a token, and indicates that this cannot be used associatively: %nonassoc [<tag>] name [number] [name [number]]... If the parser encounters associative use of this token it reports an error. If tag is present, it shall declare a C type for names as described for %token. The following declares that union member names are non-terminals, and thus it is required to have a tag field at its beginning: %type <tag> name... Because it deals with non-terminals only, assigning a token number or using a literal is also prohibited. If this construct is present, yacc shall perform type checking; if this construct is not present, the parse stack shall hold only the int type. Every name used in grammar not defined by a %token, %left, %right, or %nonassoc declaration is assumed to represent a non- terminal symbol. The yacc utility shall report an error for any non-terminal symbol that does not appear on the left side of at least one grammar rule. Once the type, precedence, or token number of a name is specified, it shall not be changed. If the first declaration of a token does not assign a token number, yacc shall assign a token number. Once this assignment is made, the token number shall not be changed by explicit assignment. The following declarators do not follow the previous pattern. The following declares the non-terminal name to be the start symbol, which represents the largest, most general structure described by the grammar rules: %start name By default, it is the left-hand side of the first grammar rule; this default can be overridden with this declaration. The following declares the yacc value stack to be a union of the various types of values desired. %union { body of union (in C) } The body of the union shall not contain unbalanced curly brace preprocessing tokens. By default, the values returned by actions (see below) and the lexical analyzer shall be of type int. The yacc utility keeps track of types, and it shall insert corresponding union member names in order to perform strict type checking of the resulting parser. Alternatively, given that at least one <tag> construct is used, the union can be declared in a header file (which shall be included in the declarations section by using a #include construct within %{ and %}), and a typedef used to define the symbol YYSTYPE to represent this union. The effect of %union is to provide the declaration of YYSTYPE directly from the yacc input. C-language declarations and definitions can appear in the declarations section, enclosed by the following marks: %{ ... %} These statements shall be copied into the code file, and have global scope within it so that they can be used in the rules and program sections. The statements shall not contain "%}" outside a comment, string literal, or multi-character constant. The application shall ensure that the declarations section is terminated by the token %%. Grammar Rules in yacc The rules section defines the context-free grammar to be accepted by the function yacc generates, and associates with those rules C-language actions and additional precedence information. The grammar is described below, and a formal definition follows. The rules section is comprised of one or more grammar rules. A grammar rule has the form: A : BODY ; The symbol A represents a non-terminal name, and BODY represents a sequence of zero or more names, literals, and semantic actions that can then be followed by optional precedence rules. Only the names and literals participate in the formation of the grammar; the semantic actions and precedence rules are used in other ways. The <colon> and the <semicolon> are yacc punctuation. If there are several successive grammar rules with the same left-hand side, the <vertical-line> ('|') can be used to avoid rewriting the left-hand side; in this case the <semicolon> appears only after the last rule. The BODY part can be empty (or empty of names and literals) to indicate that the non-terminal symbol matches the empty string. The yacc utility assigns a unique number to each rule. Rules using the vertical bar notation are distinct rules. The number assigned to the rule appears in the description file. The elements comprising a BODY are: name, literal These form the rules of the grammar: name is either a token or a non-terminal; literal stands for itself (less the lexically required quotation marks). semantic action With each grammar rule, the user can associate actions to be performed each time the rule is recognized in the input process. (Note that the word ``action'' can also refer to the actions of the parsershift, reduce, and so on.) These actions can return values and can obtain the values returned by previous actions. These values are kept in objects of type YYSTYPE (see %union). The result value of the action shall be kept on the parse stack with the left-hand side of the rule, to be accessed by other reductions as part of their right- hand side. By using the <tag> information provided in the declarations section, the code generated by yacc can be strictly type checked and contain arbitrary information. In addition, the lexical analyzer can provide the same kinds of values for tokens, if desired. An action is an arbitrary C statement and as such can do input or output, call subprograms, and alter external variables. An action is one or more C statements enclosed in curly braces '{' and '}'. The statements shall not contain unbalanced curly brace preprocessing tokens. Certain pseudo-variables can be used in the action. These are macros for access to data structures known internally to yacc. $$ The value of the action can be set by assigning it to $$. If type checking is enabled and the type of the value to be assigned cannot be determined, a diagnostic message may be generated. $number This refers to the value returned by the component specified by the token number in the right side of a rule, reading from left to right; number can be zero or negative. If number is zero or negative, it refers to the data associated with the name on the parser's stack preceding the leftmost symbol of the current rule. (That is, "$0" refers to the name immediately preceding the leftmost name in the current rule to be found on the parser's stack and "$-1" refers to the symbol to its left.) If number refers to an element past the current point in the rule, or beyond the bottom of the stack, the result is undefined. If type checking is enabled and the type of the value to be assigned cannot be determined, a diagnostic message may be generated. $<tag>number These correspond exactly to the corresponding symbols without the tag inclusion, but allow for strict type checking (and preclude unwanted type conversions). The effect is that the macro is expanded to use tag to select an element from the YYSTYPE union (using dataname.tag). This is particularly useful if number is not positive. $<tag>$ This imposes on the reference the type of the union member referenced by tag. This construction is applicable when a reference to a left context value occurs in the grammar, and provides yacc with a means for selecting a type. Actions can occur anywhere in a rule (not just at the end); an action can access values returned by actions to its left, and in turn the value it returns can be accessed by actions to its right. An action appearing in the middle of a rule shall be equivalent to replacing the action with a new non-terminal symbol and adding an empty rule with that non-terminal symbol on the left-hand side. The semantic action associated with the new rule shall be equivalent to the original action. The use of actions within rules might introduce conflicts that would not otherwise exist. By default, the value of a rule shall be the value of the first element in it. If the first element does not have a type (particularly in the case of a literal) and type checking is turned on by %type, an error message shall result. precedence The keyword %prec can be used to change the precedence level associated with a particular grammar rule. Examples of this are in cases where a unary and binary operator have the same symbolic representation, but need to be given different precedences, or where the handling of an ambiguous if-else construction is necessary. The reserved symbol %prec can appear immediately after the body of the grammar rule and can be followed by a token name or a literal. It shall cause the precedence of the grammar rule to become that of the following token name or literal. The action for the rule as a whole can follow %prec. If a program section follows, the application shall ensure that the grammar rules are terminated by %%. Programs Section The programs section can include the definition of the lexical analyzer yylex(), and any other functions; for example, those used in the actions specified in the grammar rules. It is unspecified whether the programs section precedes or follows the semantic actions in the output file; therefore, if the application contains any macro definitions and declarations intended to apply to the code in the semantic actions, it shall place them within "%{ ... %}" in the declarations section. Input Grammar The following input to yacc yields a parser for the input to yacc. This formal syntax takes precedence over the preceding text syntax description. The lexical structure is defined less precisely; Lexical Structure of the Grammar defines most terms. The correspondence between the previous terms and the tokens below is as follows. IDENTIFIER This corresponds to the concept of name, given previously. It also includes literals as defined previously. C_IDENTIFIER This is a name, and additionally it is known to be followed by a <colon>. A literal cannot yield this token. NUMBER A string of digits (a non-negative decimal integer). TYPE, LEFT, MARK, LCURL, RCURL These correspond directly to %type, %left, %%, %{, and %}. { ... } This indicates C-language source code, with the possible inclusion of '$' macros as discussed previously. /* Grammar for the input to yacc. */ /* Basic entries. */ /* The following are recognized by the lexical analyzer. */ %token IDENTIFIER /* Includes identifiers and literals */ %token C_IDENTIFIER /* identifier (but not literal) followed by a :. */ %token NUMBER /* [0-9][0-9]* */ /* Reserved words : %type=>TYPE %left=>LEFT, and so on */ %token LEFT RIGHT NONASSOC TOKEN PREC TYPE START UNION %token MARK /* The %% mark. */ %token LCURL /* The %{ mark. */ %token RCURL /* The %} mark. */ /* 8-bit character literals stand for themselves; */ /* tokens have to be defined for multi-byte characters. */ %start spec %% spec : defs MARK rules tail ; tail : MARK { /* In this action, set up the rest of the file. */ } | /* Empty; the second MARK is optional. */ ; defs : /* Empty. */ | defs def ; def : START IDENTIFIER | UNION { /* Copy union definition to output. */ } | LCURL { /* Copy C code to output file. */ } RCURL | rword tag nlist ; rword : TOKEN | LEFT | RIGHT | NONASSOC | TYPE ; tag : /* Empty: union tag ID optional. */ | '<' IDENTIFIER '>' ; nlist : nmno | nlist nmno ; nmno : IDENTIFIER /* Note: literal invalid with % type. */ | IDENTIFIER NUMBER /* Note: invalid with % type. */ ; /* Rule section */ rules : C_IDENTIFIER rbody prec | rules rule ; rule : C_IDENTIFIER rbody prec | '|' rbody prec ; rbody : /* empty */ | rbody IDENTIFIER | rbody act ; act : '{' { /* Copy action, translate $$, and so on. */ } '}' ; prec : /* Empty */ | PREC IDENTIFIER | PREC IDENTIFIER act | prec ';' ; Conflicts The parser produced for an input grammar may contain states in which conflicts occur. The conflicts occur because the grammar is not LALR(1). An ambiguous grammar always contains at least one LALR(1) conflict. The yacc utility shall resolve all conflicts, using either default rules or user-specified precedence rules. Conflicts are either shift/reduce conflicts or reduce/reduce conflicts. A shift/reduce conflict is where, for a given state and lookahead symbol, both a shift action and a reduce action are possible. A reduce/reduce conflict is where, for a given state and lookahead symbol, reductions by two different rules are possible. The rules below describe how to specify what actions to take when a conflict occurs. Not all shift/reduce conflicts can be successfully resolved this way because the conflict may be due to something other than ambiguity, so incautious use of these facilities can cause the language accepted by the parser to be much different from that which was intended. The description file shall contain sufficient information to understand the cause of the conflict. Where ambiguity is the reason either the default or explicit rules should be adequate to produce a working parser. The declared precedences and associativities (see Declarations Section) are used to resolve parsing conflicts as follows: 1. A precedence and associativity is associated with each grammar rule; it is the precedence and associativity of the last token or literal in the body of the rule. If the %prec keyword is used, it overrides this default. Some grammar rules might not have both precedence and associativity. 2. If there is a shift/reduce conflict, and both the grammar rule and the input symbol have precedence and associativity associated with them, then the conflict is resolved in favor of the action (shift or reduce) associated with the higher precedence. If the precedences are the same, then the associativity is used; left associative implies reduce, right associative implies shift, and non-associative implies an error in the string being parsed. 3. When there is a shift/reduce conflict that cannot be resolved by rule 2, the shift is done. Conflicts resolved this way are counted in the diagnostic output described in Error Handling. 4. When there is a reduce/reduce conflict, a reduction is done by the grammar rule that occurs earlier in the input sequence. Conflicts resolved this way are counted in the diagnostic output described in Error Handling. Conflicts resolved by precedence or associativity shall not be counted in the shift/reduce and reduce/reduce conflicts reported by yacc on either standard error or in the description file. Error Handling The token error shall be reserved for error handling. The name error can be used in grammar rules. It indicates places where the parser can recover from a syntax error. The default value of error shall be 256. Its value can be changed using a %token declaration. The lexical analyzer should not return the value of error. The parser shall detect a syntax error when it is in a state where the action associated with the lookahead symbol is error. A semantic action can cause the parser to initiate error handling by executing the macro YYERROR. When YYERROR is executed, the semantic action passes control back to the parser. YYERROR cannot be used outside of semantic actions. When the parser detects a syntax error, it normally calls yyerror() with the character string "syntax error" as its argument. The call shall not be made if the parser is still recovering from a previous error when the error is detected. The parser is considered to be recovering from a previous error until the parser has shifted over at least three normal input symbols since the last error was detected or a semantic action has executed the macro yyerrok. The parser shall not call yyerror() when YYERROR is executed. The macro function YYRECOVERING shall return 1 if a syntax error has been detected and the parser has not yet fully recovered from it. Otherwise, zero shall be returned. When a syntax error is detected by the parser, the parser shall check if a previous syntax error has been detected. If a previous error was detected, and if no normal input symbols have been shifted since the preceding error was detected, the parser checks if the lookahead symbol is an endmarker (see Interface to the Lexical Analyzer). If it is, the parser shall return with a non- zero value. Otherwise, the lookahead symbol shall be discarded and normal parsing shall resume. When YYERROR is executed or when the parser detects a syntax error and no previous error has been detected, or at least one normal input symbol has been shifted since the previous error was detected, the parser shall pop back one state at a time until the parse stack is empty or the current state allows a shift over error. If the parser empties the parse stack, it shall return with a non-zero value. Otherwise, it shall shift over error and then resume normal parsing. If the parser reads a lookahead symbol before the error was detected, that symbol shall still be the lookahead symbol when parsing is resumed. The macro yyerrok in a semantic action shall cause the parser to act as if it has fully recovered from any previous errors. The macro yyclearin shall cause the parser to discard the current lookahead token. If the current lookahead token has not yet been read, yyclearin shall have no effect. The macro YYACCEPT shall cause the parser to return with the value zero. The macro YYABORT shall cause the parser to return with a non-zero value. Interface to the Lexical Analyzer The yylex() function is an integer-valued function that returns a token number representing the kind of token read. If there is a value associated with the token returned by yylex() (see the discussion of tag above), it shall be assigned to the external variable yylval. If the parser and yylex() do not agree on these token numbers, reliable communication between them cannot occur. For (single- byte character) literals, the token is simply the numeric value of the character in the current character set. The numbers for other tokens can either be chosen by yacc, or chosen by the user. In either case, the #define construct of C is used to allow yylex() to return these numbers symbolically. The #define statements are put into the code file, and the header file if that file is requested. The set of characters permitted by yacc in an identifier is larger than that permitted by C. Token names found to contain such characters shall not be included in the #define declarations. If the token numbers are chosen by yacc, the tokens other than literals shall be assigned numbers greater than 256, although no order is implied. A token can be explicitly assigned a number by following its first appearance in the declarations section with a number. Names and literals not defined this way retain their default definition. All token numbers assigned by yacc shall be unique and distinct from the token numbers used for literals and user-assigned tokens. If duplicate token numbers cause conflicts in parser generation, yacc shall report an error; otherwise, it is unspecified whether the token assignment is accepted or an error is reported. The end of the input is marked by a special token called the endmarker, which has a token number that is zero or negative. (These values are invalid for any other token.) All lexical analyzers shall return zero or negative as a token number upon reaching the end of their input. If the tokens up to, but excluding, the endmarker form a structure that matches the start symbol, the parser shall accept the input. If the endmarker is seen in any other context, it shall be considered an error. Completing the Program In addition to yyparse() and yylex(), the functions yyerror() and main() are required to make a complete program. The application can supply main() and yyerror(), or those routines can be obtained from the yacc library. Yacc Library The following functions shall appear only in the yacc library accessible through the -l y operand to c99; they can therefore be redefined by a conforming application: int main(void) This function shall call yyparse() and exit with an unspecified value. Other actions within this function are unspecified. int yyerror(const char *s) This function shall write the NUL-terminated argument to standard error, followed by a <newline>. The order of the -l y and -l l operands given to c99 is significant; the application shall either provide its own main() function or ensure that -l y precedes -l l. Debugging the Parser The parser generated by yacc shall have diagnostic facilities in it that can be optionally enabled at either compile time or at runtime (if enabled at compile time). The compilation of the runtime debugging code is under the control of YYDEBUG, a preprocessor symbol. If YYDEBUG has a non-zero value, the debugging code shall be included. If its value is zero, the code shall not be included. In parsers where the debugging code has been included, the external int yydebug can be used to turn debugging on (with a non-zero value) and off (zero value) at runtime. The initial value of yydebug shall be zero. When -t is specified, the code file shall be built such that, if YYDEBUG is not already defined at compilation time (using the c99 -D YYDEBUG option, for example), YYDEBUG shall be set explicitly to 1. When -t is not specified, the code file shall be built such that, if YYDEBUG is not already defined, it shall be set explicitly to zero. The format of the debugging output is unspecified but includes at least enough information to determine the shift and reduce actions, and the input symbols. It also provides information about error recovery. Algorithms The parser constructed by yacc implements an LALR(1) parsing algorithm as documented in the literature. It is unspecified whether the parser is table-driven or direct-coded. A parser generated by yacc shall never request an input symbol from yylex() while in a state where the only actions other than the error action are reductions by a single rule. The literature of parsing theory defines these concepts. Limits The yacc utility may have several internal tables. The minimum maximums for these tables are shown in the following table. The exact meaning of these values is implementation-defined. The implementation shall define the relationship between these values and between them and any error messages that the implementation may generate should it run out of space for any internal structure. An implementation may combine groups of these resources into a single pool as long as the total available to the user does not fall below the sum of the sizes specified by this section. Table: Internal Limits in yacc Minimum Limit Maximum Description {NTERMS} 126 Number of tokens. {NNONTERM} 200 Number of non-terminals. {NPROD} 300 Number of rules. {NSTATES} 600 Number of states. {MEMSIZE} 5200 Length of rules. The total length, in names (tokens and non-terminals), of all the rules of the grammar. The left-hand side is counted for each rule, even if it is not explicitly repeated, as specified in Grammar Rules in yacc. {ACTSIZE} 4000 Number of actions. ``Actions'' here (and in the description file) refer to parser actions (shift, reduce, and so on) not to semantic actions defined in Grammar Rules in yacc. EXIT STATUS top The following exit values shall be returned: 0 Successful completion. >0 An error occurred. CONSEQUENCES OF ERRORS top If any errors are encountered, the run is aborted and yacc exits with a non-zero status. Partial code files and header files may be produced. The summary information in the description file shall always be produced if the -v flag is present. The following sections are informative. APPLICATION USAGE top Historical implementations experience name conflicts on the names yacc.tmp, yacc.acts, yacc.debug, y.tab.c, y.tab.h, and y.output if more than one copy of yacc is running in a single directory at one time. The -b option was added to overcome this problem. The related problem of allowing multiple yacc parsers to be placed in the same file was addressed by adding a -p option to override the previously hard-coded yy variable prefix. The description of the -p option specifies the minimal set of function and variable names that cause conflict when multiple parsers are linked together. YYSTYPE does not need to be changed. Instead, the programmer can use -b to give the header files for different parsers different names, and then the file with the yylex() for a given parser can include the header for that parser. Names such as yyclearerr do not need to be changed because they are used only in the actions; they do not have linkage. It is possible that an implementation has other names, either internal ones for implementing things such as yyclearerr, or providing non-standard features that it wants to change with -p. Unary operators that are the same token as a binary operator in general need their precedence adjusted. This is handled by the %prec advisory symbol associated with the particular grammar rule defining that unary operator. (See Grammar Rules in yacc.) Applications are not required to use this operator for unary operators, but the grammars that do not require it are rare. EXAMPLES top Access to the yacc library is obtained with library search operands to c99. To use the yacc library main(): c99 y.tab.c -l y Both the lex library and the yacc library contain main(). To access the yacc main(): c99 y.tab.c lex.yy.c -l y -l l This ensures that the yacc library is searched first, so that its main() is used. The historical yacc libraries have contained two simple functions that are normally coded by the application programmer. These functions are similar to the following code: #include <locale.h> int main(void) { extern int yyparse(); setlocale(LC_ALL, ""); /* If the following parser is one created by lex, the application must be careful to ensure that LC_CTYPE and LC_COLLATE are set to the POSIX locale. */ (void) yyparse(); return (0); } #include <stdio.h> int yyerror(const char *msg) { (void) fprintf(stderr, "%s\n", msg); return (0); } RATIONALE top The references in Referenced Documents may be helpful in constructing the parser generator. The referenced DeRemer and Pennello article (along with the works it references) describes a technique to generate parsers that conform to this volume of POSIX.12017. Work in this area continues to be done, so implementors should consult current literature before doing any new implementations. The original Knuth article is the theoretical basis for this kind of parser, but the tables it generates are impractically large for reasonable grammars and should not be used. The ``equivalent to'' wording is intentional to assure that the best tables that are LALR(1) can be generated. There has been confusion between the class of grammars, the algorithms needed to generate parsers, and the algorithms needed to parse the languages. They are all reasonably orthogonal. In particular, a parser generator that accepts the full range of LR(1) grammars need not generate a table any more complex than one that accepts SLR(1) (a relatively weak class of LR grammars) for a grammar that happens to be SLR(1). Such an implementation need not recognize the case, either; table compression can yield the SLR(1) table (or one even smaller than that) without recognizing that the grammar is SLR(1). The speed of an LR(1) parser for any class is dependent more upon the table representation and compression (or the code generation if a direct parser is generated) than upon the class of grammar that the table generator handles. The speed of the parser generator is somewhat dependent upon the class of grammar it handles. However, the original Knuth article algorithms for constructing LR parsers were judged by its author to be impractically slow at that time. Although full LR is more complex than LALR(1), as computer speeds and algorithms improve, the difference (in terms of acceptable wall-clock execution time) is becoming less significant. Potential authors are cautioned that the referenced DeRemer and Pennello article previously cited identifies a bug (an over- simplification of the computation of LALR(1) lookahead sets) in some of the LALR(1) algorithm statements that preceded it to publication. They should take the time to seek out that paper, as well as current relevant work, particularly Aho's. The -b option was added to provide a portable method for permitting yacc to work on multiple separate parsers in the same directory. If a directory contains more than one yacc grammar, and both grammars are constructed at the same time (by, for example, a parallel make program), conflict results. While the solution is not historical practice, it corrects a known deficiency in historical implementations. Corresponding changes were made to all sections that referenced the filenames y.tab.c (now ``the code file''), y.tab.h (now ``the header file''), and y.output (now ``the description file''). The grammar for yacc input is based on System V documentation. The textual description shows there that the ';' is required at the end of the rule. The grammar and the implementation do not require this. (The use of C_IDENTIFIER causes a reduce to occur in the right place.) Also, in that implementation, the constructs such as %token can be terminated by a <semicolon>, but this is not permitted by the grammar. The keywords such as %token can also appear in uppercase, which is again not discussed. In most places where '%' is used, <backslash> can be substituted, and there are alternate spellings for some of the symbols (for example, %LEFT can be "%<" or even "\<"). Historically, <tag> can contain any characters except '>', including white space, in the implementation. However, since the tag must reference an ISO C standard union member, in practice conforming implementations need to support only the set of characters for ISO C standard identifiers in this context. Some historical implementations are known to accept actions that are terminated by a period. Historical implementations often allow '$' in names. A conforming implementation does not need to support either of these behaviors. Deciding when to use %prec illustrates the difficulty in specifying the behavior of yacc. There may be situations in which the grammar is not, strictly speaking, in error, and yet yacc cannot interpret it unambiguously. The resolution of ambiguities in the grammar can in many instances be resolved by providing additional information, such as using %type or %union declarations. It is often easier and it usually yields a smaller parser to take this alternative when it is appropriate. The size and execution time of a program produced without the runtime debugging code is usually smaller and slightly faster in historical implementations. Statistics messages from several historical implementations include the following types of information: n/512 terminals, n/300 non-terminals n/600 grammar rules, n/1500 states n shift/reduce, n reduce/reduce conflicts reported n/350 working sets used Memory: states, etc. n/15000, parser n/15000 n/600 distinct lookahead sets n extra closures n shift entries, n exceptions n goto entries n entries saved by goto default Optimizer space used: input n/15000, output n/15000 n table entries, n zero Maximum spread: n, Maximum offset: n The report of internal tables in the description file is left implementation-defined because all aspects of these limits are also implementation-defined. Some implementations may use dynamic allocation techniques and have no specific limit values to report. The format of the y.output file is not given because specification of the format was not seen to enhance applications portability. The listing is primarily intended to help human users understand and debug the parser; use of y.output by a conforming application script would be unusual. Furthermore, implementations have not produced consistent output and no popular format was apparent. The format selected by the implementation should be human-readable, in addition to the requirement that it be a text file. Standard error reports are not specifically described because they are seldom of use to conforming applications and there was no reason to restrict implementations. Some implementations recognize "={" as equivalent to '{' because it appears in historical documentation. This construction was recognized and documented as obsolete as long ago as 1978, in the referenced Yacc: Yet Another Compiler-Compiler. This volume of POSIX.12017 chose to leave it as obsolete and omit it. Multi-byte characters should be recognized by the lexical analyzer and returned as tokens. They should not be returned as multi-byte character literals. The token error that is used for error recovery is normally assigned the value 256 in the historical implementation. Thus, the token value 256, which is used in many multi-byte character sets, is not available for use as the value of a user-defined token. FUTURE DIRECTIONS top None. SEE ALSO top c99(1p), lex(1p) The Base Definitions volume of POSIX.12017, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines COPYRIGHT top Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE/The Open Group 2017 YACC(1P) Pages that refer to this page: cflow(1p), lex(1p), make(1p) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# yacc\n\n> Generate an LALR parser (in C) with a formal grammar specification file.\n> See also: `bison`.\n> More information: <https://manned.org/man/yacc.1p>.\n\n- Create a file `y.tab.c` containing the C parser code and compile the grammar file with all necessary constant declarations for values. (Constant declarations file `y.tab.h` is created only when the `-d` flag is used):\n\n`yacc -d {{path/to/grammar_file.y}}`\n\n- Compile a grammar file containing the description of the parser and a report of conflicts generated by ambiguities in the grammar:\n\n`yacc -d {{path/to/grammar_file.y}} -v`\n\n- Compile a grammar file, and prefix output filenames with `prefix` instead of `y`:\n\n`yacc -d {{path/to/grammar_file.y}} -v -b {{prefix}}`\n
yes
yes(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training yes(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON YES(1) User Commands YES(1) NAME top yes - output a string repeatedly until killed SYNOPSIS top yes [STRING]... yes OPTION DESCRIPTION top Repeatedly output a line with all specified STRING(s), or 'y'. --help display this help and exit --version output version information and exit AUTHOR top Written by David MacKenzie. REPORTING BUGS top GNU coreutils online help: <https://www.gnu.org/software/coreutils/> Report any translation bugs to <https://translationproject.org/team/> COPYRIGHT top Copyright 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO top Full documentation <https://www.gnu.org/software/coreutils/yes> or available locally via: info '(coreutils) yes invocation' COLOPHON top This page is part of the coreutils (basic file, shell and text manipulation utilities) project. Information about the project can be found at http://www.gnu.org/software/coreutils/. If you have a bug report for this manual page, see http://www.gnu.org/software/coreutils/. This page was obtained from the tarball coreutils-9.4.tar.xz fetched from http://ftp.gnu.org/gnu/coreutils/ on 2023-12-22. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] GNU coreutils 9.4 August 2023 YES(1) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# yes\n\n> Output something repeatedly.\n> This command is commonly used to answer yes to every prompt by install commands (such as apt-get).\n> More information: <https://www.gnu.org/software/coreutils/yes>.\n\n- Repeatedly output "message":\n\n`yes {{message}}`\n\n- Repeatedly output "y":\n\n`yes`\n\n- Accept everything prompted by the `apt-get` command:\n\n`yes | sudo apt-get install {{program}}`\n\n- Repeatedly output a newline to always accept the default option of a prompt:\n\n`yes ''`\n
yum
yum(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training Another version of this page is provided by the yum project yum(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | COMMANDS | SPECIFYING PACKAGES | SPECIFYING PROVIDES | SPECIFYING GROUPS | SPECIFYING MODULES | SPECIFYING TRANSACTIONS | PACKAGE FILTERING | METADATA SYNCHRONIZATION | CONFIGURATION FILES REPLACEMENT POLICY | FILES | SEE ALSO | AUTHOR | COPYRIGHT | COLOPHON YUM(8) DNF YUM(8) NAME top yum - redirecting to DNF Command Reference SYNOPSIS top dnf [options] <command> [<args>...] DESCRIPTION top DNF is the next upcoming major version of YUM, a package manager for RPM-based Linux distributions. It roughly maintains CLI compatibility with YUM and defines a strict API for extensions and plugins. Plugins can modify or extend features of DNF or provide additional CLI commands on top of those mentioned below. If you know the name of such a command (including commands mentioned below), you may find/install the package which provides it using the appropriate virtual provide in the form of dnf-command(<alias>), where <alias> is the name of the command; e.g.``dnf install 'dnf-command(versionlock)'`` installs a versionlock plugin. This approach also applies to specifying dependencies of packages that require a particular DNF command. Return values: 0 : Operation was successful. 1 : An error occurred, which was handled by dnf. 3 : An unknown unhandled error occurred during operation. 100: See check-update 200: There was a problem with acquiring or releasing of locks. Available commands: alias autoremove check check-update clean deplist distro-sync downgrade group help history info install list makecache mark module provides reinstall remove repoinfo repolist repoquery repository-packages search shell swap updateinfo upgrade upgrade-minimal Additional information: Options Specifying Packages Specifying Provides Specifying File Provides Specifying Groups Specifying Transactions Metadata Synchronization Configuration Files Replacement Policy Files See Also OPTIONS top -4 Resolve to IPv4 addresses only. -6 Resolve to IPv6 addresses only. --advisory=<advisory>, --advisories=<advisory> Include packages corresponding to the advisory ID, Eg. FEDORA-2201-123. Applicable for the install, repoquery, updateinfo, upgrade and offline-upgrade (dnf-plugins-core) commands. --allowerasing Allow erasing of installed packages to resolve dependencies. This option could be used as an alternative to the yum swap command where packages to remove are not explicitly defined. --assumeno Automatically answer no for all questions. -b, --best Try the best available package versions in transactions. Specifically during dnf upgrade, which by default skips over updates that can not be installed for dependency reasons, the switch forces DNF to only consider the latest packages. When running into packages with broken dependencies, DNF will fail giving a reason why the latest version can not be installed. Note that the use of the newest available version is only guaranteed for the packages directly requested (e.g. as a command line arguments), and the solver may use older versions of dependencies to meet their requirements. --bugfix Include packages that fix a bugfix issue. Applicable for the install, repoquery, updateinfo, upgrade and offline-upgrade (dnf-plugins-core) commands. --bz=<bugzilla>, --bzs=<bugzilla> Include packages that fix a Bugzilla ID, Eg. 123123. Applicable for the install, repoquery, updateinfo, upgrade and offline-upgrade (dnf-plugins-core) commands. -C, --cacheonly Run entirely from system cache, don't update the cache and use it even in case it is expired. DNF uses a separate cache for each user under which it executes. The cache for the root user is called the system cache. This switch allows a regular user read-only access to the system cache, which usually is more fresh than the user's and thus he does not have to wait for metadata sync. --color=<color> Control whether color is used in terminal output. Valid values are always, never and auto (default). --comment=<comment> Add a comment to the transaction history. -c <config file>, --config=<config file> Configuration file location. --cve=<cves>, --cves=<cves> Include packages that fix a CVE (Common Vulnerabilities and Exposures) ID (http://cve.mitre.org/about/ ), Eg. CVE-2201-0123. Applicable for the install, repoquery, updateinfo, upgrade and offline-upgrade (dnf-plugins-core) commands. -d <debug level>, --debuglevel=<debug level> Debugging output level. This is an integer value between 0 (no additional information strings) and 10 (shows all debugging information, even that not understandable to the user), default is 2. Deprecated, use -v instead. --debugsolver Dump data aiding in dependency solver debugging into ./debugdata. --disableexcludes=[all|main|<repoid>], --disableexcludepkgs=[all|main|<repoid>] Disable the configuration file excludes. Takes one of the following three options: all, disables all configuration file excludes main, disables excludes defined in the [main] section repoid, disables excludes defined for the given repository --disable, --set-disabled Disable specified repositories (automatically saves). The option has to be used together with the config-manager command (dnf-plugins-core). --disableplugin=<plugin names> Disable the listed plugins specified by names or globs. --disablerepo=<repoid> Temporarily disable active repositories for the purpose of the current dnf command. Accepts an id, a comma-separated list of ids, or a glob of ids. This option can be specified multiple times, but is mutually exclusive with --repo. --downloaddir=<path>, --destdir=<path> Redirect downloaded packages to provided directory. The option has to be used together with the --downloadonly command line option, with the download, modulesync, reposync or system-upgrade commands (dnf-plugins-core). --downloadonly Download the resolved package set without performing any rpm transaction (install/upgrade/erase). Packages are removed after the next successful transaction. This applies also when used together with --destdir option as the directory is considered as a part of the DNF cache. To persist the packages, use the download command instead. -e <error level>, --errorlevel=<error level> Error output level. This is an integer value between 0 (no error output) and 10 (shows all error messages), default is 3. Deprecated, use -v instead. --enable, --set-enabled Enable specified repositories (automatically saves). The option has to be used together with the config-manager command (dnf-plugins-core). --enableplugin=<plugin names> Enable the listed plugins specified by names or globs. --enablerepo=<repoid> Temporarily enable additional repositories for the purpose of the current dnf command. Accepts an id, a comma-separated list of ids, or a glob of ids. This option can be specified multiple times. --enhancement Include enhancement relevant packages. Applicable for the install, repoquery, updateinfo, upgrade and offline-upgrade (dnf-plugins-core) commands. -x <package-file-spec>, --exclude=<package-file-spec> Exclude packages specified by <package-file-spec> from the operation. --excludepkgs=<package-file-spec> Deprecated option. It was replaced by the --exclude option. --forcearch=<arch> Force the use of an architecture. Any architecture can be specified. However, use of an architecture not supported natively by your CPU will require emulation of some kind. This is usually through QEMU. The behavior of --forcearch can be configured by using the arch and ignorearch configuration options with values <arch> and True respectively. -h, --help, --help-cmd Show the help. --installroot=<path> Specifies an alternative installroot, relative to where all packages will be installed. Think of this like doing chroot <root> dnf, except using --installroot allows dnf to work before the chroot is created. It requires absolute path. cachedir, log files, releasever, and gpgkey are taken from or stored in the installroot. Gpgkeys are imported into the installroot from a path relative to the host which can be specified in the repository section of configuration files. configuration file and reposdir are searched inside the installroot first. If they are not present, they are taken from the host system. Note: When a path is specified within a command line argument (--config=<config file> in case of configuration file and --setopt=reposdir=<reposdir> for reposdir) then this path is always relative to the host with no exceptions. vars are taken from the host system or installroot according to reposdir . When reposdir path is specified within a command line argument, vars are taken from the installroot. When varsdir paths are specified within a command line argument (--setopt=varsdir=<reposdir>) then those path are always relative to the host with no exceptions. The pluginpath and pluginconfpath are relative to the host. Note: You may also want to use the command-line option --releasever=<release> when creating the installroot, otherwise the $releasever value is taken from the rpmdb within the installroot (and thus it is empty at the time of creation and the transaction will fail). If --releasever=/ is used, the releasever will be detected from the host (/) system. The new installroot path at the time of creation does not contain the repository, releasever and dnf.conf files. On a modular system you may also want to use the --setopt=module_platform_id=<module_platform_name:stream> command-line option when creating the installroot, otherwise the module_platform_id value will be taken from the /etc/os-release file within the installroot (and thus it will be empty at the time of creation, the modular dependency could be unsatisfied and modules content could be excluded). Installroot examples: dnf --installroot=<installroot> --releasever=<release> install system-release Permanently sets the releasever of the system in the <installroot> directory to <release>. dnf --installroot=<installroot> --setopt=reposdir=<path> --config /path/dnf.conf upgrade Upgrades packages inside the installroot from a repository described by --setopt using configuration from /path/dnf.conf. --newpackage Include newpackage relevant packages. Applicable for the install, repoquery, updateinfo, upgrade and offline-upgrade (dnf-plugins-core) commands. --noautoremove Disable removal of dependencies that are no longer used. It sets clean_requirements_on_remove configuration option to False. --nobest Set best option to False, so that transactions are not limited to best candidates only. --nodocs Do not install documentation. Sets the rpm flag 'RPMTRANS_FLAG_NODOCS'. --nogpgcheck Skip checking GPG signatures on packages (if RPM policy allows). --noplugins Disable all plugins. --obsoletes This option has an effect on an install/update, it enables dnf's obsoletes processing logic. For more information see the obsoletes option. This option also displays capabilities that the package obsoletes when used together with the repoquery command. Configuration Option: obsoletes -q, --quiet In combination with a non-interactive command, shows just the relevant content. Suppresses messages notifying about the current state or actions of DNF. -R <minutes>, --randomwait=<minutes> Maximum command wait time. --refresh Set metadata as expired before running the command. --releasever=<release> Configure DNF as if the distribution release was <release>. This can affect cache paths, values in configuration files and mirrorlist URLs. --repofrompath <repo>,<path/url> Specify a repository to add to the repositories for this query. This option can be used multiple times. The repository label is specified by <repo>. The path or url to the repository is specified by <path/url>. It is the same path as a baseurl and can be also enriched by the repo variables. The configuration for the repository can be adjusted using - -setopt=<repo>.<option>=<value>. If you want to view only packages from this repository, combine this with the --repo=<repo> or --disablerepo="*" switches. --repo=<repoid>, --repoid=<repoid> Enable just specific repositories by an id or a glob. Can be used multiple times with accumulative effect. It is basically a shortcut for --disablerepo="*" --enablerepo=<repoid> and is mutually exclusive with the --disablerepo option. --rpmverbosity=<name> RPM debug scriptlet output level. Sets the debug level to <name> for RPM scriptlets. For available levels, see the rpmverbosity configuration option. --sec-severity=<severity>, --secseverity=<severity> Includes packages that provide a fix for an issue of the specified severity. Applicable for the install, repoquery, updateinfo, upgrade and offline-upgrade (dnf-plugins-core) commands. --security Includes packages that provide a fix for a security issue. Applicable for the install, repoquery, updateinfo, upgrade and offline-upgrade (dnf-plugins-core) commands. --setopt=<option>=<value> Override a configuration option from the configuration file. To override configuration options for repositories, use repoid.option for the <option>. Values for configuration options like excludepkgs, includepkgs, installonlypkgs and tsflags are appended to the original value, they do not override it. However, specifying an empty value (e.g. --setopt=tsflags=) will clear the option. --skip-broken Resolve depsolve problems by removing packages that are causing problems from the transaction. It is an alias for the strict configuration option with value False. Additionally, with the enable and disable module subcommands it allows one to perform an action even in case of broken modular dependencies. --showduplicates Show duplicate packages in repositories. Applicable for the list and search commands. -v, --verbose Verbose operation, show debug messages. --version Show DNF version and exit. -y, --assumeyes Automatically answer yes for all questions. List options are comma-separated. Command-line options override respective settings from configuration files. COMMANDS top For an explanation of <package-spec>, <package-file-spec> and <package-name-spec> see Specifying Packages. For an explanation of <provide-spec> see Specifying Provides. For an explanation of <group-spec> see Specifying Groups. For an explanation of <module-spec> see Specifying Modules. For an explanation of <transaction-spec> see Specifying Transactions. Alias Command Command: alias Allows the user to define and manage a list of aliases (in the form <name=value>), which can be then used as dnf commands to abbreviate longer command sequences. For examples on using the alias command, see Alias Examples. For examples on the alias processing, see Alias Processing Examples. To use an alias (name=value), the name must be placed as the first "command" (e.g. the first argument that is not an option). It is then replaced by its value and the resulting sequence is again searched for aliases. The alias processing stops when the first found command is not a name of any alias. In case the processing would result in an infinite recursion, the original arguments are used instead. Also, like in shell aliases, if the result starts with a \, the alias processing will stop. All aliases are defined in configuration files in the /etc/dnf/aliases.d/ directory in the [aliases] section, and aliases created by the alias command are written to the USER.conf file. In case of conflicts, the USER.conf has the highest priority, and alphabetical ordering is used for the rest of the configuration files. Optionally, there is the enabled option in the [main] section defaulting to True. This can be set for each file separately in the respective file, or globally for all aliases in the ALIASES.conf file. dnf alias [options] [list] [<name>...] List aliases with their final result. The [<alias>...] parameter further limits the result to only those aliases matching it. dnf alias [options] add <name=value>... Create new aliases. dnf alias [options] delete <name>... Delete aliases. Alias Examples dnf alias list Lists all defined aliases. dnf alias add rm=remove Adds a new command alias called rm which works the same as the remove command. dnf alias add upgrade="\upgrade --skip-broken --disableexcludes=all --obsoletes" Adds a new command alias called upgrade which works the same as the upgrade command, with additional options. Note that the original upgrade command is prefixed with a \ to prevent an infinite loop in alias processing. Alias Processing Examples If there are defined aliases in=install and FORCE="--skip-broken --disableexcludes=all": dnf FORCE in will be replaced with dnf --skip-broken --disableexcludes=all install dnf in FORCE will be replaced with dnf install FORCE (which will fail) If there is defined alias in=install: dnf in will be replaced with dnf install dnf --repo updates in will be replaced with dnf --repo updates in (which will fail) Autoremove Command Command: autoremove Aliases for explicit NEVRA matching: autoremove-n, autoremove-na, autoremove-nevra dnf [options] autoremove Removes all "leaf" packages from the system that were originally installed as dependencies of user-installed packages, but which are no longer required by any such package. Packages listed in installonlypkgs are never automatically removed by this command. dnf [options] autoremove <spec>... This is an alias for the Remove Command command with clean_requirements_on_remove set to True. It removes the specified packages from the system along with any packages depending on the packages being removed. Each <spec> can be either a <package-spec>, which specifies a package directly, or a @<group-spec>, which specifies an (environment) group which contains it. It also removes any dependencies that are no longer needed. There are also a few specific autoremove commands autoremove-n, autoremove-na and autoremove-nevra that allow the specification of an exact argument in the NEVRA (name-epoch:version-release.architecture) format. This command by default does not force a sync of expired metadata. See also Metadata Synchronization. Check Command Command: check dnf [options] check [--dependencies] [--duplicates] [--obsoleted] [--provides] Checks the local packagedb and produces information on any problems it finds. You can limit the checks to be performed by using the --dependencies, --duplicates, --obsoleted and --provides options (the default is to check everything). Check-Update Command Command: check-update Aliases: check-upgrade dnf [options] check-update [--changelogs] [<package-file-spec>...] Non-interactively checks if updates of the specified packages are available. If no <package-file-spec> is given, checks whether any updates at all are available for your system. DNF exit code will be 100 when there are updates available and a list of the updates will be printed, 0 if not and 1 if an error occurs. If --changelogs option is specified, also changelog delta of packages about to be updated is printed. Please note that having a specific newer version available for an installed package (and reported by check-update) does not imply that subsequent dnf upgrade will install it. The difference is that dnf upgrade has restrictions (like package dependencies being satisfied) to take into account. The output is affected by the autocheck_running_kernel configuration option. Clean Command Command: clean Performs cleanup of temporary files kept for repositories. This includes any such data left behind from disabled or removed repositories as well as for different distribution release versions. dnf clean dbcache Removes cache files generated from the repository metadata. This forces DNF to regenerate the cache files the next time it is run. dnf clean expire-cache Marks the repository metadata expired. DNF will re-validate the cache for each repository the next time it is used. dnf clean metadata Removes repository metadata. Those are the files which DNF uses to determine the remote availability of packages. Using this option will make DNF download all the metadata the next time it is run. dnf clean packages Removes any cached packages from the system. dnf clean all Does all of the above. Deplist Command dnf [options] deplist [<select-options>] [<query-options>] [<package-spec>] Deprecated alias for dnf repoquery --deplist. Distro-Sync Command Command: distro-sync Aliases: dsync Deprecated aliases: distrosync, distribution-synchronization dnf distro-sync [<package-spec>...] As necessary upgrades, downgrades or keeps selected installed packages to match the latest version available from any enabled repository. If no package is given, all installed packages are considered. See also Configuration Files Replacement Policy. Downgrade Command Command: downgrade Aliases: dg dnf [options] downgrade <package-spec>... Downgrades the specified packages to the highest installable package of all known lower versions if possible. When version is given and is lower than version of installed package then it downgrades to target version. Group Command Command: group Aliases: grp Deprecated aliases: groups, grouplist, groupinstall, groupupdate, groupremove, grouperase, groupinfo Groups are virtual collections of packages. DNF keeps track of groups that the user selected ("marked") installed and can manipulate the comprising packages with simple commands. dnf [options] group [summary] <group-spec> Display overview of how many groups are installed and available. With a spec, limit the output to the matching groups. summary is the default groups subcommand. dnf [options] group info <group-spec> Display package lists of a group. Shows which packages are installed or available from a repository when -v is used. dnf [options] group install [--with-optional] <group-spec>... Mark the specified group installed and install packages it contains. Also include optional packages of the group if --with-optional is specified. All Mandatory and Default packages will be installed whenever possible. Conditional packages are installed if they meet their requirement. If the group is already (partially) installed, the command installs the missing packages from the group. Depending on the value of obsoletes configuration option group installation takes obsoletes into account. dnf [options] group list <group-spec>... List all matching groups, either among installed or available groups. If nothing is specified, list all known groups. --installed and --available options narrow down the requested list. Records are ordered by the display_order tag defined in comps.xml file. Provides a list of all hidden groups by using option --hidden. Provides group IDs when the -v or --ids options are used. dnf [options] group remove <group-spec>... Mark the group removed and remove those packages in the group from the system which do not belong to another installed group and were not installed explicitly by the user. dnf [options] group upgrade <group-spec>... Upgrades the packages from the group and upgrades the group itself. The latter comprises of installing packages that were added to the group by the distribution and removing packages that got removed from the group as far as they were not installed explicitly by the user. Groups can also be marked installed or removed without physically manipulating any packages: dnf [options] group mark install <group-spec>... Mark the specified group installed. No packages will be installed by this command, but the group is then considered installed. dnf [options] group mark remove <group-spec>... Mark the specified group removed. No packages will be removed by this command. See also Configuration Files Replacement Policy. Help Command Command: help dnf help [<command>] Displays the help text for all commands. If given a command name then only displays help for that particular command. History Command Command: history Aliases: hist The history command allows the user to view what has happened in past transactions and act according to this information (assuming the history_record configuration option is set). dnf history [list] [--reverse] [<spec>...] The default history action is listing information about given transactions in a table. Each <spec> can be either a <transaction-spec>, which specifies a transaction directly, or a <transaction-spec>..<transaction-spec>, which specifies a range of transactions, or a <package-name-spec>, which specifies a transaction by a package which it manipulated. When no transaction is specified, list all known transactions. The "Action(s)" column lists each type of action taken in the transaction. The possible values are: Install (I): a new package was installed on the system Downgrade (D): an older version of a package replaced the previously-installed version Obsolete (O): an obsolete package was replaced by a new package Upgrade (U): a newer version of the package replaced the previously-installed version Remove (E): a package was removed from the system Reinstall (R): a package was reinstalled with the same version Reason change (C): a package was kept in the system but its reason for being installed changed The "Altered" column lists the number of actions taken in each transaction, possibly followed by one or two of the following symbols: >: The RPM database was changed, outside DNF, after the transaction <: The RPM database was changed, outside DNF, before the transaction *: The transaction aborted before completion #: The transaction completed, but with a non-zero status E: The transaction completed successfully, but had warning/error output --reverse The order of history list output is printed in reverse order. dnf history info [<spec>...] Describe the given transactions. The meaning of <spec> is the same as in the History List Command. When no transaction is specified, describe what happened during the latest transaction. dnf history redo <transaction-spec>|<package-file-spec> Repeat the specified transaction. Uses the last transaction (with the highest ID) if more than one transaction for given <package-file-spec> is found. If it is not possible to redo some operations due to the current state of RPMDB, it will not redo the transaction. dnf history replay [--ignore-installed] [--ignore-extras] [--skip-unavailable] <filename> Replay a transaction stored in file <filename> by History Store Command. The replay will perform the exact same operations on the packages as in the original transaction and will return with an error if case of any differences in installed packages or their versions. See also the Transaction JSON Format specification of the file format. --ignore-installed Don't check for the installed packages being in the same state as those recorded in the transaction. E.g. in case there is an upgrade foo-1.0 -> foo-2.0 stored in the transaction, but there is foo-1.1 installed on the target system. --ignore-extras Don't check for extra packages pulled into the transaction on the target system. E.g. the target system may not have some dependency, which was installed on the source system. The replay errors out on this by default, as the transaction would not be the same. --skip-unavailable In case some packages stored in the transaction are not available on the target system, skip them instead of erroring out. dnf history rollback <transaction-spec>|<package-file-spec> Undo all transactions performed after the specified transaction. Uses the last transaction (with the highest ID) if more than one transaction for given <package-file-spec> is found. If it is not possible to undo some transactions due to the current state of RPMDB, it will not undo any transaction. dnf history store [--output <output-file>] <transaction-spec> Store a transaction specified by <transaction-spec>. The transaction can later be replayed by the History Replay Command. Warning: The stored transaction format is considered unstable and may change at any time. It will work if the same version of dnf is used to store and replay (or between versions as long as it stays the same). -o <output-file>, --output=<output-file> Store the serialized transaction into <output-file. Default is transaction.json. dnf history undo <transaction-spec>|<package-file-spec> Perform the opposite operation to all operations performed in the specified transaction. Uses the last transaction (with the highest ID) if more than one transaction for given <package-file-spec> is found. If it is not possible to undo some operations due to the current state of RPMDB, it will not undo the transaction. dnf history userinstalled Show all installonly packages, packages installed outside of DNF and packages not installed as dependency. I.e. it lists packages that will stay on the system when Autoremove Command or Remove Command along with clean_requirements_on_remove configuration option set to True is executed. Note the same results can be accomplished with dnf repoquery --userinstalled, and the repoquery command is more powerful in formatting of the output. This command by default does not force a sync of expired metadata, except for the redo, rollback, and undo subcommands. See also Metadata Synchronization and Configuration Files Replacement Policy. Info Command Command: info Aliases: if dnf [options] info [<package-file-spec>...] Lists description and summary information about installed and available packages. The info command limits the displayed packages the same way as the list command. This command by default does not force a sync of expired metadata. See also Metadata Synchronization. Install Command Command: install Aliases: in Aliases for explicit NEVRA matching: install-n, install-na, install-nevra Deprecated aliases: localinstall dnf [options] install <spec>... Makes sure that the given packages and their dependencies are installed on the system. Each <spec> can be either a <package-spec>, or a @<module-spec>, or a @<group-spec>. See Install Examples. If a given package or provide cannot be (and is not already) installed, the exit code will be non-zero. If the <spec> matches both a @ <module-spec> and a @<group-spec>, only the module is installed. When <package-spec> to specify the exact version of the package is given, DNF will install the desired version, no matter which version of the package is already installed. The former version of the package will be removed in the case of non-installonly package. On the other hand if <package-spec> specifies only a name, DNF also takes into account packages obsoleting it when picking which package to install. This behaviour is specific to the install command. Note that this can lead to seemingly unexpected results if a package has multiple versions and some older version is being obsoleted. It creates a split in the upgrade-path and both ways are considered correct, the resulting package is picked simply by lexicographical order. There are also a few specific install commands install-n, install-na and install-nevra that allow the specification of an exact argument in the NEVRA format. See also Configuration Files Replacement Policy. Install Examples dnf install tito Install the tito package (tito is the package name). dnf install ~/Downloads/tito-0.6.2-1.fc22.noarch.rpm Install a local rpm file tito-0.6.2-1.fc22.noarch.rpm from the ~/Downloads/ directory. dnf install tito-0.5.6-1.fc22 Install the package with a specific version. If the package is already installed it will automatically try to downgrade or upgrade to the specific version. dnf --best install tito Install the latest available version of the package. If the package is already installed it will try to automatically upgrade to the latest version. If the latest version of the package cannot be installed, the installation will fail. dnf install vim DNF will automatically recognize that vim is not a package name, but will look up and install a package that provides vim with all the required dependencies. Note: Package name match has precedence over package provides match. dnf install https://kojipkgs.fedoraproject.org//packages/tito/0.6.0/1.fc22/noarch/tito-0.6.0-1.fc22.noarch.rpm Install a package directly from a URL. dnf install '@docker' Install all default profiles of module 'docker' and their RPMs. Module streams get enabled accordingly. dnf install '@Web Server' Install the 'Web Server' environmental group. dnf install /usr/bin/rpmsign Install a package that provides the /usr/bin/rpmsign file. dnf -y install tito --setopt=install_weak_deps=False Install the tito package (tito is the package name) without weak deps. Weak deps are not required for core functionality of the package, but they enhance the original package (like extended documentation, plugins, additional functions, etc.). dnf install --advisory=FEDORA-2018-b7b99fe852 \* Install all packages that belong to the "FEDORA-2018-b7b99fe852" advisory. List Command Command: list Aliases: ls Prints lists of packages depending on the packages' relation to the system. A package is installed if it is present in the RPMDB, and it is available if it is not installed but is present in a repository that DNF knows about. The list command also limits the displayed packages according to specific criteria, e.g. to only those that update an installed package (respecting the repository priority). The exclude option in the configuration file can influence the result, but if the - -disableexcludes command line option is used, it ensures that all installed packages will be listed. dnf [options] list [--all] [<package-file-spec>...] Lists all packages, present in the RPMDB, in a repository or both. dnf [options] list --installed [<package-file-spec>...] Lists installed packages. dnf [options] list --available [<package-file-spec>...] Lists available packages. dnf [options] list --extras [<package-file-spec>...] Lists extras, that is packages installed on the system that are not available in any known repository. dnf [options] list --obsoletes [<package-file-spec>...] List packages installed on the system that are obsoleted by packages in any known repository. dnf [options] list --recent [<package-file-spec>...] List packages recently added into the repositories. dnf [options] list --upgrades [<package-file-spec>...] List upgrades available for the installed packages. dnf [options] list --autoremove List packages which will be removed by the dnf autoremove command. This command by default does not force a sync of expired metadata. See also Metadata Synchronization. Makecache Command Command: makecache Aliases: mc dnf [options] makecache Downloads and caches metadata for enabled repositories. Tries to avoid downloading whenever possible (e.g. when the local metadata hasn't expired yet or when the metadata timestamp hasn't changed). dnf [options] makecache --timer Like plain makecache, but instructs DNF to be more resource-aware, meaning it will not do anything if running on battery power and will terminate immediately if it's too soon after the last successful makecache run (see dnf.conf(5), metadata_timer_sync). Mark Command Command: mark dnf mark install <package-spec>... Marks the specified packages as installed by user. This can be useful if any package was installed as a dependency and is desired to stay on the system when Autoremove Command or Remove Command along with clean_requirements_on_remove configuration option set to True is executed. dnf mark remove <package-spec>... Unmarks the specified packages as installed by user. Whenever you as a user don't need a specific package you can mark it for removal. The package stays installed on the system but will be removed when Autoremove Command or Remove Command along with clean_requirements_on_remove configuration option set to True is executed. You should use this operation instead of Remove Command if you're not sure whether the package is a requirement of other user installed packages on the system. dnf mark group <package-spec>... Marks the specified packages as installed by group. This can be useful if any package was installed as a dependency or a user and is desired to be protected and handled as a group member like during group remove. Module Command Command: module Modularity overview is available at man page dnf.modularity(7). Module subcommands take <module-spec>... arguments that specify modules or profiles. dnf [options] module install <module-spec>... Install module profiles, including their packages. In case no profile was provided, all default profiles get installed. Module streams get enabled accordingly. This command cannot be used for switching module streams. Use the dnf module switch-to command for that. dnf [options] module update <module-spec>... Update packages associated with an active module stream, optionally restricted to a profile. If the profile_name is provided, only the packages referenced by that profile will be updated. dnf [options] module switch-to <module-spec>... Switch to or enable a module stream, change versions of installed packages to versions provided by the new stream, and remove packages from the old stream that are no longer available. It also updates installed profiles if they are available for the new stream. When a profile was provided, it installs that profile and does not update any already installed profiles. This command can be used as a stronger version of the dnf module enable command, which not only enables modules, but also does a distrosync to all modular packages in the enabled modules. It can also be used as a stronger version of the dnf module install command, but it requires to specify profiles that are supposed to be installed, because switch-to command does not use default profiles. The switch-to command doesn't only install profiles, it also makes a distrosync to all modular packages in the installed module. dnf [options] module remove <module-spec>... Remove installed module profiles, including packages that were installed with the dnf module install command. Will not remove packages required by other installed module profiles or by other user-installed packages. In case no profile was provided, all installed profiles get removed. dnf [options] module remove --all <module-spec>... Remove installed module profiles, including packages that were installed with the dnf module install command. With --all option it additionally removes all packages whose names are provided by specified modules. Packages required by other installed module profiles and packages whose names are also provided by any other module are not removed. dnf [options] module enable <module-spec>... Enable a module stream and make the stream RPMs available in the package set. Modular dependencies are resolved, dependencies checked and also recursively enabled. In case of modular dependency issue the operation will be rejected. To perform the action anyway please use --skip-broken option. This command cannot be used for switching module streams. Use the dnf module switch-to command for that. dnf [options] module disable <module-name>... Disable a module. All related module streams will become unavailable. Consequently, all installed profiles will be removed and the module RPMs will become unavailable in the package set. In case of modular dependency issue the operation will be rejected. To perform the action anyway please use --skip-broken option. dnf [options] module reset <module-name>... Reset module state so it's no longer enabled or disabled. Consequently, all installed profiles will be removed and only RPMs from the default stream will be available in the package set. dnf [options] module provides <package-name-spec>... Lists all modular packages matching <package-name-spec> from all modules (including disabled), along with the modules and streams they belong to. dnf [options] module list [--all] [module_name...] Lists all module streams, their profiles and states (enabled, disabled, default). dnf [options] module list --enabled [module_name...] Lists module streams that are enabled. dnf [options] module list --disabled [module_name...] Lists module streams that are disabled. dnf [options] module list --installed [module_name...] List module streams with installed profiles. dnf [options] module info <module-spec>... Print detailed information about given module stream. dnf [options] module info --profile <module-spec>... Print detailed information about given module profiles. dnf [options] module repoquery <module-spec>... List all available packages belonging to selected modules. dnf [options] module repoquery --available <module-spec>... List all available packages belonging to selected modules. dnf [options] module repoquery --installed <module-spec>... List all installed packages with same name like packages belonging to selected modules. Provides Command Command: provides Aliases: prov, whatprovides, wp dnf [options] provides <provide-spec> Finds the packages providing the given <provide-spec>. This is useful when one knows a filename and wants to find what package (installed or not) provides this file. The <provide-spec> is gradually looked for at following locations: 1. The <provide-spec> is matched with all file provides of any available package: $ dnf provides /usr/bin/gzip gzip-1.9-9.fc29.x86_64 : The GNU data compression program Matched from: Filename : /usr/bin/gzip 2. Then all provides of all available packages are searched: $ dnf provides "gzip(x86-64)" gzip-1.9-9.fc29.x86_64 : The GNU data compression program Matched from: Provide : gzip(x86-64) = 1.9-9.fc29 3. DNF assumes that the <provide-spec> is a system command, prepends it with /usr/bin/, /usr/sbin/ prefixes (one at a time) and does the file provides search again. For legacy reasons (packages that didn't do UsrMove) also /bin and /sbin prefixes are being searched: $ dnf provides zless gzip-1.9-9.fc29.x86_64 : The GNU data compression program Matched from: Filename : /usr/bin/zless 4. If this last step also fails, DNF returns "Error: No Matches found". This command by default does not force a sync of expired metadata. See also Metadata Synchronization. Reinstall Command Command: reinstall Aliases: rei dnf [options] reinstall <package-spec>... Installs the specified packages, fails if some of the packages are either not installed or not available (i.e. there is no repository where to download the same RPM). Remove Command Command: remove Aliases: rm Aliases for explicit NEVRA matching: remove-n, remove-na, remove-nevra Deprecated aliases: erase, erase-n, erase-na, erase-nevra dnf [options] remove <package-spec>... Removes the specified packages from the system along with any packages depending on the packages being removed. Each <spec> can be either a <package-spec>, which specifies a package directly, or a @<group-spec>, which specifies an (environment) group which contains it. If clean_requirements_on_remove is enabled (the default), also removes any dependencies that are no longer needed. dnf [options] remove --duplicates Removes older versions of duplicate packages. To ensure the integrity of the system it reinstalls the newest package. In some cases the command cannot resolve conflicts. In such cases the dnf shell command with remove --duplicates and upgrade dnf-shell sub-commands could help. dnf [options] remove --oldinstallonly Removes old installonly packages, keeping only latest versions and version of running kernel. There are also a few specific remove commands remove-n, remove-na and remove-nevra that allow the specification of an exact argument in the NEVRA format. Remove Examples dnf remove acpi tito Remove the acpi and tito packages. dnf remove $(dnf repoquery --extras --exclude=tito,acpi) Remove packages not present in any repository, but don't remove the tito and acpi packages (they still might be removed if they depend on some of the removed packages). Remove older versions of duplicated packages (an equivalent of yum's package-cleanup --cleandups): dnf remove --duplicates Repoinfo Command Command: repoinfo An alias for the repolist command that provides more detailed information like dnf repolist -v. Repolist Command Command: repolist dnf [options] repolist [--enabled|--disabled|--all] Depending on the exact command lists enabled, disabled or all known repositories. Lists all enabled repositories by default. Provides more detailed information when -v option is used. This command by default does not force a sync of expired metadata. See also Metadata Synchronization. Repoquery Command Command: repoquery Aliases: rq Aliases for explicit NEVRA matching: repoquery-n, repoquery-na, repoquery-nevra dnf [options] repoquery [<select-options>] [<query-options>] [<package-file-spec>] Searches available DNF repositories for selected packages and displays the requested information about them. It is an equivalent of rpm -q for remote repositories. dnf [options] repoquery --groupmember <package-spec>... List groups that contain <package-spec>. dnf [options] repoquery --querytags Provides the list of tags recognized by the --queryformat repoquery option. There are also a few specific repoquery commands repoquery-n, repoquery-na and repoquery-nevra that allow the specification of an exact argument in the NEVRA format (does not affect arguments of options like --whatprovides <arg>, ...). Select Options Together with <package-file-spec>, control what packages are displayed in the output. If <package-file-spec> is given, limits the resulting set of packages to those matching the specification. All packages are considered if no <package-file-spec> is specified. <package-file-spec> Package specification in the NEVRA format (name[-[epoch:]version[-release]][.arch]), a package provide or a file provide. See Specifying Packages. -a, --all Query all packages (for rpmquery compatibility, also a shorthand for repoquery '*' or repoquery without arguments). --arch <arch>[,<arch>...], --archlist <arch>[,<arch>...] Limit the resulting set only to packages of selected architectures (default is all architectures). In some cases the result is affected by the basearch of the running system, therefore to run repoquery for an arch incompatible with your system use the --forcearch=<arch> option to change the basearch. --duplicates Limit the resulting set to installed duplicate packages (i.e. more package versions for the same name and architecture). Installonly packages are excluded from this set. --unneeded Limit the resulting set to leaves packages that were installed as dependencies so they are no longer needed. This switch lists packages that are going to be removed after executing the dnf autoremove command. --available Limit the resulting set to available packages only (set by default). --disable-modular-filtering Disables filtering of modular packages, so that packages of inactive module streams are included in the result. --extras Limit the resulting set to packages that are not present in any of the available repositories. -f <file>, --file <file> Limit the resulting set only to the package that owns <file>. --installed Limit the resulting set to installed packages only. The exclude option in the configuration file might influence the result, but if the command line option - -disableexcludes is used, it ensures that all installed packages will be listed. --installonly Limit the resulting set to installed installonly packages. --latest-limit <number> Limit the resulting set to <number> of latest packages for every package name and architecture. If <number> is negative, skip <number> of latest packages. For a negative <number> use the --latest-limit=<number> syntax. --recent Limit the resulting set to packages that were recently edited. --repo <repoid> Limit the resulting set only to packages from a repository identified by <repoid>. Can be used multiple times with accumulative effect. --unsatisfied Report unsatisfied dependencies among installed packages (i.e. missing requires and existing conflicts). --upgrades Limit the resulting set to packages that provide an upgrade for some already installed package. --userinstalled Limit the resulting set to packages installed by the user. The exclude option in the configuration file might influence the result, but if the command line option - -disableexcludes is used, it ensures that all installed packages will be listed. --whatdepends <capability>[,<capability>...] Limit the resulting set only to packages that require, enhance, recommend, suggest or supplement any of <capabilities>. --whatconflicts <capability>[,<capability>...] Limit the resulting set only to packages that conflict with any of <capabilities>. --whatenhances <capability>[,<capability>...] Limit the resulting set only to packages that enhance any of <capabilities>. Use --whatdepends if you want to list all depending packages. --whatobsoletes <capability>[,<capability>...] Limit the resulting set only to packages that obsolete any of <capabilities>. --whatprovides <capability>[,<capability>...] Limit the resulting set only to packages that provide any of <capabilities>. --whatrecommends <capability>[,<capability>...] Limit the resulting set only to packages that recommend any of <capabilities>. Use --whatdepends if you want to list all depending packages. --whatrequires <capability>[,<capability>...] Limit the resulting set only to packages that require any of <capabilities>. Use --whatdepends if you want to list all depending packages. --whatsuggests <capability>[,<capability>...] Limit the resulting set only to packages that suggest any of <capabilities>. Use --whatdepends if you want to list all depending packages. --whatsupplements <capability>[,<capability>...] Limit the resulting set only to packages that supplement any of <capabilities>. Use --whatdepends if you want to list all depending packages. --alldeps This option is stackable with --whatrequires or - -whatdepends only. Additionally it adds all packages requiring the package features to the result set (used as default). --exactdeps This option is stackable with --whatrequires or - -whatdepends only. Limit the resulting set only to packages that require <capability> specified by --whatrequires. --srpm Operate on the corresponding source RPM. Query Options Set what information is displayed about each package. The following are mutually exclusive, i.e. at most one can be specified. If no query option is given, matching packages are displayed in the standard NEVRA notation. -i, --info Show detailed information about the package. -l, --list Show the list of files in the package. -s, --source Show the package source RPM name. --changelogs Print the package changelogs. --conflicts Display capabilities that the package conflicts with. Same as --qf "%{conflicts}. --depends Display capabilities that the package depends on, enhances, recommends, suggests or supplements. --enhances Display capabilities enhanced by the package. Same as --qf "%{enhances}"". --location Show a location where the package could be downloaded from. --obsoletes Display capabilities that the package obsoletes. Same as --qf "%{obsoletes}". --provides Display capabilities provided by the package. Same as --qf "%{provides}". --recommends Display capabilities recommended by the package. Same as --qf "%{recommends}". --requires Display capabilities that the package depends on. Same as --qf "%{requires}". --requires-pre Display capabilities that the package depends on for running a %pre script. Same as --qf "%{requires-pre}". --suggests Display capabilities suggested by the package. Same as --qf "%{suggests}". --supplements Display capabilities supplemented by the package. Same as --qf "%{supplements}". --tree Display a recursive tree of packages with capabilities specified by one of the following supplementary options: --whatrequires, --requires, --conflicts, --enhances, --suggests, --provides, --supplements, --recommends. --deplist Produce a list of all direct dependencies and what packages provide those dependencies for the given packages. The result only shows the newest providers (which can be changed by using --verbose). --nvr Show found packages in the name-version-release format. Same as --qf "%{name}-%{version}-%{release}". --nevra Show found packages in the name-epoch:version-release.architecture format. Same as --qf "%{name}-%{epoch}:%{version}-%{release}.%{arch}" (default). --envra Show found packages in the epoch:name-version-release.architecture format. Same as --qf "%{epoch}:%{name}-%{version}-%{release}.%{arch}" --qf <format>, --queryformat <format> Custom display format. <format> is the string to output for each matched package. Every occurrence of %{<tag>} within is replaced by the corresponding attribute of the package. The list of recognized tags can be displayed by running dnf repoquery --querytags. --recursive Query packages recursively. Has to be used with --whatrequires <REQ> (optionally with --alldeps, but not with --exactdeps) or with --requires <REQ> --resolve. --resolve resolve capabilities to originating package(s). Examples Display NEVRAs of all available packages matching light*: dnf repoquery 'light*' Display NEVRAs of all available packages matching name light* and architecture noarch (accepts only arguments in the "<name>.<arch>" format): dnf repoquery-na 'light*.noarch' Display requires of all lighttpd packages: dnf repoquery --requires lighttpd Display packages providing the requires of python packages: dnf repoquery --requires python --resolve Display source rpm of ligttpd package: dnf repoquery --source lighttpd Display package name that owns the given file: dnf repoquery --file /etc/lighttpd/lighttpd.conf Display name, architecture and the containing repository of all lighttpd packages: dnf repoquery --queryformat '%{name}.%{arch} : %{reponame}' lighttpd Display all available packages providing "webserver": dnf repoquery --whatprovides webserver Display all available packages providing "webserver" but only for "i686" architecture: dnf repoquery --whatprovides webserver --arch i686 Display duplicate packages: dnf repoquery --duplicates Display source packages that require a <provide> for a build: dnf repoquery --disablerepo="*" --enablerepo="*-source" --arch=src --whatrequires <provide> Repository-Packages Command Command: repository-packages Deprecated aliases: repo-pkgs, repo-packages, repository-pkgs The repository-packages command allows the user to run commands on top of all packages in the repository named <repoid>. However, any dependency resolution takes into account packages from all enabled repositories. The <package-file-spec> and <package-spec> specifications further limit the candidates to only those packages matching at least one of them. The info subcommand lists description and summary information about packages depending on the packages' relation to the repository. The list subcommand just prints lists of those packages. dnf [options] repository-packages <repoid> check-update [<package-file-spec>...] Non-interactively checks if updates of the specified packages in the repository are available. DNF exit code will be 100 when there are updates available and a list of the updates will be printed. dnf [options] repository-packages <repoid> info [--all] [<package-file-spec>...] List all related packages. dnf [options] repository-packages <repoid> info --installed [<package-file-spec>...] List packages installed from the repository. dnf [options] repository-packages <repoid> info --available [<package-file-spec>...] List packages available in the repository but not currently installed on the system. dnf [options] repository-packages <repoid> info --extras [<package-file-specs>...] List packages installed from the repository that are not available in any repository. dnf [options] repository-packages <repoid> info --obsoletes [<package-file-spec>...] List packages in the repository that obsolete packages installed on the system. dnf [options] repository-packages <repoid> info --recent [<package-file-spec>...] List packages recently added into the repository. dnf [options] repository-packages <repoid> info --upgrades [<package-file-spec>...] List packages in the repository that upgrade packages installed on the system. dnf [options] repository-packages <repoid> install [<package-spec>...] Install packages matching <package-spec> from the repository. If <package-spec> isn't specified at all, install all packages from the repository. dnf [options] repository-packages <repoid> list [--all] [<package-file-spec>...] List all related packages. dnf [options] repository-packages <repoid> list --installed [<package-file-spec>...] List packages installed from the repository. dnf [options] repository-packages <repoid> list --available [<package-file-spec>...] List packages available in the repository but not currently installed on the system. dnf [options] repository-packages <repoid> list --extras [<package-file-spec>...] List packages installed from the repository that are not available in any repository. dnf [options] repository-packages <repoid> list --obsoletes [<package-file-spec>...] List packages in the repository that obsolete packages installed on the system. dnf [options] repository-packages <repoid> list --recent [<package-file-spec>...] List packages recently added into the repository. dnf [options] repository-packages <repoid> list --upgrades [<package-file-spec>...] List packages in the repository that upgrade packages installed on the system. dnf [options] repository-packages <repoid> move-to [<package-spec>...] Reinstall all those packages that are available in the repository. dnf [options] repository-packages <repoid> reinstall [<package-spec>...] Run the reinstall-old subcommand. If it fails, run the move-to subcommand. dnf [options] repository-packages <repoid> reinstall-old [<package-spec>...] Reinstall all those packages that were installed from the repository and simultaneously are available in the repository. dnf [options] repository-packages <repoid> remove [<package-spec>...] Remove all packages installed from the repository along with any packages depending on the packages being removed. If clean_requirements_on_remove is enabled (the default) also removes any dependencies that are no longer needed. dnf [options] repository-packages <repoid> remove-or-distro-sync [<package-spec>...] Select all packages installed from the repository. Upgrade, downgrade or keep those of them that are available in another repository to match the latest version available there and remove the others along with any packages depending on the packages being removed. If clean_requirements_on_remove is enabled (the default) also removes any dependencies that are no longer needed. dnf [options] repository-packages <repoid> remove-or-reinstall [<package-spec>...] Select all packages installed from the repository. Reinstall those of them that are available in another repository and remove the others along with any packages depending on the packages being removed. If clean_requirements_on_remove is enabled (the default) also removes any dependencies that are no longer needed. dnf [options] repository-packages <repoid> upgrade [<package-spec>...] Update all packages to the highest resolvable version available in the repository. When versions are specified in the <package-spec>, update to these versions. dnf [options] repository-packages <repoid> upgrade-to [<package-specs>...] A deprecated alias for the upgrade subcommand. Search Command Command: search Aliases: se dnf [options] search [--all] <keywords>... Search package metadata for keywords. Keywords are matched as case-insensitive substrings, globbing is supported. By default lists packages that match all requested keys (AND operation). Keys are searched in package names and summaries. If the --all option is used, lists packages that match at least one of the keys (an OR operation). In addition the keys are searched in the package descriptions and URLs. The result is sorted from the most relevant results to the least. This command by default does not force a sync of expired metadata. See also Metadata Synchronization. Shell Command Command: shell Aliases: sh dnf [options] shell [filename] Open an interactive shell for conducting multiple commands during a single execution of DNF. These commands can be issued manually or passed to DNF from a file. The commands are much the same as the normal DNF command line options. There are a few additional commands documented below. config [conf-option] [value] Set a configuration option to a requested value. If no value is given it prints the current value. repo [list|enable|disable] [repo-id] list: list repositories and their status enable: enable repository disable: disable repository transaction [list|reset|solve|run] list: resolve and list the content of the transaction reset: reset the transaction run: resolve and run the transaction Note that all local packages must be used in the first shell transaction subcommand (e.g. install /tmp/nodejs-1-1.x86_64.rpm /tmp/acpi-1-1.noarch.rpm) otherwise an error will occur. Any disable, enable, and reset module operations (e.g. module enable nodejs) must also be performed before any other shell transaction subcommand is used. Swap Command Command: swap dnf [options] swap <remove-spec> <install-spec> Remove spec and install spec in one transaction. Each <spec> can be either a <package-spec>, which specifies a package directly, or a @<group-spec>, which specifies an (environment) group which contains it. Automatic conflict solving is provided in DNF by the --allowerasing option that provides the functionality of the swap command automatically. Updateinfo Command Command: updateinfo Aliases: upif Deprecated aliases: list-updateinfo, list-security, list-sec, info-updateinfo, info-security, info-sec, summary-updateinfo dnf [options] updateinfo [--summary|--list|--info] [<availability>] [<spec>...] Display information about update advisories. Depending on the output type, DNF displays just counts of advisory types (omitted or --summary), list of advisories (--list) or detailed information (--info). The -v option extends the output. When used with --info, the information is even more detailed. When used with --list, an additional column with date of the last advisory update is added. <availability> specifies whether advisories about newer versions of installed packages (omitted or --available), advisories about equal and older versions of installed packages (--installed), advisories about newer versions of those installed packages for which a newer version is available (--updates) or advisories about any versions of installed packages (--all) are taken into account. Most of the time, --available and --updates displays the same output. The outputs differ only in the cases when an advisory refers to a newer version but there is no enabled repository which contains any newer version. Note, that --available takes only the latest installed versions of packages into account. In case of the kernel packages (when multiple version could be installed simultaneously) also packages of the currently running version of kernel are added. To print only advisories referencing a CVE or a bugzilla use --with-cve or --with-bz options. When these switches are used also the output of the --list is altered - the ID of the CVE or the bugzilla is printed instead of the one of the advisory. If given and if neither ID, type (bugfix, enhancement, security/sec) nor a package name of an advisory matches <spec>, the advisory is not taken into account. The matching is case-sensitive and in the case of advisory IDs and package names, globbing is supported. Output of the --summary option is affected by the autocheck_running_kernel configuration option. Upgrade Command Command: upgrade Aliases: up Deprecated aliases: update, upgrade-to, update-to, localupdate dnf [options] upgrade Updates each package to the latest version that is both available and resolvable. dnf [options] upgrade <package-spec>... Updates each specified package to the latest available version. Updates dependencies as necessary. When versions are specified in the <package-spec>, update to these versions. dnf [options] upgrade @<spec>... Alias for the dnf module update command. If the main obsoletes configure option is true or the --obsoletes flag is present, dnf will include package obsoletes in its calculations. For more information see obsoletes. See also Configuration Files Replacement Policy. Upgrade-Minimal Command Command: upgrade-minimal Aliases: up-min Deprecated aliases: update-minimal dnf [options] upgrade-minimal Updates each package to the latest available version that provides a bugfix, enhancement or a fix for a security issue (security). dnf [options] upgrade-minimal <package-spec>... Updates each specified package to the latest available version that provides a bugfix, enhancement or a fix for security issue (security). Updates dependencies as necessary. SPECIFYING PACKAGES top Many commands take a <package-spec> parameter that selects a package for the operation. The <package-spec> argument is matched against package NEVRAs, provides and file provides. <package-file-spec> is similar to <package-spec>, except provides matching is not performed. Therefore, <package-file-spec> is matched only against NEVRAs and file provides. <package-name-spec> is matched against NEVRAs only. Globs Package specification supports the same glob pattern matching that shell does, in all three above mentioned packages it matches against (NEVRAs, provides and file provides). The following patterns are supported: * Matches any number of characters. ? Matches any single character. [] Matches any one of the enclosed characters. A pair of characters separated by a hyphen denotes a range expression; any character that falls between those two characters, inclusive, is matched. If the first character following the [ is a ! or a ^ then any character not enclosed is matched. Note: Curly brackets ({}) are not supported. You can still use them in shells that support them and let the shell do the expansion, but if quoted or escaped, dnf will not expand them. NEVRA Matching When matching against NEVRAs, partial matching is supported. DNF tries to match the spec against the following list of NEVRA forms (in decreasing order of priority): name-[epoch:]version-release.arch name.arch name name-[epoch:]version-release name-[epoch:]version Note that name can in general contain dashes (e.g. package-with-dashes). The first form that matches any packages is used and the remaining forms are not tried. If none of the forms match any packages, an attempt is made to match the <package-spec> against full package NEVRAs. This is only relevant if globs are present in the <package-spec>. <package-spec> matches NEVRAs the same way <package-name-spec> does, but in case matching NEVRAs fails, it attempts to match against provides and file provides of packages as well. You can specify globs as part of any of the five NEVRA components. You can also specify a glob pattern to match over multiple NEVRA components (in other words, to match across the NEVRA separators). In that case, however, you need to write the spec to match against full package NEVRAs, as it is not possible to split such spec into NEVRA forms. Specifying NEVRA Matching Explicitly Some commands (autoremove, install, remove and repoquery) also have aliases with suffixes -n, -na and -nevra that allow to explicitly specify how to parse the arguments: Command install-n only matches against name. Command install-na only matches against name.arch. Command install-nevra only matches against name-[epoch:]version-release.arch. SPECIFYING PROVIDES top <provide-spec> in command descriptions means the command operates on packages providing the given spec. This can either be an explicit provide, an implicit provide (i.e. name of the package) or a file provide. The selection is case-sensitive and globbing is supported. Specifying File Provides If a spec starts with either / or */, it is considered as a potential file provide. SPECIFYING GROUPS top <group-spec> allows one to select (environment) groups a particular operation should work on. It is a case insensitive string (supporting globbing characters) that is matched against a group's ID, canonical name and name translated into the current LC_MESSAGES locale (if possible). SPECIFYING MODULES top <module-spec> allows one to select modules or profiles a particular operation should work on. It is in the form of NAME:STREAM:VERSION:CONTEXT:ARCH/PROFILE and supported partial forms are the following: NAME NAME:STREAM NAME:STREAM:VERSION NAME:STREAM:VERSION:CONTEXT all above combinations with ::ARCH (e.g. NAME::ARCH) NAME:STREAM:VERSION:CONTEXT:ARCH all above combinations with /PROFILE (e.g. NAME/PROFILE) In case stream is not specified, the enabled or the default stream is used, in this order. In case profile is not specified, the system default profile or the 'default' profile is used. SPECIFYING TRANSACTIONS top <transaction-spec> can be in one of several forms. If it is an integer, it specifies a transaction ID. Specifying last is the same as specifying the ID of the most recent transaction. The last form is last-<offset>, where <offset> is a positive integer. It specifies offset-th transaction preceding the most recent transaction. PACKAGE FILTERING top Package filtering filters packages out from the available package set, making them invisible to most of dnf commands. They cannot be used in a transaction. Packages can be filtered out by either Exclude Filtering or Modular Filtering. Exclude Filtering Exclude Filtering is a mechanism used by a user or by a DNF plugin to modify the set of available packages. Exclude Filtering can be modified by either includepkgs or excludepkgs configuration options in configuration files. The - -disableexcludes command line option can be used to override excludes from configuration files. In addition to user-configured excludes, plugins can also extend the set of excluded packages. To disable excludes from a DNF plugin you can use the - -disableplugin command line option. To disable all excludes for e.g. the install command you can use the following combination of command line options: dnf --disableexcludes=all --disableplugin="*" install bash Modular Filtering Please see the modularity documentation for details on how Modular Filtering works. With modularity, only RPM packages from active module streams are included in the available package set. RPM packages from inactive module streams, as well as non-modular packages with the same name or provides as a package from an active module stream, are filtered out. Modular filtering is not applied to packages added from the command line, installed packages, or packages from repositories with module_hotfixes=true in their .repo file. Disabling of modular filtering is not recommended, because it could cause the system to get into a broken state. To disable modular filtering for a particular repository, specify module_hotfixes=true in the .repo file or use --setopt=<repo_id>.module_hotfixes=true. To discover the module which contains an excluded package use dnf module provides. METADATA SYNCHRONIZATION top Correct operation of DNF depends on having access to up-to-date data from all enabled repositories but contacting remote mirrors on every operation considerably slows it down and costs bandwidth for both the client and the repository provider. The metadata_expire (see dnf.conf(5)) repository configuration option is used by DNF to determine whether a particular local copy of repository data is due to be re-synced. It is crucial that the repository providers set the option well, namely to a value where it is guaranteed that if particular metadata was available in time T on the server, then all packages it references will still be available for download from the server in time T + metadata_expire. To further reduce the bandwidth load, some of the commands where having up-to-date metadata is not critical (e.g. the list command) do not look at whether a repository is expired and whenever any version of it is locally available to the user's account, it will be used. For non-root use, see also the --cacheonly switch. Note that in all situations the user can force synchronization of all enabled repositories with the --refresh switch. CONFIGURATION FILES REPLACEMENT POLICY top The updated packages could replace the old modified configuration files with the new ones or keep the older files. Neither of the files are actually replaced. To the conflicting ones RPM gives additional suffix to the origin name. Which file should maintain the true name after transaction is not controlled by package manager but is specified by each package itself, following packaging guideline. FILES top Cache Files /var/cache/dnf Main Configuration /etc/dnf/dnf.conf Repository /etc/yum.repos.d/ SEE ALSO top dnf.conf(5), DNF Configuration Reference dnf-PLUGIN(8) for documentation on DNF plugins. dnf.modularity(7), Modularity overview. dnf-transaction-json(5), Stored Transaction JSON Format Specification. DNF project homepage ( https://github.com/rpm-software-management/dnf/ ) How to report a bug ( https://github.com/rpm-software-management/dnf/wiki/Bug-Reporting ) YUM project homepage (http://yum.baseurl.org/ ) AUTHOR top See AUTHORS in DNF source distribution. COPYRIGHT top 2012-2020, Red Hat, Licensed under GPLv2+ COLOPHON top This page is part of the dnf (DNF Package Manager) project. Information about the project can be found at https://github.com/rpm-software-management/dnf. It is not known how to report bugs for this man page; if you know, please send a mail to [email protected]. This page was obtained from the project's upstream Git repository https://github.com/rpm-software-management/dnf.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-08.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] 4.18.2 Dec 22, 2023 YUM(8) Pages that refer to this page: yum-filter-data(1), yum-groups-manager(1), yum-list-data(1), yum-ovl(1), yum-verify(1), yum.conf(5@@yum), yum-cron(8), yumdb(8), yum-shell(8@@yum), yum-updatesd(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# yum\n\n> Package management utility for RHEL, Fedora, and CentOS (for older versions).\n> For equivalent commands in other package managers, see <https://wiki.archlinux.org/title/Pacman/Rosetta>.\n> More information: <https://manned.org/yum>.\n\n- Install a new package:\n\n`yum install {{package}}`\n\n- Install a new package and assume yes to all questions (also works with update, great for automated updates):\n\n`yum -y install {{package}}`\n\n- Find the package that provides a particular command:\n\n`yum provides {{command}}`\n\n- Remove a package:\n\n`yum remove {{package}}`\n\n- Display available updates for installed packages:\n\n`yum check-update`\n\n- Upgrade installed packages to the newest available versions:\n\n`yum upgrade`\n
zcat
zcat(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training zcat(1p) Linux manual page PROLOG | NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | STDIN | INPUT FILES | ENVIRONMENT VARIABLES | ASYNCHRONOUS EVENTS | STDOUT | STDERR | OUTPUT FILES | EXTENDED DESCRIPTION | EXIT STATUS | CONSEQUENCES OF ERRORS | APPLICATION USAGE | EXAMPLES | RATIONALE | FUTURE DIRECTIONS | SEE ALSO | COPYRIGHT ZCAT(1P) POSIX Programmer's Manual ZCAT(1P) PROLOG top This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME top zcat expand and concatenate data SYNOPSIS top zcat [file...] DESCRIPTION top The zcat utility shall write to standard output the uncompressed form of files that have been compressed using the compress utility. It is the equivalent of uncompress -c. Input files are not affected. OPTIONS top None. OPERANDS top The following operand shall be supported: file The pathname of a file previously processed by the compress utility. If file already has the .Z suffix specified, it is used as submitted. Otherwise, the .Z suffix is appended to the filename prior to processing. STDIN top The standard input shall be used only if no file operands are specified, or if a file operand is '-'. INPUT FILES top Input files shall be compressed files that are in the format produced by the compress utility. ENVIRONMENT VARIABLES top The following environment variables shall affect the execution of zcat: LANG Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.12017, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) LC_ALL If set to a non-empty string value, override the values of all the other internationalization variables. LC_CTYPE Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments). LC_MESSAGES Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. ASYNCHRONOUS EVENTS top Default. STDOUT top The compressed files given as input shall be written on standard output in their uncompressed form. STDERR top The standard error shall be used only for diagnostic messages. OUTPUT FILES top None. EXTENDED DESCRIPTION top None. EXIT STATUS top The following exit values shall be returned: 0 Successful completion. >0 An error occurred. CONSEQUENCES OF ERRORS top Default. The following sections are informative. APPLICATION USAGE top None. EXAMPLES top None. RATIONALE top None. FUTURE DIRECTIONS top None. SEE ALSO top compress(1p), uncompress(1p) The Base Definitions volume of POSIX.12017, Chapter 8, Environment Variables COPYRIGHT top Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html . IEEE/The Open Group 2017 ZCAT(1P) Pages that refer to this page: compress(1p), uncompress(1p) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# zcat\n\n> Print data from `gzip` compressed files.\n> More information: <https://www.gnu.org/software/gzip/manual/gzip.html>.\n\n- Print the uncompressed contents of a `gzip` archive to `stdout`:\n\n`zcat {{file.txt.gz}}`\n\n- Print compression details of a `gzip` archive to `stdout`:\n\n`zcat -l {{file.txt.gz}}`\n
zramctl
zramctl(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training zramctl(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXIT STATUS | FILES | EXAMPLE | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY ZRAMCTL(8) System Administration ZRAMCTL(8) NAME top zramctl - set up and control zram devices SYNOPSIS top Get info: zramctl [options] Reset zram: zramctl -r zramdev... Print name of first unused zram device: zramctl -f Set up a zram device: zramctl [-f | zramdev] [-s size] [-t number] [-a algorithm] DESCRIPTION top zramctl is used to quickly set up zram device parameters, to reset zram devices, and to query the status of used zram devices. If no option is given, all non-zero size zram devices are shown. Note that zramdev node specified on command line has to already exist. The command zramctl creates a new /dev/zram<N> nodes only when --find option specified. Its possible (and common) that after system boot /dev/zram<N> nodes are not created yet. OPTIONS top -a, --algorithm lzo|lz4|lz4hc|deflate|842|zstd Set the compression algorithm to be used for compressing data in the zram device. The list of supported algorithms could be inaccurate as it depends on the current kernel configuration. A basic overview can be obtained by using the command "cat /sys/block/zram0/comp_algorithm"; however, please note that this list might also be incomplete. This is due to the fact that ZRAM utilizes the Crypto API, and if certain algorithms were built as modules, it becomes impossible to enumerate all of them. -f, --find Find the first unused zram device. If a --size argument is present, then initialize the device. -n, --noheadings Do not print a header line in status output. -o, --output list Define the status output columns to be used. If no output arrangement is specified, then a default set is used. Use --help to get a list of all supported columns. --output-all Output all available columns. --raw Use the raw format for status output. -r, --reset Reset the options of the specified zram device(s). Zram device settings can be changed only after a reset. -s, --size size Create a zram device of the specified size. Zram devices are aligned to memory pages; when the requested size is not a multiple of the page size, it will be rounded up to the next multiple. When not otherwise specified, the unit of the size parameter is bytes. The size argument may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB") or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB. -t, --streams number Set the maximum number of compression streams that can be used for the device. The default is use all CPUs and one stream for kernels older than 4.6. -h, --help Display help text and exit. -V, --version Print version and exit. EXIT STATUS top zramctl returns 0 on success, nonzero on failure. FILES top /dev/zram[0..N] zram block devices EXAMPLE top The following commands set up a zram device with a size of one gigabyte and use it as swap device. # zramctl --find --size 1024M /dev/zram0 # mkswap /dev/zram0 # swapon /dev/zram0 ... # swapoff /dev/zram0 # zramctl --reset /dev/zram0 AUTHORS top Timofey Titovets <[email protected]>, Karel Zak <[email protected]> SEE ALSO top Linux kernel documentation <https://docs.kernel.org/admin-guide/blockdev/zram.html> REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The zramctl command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is part of the util-linux (a random collection of Linux utilities) project. Information about the project can be found at https://www.kernel.org/pub/linux/utils/util-linux/. If you have a bug report for this manual page, send it to [email protected]. This page was obtained from the project's upstream Git repository git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-14.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which is not part of the original manual page), send a mail to [email protected] util-linux 2.39.594-1e0ad 2023-08-25 ZRAMCTL(8) HTML rendering created 2023-12-22 by Michael Kerrisk, author of The Linux Programming Interface. For details of in-depth Linux/UNIX system programming training courses that I teach, look here. Hosting by jambit GmbH.
# zramctl\n\n> Setup and control zram devices.\n> Use `mkfs` or `mkswap` to format zram devices to partitions.\n> More information: <https://manned.org/zramctl>.\n\n- Check if zram is enabled:\n\n`lsmod | grep -i zram`\n\n- Enable zram with a dynamic number of devices (use `zramctl` to configure devices further):\n\n`sudo modprobe zram`\n\n- Enable zram with exactly 2 devices:\n\n`sudo modprobe zram num_devices={{2}}`\n\n- Find and initialize the next free zram device to a 2 GB virtual drive using LZ4 compression:\n\n`sudo zramctl --find --size {{2GB}} --algorithm {{lz4}}`\n\n- List currently initialized devices:\n\n`zramctl`\n