Linux-Utility
stringlengths 1
30
| Manual-Page
stringlengths 700
948k
| TLDR-Summary
stringlengths 110
2.05k
|
---|---|---|
mklost+found | mklost+found(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training mklost+found(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | AUTHOR | BUGS | AVAILABILITY | SEE ALSO | COLOPHON MKLOST+FOUND(8) System Manager's Manual MKLOST+FOUND(8) NAME top mklost+found - create a lost+found directory on a mounted Linux second extended file system SYNOPSIS top mklost+found DESCRIPTION top mklost+found is used to create a lost+found directory in the current working directory on a Linux second extended file system. There is normally a lost+found directory in the root directory of each file system. mklost+found pre-allocates disk blocks to the lost+found directory so that when e2fsck(8) is being run to recover a file system, it does not need to allocate blocks in the file system to store a large number of unlinked files. This ensures that e2fsck will not have to allocate data blocks in the file system during recovery. OPTIONS top There are none. AUTHOR top mklost+found has been written by Remy Card <[email protected]>. It is currently being maintained by Theodore Ts'o <[email protected]>. BUGS top There are none :-) AVAILABILITY top mklost+found is part of the e2fsprogs package and is available from http://e2fsprogs.sourceforge.net. SEE ALSO top e2fsck(8), mke2fs(8) 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 MKLOST+FOUND(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. | # mklost+found\n\n> Create a lost+found directory.\n> More information: <https://manned.org/mklost+found>.\n\n- Create a `lost+found` directory in the current directory:\n\n`mklost+found`\n |
mknod | mknod(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training mknod(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON MKNOD(1) User Commands MKNOD(1) NAME top mknod - make block or character special files SYNOPSIS top mknod [OPTION]... NAME TYPE [MAJOR MINOR] DESCRIPTION top Create the special file NAME of the given TYPE. Mandatory arguments to long options are mandatory for short options too. -m, --mode=MODE set file permission bits to MODE, not a=rw - umask -Z set the SELinux security context to default type --context[=CTX] like -Z, or if CTX is specified then set the SELinux or SMACK security context to CTX --help display this help and exit --version output version information and exit Both MAJOR and MINOR must be specified when TYPE is b, c, or u, and they must be omitted when TYPE is p. If MAJOR or MINOR begins with 0x or 0X, it is interpreted as hexadecimal; otherwise, if it begins with 0, as octal; otherwise, as decimal. TYPE may be: b create a block (buffered) special file c, u create a character (unbuffered) special file p create a FIFO NOTE: your shell may have its own version of mknod, 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 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 mknod(2) Full documentation <https://www.gnu.org/software/coreutils/mknod> or available locally via: info '(coreutils) mknod 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 MKNOD(1) Pages that refer to this page: ioctl_console(2), mknod(2), fd(4), full(4), hd(4), initrd(4), intro(4), lp(4), mem(4), null(4), ram(4), random(4), tty(4), ttyS(4), hier(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. | # mknod\n\n> Create block or character device special files.\n> More information: <https://www.gnu.org/software/coreutils/mknod>.\n\n- Create a block device:\n\n`sudo mknod {{path/to/device_file}} b {{major_device_number}} {{minor_device_number}}`\n\n- Create a character device:\n\n`sudo mknod {{path/to/device_file}} c {{major_device_number}} {{minor_device_number}}`\n\n- Create a FIFO (queue) device:\n\n`sudo mknod {{path/to/device_file}} p`\n\n- Create a device file with default SELinux security context:\n\n`sudo mknod -Z {{path/to/device_file}} {{type}} {{major_device_number}} {{minor_device_number}}`\n |
mkswap | mkswap(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training mkswap(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | WARNING | OPTIONS | ENVIRONMENT | NOTES | SEE ALSO | REPORTING BUGS | AVAILABILITY MKSWAP(8) System Administration MKSWAP(8) NAME top mkswap - set up a Linux swap area SYNOPSIS top mkswap [options] device [size] DESCRIPTION top mkswap sets up a Linux swap area on a device or in a file. The device argument will usually be a disk partition (something like /dev/sdb7) but can also be a file. The Linux kernel does not look at partition IDs, but many installation scripts will assume that partitions of hex type 82 (LINUX_SWAP) are meant to be swap partitions. (Warning: Solaris also uses this type. Be careful not to kill your Solaris partitions.) The size parameter is superfluous but retained for backwards compatibility. (It specifies the desired size of the swap area in 1024-byte blocks. mkswap will use the entire partition or file if it is omitted. Specifying it is unwise - a typo may destroy your disk.) After creating the swap area, you need the swapon(8) command to start using it. Usually swap areas are listed in /etc/fstab so that they can be taken into use at boot time by a swapon -a command in some boot script. WARNING top The swap header does not touch the first block. A boot loader or disk label can be there, but it is not a recommended setup. The recommended setup is to use a separate partition for a Linux swap area. mkswap, like many others mkfs-like utils, erases the first partition block to make any previous filesystem invisible. However, mkswap refuses to erase the first block on a device with a disk label (SUN, BSD, ...). OPTIONS top -c, --check Check the device (if it is a block device) for bad blocks before creating the swap area. If any bad blocks are found, the count is printed. -f, --force Go ahead even if the command is stupid. This allows the creation of a swap area larger than the file or partition it resides on. Also, without this option, mkswap will refuse to erase the first block on a device with a partition table. -q, --quiet Suppress output and warning messages. -L, --label label Specify a label for the device, to allow swapon(8) by label. --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 systemd-udevd(8) or other tools. -p, --pagesize size Specify the page size (in bytes) to use. This option is usually unnecessary; mkswap reads the size from the kernel. -U, --uuid UUID Specify the UUID to use. The default is to generate a 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 filesystem UUID random generate a new randomly-generated UUID time generate a new time-based UUID -e, --endianness ENDIANNESS Specify the ENDIANNESS to use, valid arguments are native, little or big. The default is native. -o, --offset offset Specify the offset to write the swap area to. -v, --swapversion 1 Specify the swap-space version. (This option is currently pointless, as the old -v 0 option has become obsolete and now only -v 1 is supported. The kernel has not supported v0 swap-space format since 2.5.22 (June 2002). The new version v1 is supported since 2.1.117 (August 1998).) --verbose Verbose execution. With this option mkswap will output more details about detected problems during swap area set up. -h, --help Display help text and exit. -V, --version Print version and exit. ENVIRONMENT top LIBBLKID_DEBUG=all enables libblkid debug output. LOCK_BLOCK_DEVICE=<mode> use exclusive BSD lock. The mode is "1" or "0". See --lock for more details. NOTES top The maximum useful size of a swap area depends on the architecture and the kernel version. The maximum number of the pages that is possible to address by swap area header is 4294967295 (32-bit unsigned int). The remaining space on the swap device is ignored. Presently, Linux allows 32 swap areas. The areas in use can be seen in the file /proc/swaps. mkswap refuses areas smaller than 10 pages. If you dont know the page size that your machine uses, you can look it up with getconf PAGESIZE. To set up a swap file, it is necessary to create that file before initializing it with mkswap, e.g. using a command like # dd if=/dev/zero of=swapfile bs=1MiB count=$((8*1024)) to create 8GiB swapfile. Please read notes from swapon(8) about the swap file use restrictions (holes, preallocation and copy-on-write issues). SEE ALSO top fdisk(8), swapon(8) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The mkswap 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 MKSWAP(8) Pages that refer to this page: swapon(2), crypttab(5), swaplabel(8), 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. | # mkswap\n\n> Set up a Linux swap area on a device or in a file.\n> Note: `path/to/file` can either point to a regular file or a swap partition.\n> More information: <https://manned.org/mkswap>.\n\n- Set up a given swap area:\n\n`sudo mkswap {{path/to/file}}`\n\n- Check a partition for bad blocks before creating the swap area:\n\n`sudo mkswap -c {{path/to/file}}`\n\n- Specify a label for the partition (to allow `swapon` to use the label):\n\n`sudo mkswap -L {{label}} {{/dev/sda1}}`\n |
mktemp | mktemp(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training mktemp(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON MKTEMP(1) User Commands MKTEMP(1) NAME top mktemp - create a temporary file or directory SYNOPSIS top mktemp [OPTION]... [TEMPLATE] DESCRIPTION top Create a temporary file or directory, safely, and print its name. TEMPLATE must contain at least 3 consecutive 'X's in last component. If TEMPLATE is not specified, use tmp.XXXXXXXXXX, and --tmpdir is implied. Files are created u+rw, and directories u+rwx, minus umask restrictions. -d, --directory create a directory, not a file -u, --dry-run do not create anything; merely print a name (unsafe) -q, --quiet suppress diagnostics about file/dir-creation failure --suffix=SUFF append SUFF to TEMPLATE; SUFF must not contain a slash. This option is implied if TEMPLATE does not end in X -p DIR, --tmpdir[=DIR] interpret TEMPLATE relative to DIR; if DIR is not specified, use $TMPDIR if set, else /tmp. With this option, TEMPLATE must not be an absolute name; unlike with -t, TEMPLATE may contain slashes, but mktemp creates only the final component -t interpret TEMPLATE as a single file name component, relative to a directory: $TMPDIR, if set; else the directory specified via -p; else /tmp [deprecated] --help display this help and exit --version output version information and exit AUTHOR top Written by Jim Meyering and Eric Blake. 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 mkstemp(3), mkdtemp(3), mktemp(3) Full documentation <https://www.gnu.org/software/coreutils/mktemp> or available locally via: info '(coreutils) mktemp 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 MKTEMP(1) Pages that refer to this page: mkdtemp(3), mktemp(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. | # mktemp\n\n> Create a temporary file or directory.\n> More information: <https://www.gnu.org/software/coreutils/mktemp>.\n\n- Create an empty temporary file and print its absolute path:\n\n`mktemp`\n\n- Use a custom directory (defaults to `$TMPDIR`, or `/tmp`):\n\n`mktemp --tmpdir={{/path/to/tempdir}}`\n\n- Use a custom path template (`X`s are replaced with random alphanumeric characters):\n\n`mktemp {{/tmp/example.XXXXXXXX}}`\n\n- Use a custom file name template:\n\n`mktemp -t {{example.XXXXXXXX}}`\n\n- Create an empty temporary file with the given suffix and print its absolute path:\n\n`mktemp --suffix {{.ext}}`\n\n- Create an empty temporary directory and print its absolute path:\n\n`mktemp --directory`\n |
modinfo | modinfo(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training modinfo(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | COPYRIGHT | SEE ALSO | AUTHORS | COLOPHON MODINFO(8) modinfo MODINFO(8) NAME top modinfo - Show information about a Linux Kernel module SYNOPSIS top modinfo [-0] [-F field] [-k kernel] [modulename|filename...] modinfo -V modinfo -h DESCRIPTION top modinfo extracts information from the Linux Kernel modules given on the command line. If the module name is not a filename, then the /lib/modules/version directory is searched, as is also done by modprobe(8) when loading kernel modules. modinfo by default lists each attribute of the module in form fieldname : value, for easy reading. The filename is listed the same way (although it's not really an attribute). This version of modinfo can understand modules of any Linux Kernel architecture. OPTIONS top -V, --version Print the modinfo version. -F, --field Only print this field value, one per line. This is most useful for scripts. Field names are case-insensitive. Common fields (which may not be in every module) include author, description, license, parm, depends, and alias. There are often multiple parm, alias and depends fields. The special field filename lists the filename of the module. -b basedir, --basedir basedir Root directory for modules, / by default. -k kernel Provide information about a kernel other than the running one. This is particularly useful for distributions needing to extract information from a newly installed (but not yet running) set of kernel modules. For example, you wish to find which firmware files are needed by various modules in a new kernel for which you must make an initrd/initramfs image prior to booting. -0, --null Use the ASCII zero character to separate field values, instead of a new line. This is useful for scripts, since a new line can theoretically appear inside a field. -a --author, -d --description, -l --license, -p --parameters, -n --filename These are shortcuts for the --field flag's author, description, license, parm and filename arguments, to ease the transition from the old modutils modinfo. COPYRIGHT top This manual page originally Copyright 2003, Rusty Russell, IBM Corporation. Maintained by Jon Masters and others. SEE ALSO top modprobe(8) AUTHORS top Jon Masters <[email protected]> Developer Lucas De Marchi <[email protected]> Developer COLOPHON top This page is part of the kmod (userspace tools for managing kernel modules) project. Information about the project can be found at [unknown -- if you know, please contact man- [email protected]] 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/kernel/kmod/kmod.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] kmod 12/22/2023 MODINFO(8) Pages that refer to this page: query_module(2), modules.dep(5), insmod(8), kmod(8), lsmod(8), modprobe(8), rmmod(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. | # modinfo\n\n> Extract information about a Linux kernel module.\n> More information: <https://manned.org/modinfo>.\n\n- List all attributes of a kernel module:\n\n`modinfo {{kernel_module}}`\n\n- List the specified attribute only:\n\n`modinfo -F {{author|description|license|parm|filename}} {{kernel_module}}`\n |
modprobe | modprobe(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training modprobe(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | ENVIRONMENT | COPYRIGHT | SEE ALSO | AUTHORS | COLOPHON MODPROBE(8) modprobe MODPROBE(8) NAME top modprobe - Add and remove modules from the Linux Kernel SYNOPSIS top modprobe [-v] [-V] [-C config-file] [-n] [-i] [-q] [-b] [modulename] [module parameters...] modprobe [-r] [-v] [-n] [-i] [modulename...] modprobe [-c] modprobe [--dump-modversions] [filename] DESCRIPTION top modprobe intelligently adds or removes a module from the Linux kernel: note that for convenience, there is no difference between _ and - in module names (automatic underscore conversion is performed). modprobe looks in the module directory /lib/modules/`uname -r` for all the modules and other files, except for the optional configuration files in the /etc/modprobe.d directory (see modprobe.d(5)). modprobe will also use module options specified on the kernel command line in the form of <module>.<option> and blacklists in the form of modprobe.blacklist=<module>. Note that unlike in 2.4 series Linux kernels (which are not supported by this tool) this version of modprobe does not do anything to the module itself: the work of resolving symbols and understanding parameters is done inside the kernel. So module failure is sometimes accompanied by a kernel message: see dmesg(8). modprobe expects an up-to-date modules.dep.bin file as generated by the corresponding depmod utility shipped along with modprobe (see depmod(8)). This file lists what other modules each module needs (if any), and modprobe uses this to add or remove these dependencies automatically. If any arguments are given after the modulename, they are passed to the kernel (in addition to any options listed in the configuration file). When loading modules, modulename can also be a path to the module. If the path is relative, it must explicitly start with "./". Note that this may fail when using a path to a module with dependencies not matching the installed depmod database. OPTIONS top -a, --all Insert all module names on the command line. -b, --use-blacklist This option causes modprobe to apply the blacklist commands in the configuration files (if any) to module names as well. It is usually used by udev(7). -C, --config This option overrides the default configuration directory (/etc/modprobe.d). This option is passed through install or remove commands to other modprobe commands in the MODPROBE_OPTIONS environment variable. -c, --showconfig Dump out the effective configuration from the config directory and exit. --dump-modversions Print out a list of module versioning information required by a module. This option is commonly used by distributions in order to package up a Linux kernel module using module versioning deps. -d, --dirname Root directory for modules, / by default. --first-time Normally, modprobe will succeed (and do nothing) if told to insert a module which is already present or to remove a module which isn't present. This is ideal for simple scripts; however, more complicated scripts often want to know whether modprobe really did something: this option makes modprobe fail in the case that it actually didn't do anything. --force-vermagic Every module contains a small string containing important information, such as the kernel and compiler versions. If a module fails to load and the kernel complains that the "version magic" doesn't match, you can use this option to remove it. Naturally, this check is there for your protection, so using this option is dangerous unless you know what you're doing. This applies to any modules inserted: both the module (or alias) on the command line and any modules on which it depends. --force-modversion When modules are compiled with CONFIG_MODVERSIONS set, a section detailing the versions of every interfaced used by (or supplied by) the module is created. If a module fails to load and the kernel complains that the module disagrees about a version of some interface, you can use "--force-modversion" to remove the version information altogether. Naturally, this check is there for your protection, so using this option is dangerous unless you know what you're doing. This applies any modules inserted: both the module (or alias) on the command line and any modules on which it depends. -f, --force Try to strip any versioning information from the module which might otherwise stop it from loading: this is the same as using both --force-vermagic and --force-modversion. Naturally, these checks are there for your protection, so using this option is dangerous unless you know what you are doing. This applies to any modules inserted: both the module (or alias) on the command line and any modules it on which it depends. -i, --ignore-install, --ignore-remove This option causes modprobe to ignore install and remove commands in the configuration file (if any) for the module specified on the command line (any dependent modules are still subject to commands set for them in the configuration file). Both install and remove commands will currently be ignored when this option is used regardless of whether the request was more specifically made with only one or other (and not both) of --ignore-install or --ignore-remove. See modprobe.d(5). -n, --dry-run, --show This option does everything but actually insert or delete the modules (or run the install or remove commands). Combined with -v, it is useful for debugging problems. For historical reasons both --dry-run and --show actually mean the same thing and are interchangeable. -q, --quiet With this flag, modprobe won't print an error message if you try to remove or insert a module it can't find (and isn't an alias or install/remove command). However, it will still return with a non-zero exit status. The kernel uses this to opportunistically probe for modules which might exist using request_module. -R, --resolve-alias Print all module names matching an alias. This can be useful for debugging module alias problems. -r, --remove This option causes modprobe to remove rather than insert a module. If the modules it depends on are also unused, modprobe will try to remove them too. Unlike insertion, more than one module can be specified on the command line (it does not make sense to specify module parameters when removing modules). There is usually no reason to remove modules, but some buggy modules require it. Your distribution kernel may not have been built to support removal of modules at all. -w, --wait=TIMEOUT_MSEC This option causes modprobe -r to continue trying to remove a module if it fails due to the module being busy, i.e. its refcount is not 0 at the time the call is made. Modprobe tries to remove the module with an incremental sleep time between each tentative up until the maximum wait time in milliseconds passed in this option. -S, --set-version Set the kernel version, rather than using uname(2) to decide on the kernel version (which dictates where to find the modules). --show-depends List the dependencies of a module (or alias), including the module itself. This produces a (possibly empty) set of module filenames, one per line, each starting with "insmod" and is typically used by distributions to determine which modules to include when generating initrd/initramfs images. Install commands which apply are shown prefixed by "install". It does not run any of the install commands. Note that modinfo(8) can be used to extract dependencies of a module from the module itself, but knows nothing of aliases or install commands. -s, --syslog This option causes any error messages to go through the syslog mechanism (as LOG_DAEMON with level LOG_NOTICE) rather than to standard error. This is also automatically enabled when stderr is unavailable. This option is passed through install or remove commands to other modprobe commands in the MODPROBE_OPTIONS environment variable. -V, --version Show version of program and exit. -v, --verbose Print messages about what the program is doing. Usually modprobe only prints messages if something goes wrong. This option is passed through install or remove commands to other modprobe commands in the MODPROBE_OPTIONS environment variable. ENVIRONMENT top The MODPROBE_OPTIONS environment variable can also be used to pass arguments to modprobe. COPYRIGHT top This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. Maintained by Jon Masters and others. SEE ALSO top modprobe.d(5), insmod(8), rmmod(8), lsmod(8), modinfo(8) depmod(8) AUTHORS top Jon Masters <[email protected]> Developer Robby Workman <[email protected]> Developer Lucas De Marchi <[email protected]> Developer COLOPHON top This page is part of the kmod (userspace tools for managing kernel modules) project. Information about the project can be found at [unknown -- if you know, please contact man- [email protected]] 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/kernel/kmod/kmod.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] kmod 12/22/2023 MODPROBE(8) Pages that refer to this page: delete_module(2), init_module(2), sk98lin(4), modprobe.d(5), modules.dep(5), modules-load.d(5), sysctl.d(5), depmod(8), insmod(8), kmod(8), lsmod(8), modinfo(8), rmmod(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. | # modprobe\n\n> Add or remove modules from the Linux kernel.\n> More information: <https://manned.org/modprobe>.\n\n- Pretend to load a module into the kernel, but don't actually do it:\n\n`sudo modprobe --dry-run {{module_name}}`\n\n- Load a module into the kernel:\n\n`sudo modprobe {{module_name}}`\n\n- Remove a module from the kernel:\n\n`sudo modprobe --remove {{module_name}}`\n\n- Remove a module and those that depend on it from the kernel:\n\n`sudo modprobe --remove-dependencies {{module_name}}`\n\n- Show a kernel module's dependencies:\n\n`sudo modprobe --show-depends {{module_name}}`\n |
more | more(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training more(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | COMMANDS | ENVIRONMENT | HISTORY | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY MORE(1) User Commands MORE(1) NAME top more - display the contents of a file in a terminal SYNOPSIS top more [options] file ... DESCRIPTION top more is a filter for paging through text one screenful at a time. This version is especially primitive. Users should realize that less(1) provides more(1) emulation plus extensive enhancements. OPTIONS top Options are also taken from the environment variable MORE (make sure to precede them with a dash (-)) but command-line options will override those. -d, --silent Prompt with "[Press space to continue, 'q' to quit.]", and display "[Press 'h' for instructions.]" instead of ringing the bell when an illegal key is pressed. -l, --logical Do not pause after any line containing a ^L (form feed). -e, --exit-on-eof Exit on End-Of-File, enabled by default if POSIXLY_CORRECT environment variable is not set or if not executed on terminal. -f, --no-pause Count logical lines, rather than screen lines (i.e., long lines are not folded). -p, --print-over Do not scroll. Instead, clear the whole screen and then display the text. Notice that this option is switched on automatically if the executable is named page. -c, --clean-print Do not scroll. Instead, paint each screen from the top, clearing the remainder of each line as it is displayed. -s, --squeeze Squeeze multiple blank lines into one. -u, --plain Suppress underlining. This option is silently ignored as backwards compatibility. -n, --lines number Specify the number of lines per screenful. The number argument is a positive decimal integer. The --lines option shall override any values obtained from any other source, such as number of lines reported by terminal. -number A numeric option means the same as --lines option argument. +number Start displaying each file at line number. +/string The string to be searched in each file before starting to display it. -h, --help Display help text and exit. -V, --version Print version and exit. COMMANDS top Interactive commands for more are based on vi(1). Some commands may be preceded by a decimal number, called k in the descriptions below. In the following descriptions, ^X means control-X. h or ? Help; display a summary of these commands. If you forget all other commands, remember this one. SPACE Display next k lines of text. Defaults to current screen size. z Display next k lines of text. Defaults to current screen size. Argument becomes new default. RETURN Display next k lines of text. Defaults to 1. Argument becomes new default. d or ^D Scroll k lines. Default is current scroll size, initially 11. Argument becomes new default. q or Q or INTERRUPT Exit. s Skip forward k lines of text. Defaults to 1. f Skip forward k screenfuls of text. Defaults to 1. b or ^B Skip backwards k screenfuls of text. Defaults to 1. Only works with files, not pipes. ' Go to the place where the last search started. = Display current line number. /pattern Search for kth occurrence of regular expression. Defaults to 1. n Search for kth occurrence of last regular expression. Defaults to 1. !command or :!command Execute command in a subshell. v Start up an editor at current line. The editor is taken from the environment variable VISUAL if defined, or EDITOR if VISUAL is not defined, or defaults to vi(1) if neither VISUAL nor EDITOR is defined. ^L Redraw screen. :n Go to kth next file. Defaults to 1. :p Go to kth previous file. Defaults to 1. :f Display current file name and line number. . Repeat previous command. ENVIRONMENT top The more command respects the following environment variables, if they exist: MORE This variable may be set with favored options to more. SHELL Current shell in use (normally set by the shell at login time). TERM The terminal type used by more to get the terminal characteristics necessary to manipulate the screen. VISUAL The editor the user prefers. Invoked when command key v is pressed. EDITOR The editor of choice when VISUAL is not specified. POSIXLY_CORRECT Disable exit-on-eof (see option -e for more details). HISTORY top The more command appeared in 3.0BSD. This man page documents more version 5.19 (Berkeley 6/29/88), which is currently in use in the Linux community. Documentation was produced using several other versions of the man page, and extensive inspection of the source code. AUTHORS top Eric Shienbrood, UC Berkeley. Modified by Geoff Peck, UCB to add underlining, single spacing. Modified by John Foderaro, UCB to add -c and MORE environment variable. SEE ALSO top less(1), vi(1) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The more 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 MORE(1) Pages that refer to this page: colcrt(1), homectl(1), journalctl(1), less(1), localectl(1), loginctl(1), machinectl(1), more(1), portablectl(1), systemctl(1), systemd(1), systemd-analyze(1), systemd-inhibit(1), systemd-nspawn(1), systemd-vmspawn(1), timedatectl(1), userdbctl(1), environ(7), systemd-tmpfiles(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. | # more\n\n> Interactively display a file, allowing scrolling and searching.\n> See also: `less`.\n> More information: <https://manned.org/more>.\n\n- Open a file:\n\n`more {{path/to/file}}`\n\n- Display a specific line:\n\n`more +{{line_number}} {{path/to/file}}`\n\n- Go to the next page:\n\n`<Space>`\n\n- Search for a string (press `n` to go to the next match):\n\n`/{{something}}`\n\n- Exit:\n\n`q`\n\n- Display help about interactive commands:\n\n`h`\n |
mount | mount(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training mount(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COMMAND-LINE OPTIONS | FILESYSTEM-INDEPENDENT MOUNT OPTIONS | FILESYSTEM-SPECIFIC MOUNT OPTIONS | DM-VERITY SUPPORT | LOOP-DEVICE SUPPORT | EXIT STATUS | EXTERNAL HELPERS | ENVIRONMENT | FILES | HISTORY | BUGS | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY MOUNT(8) System Administration MOUNT(8) NAME top mount - mount a filesystem SYNOPSIS top mount [-h|-V] mount [-l] [-t fstype] mount -a [-fFnrsvw] [-t fstype] [-O optlist] mount [-fnrsvw] [-o options] device|mountpoint mount [-fnrsvw] [-t fstype] [-o options] device mountpoint mount --bind|--rbind|--move olddir newdir mount --make-[shared|slave|private|unbindable|rshared|rslave|rprivate|runbindable] mountpoint DESCRIPTION top All files accessible in a Unix system are arranged in one big tree, the file hierarchy, rooted at /. These files can be spread out over several devices. The mount command serves to attach the filesystem found on some device to the big file tree. Conversely, the umount(8) command will detach it again. The filesystem is used to control how data is stored on the device or provided in a virtual way by network or other services. The standard form of the mount command is: mount -t type device dir This tells the kernel to attach the filesystem found on device (which is of type type) at the directory dir. The option -t type is optional. The mount command is usually able to detect a filesystem. The root permissions are necessary to mount a filesystem by default. See section "Non-superuser mounts" below for more details. The previous contents (if any) and owner and mode of dir become invisible, and as long as this filesystem remains mounted, the pathname dir refers to the root of the filesystem on device. If only the directory or the device is given, for example: mount /dir then mount looks for a mountpoint (and if not found then for a device) in the /etc/fstab file. Its possible to use the --target or --source options to avoid ambiguous interpretation of the given argument. For example: mount --target /mountpoint The same filesystem may be mounted more than once, and in some cases (e.g., network filesystems) the same filesystem may be mounted on the same mountpoint multiple times. The mount command does not implement any policy to control this behavior. All behavior is controlled by the kernel and it is usually specific to the filesystem driver. The exception is --all, in this case already mounted filesystems are ignored (see --all below for more details). Listing the mounts The listing mode is maintained for backward compatibility only. For more robust and customizable output use findmnt(8), especially in your scripts. Note that control characters in the mountpoint name are replaced with '?'. The following command lists all mounted filesystems (of type type): mount [-l] [-t type] The option -l adds labels to this listing. See below. Indicating the device and filesystem Most devices are indicated by a filename (of a block special device), like /dev/sda1, but there are other possibilities. For example, in the case of an NFS mount, device may look like knuth.cwi.nl:/dir. The device names of disk partitions are unstable; hardware reconfiguration, and adding or removing a device can cause changes in names. This is the reason why its strongly recommended to use filesystem or partition identifiers like UUID or LABEL. Currently supported identifiers (tags): LABEL=label Human readable filesystem identifier. See also -L. UUID=uuid Filesystem universally unique identifier. The format of the UUID is usually a series of hex digits separated by hyphens. See also -U. Note that mount uses UUIDs as strings. The UUIDs from the command line or from fstab(5) are not converted to internal binary representation. The string representation of the UUID should be based on lower case characters. PARTLABEL=label Human readable partition identifier. This identifier is independent on filesystem and does not change by mkfs or mkswap operations. Its supported for example for GUID Partition Tables (GPT). PARTUUID=uuid Partition universally unique identifier. This identifier is independent on filesystem and does not change by mkfs or mkswap operations. Its supported for example for GUID Partition Tables (GPT). ID=id Hardware block device ID as generated by udevd. This identifier is usually based on WWN (unique storage identifier) and assigned by the hardware manufacturer. See ls /dev/disk/by-id for more details, this directory and running udevd is required. This identifier is not recommended for generic use as the identifier is not strictly defined and it depends on udev, udev rules and hardware. The command lsblk --fs provides an overview of filesystems, LABELs and UUIDs on available block devices. The command blkid -p <device> provides details about a filesystem on the specified device. Dont forget that there is no guarantee that UUIDs and labels are really unique, especially if you move, share or copy the device. Use lsblk -o +UUID,PARTUUID to verify that the UUIDs are really unique in your system. The recommended setup is to use tags (e.g. UUID=uuid) rather than /dev/disk/by-{label,uuid,id,partuuid,partlabel} udev symlinks in the /etc/fstab file. Tags are more readable, robust and portable. The mount(8) command internally uses udev symlinks, so the use of symlinks in /etc/fstab has no advantage over tags. For more details see libblkid(3). The proc filesystem is not associated with a special device, and when mounting it, an arbitrary keyword - for example, proc - can be used instead of a device specification. (The customary choice none is less fortunate: the error message 'none already mounted' from mount can be confusing.) The files /etc/fstab, /etc/mtab and /proc/mounts The file /etc/fstab (see fstab(5)), may contain lines describing what devices are usually mounted where, using which options. The default location of the fstab(5) file can be overridden with the --fstab path command-line option (see below for more details). The command mount -a [-t type] [-O optlist] (usually given in a bootscript) causes all filesystems mentioned in fstab (of the proper type and/or having or not having the proper options) to be mounted as indicated, except for those whose line contains the noauto keyword. Adding the -F option will make mount fork, so that the filesystems are mounted in parallel. When mounting a filesystem mentioned in fstab or mtab, it suffices to specify on the command line only the device, or only the mount point. The programs mount and umount(8) traditionally maintained a list of currently mounted filesystems in the file /etc/mtab. The support for regular classic /etc/mtab is completely disabled at compile time by default, because on current Linux systems it is better to make /etc/mtab a symlink to /proc/mounts instead. The regular mtab file maintained in userspace cannot reliably work with namespaces, containers and other advanced Linux features. If the regular mtab support is enabled, then its possible to use the file as well as the symlink. If no arguments are given to mount, the list of mounted filesystems is printed. If you want to override mount options from /etc/fstab, you have to use the -o option: mount device|dir -o options and then the mount options from the command line will be appended to the list of options from /etc/fstab. This default behaviour can be changed using the --options-mode command-line option. The usual behavior is that the last option wins if there are conflicting ones. The mount program does not read the /etc/fstab file if both device (or LABEL, UUID, ID, PARTUUID or PARTLABEL) and dir are specified. For example, to mount device foo at /dir: mount /dev/foo /dir This default behaviour can be changed by using the --options-source-force command-line option to always read configuration from fstab. For non-root users mount always reads the fstab configuration. Non-superuser mounts Normally, only the superuser can mount filesystems. However, when fstab contains the user option on a line, anybody can mount the corresponding filesystem. Thus, given a line /dev/cdrom /cd iso9660 ro,user,noauto,unhide any user can mount the iso9660 filesystem found on an inserted CDROM using the command: mount /cd Note that mount is very strict about non-root users and all paths specified on command line are verified before fstab is parsed or a helper program is executed. Its strongly recommended to use a valid mountpoint to specify filesystem, otherwise mount may fail. For example its a bad idea to use NFS or CIFS source on command line. Since util-linux 2.35, mount does not exit when user permissions are inadequate according to libmounts internal security rules. Instead, it drops suid permissions and continues as regular non-root user. This behavior supports use-cases where root permissions are not necessary (e.g., fuse filesystems, user namespaces, etc). For more details, see fstab(5). Only the user that mounted a filesystem can unmount it again. If any user should be able to unmount it, then use users instead of user in the fstab line. The owner option is similar to the user option, with the restriction that the user must be the owner of the special file. This may be useful e.g. for /dev/fd if a login script makes the console user owner of this device. The group option is similar, with the restriction that the user must be a member of the group of the special file. The user mount option is accepted if no username is specified. If used in the format user=someone, the option is silently ignored and visible only for external mount helpers (/sbin/mount.<type>) for compatibility with some network filesystems. Bind mount operation Remount part of the file hierarchy somewhere else. The call is: mount --bind olddir newdir or by using this fstab entry: /olddir /newdir none bind After this call the same contents are accessible in two places. It is important to understand that "bind" does not create any second-class or special node in the kernel VFS. The "bind" is just another operation to attach a filesystem. There is nowhere stored information that the filesystem has been attached by a "bind" operation. The olddir and newdir are independent and the olddir may be unmounted. One can also remount a single file (on a single file). Its also possible to use a bind mount to create a mountpoint from a regular directory, for example: mount --bind foo foo The bind mount call attaches only (part of) a single filesystem, not possible submounts. The entire file hierarchy including submounts can be attached a second place by using: mount --rbind olddir newdir Note that the filesystem mount options maintained by the kernel will remain the same as those on the original mount point. The userspace mount options (e.g., _netdev) will not be copied by mount and its necessary to explicitly specify the options on the mount command line. Since util-linux 2.27 mount permits changing the mount options by passing the relevant options along with --bind. For example: mount -o bind,ro foo foo This feature is not supported by the Linux kernel; it is implemented in userspace by an additional mount(2) remounting system call. This solution is not atomic. The alternative (classic) way to create a read-only bind mount is to use the remount operation, for example: mount --bind olddir newdir mount -o remount,bind,ro olddir newdir Note that a read-only bind will create a read-only mountpoint (VFS entry), but the original filesystem superblock will still be writable, meaning that the olddir will be writable, but the newdir will be read-only. Its also possible to change nosuid, nodev, noexec, noatime, nodiratime, relatime and nosymfollow VFS entry flags via a "remount,bind" operation. The other flags (for example filesystem-specific flags) are silently ignored. The classic mount(2) system call does not allow to change mount options recursively (for example with -o rbind,ro). The recursive semantic is possible with a new mount_setattr(2) kernel system call and its supported since libmount from util-linux v2.39 by a new experimental "recursive" option argument (e.g. -o rbind,ro=recursive). For more details see the FILESYSTEM-INDEPENDENT MOUNT OPTIONS section. Since util-linux 2.31, mount ignores the bind flag from /etc/fstab on a remount operation (if -o remount is specified on command line). This is necessary to fully control mount options on remount by command line. In previous versions the bind flag has been always applied and it was impossible to re-define mount options without interaction with the bind semantic. This mount behavior does not affect situations when "remount,bind" is specified in the /etc/fstab file. Since util-linux 2.40, mount does not canonicalize the mountpoint path on bind operation if the target is a symlink. This feature is usable (only) with the new kernel mount API where bind mount over symlinks is supported. The move operation Move a mounted tree to another place (atomically). The call is: mount --move olddir newdir This will cause the contents which previously appeared under olddir to now be accessible under newdir. The physical location of the files is not changed. Note that olddir has to be a mountpoint. Note also that moving a mount residing under a shared mount is invalid and unsupported. Use findmnt -o TARGET,PROPAGATION to see the current propagation flags. Shared subtree operations Since Linux 2.6.15 it is possible to mark a mount and its submounts as shared, private, slave or unbindable. A shared mount provides the ability to create mirrors of that mount such that mounts and unmounts within any of the mirrors propagate to the other mirror. A slave mount receives propagation from its master, but not vice versa. A private mount carries no propagation abilities. An unbindable mount is a private mount which cannot be cloned through a bind operation. The detailed semantics are documented in Documentation/filesystems/sharedsubtree.txt file in the kernel source tree; see also mount_namespaces(7). Supported operations are: mount --make-shared mountpoint mount --make-slave mountpoint mount --make-private mountpoint mount --make-unbindable mountpoint The following commands allow one to recursively change the type of all the mounts under a given mountpoint. mount --make-rshared mountpoint mount --make-rslave mountpoint mount --make-rprivate mountpoint mount --make-runbindable mountpoint mount does not read fstab(5) when a --make-* operation is requested. All necessary information has to be specified on the command line. Note that the Linux kernel does not allow changing multiple propagation flags with a single mount(2) system call, and the flags cannot be mixed with other mount options and operations. Since util-linux 2.23 the mount command can be used to do more propagation (topology) changes by one mount(8) call and do it also together with other mount operations. The propagation flags are applied by additional mount(2) system calls when the preceding mount operations were successful. Note that this use case is not atomic. It is possible to specify the propagation flags in fstab(5) as mount options (private, slave, shared, unbindable, rprivate, rslave, rshared, runbindable). For example: mount --make-private --make-unbindable /dev/sda1 /foo is the same as: mount /dev/sda1 /foo mount --make-private /foo mount --make-unbindable /foo COMMAND-LINE OPTIONS top The full set of mount options used by an invocation of mount is determined by first extracting the mount options for the filesystem from the fstab table, then applying any options specified by the -o argument, and finally applying a -r or -w option, when present. The mount command does not pass all command-line options to the /sbin/mount.suffix mount helpers. The interface between mount and the mount helpers is described below in the EXTERNAL HELPERS section. Command-line options available for the mount command are: -a, --all Mount all filesystems (of the given types) mentioned in fstab (except for those whose line contains the noauto keyword). The filesystems are mounted following their order in fstab. The mount command compares filesystem source, target (and fs root for bind mount or btrfs) to detect already mounted filesystems. The kernel table with already mounted filesystems is cached during mount --all. This means that all duplicated fstab entries will be mounted. The correct functionality depends on /proc (to detect already mounted filesystems) and on /sys (to evaluate filesystem tags like UUID= or LABEL=). Its strongly recommended to mount /proc and /sys filesystems before mount -a is executed, or keep /proc and /sys at the beginning of fstab. The option --all is possible to use for remount operation too. In this case all filters (-t and -O) are applied to the table of already mounted filesystems. Since version 2.35 it is possible to use the command line option -o to alter mount options from fstab (see also --options-mode). Note that it is a bad practice to use mount -a for fstab checking. The recommended solution is findmnt --verify. -B, --bind Remount a subtree somewhere else (so that its contents are available in both places). See above, under Bind mount operation. -c, --no-canonicalize Dont canonicalize paths. The mount command canonicalizes all paths (from the command line or fstab) by default. The option is designed for mount helpers which call mount -i. It is strongly recommended to not use this command-line option for normal mount operations. Since util-linux 2.40, mount does not canonicalize the mountpoint path on bind operation if the target is a symlink (see "Bind mount operation" section for more details). Note that mount does not pass this option to the /sbin/mount.type helpers. -F, --fork (Used in conjunction with -a.) Fork off a new incarnation of mount for each device. This will do the mounts on different devices or different NFS servers in parallel. This has the advantage that it is faster; also NFS timeouts proceed in parallel. A disadvantage is that the order of the mount operations is undefined. Thus, you cannot use this option if you want to mount both /usr and /usr/spool. -f, --fake Causes everything to be done except for the mount-related system calls. The --fake option was originally designed to write an entry to /etc/mtab without actually mounting. The /etc/mtab is no longer maintained in userspace, and starting from version 2.39, the mount operation can be a complex chain of operations with dependencies between the syscalls. The --fake option forces libmount to skip all mount source preparation, mount option analysis, and the actual mounting process. The difference between fake and non-fake execution is huge. This is the reason why the --fake option has minimal significance for the current mount(8) implementation and it is maintained mostly for backward compatibility. -i, --internal-only Dont call the /sbin/mount.filesystem helper even if it exists. -L, --label label Mount the partition that has the specified label. -l, --show-labels Add the labels in the mount output. mount must have permission to read the disk device (e.g. be set-user-ID root) for this to work. One can set such a label for ext2, ext3 or ext4 using the e2label(8) utility, or for XFS using xfs_admin(8), or for reiserfs using reiserfstune(8). -M, --move Move a subtree to some other place. See above, the subsection The move operation. -m, --mkdir[=mode] Allow to make a target directory (mountpoint) if it does not exist yet. Alias to "-o X-mount.mkdir[=mode]", the default mode is 0755. For more details see X-mount.mkdir below. --map-groups, --map-users inner:_outer_:_count_ Add the specified user/group mapping to an X-mount.idmap map. These options can be given multiple times to build up complete mappings for users and groups. For more details see X-mount.idmap below. --map-users /proc/PID/ns/user Use the specified user namespace for user and group mapping in an id-mapped mount. This is an alias for "-o X-mount.idmap=/proc/PID/ns/user" and cannot be used twice nor together with the inner:_outer_:_count_ option format above. For more details see X-mount.idmap below. -n, --no-mtab Mount without writing in /etc/mtab. This is necessary for example when /etc is on a read-only filesystem. -N, --namespace ns Perform the mount operation in the mount namespace specified by ns. ns is either PID of process running in that namespace or special file representing that namespace. mount switches to the mount namespace when it reads /etc/fstab, writes /etc/mtab: (or writes to _/run/mount) and calls mount(2), otherwise it runs in the original mount namespace. This means that the target namespace does not have to contain any libraries or other requirements necessary to execute the mount(2) call. See mount_namespaces(7) for more information. -O, --test-opts opts Limit the set of filesystems to which the -a option applies. In this regard it is like the -t option except that -O is useless without -a. For example, the command mount -a -O no_netdev mounts all filesystems except those which have the option netdev specified in the options field in the /etc/fstab file. It is different from -t in that each option is matched exactly; a leading no at the beginning of one option does not negate the rest. The -t and -O options are cumulative in effect; that is, the command mount -a -t ext2 -O _netdev mounts all ext2 filesystems with the _netdev option, not all filesystems that are either ext2 or have the _netdev option specified. -o, --options opts Use the specified mount options. The opts argument is a comma-separated list. For example: mount LABEL=mydisk -o noatime,nodev,nosuid Note that the order of the options matters, as the last option wins if there are conflicting ones. The options from the command line also overwrite options from fstab by default. For more details, see the FILESYSTEM-INDEPENDENT MOUNT OPTIONS and FILESYSTEM-SPECIFIC MOUNT OPTIONS sections. --onlyonce Forces mount command to check if the filesystem is already mounted. This behavior is the default for --all; otherwise, it depends on the kernel filesystem driver. Some filesystems may be mounted more than once on the same mount point (e.g. tmpfs). --options-mode mode Controls how to combine options from fstab/mtab with options from the command line. mode can be one of ignore, append, prepend or replace. For example, append means that options from fstab are appended to options from the command line. The default value is prepend it means command line options are evaluated after fstab options. Note that the last option wins if there are conflicting ones. --options-source source Source of default options. source is a comma-separated list of fstab, mtab and disable. disable disables fstab and mtab and enables --options-source-force. The default value is fstab,mtab. --options-source-force Use options from fstab/mtab even if both device and dir are specified. -R, --rbind Remount a subtree and all possible submounts somewhere else (so that its contents are available in both places). See above, the subsection Bind mount operation. -r, --read-only Mount the filesystem read-only. A synonym is -o ro. Note that, depending on the filesystem type, state and kernel behavior, the system may still write to the device. For example, ext3 and ext4 will replay the journal if the filesystem is dirty. To prevent this kind of write access, you may want to mount an ext3 or ext4 filesystem with the ro,noload mount options or set the block device itself to read-only mode, see the blockdev(8) command. -s Tolerate sloppy mount options rather than failing. This will ignore mount options not supported by a filesystem type. Not all filesystems support this option. Currently its supported by the mount.nfs mount helper only. --source device If only one argument for the mount command is given, then the argument might be interpreted as the target (mountpoint) or source (device). This option allows you to explicitly define that the argument is the mount source. --target directory If only one argument for the mount command is given, then the argument might be interpreted as the target (mountpoint) or source (device). This option allows you to explicitly define that the argument is the mount target. --target-prefix directory Prepend the specified directory to all mount targets. This option can be used to follow fstab, but mount operations are done in another place, for example: mount --all --target-prefix /chroot -o X-mount.mkdir mounts all from system fstab to /chroot, all missing mountpoint are created (due to X-mount.mkdir). See also --fstab to use an alternative fstab. -T, --fstab path Specifies an alternative fstab file. If path is a directory, then the files in the directory are sorted by strverscmp(3); files that start with "." or without an .fstab extension are ignored. The option can be specified more than once. This option is mostly designed for initramfs or chroot scripts where additional configuration is specified beyond standard system configuration. Note that mount does not pass the option --fstab to the /sbin/mount.type helpers, meaning that the alternative fstab files will be invisible for the helpers. This is no problem for normal mounts, but user (non-root) mounts always require fstab to verify the users rights. -t, --types fstype The argument following the -t is used to indicate the filesystem type. The filesystem types which are currently supported depend on the running kernel. See /proc/filesystems and /lib/modules/$(uname -r)/kernel/fs for a complete list of the filesystems. The most common are ext2, ext3, ext4, xfs, btrfs, vfat, sysfs, proc, nfs and cifs. The programs mount and umount(8) support filesystem subtypes. The subtype is defined by a '.subtype' suffix. For example 'fuse.sshfs'. Its recommended to use subtype notation rather than add any prefix to the mount source (for example 'sshfs#example.com' is deprecated). If no -t option is given, or if the auto type is specified, mount will try to guess the desired type. mount uses the libblkid(3) library for guessing the filesystem type; if that does not turn up anything that looks familiar, mount will try to read the file /etc/filesystems, or, if that does not exist, /proc/filesystems. All of the filesystem types listed there will be tried, except for those that are labeled "nodev" (e.g. devpts, proc and nfs). If /etc/filesystems ends in a line with a single *, mount will read /proc/filesystems afterwards. While trying, all filesystem types will be mounted with the mount option silent. The auto type may be useful for user-mounted floppies. Creating a file /etc/filesystems can be useful to change the probe order (e.g., to try vfat before msdos or ext3 before ext2) or if you use a kernel module autoloader. More than one type may be specified in a comma-separated list, for the -t option as well as in an /etc/fstab entry. The list of filesystem types for the -t option can be prefixed with no to specify the filesystem types on which no action should be taken. The prefix no has no effect when specified in an /etc/fstab entry. The prefix no can be meaningful with the -a option. For example, the command mount -a -t nomsdos,smbfs mounts all filesystems except those of type msdos and smbfs. For most types all the mount program has to do is issue a simple mount(2) system call, and no detailed knowledge of the filesystem type is required. For a few types however (like nfs, nfs4, cifs, smbfs, ncpfs) an ad hoc code is necessary. The nfs, nfs4, cifs, smbfs, and ncpfs filesystems have a separate mount program. In order to make it possible to treat all types in a uniform way, mount will execute the program /sbin/mount.type (if that exists) when called with type type. Since different versions of the smbmount program have different calling conventions, /sbin/mount.smbfs may have to be a shell script that sets up the desired call. -U, --uuid uuid Mount the partition that has the specified uuid. -v, --verbose Verbose mode. -w, --rw, --read-write Mount the filesystem read/write. Read-write is the kernel default and the mount default is to try read-only if the previous mount(2) syscall with read-write flags on write-protected devices failed. A synonym is -o rw. Note that specifying -w on the command line forces mount to never try read-only mount on write-protected devices or already mounted read-only filesystems. -h, --help Display help text and exit. -V, --version Print version and exit. FILESYSTEM-INDEPENDENT MOUNT OPTIONS top Some of these options are only useful when they appear in the /etc/fstab file. Some of these options could be enabled or disabled by default in the system kernel. To check the current setting see the options in /proc/mounts. Note that filesystems also have per-filesystem specific default mount options (see for example tune2fs -l output for extN filesystems). The options nosuid, noexec, nodiratime, relatime, noatime, strictatime, and nosymfollow are interpreted only by the abstract VFS kernel layer and applied to the mountpoint node rather than to the filesystem itself. Try: findmnt -o TARGET,VFS-OPTIONS,FS-OPTIONS to get a complete overview of filesystems and VFS options. The read-only setting (ro or rw) is interpreted by VFS and the filesystem and depends on how the option is specified on the mount(8) command line. The default is to interpret it on the filesystem level. The operation "-o bind,remount,ro" is applied only to the VFS mountpoint, and operation "-o remount,ro" is applied to VFS and filesystem superblock. This semantic allows create a read-only mountpoint but keeps the filesystem writable from another mountpoint. Since v2.39 libmount can use a new kernel mount interface to set the VFS options recursive. For backward compatibility, this feature is not enabled by default, although recursive operation (e.g. rbind) has been requested. The new option argument "recursive" could be specified, for example: mount -orbind,ro=recursive,noexec=recursive,nosuid /foo /bar recursively binds filesystems from /foo to /bar, /bar, and all submounts will be read-only and noexec, but only /bar itself will be "nosuid". The "recursive" optional argument for VFS mount options is an EXPERIMENTAL feature. The following options apply to any filesystem that is being mounted (but not every filesystem actually honors them - e.g., the sync option today has an effect only for ext2, ext3, ext4, fat, vfat, ufs and xfs): async All I/O to the filesystem should be done asynchronously. (See also the sync option.) atime Do not use the noatime feature, so the inode access time is controlled by kernel defaults. See also the descriptions of the relatime and strictatime mount options. noatime Do not update inode access times on this filesystem (e.g. for faster access on the news spool to speed up news servers). This works for all inode types (directories too), so it implies nodiratime. auto Can be mounted with the -a option. noauto Can only be mounted explicitly (i.e., the -a option will not cause the filesystem to be mounted). context=context, fscontext=context, defcontext=context, and rootcontext=context The context= option is useful when mounting filesystems that do not support extended attributes, such as a floppy or hard disk formatted with VFAT, or systems that are not normally running under SELinux, such as an ext3 or ext4 formatted disk from a non-SELinux workstation. You can also use context= on filesystems you do not trust, such as a floppy. It also helps in compatibility with xattr-supporting filesystems on earlier 2.4.<x> kernel versions. Even where xattrs are supported, you can save time not having to label every file by assigning the entire disk one security context. A commonly used option for removable media is context="system_u:object_r:removable_t. The fscontext= option works for all filesystems, regardless of their xattr support. The fscontext option sets the overarching filesystem label to a specific security context. This filesystem label is separate from the individual labels on the files. It represents the entire filesystem for certain kinds of permission checks, such as during mount or file creation. Individual file labels are still obtained from the xattrs on the files themselves. The context option actually sets the aggregate context that fscontext provides, in addition to supplying the same label for individual files. You can set the default security context for unlabeled files using defcontext= option. This overrides the value set for unlabeled files in the policy and requires a filesystem that supports xattr labeling. The rootcontext= option allows you to explicitly label the root inode of a FS being mounted before that FS or inode becomes visible to userspace. This was found to be useful for things like stateless Linux. The special value @target can be used to assign the current context of the target mountpoint location. Note that the kernel rejects any remount request that includes the context option, even when unchanged from the current context. Warning: the context value might contain commas, in which case the value has to be properly quoted, otherwise mount will interpret the comma as a separator between mount options. Dont forget that the shell strips off quotes and thus double quoting is required. For example: mount -t tmpfs none /mnt -o \ 'context="system_u:object_r:tmp_t:s0:c127,c456",noexec' For more details, see selinux(8). defaults Use the default options: rw, suid, dev, exec, auto, nouser, and async. Note that the real set of all default mount options depends on the kernel and filesystem type. See the beginning of this section for more details. dev Interpret character or block special devices on the filesystem. nodev Do not interpret character or block special devices on the filesystem. diratime Update directory inode access times on this filesystem. This is the default. (This option is ignored when noatime is set.) nodiratime Do not update directory inode access times on this filesystem. (This option is implied when noatime is set.) dirsync All directory updates within the filesystem should be done synchronously. This affects the following system calls: creat(2), link(2), unlink(2), symlink(2), mkdir(2), rmdir(2), mknod(2) and rename(2). exec Permit execution of binaries and other executable files. noexec Do not permit direct execution of any binaries on the mounted filesystem. group Allow an ordinary user to mount the filesystem if one of that users groups matches the group of the device. This option implies the options nosuid and nodev (unless overridden by subsequent options, as in the option line group,dev,suid). iversion Every time the inode is modified, the i_version field will be incremented. noiversion Do not increment the i_version inode field. mand Allow mandatory locks on this filesystem. See fcntl(2). This option was deprecated in Linux 5.15. nomand Do not allow mandatory locks on this filesystem. _netdev The filesystem resides on a device that requires network access (used to prevent the system from attempting to mount these filesystems until the network has been enabled on the system). nofail Do not report errors for this device if it does not exist. relatime Update inode access times relative to modify or change time. Access time is only updated if the previous access time was earlier than or equal to the current modify or change time. (Similar to noatime, but it doesnt break mutt(1) or other applications that need to know if a file has been read since the last time it was modified.) Since Linux 2.6.30, the kernel defaults to the behavior provided by this option (unless noatime was specified), and the strictatime option is required to obtain traditional semantics. In addition, since Linux 2.6.30, the files last access time is always updated if it is more than 1 day old. norelatime Do not use the relatime feature. See also the strictatime mount option. strictatime Allows to explicitly request full atime updates. This makes it possible for the kernel to default to relatime or noatime but still allow userspace to override it. For more details about the default system mount options see /proc/mounts. nostrictatime Use the kernels default behavior for inode access time updates. lazytime Only update times (atime, mtime, ctime) on the in-memory version of the file inode. This mount option significantly reduces writes to the inode table for workloads that perform frequent random writes to preallocated files. The on-disk timestamps are updated only when: the inode needs to be updated for some change unrelated to file timestamps the application employs fsync(2), syncfs(2), or sync(2) an undeleted inode is evicted from memory more than 24 hours have passed since the inode was written to disk. nolazytime Do not use the lazytime feature. suid Honor set-user-ID and set-group-ID bits or file capabilities when executing programs from this filesystem. nosuid Do not honor set-user-ID and set-group-ID bits or file capabilities when executing programs from this filesystem. In addition, SELinux domain transitions require permission nosuid_transition, which in turn needs also policy capability nnp_nosuid_transition. silent Turn on the silent flag. loud Turn off the silent flag. owner Allow an ordinary user to mount the filesystem if that user is the owner of the device. This option implies the options nosuid and nodev (unless overridden by subsequent options, as in the option line owner,dev,suid). remount Attempt to remount an already-mounted filesystem. This is commonly used to change the mount flags for a filesystem, especially to make a readonly filesystem writable. It does not change device or mount point. The remount operation together with the bind flag has special semantics. See above, the subsection Bind mount operation. The default kernel behavior for VFS mount flags (nodev,nosuid,noexec,ro) is to reset all unspecified flags on remount. Thats why mount(8) tries to keep the current setting according to fstab or /proc/self/mountinfo. This default behavior is possible to change by --options-mode. The recursive change of the mount flags (supported since v2.39 on systems with mount_setattr(2) syscall), for example, mount -o remount,ro=recursive, do not use "reset-unspecified" behavior, and it works as a simple add/remove operation and unspecified flags are not modified. The remount functionality follows the standard way the mount command works with options from fstab. This means that mount does not read fstab (or mtab) only when both device and dir are specified. mount -o remount,rw /dev/foo /dir After this call all old mount options are replaced and arbitrary stuff from fstab (or mtab) is ignored, except the loop= option which is internally generated and maintained by the mount command. mount -o remount,rw /dir After this call, mount reads fstab and merges these options with the options from the command line (-o). If no mountpoint is found in fstab, then it defaults to mount options from /proc/self/mountinfo. mount allows the use of --all to remount all already mounted filesystems which match a specified filter (-O and -t). For example: mount --all -o remount,ro -t vfat remounts all already mounted vfat filesystems in read-only mode. Each of the filesystems is remounted by mount -o remount,ro /dir semantic. This means the mount command reads fstab or mtab and merges these options with the options from the command line. ro Mount the filesystem read-only. rw Mount the filesystem read-write. sync All I/O to the filesystem should be done synchronously. In the case of media with a limited number of write cycles (e.g. some flash drives), sync may cause life-cycle shortening. user Allow an ordinary user to mount the filesystem. The name of the mounting user is written to the mtab file (or to the private libmount file in /run/mount on systems without a regular mtab) so that this same user can unmount the filesystem again. This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line user,exec,dev,suid). nouser Forbid an ordinary user to mount the filesystem. This is the default; it does not imply any other options. users Allow any user to mount and to unmount the filesystem, even when some other ordinary user mounted it. This option implies the options noexec, nosuid, and nodev (unless overridden by subsequent options, as in the option line users,exec,dev,suid). X-* All options prefixed with "X-" are interpreted as comments or as userspace application-specific options. These options are not stored in user space (e.g., mtab file), nor sent to the mount.type helpers nor to the mount(2) system call. The suggested format is X-appname.option. x-* The same as X-* options, but stored permanently in user space. This means the options are also available for umount(8) or other operations. Note that maintaining mount options in user space is tricky, because its necessary use libmount-based tools and there is no guarantee that the options will be always available (for example after a move mount operation or in unshared namespace). Note that before util-linux v2.30 the x-* options have not been maintained by libmount and stored in user space (functionality was the same as for X-* now), but due to the growing number of use-cases (in initrd, systemd etc.) the functionality has been extended to keep existing fstab configurations usable without a change. X-mount.auto-fstypes=list Specifies allowed or forbidden filesystem types for automatic filesystem detection. The list is a comma-separated list of the filesystem names. The automatic filesystem detection is triggered by the "auto" filesystem type or when the filesystem type is not specified. Thy list follows how mount evaluates type patterns (see -t for more details). Only specified filesystem types are allowed, or all specified types are forbidden if the list is prefixed by "no". For example, X-mount.auto-fstypes="ext4,btrfs" accepts only ext4 and btrfs, and X-mount.auto-fstypes="novfat,xfs" accepts all filesystems except vfat and xfs. Note that comma is used as a separator between mount options, it means that auto-fstypes values have to be properly quoted, dont forget that the shell strips off quotes and thus double quoting is required. For example: mount -t auto -oX-mount.auto-fstypes="noext2,ext3"' /dev/sdc1 /mnt/test X-mount.mkdir[=mode] Allow to make a target directory (mountpoint) if it does not exist yet. The optional argument mode specifies the filesystem access mode used for mkdir(2) in octal notation. The default mode is 0755. This functionality is supported only for root users or when mount is executed without suid permissions. The option is also supported as x-mount.mkdir, but this notation is deprecated since v2.30. See also --mkdir command line option. X-mount.subdir=directory Allow mounting sub-directory from a filesystem instead of the root directory. For now, this feature is implemented by temporary filesystem root directory mount in unshared namespace and then bind the sub-directory to the final mount point and umount the root of the filesystem. The sub-directory mount shows up atomically for the rest of the system although it is implemented by multiple mount(2) syscalls. Note that this feature will not work in session with an unshared private mount namespace (after unshare --mount) on old kernels or with mount(8) without support for file-descriptors-based mount kernel API. In this case, you need unshare --mount --propagation shared. This feature is EXPERIMENTAL. X-mount.owner=username|UID, X-mount.group=group|GID Set mountpoint's ownership after mounting. Names resolved in the target mount namespace, see -N. X-mount.mode=mode Set mountpoint's mode after mounting. X-mount.idmap=id-type:id-mount:id-host:id-range [id-type:id-mount:id-host:id-range], X-mount.idmap=file Use this option to create an idmapped mount. An idmapped mount allows to change ownership of all files located under a mount according to the ID-mapping associated with a user namespace. The ownership change is tied to the lifetime and localized to the relevant mount. The relevant ID-mapping can be specified in two ways: A user can specify the ID-mapping directly. The ID-mapping must be specified using the syntax id-type:id-mount:id-host:id-range. Specifying u as the id-type prefix creates a UID-mapping, g creates a GID-mapping and omitting id-type or specifying b creates both a UID- and GID-mapping. The id-mount parameter indicates the starting ID in the new mount. The id-host parameter indicates the starting ID in the filesystem. The id-range parameter indicates how many IDs are to be mapped. It is possible to specify multiple ID-mappings. The individual ID-mappings must be separated by spaces. For example, the ID-mapping X-mount.idmap=u:1000:0:1 g:1001:1:2 5000:1000:2 creates an idmapped mount where UID 0 is mapped to UID 1000, GID 1 is mapped to GUID 1001, GID 2 is mapped to GID 1002, UID and GID 1000 are mapped to 5000, and UID and GID 1001 are mapped to 5001 in the mount. When an ID-mapping is specified directly a new user namespace will be allocated with the requested ID-mapping. The newly created user namespace will be attached to the mount. A user can specify a user namespace file. The user namespace will then be attached to the mount and the ID-mapping of the user namespace will become the ID-mapping of the mount. For example, X-mount.idmap=/proc/PID/ns/user will attach the user namespace of the process PID to the mount. nosymfollow Do not follow symlinks when resolving paths. Symlinks can still be created, and readlink(1), readlink(2), realpath(1), and realpath(3) all still work properly. FILESYSTEM-SPECIFIC MOUNT OPTIONS top This section lists options that are specific to particular filesystems. Where possible, you should first consult filesystem-specific manual pages for details. Some of those pages are listed in the following table. Filesystem(s) Manual page btrfs btrfs(5) cifs mount.cifs(8) ext2, ext3, ext4 ext4(5) fuse fuse(8) nfs nfs(5) tmpfs tmpfs(5) xfs xfs(5) Note that some of the pages listed above might be available only after you install the respective userland tools. The following options apply only to certain filesystems. We sort them by filesystem. All options follow the -o flag. What options are supported depends a bit on the running kernel. Further information may be available in filesystem-specific files in the kernel source subdirectory Documentation/filesystems. Mount options for adfs uid=value and gid=value Set the owner and group of the files in the filesystem (default: uid=gid=0). ownmask=value and othmask=value Set the permission mask for ADFS 'owner' permissions and 'other' permissions, respectively (default: 0700 and 0077, respectively). See also /usr/src/linux/Documentation/filesystems/adfs.rst. Mount options for affs uid=value and gid=value Set the owner and group of the root of the filesystem (default: uid=gid=0, but with option uid or gid without specified value, the UID and GID of the current process are taken). setuid=value and setgid=value Set the owner and group of all files. mode=value Set the mode of all files to value & 0777 disregarding the original permissions. Add search permission to directories that have read permission. The value is given in octal. protect Do not allow any changes to the protection bits on the filesystem. usemp Set UID and GID of the root of the filesystem to the UID and GID of the mount point upon the first sync or umount, and then clear this option. Strange... verbose Print an informational message for each successful mount. prefix=string Prefix used before volume name, when following a link. volume=string Prefix (of length at most 30) used before '/' when following a symbolic link. reserved=value (Default: 2.) Number of unused blocks at the start of the device. root=value Give explicitly the location of the root block. bs=value Give blocksize. Allowed values are 512, 1024, 2048, 4096. grpquota|noquota|quota|usrquota These options are accepted but ignored. (However, quota utilities may react to such strings in /etc/fstab.) Mount options for debugfs The debugfs filesystem is a pseudo filesystem, traditionally mounted on /sys/kernel/debug. As of kernel version 3.4, debugfs has the following options: uid=n, gid=n Set the owner and group of the mountpoint. mode=value Sets the mode of the mountpoint. Mount options for devpts The devpts filesystem is a pseudo filesystem, traditionally mounted on /dev/pts. In order to acquire a pseudo terminal, a process opens /dev/ptmx; the number of the pseudo terminal is then made available to the process and the pseudo terminal slave can be accessed as /dev/pts/<number>. uid=value and gid=value This sets the owner or the group of newly created pseudo terminals to the specified values. When nothing is specified, they will be set to the UID and GID of the creating process. For example, if there is a tty group with GID 5, then gid=5 will cause newly created pseudo terminals to belong to the tty group. mode=value Set the mode of newly created pseudo terminals to the specified value. The default is 0600. A value of mode=620 and gid=5 makes "mesg y" the default on newly created pseudo terminals. newinstance Create a private instance of the devpts filesystem, such that indices of pseudo terminals allocated in this new instance are independent of indices created in other instances of devpts. All mounts of devpts without this newinstance option share the same set of pseudo terminal indices (i.e., legacy mode). Each mount of devpts with the newinstance option has a private set of pseudo terminal indices. This option is mainly used to support containers in the Linux kernel. It is implemented in Linux kernel versions starting with 2.6.29. Further, this mount option is valid only if CONFIG_DEVPTS_MULTIPLE_INSTANCES is enabled in the kernel configuration. To use this option effectively, /dev/ptmx must be a symbolic link to pts/ptmx. See Documentation/filesystems/devpts.txt in the Linux kernel source tree for details. ptmxmode=value Set the mode for the new ptmx device node in the devpts filesystem. With the support for multiple instances of devpts (see newinstance option above), each instance has a private ptmx node in the root of the devpts filesystem (typically /dev/pts/ptmx). For compatibility with older versions of the kernel, the default mode of the new ptmx node is 0000. ptmxmode=value specifies a more useful mode for the ptmx node and is highly recommended when the newinstance option is specified. This option is only implemented in Linux kernel versions starting with 2.6.29. Further, this option is valid only if CONFIG_DEVPTS_MULTIPLE_INSTANCES is enabled in the kernel configuration. Mount options for fat (Note: fat is not a separate filesystem, but a common part of the msdos, umsdos and vfat filesystems.) blocksize={512|1024|2048} Set blocksize (default 512). This option is obsolete. uid=value and gid=value Set the owner and group of all files. (Default: the UID and GID of the current process.) umask=value Set the umask (the bitmask of the permissions that are not present). The default is the umask of the current process. The value is given in octal. dmask=value Set the umask applied to directories only. The default is the umask of the current process. The value is given in octal. fmask=value Set the umask applied to regular files only. The default is the umask of the current process. The value is given in octal. allow_utime=value This option controls the permission check of mtime/atime. 20 If current process is in group of files group ID, you can change timestamp. 2 Other users can change timestamp. The default is set from 'dmask' option. (If the directory is writable, utime(2) is also allowed. I.e. ~dmask & 022) Normally utime(2) checks that the current process is owner of the file, or that it has the CAP_FOWNER capability. But FAT filesystems dont have UID/GID on disk, so the normal check is too inflexible. With this option you can relax it. check=value Three different levels of pickiness can be chosen: r[elaxed] Upper and lower case are accepted and equivalent, long name parts are truncated (e.g. verylongname.foobar becomes verylong.foo), leading and embedded spaces are accepted in each name part (name and extension). n[ormal] Like "relaxed", but many special characters (*, ?, <, spaces, etc.) are rejected. This is the default. s[trict] Like "normal", but names that contain long parts or special characters that are sometimes used on Linux but are not accepted by MS-DOS (+, =, etc.) are rejected. codepage=value Sets the codepage for converting to shortname characters on FAT and VFAT filesystems. By default, codepage 437 is used. conv=mode This option is obsolete and may fail or be ignored. cvf_format=module Forces the driver to use the CVF (Compressed Volume File) module cvf_module instead of auto-detection. If the kernel supports kmod, the cvf_format=xxx option also controls on-demand CVF module loading. This option is obsolete. cvf_option=option Option passed to the CVF module. This option is obsolete. debug Turn on the debug flag. A version string and a list of filesystem parameters will be printed (these data are also printed if the parameters appear to be inconsistent). discard If set, causes discard/TRIM commands to be issued to the block device when blocks are freed. This is useful for SSD devices and sparse/thinly-provisioned LUNs. dos1xfloppy If set, use a fallback default BIOS Parameter Block configuration, determined by backing device size. These static parameters match defaults assumed by DOS 1.x for 160 kiB, 180 kiB, 320 kiB, and 360 kiB floppies and floppy images. errors={panic|continue|remount-ro} Specify FAT behavior on critical errors: panic, continue without doing anything, or remount the partition in read-only mode (default behavior). fat={12|16|32} Specify a 12, 16 or 32 bit fat. This overrides the automatic FAT type detection routine. Use with caution! iocharset=value Character set to use for converting between 8 bit characters and 16 bit Unicode characters. The default is iso8859-1. Long filenames are stored on disk in Unicode format. nfs={stale_rw|nostale_ro} Enable this only if you want to export the FAT filesystem over NFS. stale_rw: This option maintains an index (cache) of directory inodes which is used by the nfs-related code to improve look-ups. Full file operations (read/write) over NFS are supported but with cache eviction at NFS server, this could result in spurious ESTALE errors. nostale_ro: This option bases the inode number and file handle on the on-disk location of a file in the FAT directory entry. This ensures that ESTALE will not be returned after a file is evicted from the inode cache. However, it means that operations such as rename, create and unlink could cause file handles that previously pointed at one file to point at a different file, potentially causing data corruption. For this reason, this option also mounts the filesystem readonly. To maintain backward compatibility, -o nfs is also accepted, defaulting to stale_rw. tz=UTC This option disables the conversion of timestamps between local time (as used by Windows on FAT) and UTC (which Linux uses internally). This is particularly useful when mounting devices (like digital cameras) that are set to UTC in order to avoid the pitfalls of local time. time_offset=minutes Set offset for conversion of timestamps from local time used by FAT to UTC. I.e., minutes will be subtracted from each timestamp to convert it to UTC used internally by Linux. This is useful when the time zone set in the kernel via settimeofday(2) is not the time zone used by the filesystem. Note that this option still does not provide correct time stamps in all cases in presence of DST - time stamps in a different DST setting will be off by one hour. quiet Turn on the quiet flag. Attempts to chown or chmod files do not return errors, although they fail. Use with caution! rodir FAT has the ATTR_RO (read-only) attribute. On Windows, the ATTR_RO of the directory will just be ignored, and is used only by applications as a flag (e.g. its set for the customized folder). If you want to use ATTR_RO as read-only flag even for the directory, set this option. showexec If set, the execute permission bits of the file will be allowed only if the extension part of the name is .EXE, .COM, or .BAT. Not set by default. sys_immutable If set, ATTR_SYS attribute on FAT is handled as IMMUTABLE flag on Linux. Not set by default. flush If set, the filesystem will try to flush to disk more early than normal. Not set by default. usefree Use the "free clusters" value stored on FSINFO. Itll be used to determine number of free clusters without scanning disk. But its not used by default, because recent Windows dont update it correctly in some case. If you are sure the "free clusters" on FSINFO is correct, by this option you can avoid scanning disk. dots, nodots, dotsOK=[yes|no] Various misguided attempts to force Unix or DOS conventions onto a FAT filesystem. Mount options for hfs creator=cccc, type=cccc Set the creator/type values as shown by the MacOS finder used for creating new files. Default values: '????'. uid=n, gid=n Set the owner and group of all files. (Default: the UID and GID of the current process.) dir_umask=n, file_umask=n, umask=n Set the umask used for all directories, all regular files, or all files and directories. Defaults to the umask of the current process. session=n Select the CDROM session to mount. Defaults to leaving that decision to the CDROM driver. This option will fail with anything but a CDROM as underlying device. part=n Select partition number n from the device. Only makes sense for CDROMs. Defaults to not parsing the partition table at all. quiet Dont complain about invalid mount options. Mount options for hpfs uid=value and gid=value Set the owner and group of all files. (Default: the UID and GID of the current process.) umask=value Set the umask (the bitmask of the permissions that are not present). The default is the umask of the current process. The value is given in octal. case={lower|asis} Convert all files names to lower case, or leave them. (Default: case=lower.) conv=mode This option is obsolete and may fail or being ignored. nocheck Do not abort mounting when certain consistency checks fail. Mount options for iso9660 ISO 9660 is a standard describing a filesystem structure to be used on CD-ROMs. (This filesystem type is also seen on some DVDs. See also the udf filesystem.) Normal iso9660 filenames appear in an 8.3 format (i.e., DOS-like restrictions on filename length), and in addition all characters are in upper case. Also there is no field for file ownership, protection, number of links, provision for block/character devices, etc. Rock Ridge is an extension to iso9660 that provides all of these UNIX-like features. Basically there are extensions to each directory record that supply all of the additional information, and when Rock Ridge is in use, the filesystem is indistinguishable from a normal UNIX filesystem (except that it is read-only, of course). norock Disable the use of Rock Ridge extensions, even if available. Cf. map. nojoliet Disable the use of Microsoft Joliet extensions, even if available. Cf. map. check={r[elaxed]|s[trict]} With check=relaxed, a filename is first converted to lower case before doing the lookup. This is probably only meaningful together with norock and map=normal. (Default: check=strict.) uid=value and gid=value Give all files in the filesystem the indicated user or group id, possibly overriding the information found in the Rock Ridge extensions. (Default: uid=0,gid=0.) map={n[ormal]|o[ff]|a[corn]} For non-Rock Ridge volumes, normal name translation maps upper to lower case ASCII, drops a trailing ';1', and converts ';' to '.'. With map=off no name translation is done. See norock. (Default: map=normal.) map=acorn is like map=normal but also apply Acorn extensions if present. mode=value For non-Rock Ridge volumes, give all files the indicated mode. (Default: read and execute permission for everybody.) Octal mode values require a leading 0. unhide Also show hidden and associated files. (If the ordinary files and the associated or hidden files have the same filenames, this may make the ordinary files inaccessible.) block={512|1024|2048} Set the block size to the indicated value. (Default: block=1024.) conv=mode This option is obsolete and may fail or being ignored. cruft If the high byte of the file length contains other garbage, set this mount option to ignore the high order bits of the file length. This implies that a file cannot be larger than 16 MB. session=x Select number of session on a multisession CD. sbsector=xxx Session begins from sector xxx. The following options are the same as for vfat and specifying them only makes sense when using discs encoded using Microsofts Joliet extensions. iocharset=value Character set to use for converting 16 bit Unicode characters on CD to 8 bit characters. The default is iso8859-1. utf8 Convert 16 bit Unicode characters on CD to UTF-8. Mount options for jfs iocharset=name Character set to use for converting from Unicode to ASCII. The default is to do no conversion. Use iocharset=utf8 for UTF8 translations. This requires CONFIG_NLS_UTF8 to be set in the kernel .config file. resize=value Resize the volume to value blocks. JFS only supports growing a volume, not shrinking it. This option is only valid during a remount, when the volume is mounted read-write. The resize keyword with no value will grow the volume to the full size of the partition. nointegrity Do not write to the journal. The primary use of this option is to allow for higher performance when restoring a volume from backup media. The integrity of the volume is not guaranteed if the system abnormally ends. integrity Default. Commit metadata changes to the journal. Use this option to remount a volume where the nointegrity option was previously specified in order to restore normal behavior. errors={continue|remount-ro|panic} Define the behavior when an error is encountered. (Either ignore errors and just mark the filesystem erroneous and continue, or remount the filesystem read-only, or panic and halt the system.) noquota|quota|usrquota|grpquota These options are accepted but ignored. Mount options for msdos See mount options for fat. If the msdos filesystem detects an inconsistency, it reports an error and sets the file system read-only. The filesystem can be made writable again by remounting it. Mount options for ncpfs Just like nfs, the ncpfs implementation expects a binary argument (a struct ncp_mount_data) to the mount(2) system call. This argument is constructed by ncpmount(8) and the current version of mount (2.12) does not know anything about ncpfs. Mount options for ntfs iocharset=name Character set to use when returning file names. Unlike VFAT, NTFS suppresses names that contain nonconvertible characters. Deprecated. nls=name New name for the option earlier called iocharset. utf8 Use UTF-8 for converting file names. uni_xlate={0|1|2} For 0 (or 'no' or 'false'), do not use escape sequences for unknown Unicode characters. For 1 (or 'yes' or 'true') or 2, use vfat-style 4-byte escape sequences starting with ":". Here 2 gives a little-endian encoding and 1 a byteswapped bigendian encoding. posix=[0|1] If enabled (posix=1), the filesystem distinguishes between upper and lower case. The 8.3 alias names are presented as hard links instead of being suppressed. This option is obsolete. uid=value, gid=value and umask=value Set the file permission on the filesystem. The umask value is given in octal. By default, the files are owned by root and not readable by somebody else. Mount options for overlay Since Linux 3.18 the overlay pseudo filesystem implements a union mount for other filesystems. An overlay filesystem combines two filesystems - an upper filesystem and a lower filesystem. When a name exists in both filesystems, the object in the upper filesystem is visible while the object in the lower filesystem is either hidden or, in the case of directories, merged with the upper object. The lower filesystem can be any filesystem supported by Linux and does not need to be writable. The lower filesystem can even be another overlayfs. The upper filesystem will normally be writable and if it is it must support the creation of trusted.* extended attributes, and must provide a valid d_type in readdir responses, so NFS is not suitable. A read-only overlay of two read-only filesystems may use any filesystem type. The options lowerdir and upperdir are combined into a merged directory by using: mount -t overlay overlay \ -olowerdir=/lower,upperdir=/upper,workdir=/work /merged lowerdir=directory Any filesystem, does not need to be on a writable filesystem. upperdir=directory The upperdir is normally on a writable filesystem. workdir=directory The workdir needs to be an empty directory on the same filesystem as upperdir. userxattr Use the "user.overlay." xattr namespace instead of "trusted.overlay.". This is useful for unprivileged mounting of overlayfs. redirect_dir={on|off|follow|nofollow} If the redirect_dir feature is enabled, then the directory will be copied up (but not the contents). Then the "{trusted|user}.overlay.redirect" extended attribute is set to the path of the original location from the root of the overlay. Finally the directory is moved to the new location. on Redirects are enabled. off Redirects are not created and only followed if "redirect_always_follow" feature is enabled in the kernel/module config. follow Redirects are not created, but followed. nofollow Redirects are not created and not followed (equivalent to "redirect_dir=off" if "redirect_always_follow" feature is not enabled). index={on|off} Inode index. If this feature is disabled and a file with multiple hard links is copied up, then this will "break" the link. Changes will not be propagated to other names referring to the same inode. uuid={on|off} Can be used to replace UUID of the underlying filesystem in file handles with null, and effectively disable UUID checks. This can be useful in case the underlying disk is copied and the UUID of this copy is changed. This is only applicable if all lower/upper/work directories are on the same filesystem, otherwise it will fallback to normal behaviour. nfs_export={on|off} When the underlying filesystems supports NFS export and the "nfs_export" feature is enabled, an overlay filesystem may be exported to NFS. With the "nfs_export" feature, on copy_up of any lower object, an index entry is created under the index directory. The index entry name is the hexadecimal representation of the copy up origin file handle. For a non-directory object, the index entry is a hard link to the upper inode. For a directory object, the index entry has an extended attribute "{trusted|user}.overlay.upper" with an encoded file handle of the upper directory inode. When encoding a file handle from an overlay filesystem object, the following rules apply For a non-upper object, encode a lower file handle from lower inode For an indexed object, encode a lower file handle from copy_up origin For a pure-upper object and for an existing non-indexed upper object, encode an upper file handle from upper inode The encoded overlay file handle includes Header including path type information (e.g. lower/upper) UUID of the underlying filesystem Underlying filesystem encoding of underlying inode This encoding format is identical to the encoding format of file handles that are stored in extended attribute "{trusted|user}.overlay.origin". When decoding an overlay file handle, the following steps are followed Find underlying layer by UUID and path type information. Decode the underlying filesystem file handle to underlying dentry. For a lower file handle, lookup the handle in index directory by name. If a whiteout is found in index, return ESTALE. This represents an overlay object that was deleted after its file handle was encoded. For a non-directory, instantiate a disconnected overlay dentry from the decoded underlying dentry, the path type and index inode, if found. For a directory, use the connected underlying decoded dentry, path type and index, to lookup a connected overlay dentry. Decoding a non-directory file handle may return a disconnected dentry. copy_up of that disconnected dentry will create an upper index entry with no upper alias. When overlay filesystem has multiple lower layers, a middle layer directory may have a "redirect" to lower directory. Because middle layer "redirects" are not indexed, a lower file handle that was encoded from the "redirect" origin directory, cannot be used to find the middle or upper layer directory. Similarly, a lower file handle that was encoded from a descendant of the "redirect" origin directory, cannot be used to reconstruct a connected overlay path. To mitigate the cases of directories that cannot be decoded from a lower file handle, these directories are copied up on encode and encoded as an upper file handle. On an overlay filesystem with no upper layer this mitigation cannot be used NFS export in this setup requires turning off redirect follow (e.g. "redirect_dir=nofollow"). The overlay filesystem does not support non-directory connectable file handles, so exporting with the subtree_check exportfs configuration will cause failures to lookup files over NFS. When the NFS export feature is enabled, all directory index entries are verified on mount time to check that upper file handles are not stale. This verification may cause significant overhead in some cases. Note: the mount options index=off,nfs_export=on are conflicting for a read-write mount and will result in an error. xino={on|off|auto} The "xino" feature composes a unique object identifier from the real object st_ino and an underlying fsid index. The "xino" feature uses the high inode number bits for fsid, because the underlying filesystems rarely use the high inode number bits. In case the underlying inode number does overflow into the high xino bits, overlay filesystem will fall back to the non xino behavior for that inode. For a detailed description of the effect of this option please refer to https://docs.kernel.org/filesystems/overlayfs.html metacopy={on|off} When metadata only copy up feature is enabled, overlayfs will only copy up metadata (as opposed to whole file), when a metadata specific operation like chown/chmod is performed. Full file will be copied up later when file is opened for WRITE operation. In other words, this is delayed data copy up operation and data is copied up when there is a need to actually modify data. volatile Volatile mounts are not guaranteed to survive a crash. It is strongly recommended that volatile mounts are only used if data written to the overlay can be recreated without significant effort. The advantage of mounting with the "volatile" option is that all forms of sync calls to the upper filesystem are omitted. In order to avoid a giving a false sense of safety, the syncfs (and fsync) semantics of volatile mounts are slightly different than that of the rest of VFS. If any writeback error occurs on the upperdirs filesystem after a volatile mount takes place, all sync functions will return an error. Once this condition is reached, the filesystem will not recover, and every subsequent sync call will return an error, even if the upperdir has not experience a new error since the last sync call. When overlay is mounted with "volatile" option, the directory "$workdir/work/incompat/volatile" is created. During next mount, overlay checks for this directory and refuses to mount if present. This is a strong indicator that user should throw away upper and work directories and create fresh one. In very limited cases where the user knows that the system has not crashed and contents of upperdir are intact, The "volatile" directory can be removed. Mount options for reiserfs Reiserfs is a journaling filesystem. conv Instructs version 3.6 reiserfs software to mount a version 3.5 filesystem, using the 3.6 format for newly created objects. This filesystem will no longer be compatible with reiserfs 3.5 tools. hash={rupasov|tea|r5|detect} Choose which hash function reiserfs will use to find files within directories. rupasov A hash invented by Yury Yu. Rupasov. It is fast and preserves locality, mapping lexicographically close file names to close hash values. This option should not be used, as it causes a high probability of hash collisions. tea A Davis-Meyer function implemented by Jeremy Fitzhardinge. It uses hash permuting bits in the name. It gets high randomness and, therefore, low probability of hash collisions at some CPU cost. This may be used if EHASHCOLLISION errors are experienced with the r5 hash. r5 A modified version of the rupasov hash. It is used by default and is the best choice unless the filesystem has huge directories and unusual file-name patterns. detect Instructs mount to detect which hash function is in use by examining the filesystem being mounted, and to write this information into the reiserfs superblock. This is only useful on the first mount of an old format filesystem. hashed_relocation Tunes the block allocator. This may provide performance improvements in some situations. no_unhashed_relocation Tunes the block allocator. This may provide performance improvements in some situations. noborder Disable the border allocator algorithm invented by Yury Yu. Rupasov. This may provide performance improvements in some situations. nolog Disable journaling. This will provide slight performance improvements in some situations at the cost of losing reiserfss fast recovery from crashes. Even with this option turned on, reiserfs still performs all journaling operations, save for actual writes into its journaling area. Implementation of nolog is a work in progress. notail By default, reiserfs stores small files and 'file tails' directly into its tree. This confuses some utilities such as lilo(8). This option is used to disable packing of files into the tree. replayonly Replay the transactions which are in the journal, but do not actually mount the filesystem. Mainly used by reiserfsck. resize=number A remount option which permits online expansion of reiserfs partitions. Instructs reiserfs to assume that the device has number blocks. This option is designed for use with devices which are under logical volume management (LVM). There is a special resizer utility which can be obtained from ftp://ftp.namesys.com/pub/reiserfsprogs. user_xattr Enable Extended User Attributes. See the attr(1) manual page. acl Enable POSIX Access Control Lists. See the acl(5) manual page. barrier=none / barrier=flush This disables / enables the use of write barriers in the journaling code. barrier=none disables, barrier=flush enables (default). This also requires an IO stack which can support barriers, and if reiserfs gets an error on a barrier write, it will disable barriers again with a warning. Write barriers enforce proper on-disk ordering of journal commits, making volatile disk write caches safe to use, at some performance penalty. If your disks are battery-backed in one way or another, disabling barriers may safely improve performance. Mount options for ubifs UBIFS is a flash filesystem which works on top of UBI volumes. Note that atime is not supported and is always turned off. The device name may be specified as ubiX_Y UBI device number X, volume number Y ubiY UBI device number 0, volume number Y ubiX:NAME UBI device number X, volume with name NAME ubi:NAME UBI device number 0, volume with name NAME Alternative ! separator may be used instead of :. The following mount options are available: bulk_read Enable bulk-read. VFS read-ahead is disabled because it slows down the filesystem. Bulk-Read is an internal optimization. Some flashes may read faster if the data are read at one go, rather than at several read requests. For example, OneNAND can do "read-while-load" if it reads more than one NAND page. no_bulk_read Do not bulk-read. This is the default. chk_data_crc Check data CRC-32 checksums. This is the default. no_chk_data_crc Do not check data CRC-32 checksums. With this option, the filesystem does not check CRC-32 checksum for data, but it does check it for the internal indexing information. This option only affects reading, not writing. CRC-32 is always calculated when writing the data. compr={none|lzo|zlib} Select the default compressor which is used when new files are written. It is still possible to read compressed files if mounted with the none option. Mount options for udf UDF is the "Universal Disk Format" filesystem defined by OSTA, the Optical Storage Technology Association, and is often used for DVD-ROM, frequently in the form of a hybrid UDF/ISO-9660 filesystem. It is, however, perfectly usable by itself on disk drives, flash drives and other block devices. See also iso9660. uid= Make all files in the filesystem belong to the given user. uid=forget can be specified independently of (or usually in addition to) uid=<user> and results in UDF not storing uids to the media. In fact the recorded uid is the 32-bit overflow uid -1 as defined by the UDF standard. The value is given as either <user> which is a valid user name or the corresponding decimal user id, or the special string "forget". gid= Make all files in the filesystem belong to the given group. gid=forget can be specified independently of (or usually in addition to) gid=<group> and results in UDF not storing gids to the media. In fact the recorded gid is the 32-bit overflow gid -1 as defined by the UDF standard. The value is given as either <group> which is a valid group name or the corresponding decimal group id, or the special string "forget". umask= Mask out the given permissions from all inodes read from the filesystem. The value is given in octal. mode= If mode= is set the permissions of all non-directory inodes read from the filesystem will be set to the given mode. The value is given in octal. dmode= If dmode= is set the permissions of all directory inodes read from the filesystem will be set to the given dmode. The value is given in octal. bs= Set the block size. Default value prior to kernel version 2.6.30 was 2048. Since 2.6.30 and prior to 4.11 it was logical device block size with fallback to 2048. Since 4.11 it is logical block size with fallback to any valid block size between logical device block size and 4096. For other details see the mkudffs(8) 2.0+ manpage, see the COMPATIBILITY and BLOCK SIZE sections. unhide Show otherwise hidden files. undelete Show deleted files in lists. adinicb Embed data in the inode. (default) noadinicb Dont embed data in the inode. shortad Use short UDF address descriptors. longad Use long UDF address descriptors. (default) nostrict Unset strict conformance. iocharset= Set the NLS character set. This requires kernel compiled with CONFIG_UDF_NLS option. utf8 Set the UTF-8 character set. Mount options for debugging and disaster recovery novrs Ignore the Volume Recognition Sequence and attempt to mount anyway. session= Select the session number for multi-session recorded optical media. (default= last session) anchor= Override standard anchor location. (default= 256) lastblock= Set the last block of the filesystem. Unused historical mount options that may be encountered and should be removed uid=ignore Ignored, use uid=<user> instead. gid=ignore Ignored, use gid=<group> instead. volume= Unimplemented and ignored. partition= Unimplemented and ignored. fileset= Unimplemented and ignored. rootdir= Unimplemented and ignored. Mount options for ufs ufstype=value UFS is a filesystem widely used in different operating systems. The problem are differences among implementations. Features of some implementations are undocumented, so its hard to recognize the type of ufs automatically. Thats why the user must specify the type of ufs by mount option. Possible values are: old Old format of ufs, this is the default, read only. (Dont forget to give the -r option.) 44bsd For filesystems created by a BSD-like system (NetBSD, FreeBSD, OpenBSD). ufs2 Used in FreeBSD 5.x supported as read-write. 5xbsd Synonym for ufs2. sun For filesystems created by SunOS or Solaris on Sparc. sunx86 For filesystems created by Solaris on x86. hp For filesystems created by HP-UX, read-only. nextstep For filesystems created by NeXTStep (on NeXT station) (currently read only). nextstep-cd For NextStep CDROMs (block_size == 2048), read-only. openstep For filesystems created by OpenStep (currently read only). The same filesystem type is also used by macOS. onerror=value Set behavior on error: panic If an error is encountered, cause a kernel panic. [lock|umount|repair] These mount options dont do anything at present; when an error is encountered only a console message is printed. Mount options for umsdos See mount options for msdos. The dotsOK option is explicitly killed by umsdos. Mount options for vfat First of all, the mount options for fat are recognized. The dotsOK option is explicitly killed by vfat. Furthermore, there are uni_xlate Translate unhandled Unicode characters to special escaped sequences. This lets you backup and restore filenames that are created with any Unicode characters. Without this option, a '?' is used when no translation is possible. The escape character is ':' because it is otherwise invalid on the vfat filesystem. The escape sequence that gets used, where u is the Unicode character, is: ':', (u & 0x3f), ((u>>6) & 0x3f), (u>>12). posix Allow two files with names that only differ in case. This option is obsolete. nonumtail First try to make a short name without sequence number, before trying name~num.ext. utf8 UTF8 is the filesystem safe 8-bit encoding of Unicode that is used by the console. It can be enabled for the filesystem with this option or disabled with utf8=0, utf8=no or utf8=false. If uni_xlate gets set, UTF8 gets disabled. shortname=mode Defines the behavior for creation and display of filenames which fit into 8.3 characters. If a long name for a file exists, it will always be the preferred one for display. There are four modes: lower Force the short name to lower case upon display; store a long name when the short name is not all upper case. win95 Force the short name to upper case upon display; store a long name when the short name is not all upper case. winnt Display the short name as is; store a long name when the short name is not all lower case or all upper case. mixed Display the short name as is; store a long name when the short name is not all upper case. This mode is the default since Linux 2.6.32. Mount options for usbfs devuid=uid and devgid=gid and devmode=mode Set the owner and group and mode of the device files in the usbfs filesystem (default: uid=gid=0, mode=0644). The mode is given in octal. busuid=uid and busgid=gid and busmode=mode Set the owner and group and mode of the bus directories in the usbfs filesystem (default: uid=gid=0, mode=0555). The mode is given in octal. listuid=uid and listgid=gid and listmode=mode Set the owner and group and mode of the file devices (default: uid=gid=0, mode=0444). The mode is given in octal. DM-VERITY SUPPORT top The device-mapper verity target provides read-only transparent integrity checking of block devices using kernel crypto API. The mount command can open the dm-verity device and do the integrity verification before the device filesystem is mounted. Requires libcryptsetup with in libmount (optionally via dlopen(3)). If libcryptsetup supports extracting the root hash of an already mounted device, existing devices will be automatically reused in case of a match. Mount options for dm-verity: verity.hashdevice=path Path to the hash tree device associated with the source volume to pass to dm-verity. verity.roothash=hex Hex-encoded hash of the root of verity.hashdevice. Mutually exclusive with verity.roothashfile. verity.roothashfile=path Path to file containing the hex-encoded hash of the root of verity.hashdevice. Mutually exclusive with verity.roothash. verity.hashoffset=offset If the hash tree device is embedded in the source volume, offset (default: 0) is used by dm-verity to get to the tree. verity.fecdevice=path Path to the Forward Error Correction (FEC) device associated with the source volume to pass to dm-verity. Optional. Requires kernel built with CONFIG_DM_VERITY_FEC. verity.fecoffset=offset If the FEC device is embedded in the source volume, offset (default: 0) is used by dm-verity to get to the FEC area. Optional. verity.fecroots=value Parity bytes for FEC (default: 2). Optional. verity.roothashsig=path Path to pkcs7(1ssl) signature of root hash hex string. Requires crypt_activate_by_signed_key() from cryptsetup and kernel built with CONFIG_DM_VERITY_VERIFY_ROOTHASH_SIG. For device reuse, signatures have to be either used by all mounts of a device or by none. Optional. verity.oncorruption=ignore|restart|panic Instruct the kernel to ignore, reboot or panic when corruption is detected. By default the I/O operation simply fails. Requires Linux 4.1 or newer, and libcrypsetup 2.3.4 or newer. Optional. Supported since util-linux v2.35. For example commands: mksquashfs /etc /tmp/etc.raw veritysetup format /tmp/etc.raw /tmp/etc.verity --root-hash-file=/tmp/etc.roothash openssl smime -sign -in /tmp/etc.roothash -nocerts -inkey private.key \ -signer private.crt -noattr -binary -outform der -out /tmp/etc.roothash.p7s mount -o verity.hashdevice=/tmp/etc.verity,verity.roothashfile=/tmp/etc.roothash,\ verity.roothashsig=/tmp/etc.roothash.p7s /tmp/etc.raw /mnt create squashfs image from /etc directory, verity hash device and mount verified filesystem image to /mnt. The kernel will verify that the root hash is signed by a key from the kernel keyring if roothashsig is used. LOOP-DEVICE SUPPORT top One further possible type is a mount via the loop device. For example, the command mount /tmp/disk.img /mnt -t vfat -o loop=/dev/loop3 will set up the loop device /dev/loop3 to correspond to the file /tmp/disk.img, and then mount this device on /mnt. If no explicit loop device is mentioned (but just an option '-o loop' is given), then mount will try to find some unused loop device and use that, for example mount /tmp/disk.img /mnt -o loop The mount command automatically creates a loop device from a regular file if a filesystem type is not specified or the filesystem is known for libblkid, for example: mount /tmp/disk.img /mnt mount -t ext4 /tmp/disk.img /mnt This type of mount knows about three options, namely loop, offset and sizelimit, that are really options to losetup(8). (These options can be used in addition to those specific to the filesystem type.) Since Linux 2.6.25 auto-destruction of loop devices is supported, meaning that any loop device allocated by mount will be freed by umount independently of /etc/mtab. You can also free a loop device by hand, using losetup -d or umount -d. Since util-linux v2.29, mount re-uses the loop device rather than initializing a new device if the same backing file is already used for some loop device with the same offset and sizelimit. This is necessary to avoid a filesystem corruption. EXIT STATUS top mount has the following exit status values (the bits can be ORed): 0 success 1 incorrect invocation or permissions 2 system error (out of memory, cannot fork, no more loop devices) 4 internal mount bug 8 user interrupt 16 problems writing or locking /etc/mtab 32 mount failure 64 some mount succeeded The command mount -a returns 0 (all succeeded), 32 (all failed), or 64 (some failed, some succeeded). EXTERNAL HELPERS top The syntax of external mount helpers is: /sbin/mount.suffix spec dir [-sfnv] [-N namespace] [-o options] [-t type.subtype] where the suffix is the filesystem type and the -sfnvoN options have the same meaning as the normal mount options. The -t option is used for filesystems with subtypes support (for example /sbin/mount.fuse -t fuse.sshfs). The command mount does not pass the mount options unbindable, runbindable, private, rprivate, slave, rslave, shared, rshared, auto, noauto, comment, x-*, loop, offset and sizelimit to the mount.<suffix> helpers. All other options are used in a comma-separated list as an argument to the -o option. ENVIRONMENT top LIBMOUNT_FORCE_MOUNT2={always|never|auto} force to use classic mount(2) system call (requires support for new file descriptors based mount API). The default is auto; in this case, libmount tries to be smart and use classic mount(2) only for well-known issues. If the new mount API is unavailable, libmount can still use traditional mount(2), although LIBMOUNT_FORCE_MOUNT2 is set to never. LIBMOUNT_FSTAB=<path> overrides the default location of the fstab file (ignored for suid) LIBMOUNT_DEBUG=all enables libmount debug output LIBBLKID_DEBUG=all enables libblkid debug output LOOPDEV_DEBUG=all enables loop device setup debug output FILES top See also "The files /etc/fstab, /etc/mtab and /proc/mounts" section above. /etc/fstab filesystem table /run/mount libmount private runtime directory /etc/mtab table of mounted filesystems or symlink to /proc/mounts /etc/mtab~ lock file (unused on systems with mtab symlink) /etc/mtab.tmp temporary file (unused on systems with mtab symlink) /etc/filesystems a list of filesystem types to try HISTORY top A mount command existed in Version 5 AT&T UNIX. BUGS top It is possible for a corrupted filesystem to cause a crash. Some Linux filesystems dont support -o sync and -o dirsync (the ext2, ext3, ext4, fat and vfat filesystems do support synchronous updates (a la BSD) when mounted with the sync option). The -o remount may not be able to change mount parameters (all ext2fs-specific parameters, except sb, are changeable with a remount, for example, but you cant change gid or umask for the fatfs). It is possible that the files /etc/mtab and /proc/mounts dont match on systems with a regular mtab file. The first file is based only on the mount command options, but the content of the second file also depends on the kernel and others settings (e.g. on a remote NFS server in certain cases the mount command may report unreliable information about an NFS mount point and the /proc/mount file usually contains more reliable information.) This is another reason to replace the mtab file with a symlink to the /proc/mounts file. Checking files on NFS filesystems referenced by file descriptors (i.e. the fcntl and ioctl families of functions) may lead to inconsistent results due to the lack of a consistency check in the kernel even if the noac mount option is used. The loop option with the offset or sizelimit options used may fail when using older kernels if the mount command cant confirm that the size of the block device has been configured as requested. This situation can be worked around by using the losetup(8) command manually before calling mount with the configured loop device. AUTHORS top Karel Zak <[email protected]> SEE ALSO top mount(2), umount(2), filesystems(5), fstab(5), nfs(5), xfs(5), mount_namespaces(7), xattr(7), e2label(8), findmnt(8), losetup(8), lsblk(8), mke2fs(8), mountd(8), nfsd(8), swapon(8), tune2fs(8), umount(8), xfs_admin(8) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The mount 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 MOUNT(8) Pages that refer to this page: eject(1), fusermount3(1), homectl(1), mountpoint(1), quotasync(1), systemd-dissect(1), systemd-mount(1), unshare(1), chown(2), fcntl(2), fsync(2), ioctl_iflags(2), mount(2), open(2), open_by_handle_at(2), umount(2), getmntent(3), getsubopt(3), fd(4), hd(4), loop(4), ram(4), autofs(5), ext4(5), filesystems(5), fstab(5), lxc.container.conf(5), nfs(5), nfsmount.conf(5), proc(5), repart.d(5), systemd.automount(5), systemd.exec(5), systemd.mount(5), tmpfs(5), xfs(5), bootparam(7), fanotify(7), file-hierarchy(7), hier(7), inode(7), man-pages(7), mount_namespaces(7), spufs(7), automount(8), blkid(8), btrfs-subvolume(8), e4crypt(8), e4defrag(8), findmnt(8), fsck.cramfs(8), fsck.xfs(8), fsfreeze(8), fstrim(8), lsof(8), mkfs.cramfs(8), mount(8), mount.fuse3(8), mount.nfs(8), pam_namespace(8), pivot_root(8), quotaon(8), swapon(8), switch_root(8), systemd-remount-fs.service(8), tune2fs(8), umount(8), wipefs(8), xfs_admin(8), xfs_db(8), xfs_freeze(8), xfs_growfs(8), xfs_info(8), xfs_logprint(8), xfs_rtcp(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. | # mount\n\n> Provides access to an entire filesystem in one directory.\n> More information: <https://manned.org/mount.8>.\n\n- Show all mounted filesystems:\n\n`mount`\n\n- Mount a device to a directory:\n\n`mount -t {{filesystem_type}} {{path/to/device_file}} {{path/to/target_directory}}`\n\n- Create a specific directory if it does not exist and mount a device to it:\n\n`mount --mkdir {{path/to/device_file}} {{path/to/target_directory}}`\n\n- Mount a device to a directory for a specific user:\n\n`mount -o uid={{user_id}},gid={{group_id}} {{path/to/device_file}} {{path/to/target_directory}}`\n\n- Mount a CD-ROM device (with the filetype ISO9660) to `/cdrom` (readonly):\n\n`mount -t {{iso9660}} -o ro {{/dev/cdrom}} {{/cdrom}}`\n\n- Mount all the filesystem defined in `/etc/fstab`:\n\n`mount -a`\n\n- Mount a specific filesystem described in `/etc/fstab` (e.g. `/dev/sda1 /my_drive ext2 defaults 0 2`):\n\n`mount {{/my_drive}}`\n\n- Mount a directory to another directory:\n\n`mount --bind {{path/to/old_dir}} {{path/to/new_dir}}`\n |
mount.ddi | systemd-dissect(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training systemd-dissect(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COMMANDS | OPTIONS | EXIT STATUS | INVOCATION AS /SBIN/MOUNT.DDI | EXAMPLES | SEE ALSO | NOTES | COLOPHON SYSTEMD-DISSECT(1) systemd-dissect SYSTEMD-DISSECT(1) NAME top systemd-dissect, mount.ddi - Dissect Discoverable Disk Images (DDIs) SYNOPSIS top systemd-dissect [OPTIONS...] IMAGE systemd-dissect [OPTIONS...] --mount IMAGE PATH systemd-dissect [OPTIONS...] --umount PATH systemd-dissect [OPTIONS...] --attach IMAGE systemd-dissect [OPTIONS...] --detach PATH systemd-dissect [OPTIONS...] --list IMAGE systemd-dissect [OPTIONS...] --mtree IMAGE systemd-dissect [OPTIONS...] --with IMAGE [COMMAND...] systemd-dissect [OPTIONS...] --copy-from IMAGE PATH [TARGET] systemd-dissect [OPTIONS...] --copy-to IMAGE [SOURCE] PATH systemd-dissect [OPTIONS...] --discover systemd-dissect [OPTIONS...] --validate IMAGE DESCRIPTION top systemd-dissect is a tool for introspecting and interacting with file system OS disk images, specifically Discoverable Disk Images (DDIs). It supports four different operations: 1. Show general OS image information, including the image's os-release(5) data, machine ID, partition information and more. 2. Mount an OS image to a local directory. In this mode it will dissect the OS image and mount the included partitions according to their designation onto a directory and possibly sub-directories. 3. Unmount an OS image from a local directory. In this mode it will recursively unmount the mounted partitions and remove the underlying loop device, including all the partition sub-devices. 4. Copy files and directories in and out of an OS image. The tool may operate on three types of OS images: 1. OS disk images containing a GPT partition table envelope, with partitions marked according to the Discoverable Partitions Specification[1]. 2. OS disk images containing just a plain file-system without an enveloping partition table. (This file system is assumed to be the root file system of the OS.) 3. OS disk images containing a GPT or MBR partition table, with a single partition only. (This partition is assumed to contain the root file system of the OS.) OS images may use any kind of Linux-supported file systems. In addition they may make use of LUKS disk encryption, and contain Verity integrity information. Note that qualifying OS images may be booted with systemd-nspawn(1)'s --image= switch, and be used as root file system for system service using the RootImage= unit file setting, see systemd.exec(5). Note that the partition table shown when invoked without command switch (as listed below) does not necessarily show all partitions included in the image, but just the partitions that are understood and considered part of an OS disk image. Specifically, partitions of unknown types are ignored, as well as duplicate partitions (i.e. more than one per partition type), as are root and /usr/ partitions of architectures not compatible with the local system. In other words: this tool will display what it operates with when mounting the image. To display the complete list of partitions use a tool such as fdisk(8). The systemd-dissect command may be invoked as mount.ddi in which case it implements the mount(8) "external helper" interface. This ensures disk images compatible with systemd-dissect can be mounted directly by mount and fstab(5). For details see below. COMMANDS top If neither of the command switches listed below are passed the specified disk image is opened and general information about the image and the contained partitions and their use is shown. --mount, -m Mount the specified OS image to the specified directory. This will dissect the image, determine the OS root file system as well as possibly other partitions and mount them to the specified directory. If the OS image contains multiple partitions marked with the Discoverable Partitions Specification[1] multiple nested mounts are established. This command expects two arguments: a path to an image file and a path to a directory where to mount the image. To unmount an OS image mounted like this use the --umount operation. When the OS image contains LUKS encrypted or Verity integrity protected file systems appropriate volumes are automatically set up and marked for automatic disassembly when the image is unmounted. The OS image may either be specified as path to an OS image stored in a regular file or may refer to block device node (in the latter case the block device must be the "whole" device, i.e. not a partition device). (The other supported commands described here support this, too.) All mounted file systems are checked with the appropriate fsck(8) implementation in automatic fixing mode, unless explicitly turned off (--fsck=no) or read-only operation is requested (--read-only). Note that this functionality is also available in mount(8) via a command such as mount -t ddi myimage.raw targetdir/, as well as in fstab(5). For details, see below. Added in version 247. -M This is a shortcut for --mount --mkdir. Added in version 247. --umount, -u Unmount an OS image from the specified directory. This command expects one argument: a directory where an OS image was mounted. All mounted partitions will be recursively unmounted, and the underlying loop device will be removed, along with all its partition sub-devices. Added in version 252. -U This is a shortcut for --umount --rmdir. Added in version 252. --attach Attach the specified disk image to an automatically allocated loopback block device, and print the path to the loopback block device to standard output. This is similar to an invocation of losetup --find --show, but will validate the image as DDI before attaching, and derive the correct sector size to use automatically. Moreover, it ensures the per-partition block devices are created before returning. Takes a path to a disk image file. Added in version 254. --detach Detach the specified disk image from a loopback block device. This undoes the effect of --attach above. This expects either a path to a loopback block device as an argument, or the path to the backing image file. In the latter case it will automatically determine the right device to detach. Added in version 254. --list, -l Prints the paths of all the files and directories in the specified OS image or directory to standard output. Added in version 253. --mtree Generates a BSD mtree(8) compatible file manifest of the specified disk image or directory. This is useful for comparing image contents in detail, including inode information and other metadata. While the generated manifest will contain detailed inode information, it currently excludes extended attributes, file system capabilities, MAC labels, chattr(1) file flags, btrfs(5) subvolume information, and various other file metadata. File content information is shown via a SHA256 digest. Additional fields might be added in future. Note that inode information such as link counts, inode numbers and timestamps is excluded from the output on purpose, as it typically complicates reproducibility. Added in version 253. --with Runs the specified command with the specified OS image mounted. This will mount the image to a temporary directory, switch the current working directory to it, and invoke the specified command line as child process. Once the process ends it will unmount the image again, and remove the temporary directory. If no command is specified a shell is invoked. The image is mounted writable, use --read-only to switch to read-only operation. The invoked process will have the $SYSTEMD_DISSECT_ROOT environment variable set, containing the absolute path name of the temporary mount point, i.e. the same directory that is set as the current working directory. It will also have the $SYSTEMD_DISSECT_DEVICE environment variable set, containing the absolute path name of the loop device the image was attached to. Added in version 253. --copy-from, -x Copies a file or directory from the specified OS image or directory into the specified location on the host file system. Expects three arguments: a path to an image file or directory, a source path (relative to the image's root directory) and a destination path (relative to the current working directory, or an absolute path, both outside of the image). If the destination path is omitted or specified as dash ("-"), the specified file is written to standard output. If the source path in the image file system refers to a regular file it is copied to the destination path. In this case access mode, extended attributes and timestamps are copied as well, but file ownership is not. If the source path in the image refers to a directory, it is copied to the destination path, recursively with all containing files and directories. In this case the file ownership is copied too. Added in version 247. --copy-to, -a Copies a file or directory from the specified location in the host file system into the specified OS image or directory. Expects three arguments: a path to an image file or directory, a source path (relative to the current working directory, or an absolute path, both outside of the image) and a destination path (relative to the image's root directory). If the source path is omitted or specified as dash ("-"), the data to write is read from standard input. If the source path in the host file system refers to a regular file, it is copied to the destination path. In this case access mode, extended attributes and timestamps are copied as well, but file ownership is not. If the source path in the host file system refers to a directory it is copied to the destination path, recursively with all containing files and directories. In this case the file ownership is copied too. As with --mount file system checks are implicitly run before the copy operation begins. Added in version 247. --discover Show a list of DDIs in well-known directories. This will show machine, portable service and system/configuration extension disk images in the usual directories /usr/lib/machines/, /usr/lib/portables/, /usr/lib/confexts/, /var/lib/machines/, /var/lib/portables/, /var/lib/extensions/ and so on. Added in version 253. --validate Validates the partition arrangement of a disk image (DDI), and ensures it matches the image policy specified via --image-policy=, if one is specified. This parses the partition table and probes the file systems in the image, but does not attempt to mount them (nor to set up disk encryption/authentication via LUKS/Verity). It does this taking the configured image dissection policy into account. Since this operation does not mount file systems, this command unlike all other commands implemented by this tool requires no privileges other than the ability to access the specified file. Prints "OK" and returns zero if the image appears to be in order and matches the specified image dissection policy. Otherwise prints an error message and returns non-zero. Added in version 254. -h, --help Print a short help text and exit. --version Print a short version string and exit. OPTIONS top The following options are understood: --read-only, -r Operate in read-only mode. By default --mount will establish writable mount points. If this option is specified they are established in read-only mode instead. Added in version 247. --fsck=no Turn off automatic file system checking. By default when an image is accessed for writing (by --mount or --copy-to) the file systems contained in the OS image are automatically checked using the appropriate fsck(8) command, in automatic fixing mode. This behavior may be switched off using --fsck=no. Added in version 247. --growfs=no Turn off automatic growing of accessed file systems to their partition size, if marked for that in the GPT partition table. By default when an image is accessed for writing (by --mount or --copy-to) the file systems contained in the OS image are automatically grown to their partition sizes, if bit 59 in the GPT partition flags is set for partition types that are defined by the Discoverable Partitions Specification[1]. This behavior may be switched off using --growfs=no. File systems are grown automatically on access if all of the following conditions are met: 1. The file system is mounted writable 2. The file system currently is smaller than the partition it is contained in (and thus can be grown) 3. The image contains a GPT partition table 4. The file system is stored on a partition defined by the Discoverable Partitions Specification 5. Bit 59 of the GPT partition flags for this partition is set, as per specification 6. The --growfs=no option is not passed. Added in version 249. --mkdir If combined with --mount the directory to mount the OS image to is created if it is missing. Note that the directory is not automatically removed when the disk image is unmounted again. Added in version 247. --rmdir If combined with --umount the specified directory where the OS image is mounted is removed after unmounting the OS image. Added in version 252. --discard= Takes one of "disabled", "loop", "all", "crypto". If "disabled" the image is accessed with empty block discarding turned off. If "loop" discarding is enabled if operating on a regular file. If "crypt" discarding is enabled even on encrypted file systems. If "all" discarding is unconditionally enabled. Added in version 247. --in-memory If specified an in-memory copy of the specified disk image is used. This may be used to operate with write-access on a (possibly read-only) image, without actually modifying the original file. This may also be used in order to operate on a disk image without keeping the originating file system busy, in order to allow it to be unmounted. Added in version 253. --root-hash=, --root-hash-sig=, --verity-data= Configure various aspects of Verity data integrity for the OS image. Option --root-hash= specifies a hex-encoded top-level Verity hash to use for setting up the Verity integrity protection. Option --root-hash-sig= specifies the path to a file containing a PKCS#7 signature for the hash. This signature is passed to the kernel during activation, which will match it against signature keys available in the kernel keyring. Option --verity-data= specifies a path to a file with the Verity data to use for the OS image, in case it is stored in a detached file. It is recommended to embed the Verity data directly in the image, using the Verity mechanisms in the Discoverable Partitions Specification[1]. Added in version 247. --loop-ref= Configures the "reference" string the kernel shall report as backing file for the loopback block device. While this is supposed to be a path or filename referencing the backing file, this is not enforced and the kernel accepts arbitrary free-form strings, chosen by the user. Accepts arbitrary strings up to a length of 63 characters. This sets the kernel's ".lo_file_name" field for the block device. Note this is distinct from the /sys/class/block/loopX/loop/backing_file attribute file that always reports a path referring to the actual backing file. The latter is subject to mount namespace translation, the former is not. This setting is particularly useful in combination with the --attach command, as it allows later referencing the allocated loop device via /dev/disk/by-loop-ref/... symlinks. Example: first, set up the loopback device via systemd-dissect attach --loop-ref=quux foo.raw, and then reference it in a command via the specified filename: cfdisk /dev/disk/by-loop-ref/quux. Added in version 254. --mtree-hash=no If combined with --mtree, turns off inclusion of file hashes in the mtree output. This makes the --mtree faster when operating on large images. Added in version 254. --image-policy=policy Takes an image policy string as argument, as per systemd.image-policy(7). The policy is enforced when operating on the disk image specified via --image=, see above. If not specified defaults to the "*" policy, i.e. all recognized file systems in the image are used. --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. --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). EXIT STATUS top On success, 0 is returned, a non-zero failure code otherwise. If the --with command is used the exit status of the invoked command is propagated. INVOCATION AS /SBIN/MOUNT.DDI top The systemd-dissect executable may be symlinked to /sbin/mount.ddi. If invoked through that it implements mount(8)'s "external helper" interface for the (pseudo) file system type "ddi". This means conformant disk images may be mounted directly via # mount -t ddi myimage.raw targetdir/ in a fashion mostly equivalent to: # systemd-dissect --mount myimage.raw targetdir/ Note that since a single DDI may contain multiple file systems it should later be unmounted with umount -R targetdir/, for recursive operation. This functionality is particularly useful to mount DDIs automatically at boot via simple /etc/fstab entries. For example: /path/to/myimage.raw /images/myimage/ ddi defaults 0 0 When invoked this way the mount options "ro", "rw", "discard", "nodiscard" map to the corresponding options listed above (i.e. --read-only, --discard=all, --discard=disabled). Mount options are not generically passed on to the file systems inside the images. EXAMPLES top Example 1. Generate a tarball from an OS disk image # systemd-dissect --with foo.raw tar cz . >foo.tar.gz SEE ALSO top systemd(1), systemd-nspawn(1), systemd.exec(5), Discoverable Partitions Specification[1], mount(8), umount(8), fdisk(8) NOTES top 1. Discoverable Partitions Specification https://uapi-group.org/specifications/specs/discoverable_partitions_specification 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 SYSTEMD-DISSECT(1) Pages that refer to this page: systemd.directives(7), systemd.image-policy(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. | # mount.ddi\n\n> Mount Discoverable Disk Images.\n> See `tldr systemd-dissect` for other commands relevant to DDIs.\n> More information: <https://www.freedesktop.org/software/systemd/man/latest/systemd-dissect.html>.\n\n- Mount an OS image:\n\n`mount.ddi {{path/to/image.raw}} {{/mnt/image}}`\n |
mountpoint | mountpoint(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training mountpoint(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXIT STATUS | ENVIRONMENT | NOTES | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY MOUNTPOINT(1) User Commands MOUNTPOINT(1) NAME top mountpoint - see if a directory or file is a mountpoint SYNOPSIS top mountpoint [-d|-q] directory|file mountpoint -x device DESCRIPTION top mountpoint checks whether the given directory or file is mentioned in the /proc/self/mountinfo file. OPTIONS top -d, --fs-devno Show the major/minor numbers of the device that is mounted on the given directory. -q, --quiet Be quiet - dont print anything. --nofollow Do not follow symbolic link if it the last element of the directory path. -x, --devno Show the major/minor numbers of the given blockdevice on standard output. -h, --help Display help text and exit. -V, --version Print version and exit. EXIT STATUS top mountpoint has the following exit status values: 0 success; the directory is a mountpoint, or device is block device on --devno 1 failure; incorrect invocation, permissions or system error 32 failure; the directory is not a mountpoint, or device is not a block device on --devno ENVIRONMENT top LIBMOUNT_DEBUG=all enables libmount debug output. NOTES top The util-linux mountpoint implementation was written from scratch for libmount. The original version for sysvinit suite was written by Miquel van Smoorenburg. AUTHORS top Karel Zak <[email protected]> SEE ALSO top mount(8) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The mountpoint 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 MOUNTPOINT(1) Pages that refer to this page: mount(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. | # mountpoint\n\n> Test if a directory is a filesystem mountpoint.\n> More information: <https://manned.org/mountpoint>.\n\n- Check if a directory is a mountpoint:\n\n`mountpoint {{path/to/directory}}`\n\n- Check if a directory is a mountpoint without showing any output:\n\n`mountpoint -q {{path/to/directory}}`\n\n- Show major/minor numbers of a mountpoint's filesystem:\n\n`mountpoint --fs-devno {{path/to/directory}}`\n |
mpstat | mpstat(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training mpstat(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | ENVIRONMENT | EXAMPLES | BUGS | FILES | AUTHOR | SEE ALSO | COLOPHON MPSTAT(1) Linux User's Manual MPSTAT(1) NAME top mpstat - Report processors related statistics. SYNOPSIS top mpstat [ -A ] [ --dec={ 0 | 1 | 2 } ] [ -H ] [ -n ] [ -u ] [ -T ] [ -V ] [ -I { keyword[,...] | ALL } ] [ -N { node_list | ALL } ] [ -o JSON ] [ -P { cpu_list | ALL } ] [ interval [ count ] ] DESCRIPTION top The mpstat command writes to standard output activities for each available processor, processor 0 being the first one. Global average activities among all processors are also reported. The mpstat command can be used on both SMP and UP machines, but in the latter, only global average activities will be printed. If no activity has been selected, then the default report is the CPU utilization report. The interval parameter specifies the amount of time in seconds between each report. A value of 0 (or no parameters at all) indicates that processors statistics are to be reported for the time since system startup (boot). The count parameter can be specified in conjunction with the interval parameter if this one is not set to zero. The value of count determines the number of reports generated at interval seconds apart. If the interval parameter is specified without the count parameter, the mpstat command generates reports continuously. OPTIONS top -A This option is equivalent to specifying -n -u -I ALL. This option also implies specifying -N ALL -P ALL unless these options are explicitly set on the command line. --dec={ 0 | 1 | 2 } Specify the number of decimal places to use (0 to 2, default value is 2). -H Also detect and display statistics for physically hotplugged vCPUs. -I { keyword[,...] | ALL } Report interrupts statistics. Possible keywords are CPU, SCPU, and SUM. With the CPU keyword, the number of each individual interrupt received per second by the CPU or CPUs is displayed. Interrupts are those listed in /proc/interrupts file. With the SCPU keyword, the number of each individual software interrupt received per second by the CPU or CPUs is displayed. This option works only with kernels 2.6.31 and later. Software interrupts are those listed in /proc/softirqs file. With the SUM keyword, the mpstat command reports the total number of interrupts per processor. The following values are displayed: CPU Processor number. The keyword all indicates that statistics are calculated as averages among all processors. intr/s Show the total number of interrupts received per second by the CPU or CPUs. The ALL keyword is equivalent to specifying all the keywords above and therefore all the interrupts statistics are displayed. -N { node_list | ALL } Indicate the NUMA nodes for which statistics are to be reported. node_list is a list of comma-separated values or range of values (e.g., 0,2,4-7,12-). Note that node all is the global average among all nodes. The ALL keyword indicates that statistics are to be reported for all nodes. -n Report summary CPU statistics based on NUMA node placement. The following values are displayed: NODE Logical NUMA node number. The keyword all indicates that statistics are calculated as averages among all nodes. All the other fields are the same as those displayed with option -u (see below). -o JSON Display the statistics in JSON (JavaScript Object Notation) format. JSON output field order is undefined, and new fields may be added in the future. -P { cpu_list | ALL } Indicate the processors for which statistics are to be reported. cpu_list is a list of comma-separated values or range of values (e.g., 0,2,4-7,12-). Note that processor 0 is the first processor, and processor all is the global average among all processors. The ALL keyword indicates that statistics are to be reported for all processors. Offline processors are not displayed. -T Display topology elements in the CPU report (see option -u below). The following elements are displayed: CORE Logical core number. SOCK Logical socket number. NODE Logical NUMA node number. -u Report CPU utilization. The following values are displayed: CPU Processor number. The keyword all indicates that statistics are calculated as averages among all processors. %usr Show the percentage of CPU utilization that occurred while executing at the user level (application). %nice Show the percentage of CPU utilization that occurred while executing at the user level with nice priority. %sys Show the percentage of CPU utilization that occurred while executing at the system level (kernel). Note that this does not include time spent servicing hardware and software interrupts. %iowait Show the percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request. %irq Show the percentage of time spent by the CPU or CPUs to service hardware interrupts. %soft Show the percentage of time spent by the CPU or CPUs to service software interrupts. %steal Show the percentage of time spent in involuntary wait by the virtual CPU or CPUs while the hypervisor was servicing another virtual processor. %guest Show the percentage of time spent by the CPU or CPUs to run a virtual processor. %gnice Show the percentage of time spent by the CPU or CPUs to run a niced guest. %idle Show the percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request. -V Print version number then exit. ENVIRONMENT top The mpstat command takes into account the following environment variable: S_COLORS By default statistics are displayed in color when the output is connected to a terminal. Use this variable to change the settings. Possible values for this variable are never, always or auto (the latter is equivalent to the default settings). Please note that the color (being red, yellow, or some other color) used to display a value is not indicative of any kind of issue simply because of the color. It only indicates different ranges of values. S_COLORS_SGR Specify the colors and other attributes used to display statistics on the terminal. Its value is a colon- separated list of capabilities that defaults to I=32;22:N=34;1:W=35;1:X=31;1:Z=34;22. Supported capabilities are: I= SGR (Select Graphic Rendition) substring for CPU number. N= SGR substring for non-zero statistics values. W= (or M=) SGR substring for percentage values in the range from 75% to 90% (or in the range 10% to 25% depending on the metric's meaning). X= (or H=) SGR substring for percentage values greater than or equal to 90% (or lower than or equal to 10% depending on the metric's meaning). Z= SGR substring for zero values. S_TIME_FORMAT If this variable exists and its value is ISO then the current locale will be ignored when printing the date in the report header. The mpstat command will use the ISO 8601 format (YYYY-MM-DD) instead. The timestamp will also be compliant with ISO 8601 format. EXAMPLES top mpstat 2 5 Display five reports of global statistics among all processors at two second intervals. mpstat -P ALL 2 5 Display five reports of statistics for all processors at two second intervals. BUGS top /proc filesystem must be mounted for the mpstat command to work. FILES top /proc contains various files with system statistics. AUTHOR top Sebastien Godard (sysstat <at> orange.fr) SEE ALSO top sar(1), pidstat(1), iostat(1), vmstat(8) https://github.com/sysstat/sysstat https://sysstat.github.io/ COLOPHON top This page is part of the sysstat (sysstat performance monitoring tools) project. Information about the project can be found at http://sebastien.godard.pagesperso-orange.fr/. If you have a bug report for this manual page, send it to sysstat-AT-orange.fr. This page was obtained from the project's upstream Git repository https://github.com/sysstat/sysstat.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] Linux AUGUST 2023 MPSTAT(1) Pages that refer to this page: cifsiostat(1), iostat(1), iowatcher(1), pcp-mpstat(1), pidstat(1), sar(1), tapestat(1), 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. | # mpstat\n\n> Report CPU statistics.\n> More information: <https://manned.org/mpstat>.\n\n- Display CPU statistics every 2 seconds:\n\n`mpstat {{2}}`\n\n- Display 5 reports, one by one, at 2 second intervals:\n\n`mpstat {{2}} {{5}}`\n\n- Display 5 reports, one by one, from a given processor, at 2 second intervals:\n\n`mpstat -P {{0}} {{2}} {{5}}`\n |
mv | mv(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training mv(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON MV(1) User Commands MV(1) NAME top mv - move (rename) files SYNOPSIS top mv [OPTION]... [-T] SOURCE DEST mv [OPTION]... SOURCE... DIRECTORY mv [OPTION]... -t DIRECTORY SOURCE... DESCRIPTION top Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY. Mandatory arguments to long options are mandatory for short options too. --backup[=CONTROL] make a backup of each existing destination file -b like --backup but does not accept an argument --debug explain how a file is copied. Implies -v -f, --force do not prompt before overwriting -i, --interactive prompt before overwrite -n, --no-clobber do not overwrite an existing file If you specify more than one of -i, -f, -n, only the final one takes effect. --no-copy do not copy if renaming fails --strip-trailing-slashes remove any trailing slashes from each SOURCE argument -S, --suffix=SUFFIX override the usual backup suffix -t, --target-directory=DIRECTORY move all SOURCE arguments into DIRECTORY -T, --no-target-directory treat DEST as a normal file --update[=UPDATE] control which existing files are updated; UPDATE={all,none,older(default)}. See below -u equivalent to --update[=older] -v, --verbose explain what is being done -Z, --context set SELinux security context of destination file to default type --help display this help and exit --version output version information and exit UPDATE controls which existing files in the destination are replaced. 'all' is the default operation when an --update option is not specified, and results in all existing files in the destination being replaced. 'none' is similar to the --no-clobber option, in that no files in the destination are replaced, but also skipped files do not induce a failure. 'older' is the default operation when --update is specified, and results in files being replaced if they're older than the corresponding source file. The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the --backup option or through the VERSION_CONTROL environment variable. Here are the values: none, off never make backups (even if --backup is given) numbered, t make numbered backups existing, nil numbered if numbered backups exist, simple otherwise simple, never always make simple backups AUTHOR top Written by Mike Parker, David MacKenzie, and 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 rename(2) Full documentation <https://www.gnu.org/software/coreutils/mv> or available locally via: info '(coreutils) mv 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 MV(1) Pages that refer to this page: rename(1), sshfs(1), rename(2), inotify(7), symlink(7), 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. | # mv\n\n> Move or rename files and directories.\n> More information: <https://www.gnu.org/software/coreutils/mv>.\n\n- Rename a file or directory when the target is not an existing directory:\n\n`mv {{path/to/source}} {{path/to/target}}`\n\n- Move a file or directory into an existing directory:\n\n`mv {{path/to/source}} {{path/to/existing_directory}}`\n\n- Move multiple files into an existing directory, keeping the filenames unchanged:\n\n`mv {{path/to/source1 path/to/source2 ...}} {{path/to/existing_directory}}`\n\n- Do not prompt for confirmation before overwriting existing files:\n\n`mv -f {{path/to/source}} {{path/to/target}}`\n\n- Prompt for confirmation before overwriting existing files, regardless of file permissions:\n\n`mv -i {{path/to/source}} {{path/to/target}}`\n\n- Do not overwrite existing files at the target:\n\n`mv -n {{path/to/source}} {{path/to/target}}`\n\n- Move files in verbose mode, showing files after they are moved:\n\n`mv -v {{path/to/source}} {{path/to/target}}`\n |
mysql | mysql(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training mysql(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | MYSQL OPTIONS | MYSQL COMMANDS | MYSQL SERVER-SIDE HELP | EXECUTING SQL STATEMENTS FROM A TEXT FILE | MYSQL TIPS | COPYRIGHT | NOTES | SEE ALSO | AUTHOR | COLOPHON MARIADB(1) MariaDB Database System MARIADB(1) NAME top mariadb - the MariaDB command-line tool (mysql is now a symlink to mariadb) SYNOPSIS top mysql [options] db_name DESCRIPTION top mysql is a simple SQL shell (with GNU readline capabilities). It supports interactive and non-interactive use. When used interactively, query results are presented in an ASCII-table format. When used non-interactively (for example, as a filter), the result is presented in tab-separated format. The output format can be changed using command options. If you have problems due to insufficient memory for large result sets, use the --quick option. This forces mysql to retrieve results from the server a row at a time rather than retrieving the entire result set and buffering it in memory before displaying it. This is done by returning the result set using the mysql_use_result() C API function in the client/server library rather than mysql_store_result(). Using mysql is very easy. Invoke it from the prompt of your command interpreter as follows: shell> mysql db_name Or: shell> mysql --user=user_name --password=your_password db_name Then type an SQL statement, end it with ;, \g, or \G and press Enter. Typing Control-C causes mysql to attempt to kill the current statement. If this cannot be done, or Control-C is typed again before the statement is killed, mysql exits. You can execute SQL statements in a script file (batch file) like this: shell> mysql db_name < script.sql > output.tab MYSQL OPTIONS top mysql supports the following options, which can be specified on the command line or in the [mysql], [client], [client-server] or [client-mariadb] option file groups. mysql also supports the options for processing option files. --help, -?, -I Display a help message and exit. --abort-source-on-error Abort 'source filename' operations in case of errors. --auto-rehash Enable automatic rehashing. This option is on by default, which enables database, table, and column name completion. Use --disable-auto-rehash, --no-auto-rehash, or --skip-auto-rehash to disable rehashing. That causes mysql to start faster, but you must issue the rehash command if you want to use name completion. To complete a name, enter the first part and press Tab. If the name is unambiguous, mysql completes it. Otherwise, you can press Tab again to see the possible names that begin with what you have typed so far. Completion does not occur if there is no default database. --auto-vertical-output Automatically switch to vertical output mode if the result is wider than the terminal width. --batch, -B Print results using tab as the column separator, with each row on a new line. With this option, mysql does not use the history file. Batch mode results in nontabular output format and escaping of special characters. Escaping may be disabled by using raw mode; see the description for the --raw option. --binary-mode Binary mode allows certain character sequences to be processed as data that would otherwise be treated with a special meaning by the parser. Specifically, this switch turns off parsing of all client commands except \C and DELIMITER in non-interactive mode (i.e., when binary mode is combined with either 1) piped input, 2) the --batch mysql option, or 3) the 'source' command). Also, in binary mode, occurrences of '\r\n' and ASCII '\0' are preserved within strings, whereas by default, '\r\n' is translated to '\n' and '\0' is disallowed in user input. --character-sets-dir=path The directory where character sets are installed. --column-names Write column names in results. --column-type-info, -m Display result set metadata. --comments, -c Whether to preserve comments in statements sent to the server. The default is --skip-comments (discard comments), enable with --comments (preserve comments). --compress, -C Compress all information sent between the client and the server if both support compression. --connect-timeout=seconds Set the number of seconds before connection timeout. (Default value is 0.) --database=db_name, -D db_name The database to use. --debug[=debug_options], -# [debug_options] Write a debugging log. A typical debug_options string is d:t:o,file_name. The default is d:t:o,/tmp/mysql.trace. --debug-check Print some debugging information when the program exits. --debug-info, -T Prints debugging information and memory and CPU usage statistics when the program exits. --default-auth=name Default authentication client-side plugin to use. --default-character-set=charset_name Use charset_name as the default character set for the client and connection. A common issue that can occur when the operating system uses utf8 or another multi-byte character set is that output from the mysql client is formatted incorrectly, due to the fact that the MariaDB client uses the latin1 character set by default. You can usually fix such issues by using this option to force the client to use the system character set instead. --defaults-extra-file=filename Set filename as the file to read default options from after the global defaults files has been read. Must be given as first option. --defaults-file=filename Set filename as the file to read default options from, override global defaults files. Must be given as first option. --defaults-group-suffix=suffix In addition to the groups named on the command line, read groups that have the given suffix. --delimiter=str Set the statement delimiter. The default is the semicolon character (;). --disable-named-commands Disable named commands. Use the \* form only, or use named commands only at the beginning of a line ending with a semicolon (;). mysql starts with this option enabled by default. However, even with this option, long-format commands still work from the first line. See the section called MYSQL COMMANDS. --enable-cleartext-plugin Obsolete option. Exists only for MySQL compatibility. --execute=statement, -e statement Execute the statement and quit. Disables --force and history file. The default output format is like that produced with --batch. --force, -f Continue even if an SQL error occurs. Sets --abort-source-on- error to 0. --host=host_name, -h host_name Connect to the MariaDB server on the given host. --html, -H Produce HTML output. --ignore-spaces, -i Ignore spaces after function names. Allows one to have spaces (including tab characters and new line characters) between function name and '('. The drawback is that this causes built in functions to become reserved words. --init-command=str SQL Command to execute when connecting to the MariaDB server. Will automatically be re-executed when reconnecting. --line-numbers Write line numbers for errors. Disable this with --skip-line-numbers. --local-infile[={0|1}] Enable or disable LOCAL capability for LOAD DATA INFILE. With no value, the option enables LOCAL. The option may be given as --local-infile=0 or --local-infile=1 to explicitly disable or enable LOCAL. Enabling LOCAL has no effect if the server does not also support it. --max-allowed-packet=num Set the maximum packet length to send to or receive from the server. (Default value is 16MB, largest 1GB.) --max-join-size=num Set the automatic limit for rows in a join when using --safe-updates. (Default value is 1,000,000.) --named-commands, -G Enable named mysql commands. Long-format commands are allowed, not just short-format commands. For example, quit and \q both are recognized. Use --skip-named-commands to disable named commands. See the section called MYSQL COMMANDS. Disabled by default. --net-buffer-length=size Set the buffer size for TCP/IP and socket communication. (Default value is 16KB.) --no-auto-rehash, -A This has the same effect as --skip-auto-rehash. See the description for --auto-rehash. --no-beep, -b Do not beep when errors occur. --no-defaults Do not read default options from any option file. This must be given as the first argument. --one-database, -o Ignore statements except those those that occur while the default database is the one named on the command line. This filtering is limited, and based only on USE statements. This is useful for skipping updates to other databases in the binary log. --pager[=command] Use the given command for paging query output. If the command is omitted, the default pager is the value of your PAGER environment variable. Valid pagers are less, more, cat [> filename], and so forth. This option works only on Unix and only in interactive mode. To disable paging, use --skip-pager. the section called MYSQL COMMANDS, discusses output paging further. --password[=password], -p[password] The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, mysql prompts for one. Specifying a password on the command line should be considered insecure. You can use an option file to avoid giving the password on the command line. --pipe, -W On Windows, connect to the server via a named pipe. This option applies only if the server supports named-pipe connections. --plugin-dir=dir_name Directory for client-side plugins. --port=port_num, -P port_num The TCP/IP port number to use for the connection or 0 for default to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306). Forces --protocol=tcp when specified on the command line without other connection properties. --print-defaults Print the program argument list and exit. This must be given as the first argument. --progress-reports Get progress reports for long running commands (such as ALTER TABLE). (Defaults to on; use --skip-progress-reports to disable.) --prompt=format_str Set the prompt to the specified format. The special sequences that the prompt can contain are described in the section called MYSQL COMMANDS. --protocol={TCP|SOCKET|PIPE|MEMORY} The connection protocol to use for connecting to the server. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want. --quick, -q Do not cache each query result, print each row as it is received. This may slow down the server if the output is suspended. With this option, mysql does not use the history file. --raw, -r For tabular output, the boxing around columns enables one column value to be distinguished from another. For nontabular output (such as is produced in batch mode or when the --batch or --silent option is given), special characters are escaped in the output so they can be identified easily. Newline, tab, NUL, and backslash are written as \n, \t, \0, and \\. The --raw option disables this character escaping. The following example demonstrates tabular versus nontabular output and the use of raw mode to disable escaping: % mysql mysql> SELECT CHAR(92); +----------+ | CHAR(92) | +----------+ | \ | +----------+ % mysql -s mysql> SELECT CHAR(92); CHAR(92) \\ % mysql -s -r mysql> SELECT CHAR(92); CHAR(92) \ --reconnect If the connection to the server is lost, automatically try to reconnect. A single reconnect attempt is made each time the connection is lost. Enabled by default, to disable use --skip-reconnect or --disable-reconnect. --safe-updates, --i-am-a-dummy, -U Allow only those UPDATE and DELETE statements that specify which rows to modify by using key values. If you have set this option in an option file, you can override it by using --safe-updates on the command line. See the section called MYSQL TIPS, for more information about this option. --secure-auth Do not send passwords to the server in old (pre-4.1.1) format. This prevents connections except for servers that use the newer password format. --select-limit=limit Set automatic limit for SELECT when using --safe-updates. (Default value is 1,000.) --server-arg=name Send name as a parameter to the embedded server. --show-warnings Cause warnings to be shown after each statement if there are any. This option applies to interactive and batch mode. --sigint-ignore Ignore SIGINT signals (typically the result of typing Control-C). --silent, -s Silent mode. Produce less output. This option can be given multiple times to produce less and less output. This option results in nontabular output format and escaping of special characters. Escaping may be disabled by using raw mode; see the description for the --raw option. --skip-auto-rehash Disable automatic rehashing. Synonym for --disable-auto-rehash. --skip-column-names, -N Do not write column names in results. --skip-line-numbers, -L Do not write line numbers for errors. Useful when you want to compare result files that include error messages. --socket=path, -S path For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use. Forces --protocol=socket when specified on the command line without other connection properties; on Windows, forces --protocol=pipe. --ssl Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl. --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies --ssl). --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl). --ssl-cert=name X509 cert in PEM format (check OpenSSL docs, implies --ssl). --ssl-cipher=name SSL cipher to use (check OpenSSL docs, implies --ssl). --ssl-key=name X509 key in PEM format (check OpenSSL docs, implies --ssl). --ssl-crl=name Certificate revocation list (check OpenSSL docs, implies --ssl). --ssl-crlpath=name Certificate revocation list path (check OpenSSL docs, implies --ssl). --ssl-verify-server-cert Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default. --table, -t Display output in table format. This is the default for interactive use, but can be used to produce table output in batch mode. --tee=file_name Append a copy of output to the given file. This option works only in interactive mode. the section called MYSQL COMMANDS, discusses tee files further. --unbuffered, -n Flush the buffer after each query. --user=user_name, -u user_name The MariaDB user name to use when connecting to the server. --verbose, -v Verbose mode. Produce more output about what the program does. This option can be given multiple times to produce more and more output. (For example, -v -v -v produces table output format even in batch mode.) --version, -V Display version information and exit. --vertical, -E Print query output rows vertically (one line per column value). Without this option, you can specify vertical output for individual statements by terminating them with \G. --wait, -w If the connection cannot be established, wait and retry instead of aborting. --xml, -X Produce XML output. The output when --xml is used with mysql matches that of mysqldump --xml. See mysqldump(1) for details. The XML output also uses an XML namespace, as shown here: shell> mysql --xml -uroot -e "SHOW VARIABLES LIKE version%" <?xml version="1.0"?> <resultset statement="SHOW VARIABLES LIKE version%" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <row> <field name="Variable_name">version</field> <field name="Value">5.0.40-debug</field> </row> <row> <field name="Variable_name">version_comment</field> <field name="Value">Source distribution</field> </row> <row> <field name="Variable_name">version_compile_machine</field> <field name="Value">i686</field> </row> <row> <field name="Variable_name">version_compile_os</field> <field name="Value">suse-linux-gnu</field> </row> </resultset> You can also set the following variables by using --var_name=value. connect_timeout The number of seconds before connection timeout. (Default value is 0.) max_allowed_packet The maximum packet length to send to or receive from the server. (Default value is 16MB.) max_join_size The automatic limit for rows in a join when using --safe-updates. (Default value is 1,000,000.) net_buffer_length The buffer size for TCP/IP and socket communication. (Default value is 16KB.) select_limit The automatic limit for SELECT statements when using --safe-updates. (Default value is 1,000.) On Unix, the mysql client writes a record of executed statements to a history file. By default, this file is named .mysql_history and is created in your home directory. To specify a different file, set the value of the MYSQL_HISTFILE environment variable. The .mysql_history should be protected with a restrictive access mode because sensitive information might be written to it, such as the text of SQL statements that contain passwords. If you do not want to maintain a history file, first remove .mysql_history if it exists, and then use either of the following techniques: Set the MYSQL_HISTFILE variable to /dev/null. To cause this setting to take effect each time you log in, put the setting in one of your shells startup files. Create .mysql_history as a symbolic link to /dev/null: shell> ln -s /dev/null $HOME/.mysql_history You need do this only once. MYSQL COMMANDS top mysql sends each SQL statement that you issue to the server to be executed. There is also a set of commands that mysql itself interprets. For a list of these commands, type help or \h at the mysql> prompt: mysql> help List of all MySQL commands: Note that all text commands must be first on line and end with ; ? (\?) Synonym for `help. clear (\c) Clear command. connect (\r) Reconnect to the server. Optional arguments are db and host. delimiter (\d) Set statement delimiter. edit (\e) Edit command with $EDITOR. ego (\G) Send command to mysql server, display result vertically. exit (\q) Exit mysql. Same as quit. go (\g) Send command to mysql server. help (\h) Display this help. nopager (\n) Disable pager, print to stdout. notee (\t) Dont write into outfile. pager (\P) Set PAGER [to_pager]. Print the query results via PAGER. print (\p) Print current command. prompt (\R) Change your mysql prompt. quit (\q) Quit mysql. rehash (\#) Rebuild completion hash. source (\.) Execute an SQL script file. Takes a file name as an argument. status (\s) Get status information from the server. system (\!) Execute a system shell command. tee (\T) Set outfile [to_outfile]. Append everything into given outfile. use (\u) Use another database. Takes database name as argument. charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets. warnings (\W) Show warnings after every statement. nowarning (\w) Dont show warnings after every statement. For server side help, type help contents Each command has both a long and short form. The long form is not case sensitive; the short form is. The long form can be followed by an optional semicolon terminator, but the short form should not. The use of short-form commands within multi-line /* ... */ comments is not supported. help [arg], \h [arg], \? [arg], ? [arg] Display a help message listing the available mysql commands. If you provide an argument to the help command, mysql uses it as a search string to access server-side help. For more information, see the section called MYSQL SERVER-SIDE HELP. charset charset_name, \C charset_name Change the default character set and issue a SET NAMES statement. This enables the character set to remain synchronized on the client and server if mysql is run with auto-reconnect enabled (which is not recommended), because the specified character set is used for reconnects. clear, \c Clear the current input. Use this if you change your mind about executing the statement that you are entering. connect [db_name host_name]], \r [db_name host_name]] Reconnect to the server. The optional database name and host name arguments may be given to specify the default database or the host where the server is running. If omitted, the current values are used. delimiter str, \d str Change the string that mysql interprets as the separator between SQL statements. The default is the semicolon character (;). The delimiter can be specified as an unquoted or quoted argument. Quoting can be done with either single quote () or douple quote (") characters. To include a quote within a quoted string, either quote the string with the other quote character or escape the quote with a backslash (\) character. Backslash should be avoided outside of quoted strings because it is the escape character for MariaDB. For an unquoted argument, the delmiter is read up to the first space or end of line. For a quoted argument, the delimiter is read up to the matching quote on the line. When the delimiter recognized by mysql is set to something other than the default of ;, instances of that character are sent to the server without interpretation. However, the server itself still interprets ; as a statement delimiter and processes statements accordingly. This behavior on the server side comes into play for multiple-statement execution, and for parsing the body of stored procedures and functions, triggers, and events. edit, \e Edit the current input statement. mysql checks the values of the EDITOR and VISUAL environment variables to determine which editor to use. The default editor is vi if neither variable is set. The edit command works only in Unix. ego, \G Send the current statement to the server to be executed and display the result using vertical format. exit, \q Exit mysql. go, \g Send the current statement to the server to be executed. nopager, \n Disable output paging. See the description for pager. The nopager command works only in Unix. notee, \t Disable output copying to the tee file. See the description for tee. nowarning, \w Enable display of warnings after each statement. pager [command], \P [command] Enable output paging. By using the --pager option when you invoke mysql, it is possible to browse or search query results in interactive mode with Unix programs such as less, more, or any other similar program. If you specify no value for the option, mysql checks the value of the PAGER environment variable and sets the pager to that. Pager functionality works only in interactive mode. Output paging can be enabled interactively with the pager command and disabled with nopager. The command takes an optional argument; if given, the paging program is set to that. With no argument, the pager is set to the pager that was set on the command line, or stdout if no pager was specified. Output paging works only in Unix because it uses the popen() function, which does not exist on Windows. For Windows, the tee option can be used instead to save query output, although it is not as convenient as pager for browsing output in some situations. print, \p Print the current input statement without executing it. prompt [str], \R [str] Reconfigure the mysql prompt to the given string. The special character sequences that can be used in the prompt are described later in this section. If you specify the prompt command with no argument, mysql resets the prompt to the default of mysql>. quit, \q Exit mysql. rehash, \# Rebuild the completion hash that enables database, table, and column name completion while you are entering statements. (See the description for the --auto-rehash option.) source file_name, \. file_name Read the named file and executes the statements contained therein. On Windows, you can specify path name separators as / or \\. status, \s Provide status information about the connection and the server you are using. If you are running in --safe-updates mode, status also prints the values for the mysql variables that affect your queries. system command, \! command Execute the given command using your default command interpreter. The system command works only in Unix. tee [file_name], \T [file_name] By using the --tee option when you invoke mysql, you can log statements and their output. All the data displayed on the screen is appended into a given file. This can be very useful for debugging purposes also. mysql flushes results to the file after each statement, just before it prints its next prompt. Tee functionality works only in interactive mode. You can enable this feature interactively with the tee command. Without a parameter, the previous file is used. The tee file can be disabled with the notee command. Executing tee again re-enables logging. use db_name, \u db_name Use db_name as the default database. warnings, \W Enable display of warnings after each statement (if there are any). Here are a few tips about the pager command: You can use it to write to a file and the results go only to the file: mysql> pager cat > /tmp/log.txt You can also pass any options for the program that you want to use as your pager: mysql> pager less -n -i -S In the preceding example, note the -S option. You may find it very useful for browsing wide query results. Sometimes a very wide result set is difficult to read on the screen. The -S option to less can make the result set much more readable because you can scroll it horizontally using the left-arrow and right-arrow keys. You can also use -S interactively within less to switch the horizontal-browse mode on and off. For more information, read the less manual page: shell> man less The -F and -X options may be used with less to cause it to exit if output fits on one screen, which is convenient when no scrolling is necessary: mysql> pager less -n -i -S -F -X You can specify very complex pager commands for handling query output: mysql> pager cat | tee /dr1/tmp/res.txt \ | tee /dr2/tmp/res2.txt | less -n -i -S In this example, the command would send query results to two files in two different directories on two different file systems mounted on /dr1 and /dr2, yet still display the results onscreen via less. You can also combine the tee and pager functions. Have a tee file enabled and pager set to less, and you are able to browse the results using the less program and still have everything appended into a file the same time. The difference between the Unix tee used with the pager command and the mysql built-in tee command is that the built-in tee works even if you do not have the Unix tee available. The built-in tee also logs everything that is printed on the screen, whereas the Unix tee used with pager does not log quite that much. Additionally, tee file logging can be turned on and off interactively from within mysql. This is useful when you want to log some queries to a file, but not others. The prompt command reconfigures the default mysql> prompt. The string for defining the prompt can contain the following special sequences. Option Description \c A counter that increments for each statement you issue \D The full current date \d The default database \h The server host \l The current delimiter (new in 5.1.12) \m Minutes of the current time \n A newline character \O The current month in three-letter format (Jan, Feb, ...) \o The current month in numeric format \P am/pm \p The current TCP/IP port or socket file \R The current time, in 24-hour military time (023) \r The current time, standard 12-hour time (112) \S Semicolon \s Seconds of the current time \t A tab character \U Your full user_name@host_name account name \u Your user name \v The server version \w The current day of the week in three-letter format (Mon, Tue, ...) \Y The current year, four digits \y The current year, two digits \_ A space \ A space (a space follows the backslash) \ Single quote \" Double quote \\ A literal \ backslash character \x x, for any x not listed above You can set the prompt in several ways: Use an environment variable. You can set the MYSQL_PS1 environment variable to a prompt string. For example: shell> export MYSQL_PS1="(\u@\h) [\d]> " Use a command-line option. You can set the --prompt option on the command line to mysql. For example: shell> mysql --prompt="(\u@\h) [\d]> " (user@host) [database]> Use an option file. You can set the prompt option in the [mysql] group of any MariaDB option file, such as /etc/my.cnf or the .my.cnf file in your home directory. For example: [mysql] prompt=(\\u@\\h) [\\d]>\\_ In this example, note that the backslashes are doubled. If you set the prompt using the prompt option in an option file, it is advisable to double the backslashes when using the special prompt options. There is some overlap in the set of allowable prompt options and the set of special escape sequences that are recognized in option files. The overlap may cause you problems if you use single backslashes. For example, \s is interpreted as a space rather than as the current seconds value. The following example shows how to define a prompt within an option file to include the current time in HH:MM:SS> format: [mysql] prompt="\\r:\\m:\\s> " Set the prompt interactively. You can change your prompt interactively by using the prompt (or \R) command. For example: mysql> prompt (\u@\h) [\d]>\_ PROMPT set to (\u@\h) [\d]>\_ (user@host) [database]> (user@host) [database]> prompt Returning to default PROMPT of mysql> mysql> MYSQL SERVER-SIDE HELP top mysql> help search_string If you provide an argument to the help command, mysql uses it as a search string to access server-side help. The proper operation of this command requires that the help tables in the mysql database be initialized with help topic information. If there is no match for the search string, the search fails: mysql> help me Nothing found Please try to run help contents for a list of all accessible topics Use help contents to see a list of the help categories: mysql> help contents You asked for help about help category: "Contents" For more information, type help <item>, where <item> is one of the following categories: Account Management Administration Data Definition Data Manipulation Data Types Functions Functions and Modifiers for Use with GROUP BY Geographic Features Language Structure Plugins Storage Engines Stored Routines Table Maintenance Transactions Triggers If the search string matches multiple items, mysql shows a list of matching topics: mysql> help logs Many help items for your request exist. To make a more specific request, please type help <item>, where <item> is one of the following topics: SHOW SHOW BINARY LOGS SHOW ENGINE SHOW LOGS Use a topic as the search string to see the help entry for that topic: mysql> help show binary logs Name: SHOW BINARY LOGS Description: Syntax: SHOW BINARY LOGS SHOW MASTER LOGS Lists the binary log files on the server. This statement is used as part of the procedure described in [purge-binary-logs], that shows how to determine which logs can be purged. mysql> SHOW BINARY LOGS; +---------------+-----------+ | Log_name | File_size | +---------------+-----------+ | binlog.000015 | 724935 | | binlog.000016 | 733481 | +---------------+-----------+ EXECUTING SQL STATEMENTS FROM A TEXT FILE top The mysql client typically is used interactively, like this: shell> mysql db_name However, it is also possible to put your SQL statements in a file and then tell mysql to read its input from that file. To do so, create a text file text_file that contains the statements you wish to execute. Then invoke mysql as shown here: shell> mysql db_name < text_file If you place a USE db_name statement as the first statement in the file, it is unnecessary to specify the database name on the command line: shell> mysql < text_file If you are already running mysql, you can execute an SQL script file using the source command or \. command: mysql> source file_name mysql> \. file_name Sometimes you may want your script to display progress information to the user. For this you can insert statements like this: SELECT <info_to_display> AS ; The statement shown outputs <info_to_display>. You can also invoke mysql with the --verbose option, which causes each statement to be displayed before the result that it produces. mysql ignores Unicode byte order mark (BOM) characters at the beginning of input files. Presence of a BOM does not cause mysql to change its default character set. To do that, invoke mysql with an option such as --default-character-set=utf8. MYSQL TIPS top This section describes some techniques that can help you use mysql more effectively. Displaying Query Results Vertically Some query results are much more readable when displayed vertically, instead of in the usual horizontal table format. Queries can be displayed vertically by terminating the query with \G instead of a semicolon. For example, longer text values that include newlines often are much easier to read with vertical output: mysql> SELECT * FROM mails WHERE LENGTH(txt) < 300 LIMIT 300,1\G *************************** 1. row *************************** msg_nro: 3068 date: 2000-03-01 23:29:50 time_zone: +0200 mail_from: Monty reply: [email protected] mail_to: "Thimble Smith" <[email protected]> sbj: UTF-8 txt: >>>>> "Thimble" == Thimble Smith writes: Thimble> Hi. I think this is a good idea. Is anyone familiar Thimble> with UTF-8 or Unicode? Otherwise, Ill put this on my Thimble> TODO list and see what happens. Yes, please do that. Regards, Monty file: inbox-jani-1 hash: 190402944 1 row in set (0.09 sec) Using the --safe-updates Option For beginners, a useful startup option is --safe-updates (or --i-am-a-dummy, which has the same effect). It is helpful for cases when you might have issued a DELETE FROM tbl_name statement but forgotten the WHERE clause. Normally, such a statement deletes all rows from the table. With --safe-updates, you can delete rows only by specifying the key values that identify them. This helps prevent accidents. When you use the --safe-updates option, mysql issues the following statement when it connects to the MariaDB server: SET sql_safe_updates=1, sql_select_limit=1000, sql_max_join_size=1000000; The SET statement has the following effects: You are not allowed to execute an UPDATE or DELETE statement unless you specify a key constraint in the WHERE clause or provide a LIMIT clause (or both). For example: UPDATE tbl_name SET not_key_column=val WHERE key_column=val; UPDATE tbl_name SET not_key_column=val LIMIT 1; The server limits all large SELECT results to 1,000 rows unless the statement includes a LIMIT clause. The server aborts multiple-table SELECT statements that probably need to examine more than 1,000,000 row combinations. To specify limits different from 1,000 and 1,000,000, you can override the defaults by using the --select-limit and --max-join-size options: shell> mysql --safe-updates --select-limit=500 --max-join-size=10000 Disabling mysql Auto-Reconnect If the mysql client loses its connection to the server while sending a statement, it immediately and automatically tries to reconnect once to the server and send the statement again. However, even if mysql succeeds in reconnecting, your first connection has ended and all your previous session objects and settings are lost: temporary tables, the autocommit mode, and user-defined and session variables. Also, any current transaction rolls back. This behavior may be dangerous for you, as in the following example where the server was shut down and restarted between the first and second statements without you knowing it: mysql> SET @a=1; Query OK, 0 rows affected (0.05 sec) mysql> INSERT INTO t VALUES(@a); ERROR 2006: MySQL server has gone away No connection. Trying to reconnect... Connection id: 1 Current database: test Query OK, 1 row affected (1.30 sec) mysql> SELECT * FROM t; +------+ | a | +------+ | NULL | +------+ 1 row in set (0.05 sec) The @a user variable has been lost with the connection, and after the reconnection it is undefined. If it is important to have mysql terminate with an error if the connection has been lost, you can start the mysql client with the --skip-reconnect option. COPYRIGHT top Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2020 MariaDB Foundation This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see http://www.gnu.org/licenses/. NOTES top 1. Bug#25946 http://bugs.mysql.com/bug.php?id=25946 SEE ALSO top For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ AUTHOR top MariaDB Foundation (http://www.mariadb.org/). COLOPHON top This page is part of the MariaDB (MariaDB database server) project. Information about the project can be found at http://mariadb.org/. If you have a bug report for this manual page, see https://mariadb.com/kb/en/mariadb/reporting-bugs/. This page was obtained from the project's upstream Git repository https://github.com/MariaDB/server on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-05-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] MariaDB 10.8 15 May 2020 MARIADB(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. | # mysql\n\n> The MySQL command-line tool.\n> More information: <https://www.mysql.com/>.\n\n- Connect to a database:\n\n`mysql {{database_name}}`\n\n- Connect to a database, user will be prompted for a password:\n\n`mysql -u {{user}} --password {{database_name}}`\n\n- Connect to a database on another host:\n\n`mysql -h {{database_host}} {{database_name}}`\n\n- Connect to a database through a Unix socket:\n\n`mysql --socket {{path/to/socket.sock}}`\n\n- Execute SQL statements in a script file (batch file):\n\n`mysql -e "source {{filename.sql}}" {{database_name}}`\n\n- Restore a database from a backup created with `mysqldump` (user will be prompted for a password):\n\n`mysql --user {{user}} --password {{database_name}} < {{path/to/backup.sql}}`\n\n- Restore all databases from a backup (user will be prompted for a password):\n\n`mysql --user {{user}} --password < {{path/to/backup.sql}}`\n |
mysqlbinlog | mysqlbinlog(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training mysqlbinlog(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | MYSQLBINLOG HEX DUMP FORMAT | MYSQLBINLOG ROW EVENT DISPLAY | COPYRIGHT | NOTES | SEE ALSO | AUTHOR | COLOPHON MARIADB-BINLOG(1) MariaDB Database System MARIADB-BINLOG(1) NAME top mariadb-binlog - utility for processing binary log files (mysqlbinlog is now a symlink to mariadb-binlog) SYNOPSIS top mysqlbinlog [options] log_file ... DESCRIPTION top The servers binary log consists of files containing events that describe modifications to database contents. The server writes these files in binary format. To display their contents in text format, use the mysqlbinlog utility. You can also use mysqlbinlog to display the contents of relay log files written by a slave server in a replication setup because relay logs have the same format as binary logs. Invoke mysqlbinlog like this: shell> mysqlbinlog [options] log_file ... For example, to display the contents of the binary log file named binlog.000003, use this command: shell> mysqlbinlog binlog.0000003 The output includes events contained in binlog.000003. For statement-based logging, event information includes the SQL statement, the ID of the server on which it was executed, the timestamp when the statement was executed, how much time it took, and so forth. For row-based logging, the event indicates a row change rather than an SQL statement. Events are preceded by header comments that provide additional information. For example: # at 141 #100309 9:28:36 server id 123 end_log_pos 245 Query thread_id=3350 exec_time=11 error_code=0 In the first line, the number following at indicates the starting position of the event in the binary log file. The second line starts with a date and time indicating when the statement started on the server where the event originated. For replication, this timestamp is propagated to slave servers. server id is the server_id value of the server where the event originated. end_log_pos indicates where the next event starts (that is, it is the end position of the current event + 1). thread_id indicates which thread executed the event. exec_time is the time spent executing the event, on a master server. On a slave, it is the difference of the end execution time on the slave minus the beginning execution time on the master. The difference serves as an indicator of how much replication lags behind the master. error_code indicates the result from executing the event. Zero means that no error occurred. The output from mysqlbinlog can be re-executed (for example, by using it as input to mysql) to redo the statements in the log. This is useful for recovery operations after a server crash. For other usage examples, see the discussion later in this section. Normally, you use mysqlbinlog to read binary log files directly and apply them to the local MariaDB server. It is also possible to read binary logs from a remote server by using the --read-from-remote-server option. To read remote binary logs, the connection parameter options can be given to indicate how to connect to the server. These options are --host, --password, --port, --protocol, --socket, and --user; they are ignored except when you also use the --read-from-remote-server option. mysqlbinlog supports the following options, which can be specified on the command line or in the [mysqlbinlog] and [client] option file groups. --help, -? Display a help message and exit. --base64-output=value This option determines when events should be displayed encoded as base-64 strings using BINLOG statements. The option has these allowable values (not case sensitive): AUTO ("automatic") or UNSPEC ("unspecified") displays BINLOG statements automatically when necessary (that is, for format description events and row events). This is the default if no --base64-output option is given. Note Automatic BINLOG display is the only safe behavior if you intend to use the output of mysqlbinlog to re-execute binary log file contents. The other option values are intended only for debugging or testing purposes because they may produce output that does not include all events in executable form. NEVER causes BINLOG statements not to be displayed. mysqlbinlog exits with an error if a row event is found that must be displayed using BINLOG. DECODE-ROWS specifies to mysqlbinlog that you intend for row events to be decoded and displayed as commented SQL statements by also specifying the --verbose option. Like NEVER, DECODE-ROWS suppresses display of BINLOG statements, but unlike NEVER, it does not exit with an error if a row event is found. The --base64-output can be given as --base64-output or --skip-base64-output (with the sense of AUTO or NEVER). For examples that show the effect of --base64-output and --verbose on row event output, see the section called MYSQLBINLOG ROW EVENT DISPLAY. --binlog-row-event-max-size=path The directory where character sets are installed. --character-sets-dir=path The directory where character sets are installed. --database=db_name, -d db_name This option causes mysqlbinlog to output entries from the binary log (local log only) that occur while db_name has been selected as the default database by USE. The --database option for mysqlbinlog is similar to the --binlog-do-db option for mysqld, but can be used to specify only one database. If --database is given multiple times, only the last instance is used. The effects of this option depend on whether the statement-based or row-based logging format is in use, in the same way that the effects of --binlog-do-db depend on whether statement-based or row-based logging is in use. Statement-based logging. The --database option works as follows: While db_name is the default database, statements are output whether they modify tables in db_name or a different database. Unless db_name is selected as the default database, statements are not output, even if they modify tables in db_name. There is an exception for CREATE DATABASE, ALTER DATABASE, and DROP DATABASE. The database being created, altered, or dropped is considered to be the default database when determining whether to output the statement. Suppose that the binary log was created by executing these statements using statement-based-logging: INSERT INTO test.t1 (i) VALUES(100); INSERT INTO db2.t2 (j) VALUES(200); USE test; INSERT INTO test.t1 (i) VALUES(101); INSERT INTO t1 (i) VALUES(102); INSERT INTO db2.t2 (j) VALUES(201); USE db2; INSERT INTO test.t1 (i) VALUES(103); INSERT INTO db2.t2 (j) VALUES(202); INSERT INTO t2 (j) VALUES(203); mysqlbinlog --database=test does not output the first two INSERT statements because there is no default database. It outputs the three INSERT statements following USE test, but not the three INSERT statements following USE db2. mysqlbinlog --database=db2 does not output the first two INSERT statements because there is no default database. It does not output the three INSERT statements following USE test, but does output the three INSERT statements following USE db2. Row-based logging. mysqlbinlog outputs only entries that change tables belonging to db_name. The default database has no effect on this. Suppose that the binary log just described was created using row-based logging rather than statement-based logging. mysqlbinlog --database=test outputs only those entries that modify t1 in the test database, regardless of whether USE was issued or what the default database is. If a server is running with binlog_format set to MIXED and you want it to be possible to use mysqlbinlog with the --database option, you must ensure that tables that are modified are in the database selected by USE. (In particular, no cross-database updates should be used.) Note This option did not work correctly for mysqlbinlog with row-based logging prior to MySQL 5.1.37. --debug[=debug_options], -# [debug_options] Write a debugging log. A typical debug_options string is d:t:o,file_name. The default is d:t:o,/tmp/mysqlbinlog.trace. --debug-check Print some debugging information when the program exits. --debug-info Print debugging information and memory and CPU usage statistics when the program exits. --defaults-extra-file=name Read this file after the global files are read. --defaults-file=name Only read default options from the given file. --default-auth=name Default authentication client-side plugin to use. --disable-log-bin, -D Disable binary logging. This is useful for avoiding an endless loop if you use the --to-last-log option and are sending the output to the same MariaDB server. This option also is useful when restoring after a crash to avoid duplication of the statements you have logged. This option requires that you have the SUPER privilege. It causes mysqlbinlog to include a SET sql_log_bin = 0 statement in its output to disable binary logging of the remaining output. The SET statement is ineffective unless you have the SUPER privilege. --force-if-open Force if binlog was not closed properly. Defaults to on; use --skip-force-if-open to disable. --force-read, -f With this option, if mysqlbinlog reads a binary log event that it does not recognize, it prints a warning, ignores the event, and continues. Without this option, mysqlbinlog stops if it reads such an event. --hexdump, -H Display a hex dump of the log in comments, as described in the section called MYSQLBINLOG HEX DUMP FORMAT. The hex output can be helpful for replication debugging. --host=host_name, -h host_name Get the binary log from the MariaDB server on the given host. --local-load=path, -l path Prepare local temporary files for LOAD DATA INFILE in the specified directory. --no-defaults Don't read default options from any option file. --offset=N, -o N Skip the first N entries in the log. --open-files-limit=NUM Sets the open_files_limit variable, which is used to reserve file descriptors for mysqlbinlog. --password[=password], -p[password] The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, mysqlbinlog prompts for one. Specifying a password on the command line should be considered insecure. You can use an option file to avoid giving the password on the command line. --plugin-dir=dir_name Directory for client-side plugins. --print-defaults Print the program argument list from all option files and exit. --port=port_num, -P port_num The TCP/IP port number to use for connecting to a remote server, or 0 for default to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services, built-in default (3306). Forces --protocol=tcp when specified on the command line without other connection properties. --protocol={TCP|SOCKET|PIPE|MEMORY} The connection protocol to use for connecting to the server. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want. --raw Requires -R. Output raw binlog data instead of SQL statements. Output files named after server logs. --read-from-remote-server, -R Read the binary log from a MariaDB server rather than reading a local log file. Any connection parameter options are ignored unless this option is given as well. These options are --host, --password, --port, --protocol, --socket, and --user. This option requires that the remote server be running. It works only for binary log files on the remote server, not relay log files. --result-file=name, -r name Direct output to the given file. With --raw this is a prefix for the file names. --rewrite-db=name, -r name Updates to a database with a different name than the original. Example: rewrite-db='from->to'. For events that are binlogged as statements, rewriting the database constitutes changing a statement's default database from db1 to db2. There is no statement analysis or rewrite of any kind, that is, if one specifies "db1.tbl" in the statement explicitly, that occurrence won't be changed to "db2.tbl". Row-based events are rewritten correctly to use the new database name. Filtering (e.g. with --database=name) happens after the database rewrites have been performed. If you use this option on the command line and ">" has a special meaning to your command interpreter, quote the value (e.g. --rewrite- db="oldname->newname". --server-id=id Display only those events created by the server having the given server ID. --set-charset=charset_name Add a SET NAMES charset_name statement to the output to specify the character set to be used for processing log files. --short-form, -s Display only the statements contained in the log, no extra info and no row-based events. This is for testing only, and should not be used in production systems. If you want to suppress base64-output, consider using --base64-output=never instead. --socket=path, -S path For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use. Forces --protocol=socket when specified on the command line without other connection properties; on Windows, forces --protocol=pipe. --start-datetime=datetime Start reading the binary log at the first event having a timestamp equal to or later than the datetime argument. The datetime value is relative to the local time zone on the machine where you run mysqlbinlog. The value should be in a format accepted for the DATETIME or TIMESTAMP data types. For example: shell> mysqlbinlog --start-datetime="2014-12-25 11:25:56" binlog.000003 This option is useful for point-in-time recovery. --start-position=N, -j N Start reading the binary log at N. Type can either be a positive integer or a GTID list. When using a positive integer, the value only applies to the first binlog passed on the command line, and the first event that has a position equal to or greater than N is printed. In GTID mode, multiple GTIDs can be passed as a comma separated list, where each must have a unique domain id. The list represents the gtid binlog state that the client (another "replica" server) is aware of. Therefore, each GTID is exclusive; only events after a given sequence number will be printed to allow users to receive events after their current state. This option is useful for point-in-time recovery. --gtid-strict-mode Process binlog according to gtid-strict-mode specification. The start, stop positions are verified to satisfy start < stop comparison condition. Sequence numbers of any gtid domain must comprise monotically growing sequence. --stop-datetime=datetime Stop reading the binary log at the first event having a timestamp equal to or later than the datetime argument. This option is useful for point-in-time recovery. See the description of the --start-datetime option for information about the datetime value. This option is useful for point-in-time recovery. --stop-never Wait for more data from the server instead of stopping at the end of the last log. Implies --to-last-log. --stop-never-slave-server-id The slave server_id used for --read-from-remote-server --stop-never. --stop-position=N Stop reading the binary log at the first event having a position equal to or greater than N. Type can either be a positive integer or a GTID list. When using a positive integer, the value only applies to the last log file named on the command line. When in GTID mode, multiple GTIDs can be passed as a comma separated list, where each must have a unique domain id. Each GTID is inclusive; only events up to the given sequence numbers are printed. This option is useful for point-in-time recovery. --table, -T List entries for just this table (local log only). --to-last-log, -t Do not stop at the end of the requested binary log from a MariaDB server, but rather continue printing until the end of the last binary log. If you send the output to the same MariaDB server, this may lead to an endless loop, so this option requires --read-from-remote-server. --user=user_name, -u user_name The MariaDB username to use when connecting to a remote server. --verbose, -v Reconstruct row events and display them as commented SQL statements. If this option is given twice, the output includes comments to indicate column data types and some metadata. If this option is given three times, the output includes diagnostic warnings about event integrity before program exit. For examples that show the effect of --base64-output and --verbose on row event output, see the section called MYSQLBINLOG ROW EVENT DISPLAY. --version, -V Display version information and exit. You can also set the following variable by using --var_name=value syntax: open_files_limit Specify the number of open file descriptors to reserve. You can pipe the output of mysqlbinlog into the mysql client to execute the events contained in the binary log. This technique is used to recover from a crash when you have an old backup. For example: shell> mysqlbinlog binlog.000001 | mysql -u root -p Or: shell> mysqlbinlog binlog.[0-9]* | mysql -u root -p You can also redirect the output of mysqlbinlog to a text file instead, if you need to modify the statement log first (for example, to remove statements that you do not want to execute for some reason). After editing the file, execute the statements that it contains by using it as input to the mysql program: shell> mysqlbinlog binlog.000001 > tmpfile shell> ... edit tmpfile ... shell> mysql -u root -p < tmpfile When mysqlbinlog is invoked with the --start-position option, it displays only those events with an offset in the binary log greater than or equal to a given position (the given position must match the start of one event). It also has options to stop and start when it sees an event with a given date and time. This enables you to perform point-in-time recovery using the --stop-datetime option (to be able to say, for example, roll forward my databases to how they were today at 10:30 a.m.). If you have more than one binary log to execute on the MariaDB server, the safe method is to process them all using a single connection to the server. Here is an example that demonstrates what may be unsafe: shell> mysqlbinlog binlog.000001 | mysql -u root -p # DANGER!! shell> mysqlbinlog binlog.000002 | mysql -u root -p # DANGER!! Processing binary logs this way using different connections to the server causes problems if the first log file contains a CREATE TEMPORARY TABLE statement and the second log contains a statement that uses the temporary table. When the first mysql process terminates, the server drops the temporary table. When the second mysql process attempts to use the table, the server reports unknown table. To avoid problems like this, use a single mysql process to execute the contents of all binary logs that you want to process. Here is one way to do so: shell> mysqlbinlog binlog.000001 binlog.000002 | mysql -u root -p Another approach is to write all the logs to a single file and then process the file: shell> mysqlbinlog binlog.000001 > /tmp/statements.sql shell> mysqlbinlog binlog.000002 >> /tmp/statements.sql shell> mysql -u root -p -e "source /tmp/statements.sql" mysqlbinlog can produce output that reproduces a LOAD DATA INFILE operation without the original data file. mysqlbinlog copies the data to a temporary file and writes a LOAD DATA LOCAL INFILE statement that refers to the file. The default location of the directory where these files are written is system-specific. To specify a directory explicitly, use the --local-load option. Because mysqlbinlog converts LOAD DATA INFILE statements to LOAD DATA LOCAL INFILE statements (that is, it adds LOCAL), both the client and the server that you use to process the statements must be configured with the LOCAL capability enabled. Warning The temporary files created for LOAD DATA LOCAL statements are not automatically deleted because they are needed until you actually execute those statements. You should delete the temporary files yourself after you no longer need the statement log. The files can be found in the temporary file directory and have names like original_file_name-#-#. MYSQLBINLOG HEX DUMP FORMAT top The --hexdump option causes mysqlbinlog to produce a hex dump of the binary log contents: shell> mysqlbinlog --hexdump master-bin.000001 The hex output consists of comment lines beginning with #, so the output might look like this for the preceding command: /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; # at 4 #051024 17:24:13 server id 1 end_log_pos 98 # Position Timestamp Type Master ID Size Master Pos Flags # 00000004 9d fc 5c 43 0f 01 00 00 00 5e 00 00 00 62 00 00 00 00 00 # 00000017 04 00 35 2e 30 2e 31 35 2d 64 65 62 75 67 2d 6c |..5.0.15.debug.l| # 00000027 6f 67 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |og..............| # 00000037 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| # 00000047 00 00 00 00 9d fc 5c 43 13 38 0d 00 08 00 12 00 |.......C.8......| # 00000057 04 04 04 04 12 00 00 4b 00 04 1a |.......K...| # Start: binlog v 4, server v 5.0.15-debug-log created 051024 17:24:13 # at startup ROLLBACK; Hex dump output currently contains the elements in the following list. This format is subject to change. (For more information about binary log format, see http://forge.mysql.com/wiki/MySQL_Internals_Binary_Log .) Position: The byte position within the log file. Timestamp: The event timestamp. In the example shown, 9d fc 5c 43 is the representation of 051024 17:24:13 in hexadecimal. Type: The event type code. In the example shown, 0f indicates a FORMAT_DESCRIPTION_EVENT. The following table lists the possible type codes. Type Name Meaning 00 UNKNOWN_EVENT This event should never be present in the log. 01 START_EVENT_V3 This indicates the start of a log file written by MySQL 4 or earlier. 02 QUERY_EVENT The most common type of events. These contain statements executed on the master. 03 STOP_EVENT Indicates that master has stopped. 04 ROTATE_EVENT Written when the master switches to a new log file. 05 INTVAR_EVENT Used for AUTO_INCREMENT values or when the LAST_INSERT_ID() function is used in the statement. 06 LOAD_EVENT Used for LOAD DATA INFILE in MySQL 3.23. 07 SLAVE_EVENT Reserved for future use. 08 CREATE_FILE_EVENT Used for LOAD DATA INFILE statements. This indicates the start of execution of such a statement. A temporary file is created on the slave. Used in MySQL 4 only. 09 APPEND_BLOCK_EVENT Contains data for use in a LOAD DATA INFILE statement. The data is stored in the temporary file on the slave. 0a EXEC_LOAD_EVENT Used for LOAD DATA INFILE statements. The contents of the temporary file is stored in the table on the slave. Used in MySQL 4 only. 0b DELETE_FILE_EVENT Rollback of a LOAD DATA INFILE statement. The temporary file should be deleted on the slave. 0c NEW_LOAD_EVENT Used for LOAD DATA INFILE in MySQL 4 and earlier. 0d RAND_EVENT Used to send information about random values if the RAND() function is used in the statement. 0e USER_VAR_EVENT Used to replicate user variables. 0f FORMAT_DESCRIPTION_EVENT This indicates the start of a log file written by MySQL 5 or later. 10 XID_EVENT Event indicating commit of an XA transaction. 11 BEGIN_LOAD_QUERY_EVENT Used for LOAD DATA INFILE statements in MySQL 5 and later. 12 EXECUTE_LOAD_QUERY_EVENT Used for LOAD DATA INFILE statements in MySQL 5 and later. 13 TABLE_MAP_EVENT Information about a table definition. Used in MySQL 5.1.5 and later. 14 PRE_GA_WRITE_ROWS_EVENT Row data for a single table that should be created. Used in MySQL 5.1.5 to 5.1.17. 15 PRE_GA_UPDATE_ROWS_EVENT Row data for a single table that needs to be updated. Used in MySQL 5.1.5 to 5.1.17. 16 PRE_GA_DELETE_ROWS_EVENT Row data for a single table that should be deleted. Used in MySQL 5.1.5 to 5.1.17. 17 WRITE_ROWS_EVENT Row data for a single table that should be created. Used in MySQL 5.1.18 and later. 18 UPDATE_ROWS_EVENT Row data for a single table that needs to be updated. Used in MySQL 5.1.18 and later. 19 DELETE_ROWS_EVENT Row data for a single table that should be deleted. Used in MySQL 5.1.18 and later. 1a INCIDENT_EVENT Something out of the ordinary happened. Added in MySQL 5.1.18. Master ID: The server ID of the master that created the event. Size: The size in bytes of the event. Master Pos: The position of the next event in the original master log file. Flags: 16 flags. Currently, the following flags are used. The others are reserved for future use. Flag Name Meaning 01 LOG_EVENT_BINLOG_IN_USE_F Log file correctly closed. (Used only in FORMAT_DESCRIPTION_EVENT.) If this flag is set (if the flags are, for example, 01 00) in a FORMAT_DESCRIPTION_EVENT, the log file has not been properly closed. Most probably this is because of a master crash (for example, due to power failure). 02 Reserved for future use. 04 LOG_EVENT_THREAD_SPECIFIC_F Set if the event is dependent on the connection it was executed in (for example, 04 00), for example, if the event uses temporary tables. 08 LOG_EVENT_SUPPRESS_USE_F Set in some circumstances when the event is not dependent on the default database. MYSQLBINLOG ROW EVENT DISPLAY top The following examples illustrate how mysqlbinlog displays row events that specify data modifications. These correspond to events with the WRITE_ROWS_EVENT, UPDATE_ROWS_EVENT, and DELETE_ROWS_EVENT type codes. The --base64-output=DECODE-ROWS and --verbose options may be used to affect row event output. Suppose that the server is using row-based binary logging and that you execute the following sequence of statements: CREATE TABLE t ( id INT NOT NULL, name VARCHAR(20) NOT NULL, date DATE NULL ) ENGINE = InnoDB; START TRANSACTION; INSERT INTO t VALUES(1, apple, NULL); UPDATE t SET name = pear, date = 2009-01-01 WHERE id = 1; DELETE FROM t WHERE id = 1; COMMIT; By default, mysqlbinlog displays row events encoded as base-64 strings using BINLOG statements. Omitting extraneous lines, the output for the row events produced by the preceding statement sequence looks like this: shell> mysqlbinlog log_file ... # at 218 #080828 15:03:08 server id 1 end_log_pos 258 Write_rows: table id 17 flags: STMT_END_F BINLOG fAS3SBMBAAAALAAAANoAAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ= fAS3SBcBAAAAKAAAAAIBAAAQABEAAAAAAAEAA//8AQAAAAVhcHBsZQ== /*!*/; ... # at 302 #080828 15:03:08 server id 1 end_log_pos 356 Update_rows: table id 17 flags: STMT_END_F BINLOG fAS3SBMBAAAALAAAAC4BAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ= fAS3SBgBAAAANgAAAGQBAAAQABEAAAAAAAEAA////AEAAAAFYXBwbGX4AQAAAARwZWFyIbIP /*!*/; ... # at 400 #080828 15:03:08 server id 1 end_log_pos 442 Delete_rows: table id 17 flags: STMT_END_F BINLOG fAS3SBMBAAAALAAAAJABAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ= fAS3SBkBAAAAKgAAALoBAAAQABEAAAAAAAEAA//4AQAAAARwZWFyIbIP /*!*/; To see the row events as comments in the form of pseudo-SQL statements, run mysqlbinlog with the --verbose or -v option. The output will contain lines beginning with ###: shell> mysqlbinlog -v log_file ... # at 218 #080828 15:03:08 server id 1 end_log_pos 258 Write_rows: table id 17 flags: STMT_END_F BINLOG fAS3SBMBAAAALAAAANoAAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ= fAS3SBcBAAAAKAAAAAIBAAAQABEAAAAAAAEAA//8AQAAAAVhcHBsZQ== /*!*/; ### INSERT INTO test.t ### SET ### @1=1 ### @2=apple ### @3=NULL ... # at 302 #080828 15:03:08 server id 1 end_log_pos 356 Update_rows: table id 17 flags: STMT_END_F BINLOG fAS3SBMBAAAALAAAAC4BAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ= fAS3SBgBAAAANgAAAGQBAAAQABEAAAAAAAEAA////AEAAAAFYXBwbGX4AQAAAARwZWFyIbIP /*!*/; ### UPDATE test.t ### WHERE ### @1=1 ### @2=apple ### @3=NULL ### SET ### @1=1 ### @2=pear ### @3=2009:01:01 ... # at 400 #080828 15:03:08 server id 1 end_log_pos 442 Delete_rows: table id 17 flags: STMT_END_F BINLOG fAS3SBMBAAAALAAAAJABAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ= fAS3SBkBAAAAKgAAALoBAAAQABEAAAAAAAEAA//4AQAAAARwZWFyIbIP /*!*/; ### DELETE FROM test.t ### WHERE ### @1=1 ### @2=pear ### @3=2009:01:01 Specify --verbose or -v twice to also display data types and some metadata for each column. The output will contain an additional comment following each column change: shell> mysqlbinlog -vv log_file ... # at 218 #080828 15:03:08 server id 1 end_log_pos 258 Write_rows: table id 17 flags: STMT_END_F BINLOG fAS3SBMBAAAALAAAANoAAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ= fAS3SBcBAAAAKAAAAAIBAAAQABEAAAAAAAEAA//8AQAAAAVhcHBsZQ== /*!*/; ### INSERT INTO test.t ### SET ### @1=1 /* INT meta=0 nullable=0 is_null=0 */ ### @2=apple /* VARSTRING(20) meta=20 nullable=0 is_null=0 */ ### @3=NULL /* VARSTRING(20) meta=0 nullable=1 is_null=1 */ ... # at 302 #080828 15:03:08 server id 1 end_log_pos 356 Update_rows: table id 17 flags: STMT_END_F BINLOG fAS3SBMBAAAALAAAAC4BAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ= fAS3SBgBAAAANgAAAGQBAAAQABEAAAAAAAEAA////AEAAAAFYXBwbGX4AQAAAARwZWFyIbIP /*!*/; ### UPDATE test.t ### WHERE ### @1=1 /* INT meta=0 nullable=0 is_null=0 */ ### @2=apple /* VARSTRING(20) meta=20 nullable=0 is_null=0 */ ### @3=NULL /* VARSTRING(20) meta=0 nullable=1 is_null=1 */ ### SET ### @1=1 /* INT meta=0 nullable=0 is_null=0 */ ### @2=pear /* VARSTRING(20) meta=20 nullable=0 is_null=0 */ ### @3=2009:01:01 /* DATE meta=0 nullable=1 is_null=0 */ ... # at 400 #080828 15:03:08 server id 1 end_log_pos 442 Delete_rows: table id 17 flags: STMT_END_F BINLOG fAS3SBMBAAAALAAAAJABAAAAABEAAAAAAAAABHRlc3QAAXQAAwMPCgIUAAQ= fAS3SBkBAAAAKgAAALoBAAAQABEAAAAAAAEAA//4AQAAAARwZWFyIbIP /*!*/; ### DELETE FROM test.t ### WHERE ### @1=1 /* INT meta=0 nullable=0 is_null=0 */ ### @2=pear /* VARSTRING(20) meta=20 nullable=0 is_null=0 */ ### @3=2009:01:01 /* DATE meta=0 nullable=1 is_null=0 */ You can tell mysqlbinlog to suppress the BINLOG statements for row events by using the --base64-output=DECODE-ROWS option. This is similar to --base64-output=NEVER but does not exit with an error if a row event is found. The combination of --base64-output=DECODE-ROWS and --verbose provides a convenient way to see row events only as SQL statements: shell> mysqlbinlog -v --base64-output=DECODE-ROWS log_file ... # at 218 #080828 15:03:08 server id 1 end_log_pos 258 Write_rows: table id 17 flags: STMT_END_F ### INSERT INTO test.t ### SET ### @1=1 ### @2=apple ### @3=NULL ... # at 302 #080828 15:03:08 server id 1 end_log_pos 356 Update_rows: table id 17 flags: STMT_END_F ### UPDATE test.t ### WHERE ### @1=1 ### @2=apple ### @3=NULL ### SET ### @1=1 ### @2=pear ### @3=2009:01:01 ... # at 400 #080828 15:03:08 server id 1 end_log_pos 442 Delete_rows: table id 17 flags: STMT_END_F ### DELETE FROM test.t ### WHERE ### @1=1 ### @2=pear ### @3=2009:01:01 Note You should not suppress BINLOG statements if you intend to re-execute mysqlbinlog output. The SQL statements produced by --verbose for row events are much more readable than the corresponding BINLOG statements. However, they do not correspond exactly to the original SQL statements that generated the events. The following limitations apply: The original column names are lost and replaced by @N, where N is a column number. Character set information is not available in the binary log, which affects string column display: There is no distinction made between corresponding binary and nonbinary string types (BINARY and CHAR, VARBINARY and VARCHAR, BLOB and TEXT). The output uses a data type of STRING for fixed-length strings and VARSTRING for variable-length strings. For multi-byte character sets, the maximum number of bytes per character is not present in the binary log, so the length for string types is displayed in bytes rather than in characters. For example, STRING(4) will be used as the data type for values from either of these column types: CHAR(4) CHARACTER SET latin1 CHAR(2) CHARACTER SET ucs2 Due to the storage format for events of type UPDATE_ROWS_EVENT, UPDATE statements are displayed with the WHERE clause preceding the SET clause. Proper interpretation of row events requires the information from the format description event at the beginning of the binary log. Because mysqlbinlog does not know in advance whether the rest of the log contains row events, by default it displays the format description event using a BINLOG statement in the initial part of the output. If the binary log is known not to contain any events requiring a BINLOG statement (that is, no row events), the --base64-output=NEVER option can be used to prevent this header from being written. COPYRIGHT top Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2021 MariaDB Foundation This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see http://www.gnu.org/licenses/. NOTES top 1. Bug#42941 http://bugs.mysql.com/bug.php?id=42941 SEE ALSO top For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ AUTHOR top MariaDB Foundation (http://www.mariadb.org/). COLOPHON top This page is part of the MariaDB (MariaDB database server) project. Information about the project can be found at http://mariadb.org/. If you have a bug report for this manual page, see https://mariadb.com/kb/en/mariadb/reporting-bugs/. This page was obtained from the project's upstream Git repository https://github.com/MariaDB/server on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-05-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] MariaDB 10.8 14 April 2021 MARIADB-BINLOG(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. | # mysqlbinlog\n\n> Utility for processing MySQL binary log files.\n> More information: <https://dev.mysql.com/doc/refman/8.0/en/mysqlbinlog.html>.\n\n- Show events from a specific binary log file:\n\n`mysqlbinlog {{path/to/binlog}}`\n\n- Show entries from a binary log for a specific database:\n\n`mysqlbinlog --database {{database_name}} {{path/to/binlog}}`\n\n- Show events from a binary log between specific dates:\n\n`mysqlbinlog --start-datetime='{{2022-01-01 01:00:00}}' --stop-datetime='{{2022-02-01 01:00:00}}' {{path/to/binlog}}`\n\n- Show events from a binary log between specific positions:\n\n`mysqlbinlog --start-position={{100}} --stop-position={{200}} {{path/to/binlog}}`\n\n- Show binary log from a MySQL server on the given host:\n\n`mysqlbinlog --host={{hostname}} {{path/to/binlog}}`\n |
mysqlcheck | mysqlcheck(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training mysqlcheck(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COPYRIGHT | SEE ALSO | AUTHOR | COLOPHON MARIADB-CHECK(1) MariaDB Database System MARIADB-CHECK(1) NAME top mariadb-check - a table maintenance program (mysqlcheck is now a symlink to mariadb-check) SYNOPSIS top mysqlcheck [options] [db_name [tbl_name ...]] DESCRIPTION top The mysqlcheck client performs table maintenance: It checks, repairs, optimizes, or analyzes tables. Each table is locked and therefore unavailable to other sessions while it is being processed, although for check operations, the table is locked with a READ lock only. Table maintenance operations can be time-consuming, particularly for large tables. If you use the --databases or --all-databases option to process all tables in one or more databases, an invocation of mysqlcheck might take a long time. (This is also true for mysql_upgrade because that program invokes mysqlcheck to check all tables and repair them if necessary.) mysqlcheck is similar in function to myisamchk, but works differently. The main operational difference is that mysqlcheck must be used when the mysqld server is running, whereas myisamchk should be used when it is not. The benefit of using mysqlcheck is that you do not have to stop the server to perform table maintenance. mysqlcheck uses the SQL statements CHECK TABLE, REPAIR TABLE, ANALYZE TABLE, and OPTIMIZE TABLE in a convenient way for the user. It determines which statements to use for the operation you want to perform, and then sends the statements to the server to be executed. The MyISAM storage engine supports all four maintenance operations, so mysqlcheck can be used to perform any of them on MyISAM tables. Other storage engines do not necessarily support all operations. In such cases, an error message is displayed. For example, if test.t is a MEMORY table, an attempt to check it produces this result: shell> mysqlcheck test t test.t note : The storage engine for the table doesnt support check If mysqlcheck is unable to repair a table, see the MariaDB Knowledge Base for manual table repair strategies. This will be the case, for example, for InnoDB tables, which can be checked with CHECK TABLE, but not repaired with REPAIR TABLE. The use of mysqlcheck with partitioned tables is not supported. Caution It is best to make a backup of a table before performing a table repair operation; under some circumstances the operation might cause data loss. Possible causes include but are not limited to file system errors. There are three general ways to invoke mysqlcheck: shell> mysqlcheck [options] db_name [tbl_name ...] shell> mysqlcheck [options] --databases db_name ... shell> mysqlcheck [options] --all-databases If you do not name any tables following db_name or if you use the --databases or --all-databases option, entire databases are checked. mysqlcheck has a special feature compared to other client programs. The default behavior of checking tables (--check) can be changed by renaming the binary. If you want to have a tool that repairs tables by default, you should just make a copy of mysqlcheck named mysqlrepair, or make a symbolic link to mysqlcheck named mysqlrepair. If you invoke mysqlrepair, it repairs tables. The following names can be used to change mysqlcheck default behavior. mysqlrepair The default option is --repair mysqlanalyze The default option is --analyze mysqloptimize The default option is --optimize mysqlcheck supports the following options, which can be specified on the command line or in the [mysqlcheck] and [client] option file groups. The -c, -r, -a and -o options are exclusive to each other. --help, -? Display a help message and exit. --all-databases, -A Check all tables in all databases. This is the same as using the --databases option and naming all the databases on the command line. --all-in-1, -1 Instead of issuing a statement for each table, execute a single statement for each database that names all the tables from that database to be processed. --analyze, -a Analyze the tables. --auto-repair If a checked table is corrupted, automatically fix it. Any necessary repairs are done after all tables have been checked. --character-sets-dir=path The directory where character sets are installed. --check, -c Check the tables for errors. This is the default operation. --check-only-changed, -C Check only tables that have changed since the last check or that have not been closed properly. --check-upgrade, -g Invoke CHECK TABLE with the FOR UPGRADE option to check tables for incompatibilities with the current version of the server. This option automatically enables the --fix-db-names and --fix-table-names options. --compress Compress all information sent between the client and the server if both support compression. --databases, -B Process all tables in the named databases. Normally, mysqlcheck treats the first name argument on the command line as a database name and following names as table names. With this option, it treats all name arguments as database names. --debug[=debug_options], -# [debug_options] Write a debugging log. A typical debug_options string is d:t:o,file_name. The default is d:t:o. --debug-check Print some debugging information when the program exits. --debug-info Print debugging information and memory and CPU usage statistics when the program exits. --default-auth=name Default authentication client-side plugin to use. --default-character-set=charset_name Use charset_name as the default character set. --defaults-extra-file=filename Set filename as the file to read default options from after the global defaults files has been read. Must be given as first option. --defaults-file=filename Set filename as the file to read default options from, override global defaults files. Must be given as first option. --extended, -e If you are using this option to check tables, it ensures that they are 100% consistent but takes a long time. If you are using this option to repair tables, it will force using the old, slow, repair with keycache method, instead of the much faster repair by sorting. --fast, -F Check only tables that have not been closed properly. --fix-db-names Convert database names to the format used since MySQL 5.1. Only database names that contain special characters are affected. --fix-table-names Convert table names (including views) to the format used since MySQL 5.1. Only table names that contain special characters are affected. --flush, Flush each table after check. This is useful if you don't want to have the checked tables take up space in the caches after the check. --force, -f Continue even if an SQL error occurs. --host=host_name, -h host_name Connect to the MariaDB server on the given host. --medium-check, -m Do a check that is faster than an --extended operation. This finds only 99.99% of all errors, which should be good enough in most cases. --no-defaults Do not read default options from any option file. This must be given as the first argument. --optimize, -o Optimize the tables. --password[=password], -p[password] The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, mysqlcheck prompts for one. Specifying a password on the command line should be considered insecure. You can use an option file to avoid giving the password on the command line. --persistent, -Z Used with ANALYZE TABLE to append the option PERSISENT FOR ALL. --pipe, -W On Windows, connect to the server via a named pipe. This option applies only if the server supports named-pipe connections. --plugin-dir=name Directory for client-side plugins. --port=port_num, -P port_num The TCP/IP port number to use for the connection. Forces --protocol=tcp when specified on the command line without other connection properties. --print-defaults Print the program argument list and exit. This must be given as the first argument. --process-tables Perform the requested operation on tables. Defaults to on; use --skip-process-tables to disable. --process-views=val Perform the requested operation (only CHECK VIEW or REPAIR VIEW). Possible values are NO, YES (correct the checksum, if necessary, add the mariadb-version field), UPGRADE_FROM_MYSQL (same as YES and toggle the algorithm MERGE<->TEMPTABLE. --protocol={TCP|SOCKET|PIPE|MEMORY} The connection protocol to use for connecting to the server. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want. --quick, -q If you are using this option to check tables, it prevents the check from scanning the rows to check for incorrect links. This is the fastest check method. If you are using this option to repair tables, it tries to repair only the index tree. This is the fastest repair method. --repair, -r Perform a repair that can fix almost anything except unique keys that are not unique. --silent, -s Silent mode. Print only error messages. --skip-database=db_name Don't process the database (case-sensitive) specified as argument. --socket=path, -S path For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use. Forces --protocol=socket when specified on the command line without other connection properties; on Windows, forces --protocol=pipe. --ssl Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl. --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies --ssl). --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl). --ssl-cert=name X509 cert in PEM format (check OpenSSL docs, implies --ssl). --ssl-cipher=name SSL cipher to use (check OpenSSL docs, implies --ssl). --ssl-key=name X509 key in PEM format (check OpenSSL docs, implies --ssl). --ssl-crl=name Certificate revocation list (check OpenSSL docs, implies --ssl). --ssl-crlpath=name Certificate revocation list path (check OpenSSL docs, implies --ssl). --ssl-verify-server-cert Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default. --tables Override the --databases or -B option. All name arguments following the option are regarded as table names. --use-frm For repair operations on MyISAM tables, get the table structure from the .frm file so that the table can be repaired even if the .MYI header is corrupted. --user=user_name, -u user_name The MariaDB user name to use when connecting to the server. --verbose, -v Verbose mode. Print information about the various stages of program operation. Using one --verbose option will give you more information about what mysqlcheck is doing. Using two --verbose options will also give you connection information. Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during the check phase. --version, -V Display version information and exit. --write-binlog This option is enabled by default, so that ANALYZE TABLE, OPTIMIZE TABLE, and REPAIR TABLE statements generated by mysqlcheck are written to the binary log. Use --skip-write-binlog to cause NO_WRITE_TO_BINLOG to be added to the statements so that they are not logged. Use the --skip-write-binlog when these statements should not be sent to replication slaves or run when using the binary logs for recovery from backup. COPYRIGHT top Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2020 MariaDB Foundation This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see http://www.gnu.org/licenses/. SEE ALSO top For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ AUTHOR top MariaDB Foundation (http://www.mariadb.org/). COLOPHON top This page is part of the MariaDB (MariaDB database server) project. Information about the project can be found at http://mariadb.org/. If you have a bug report for this manual page, see https://mariadb.com/kb/en/mariadb/reporting-bugs/. This page was obtained from the project's upstream Git repository https://github.com/MariaDB/server on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-05-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] MariaDB 10.8 15 May 2020 MARIADB-CHECK(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. | # mysqlcheck\n\n> Check and repair MySQL tables.\n> More information: <https://dev.mysql.com/doc/refman/8.0/en/mysqlcheck.html>.\n\n- Check a table:\n\n`mysqlcheck --check {{table}}`\n\n- Check a table and provide credentials to access it:\n\n`mysqlcheck --check {{table}} --user {{username}} --password {{password}}`\n\n- Repair a table:\n\n`mysqlcheck --repair {{table}}`\n\n- Optimize a table:\n\n`mysqlcheck --optimize {{table}}`\n |
mysqld | mysqld(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training mysqld(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COPYRIGHT | SEE ALSO | AUTHOR | COLOPHON MARIADBD(8) MariaDB Database System MARIADBD(8) NAME top mariadbd - the MariaDB server (mysqld is now a symlink to mariadbd) SYNOPSIS top mysqld [options] DESCRIPTION top mysqld, also known as MariaDB Server, is the main program that does most of the work in a MariaDB installation. MariaDB Server manages access to the MariaDB data directory that contains databases and tables. The data directory is also the default location for other information such as log files and status files. When MariaDB server starts, it listens for network connections from client programs and manages access to databases on behalf of those clients. The mysqld program has many options that can be specified at startup. For a complete list of options, run this command: shell> mysqld --verbose --help MariaDB Server also has a set of system variables that affect its operation as it runs. System variables can be set at server startup, and many of them can be changed at runtime to effect dynamic server reconfiguration. MariaDB Server also has a set of status variables that provide information about its operation. You can monitor these status variables to access runtime performance characteristics. For a full description of MariaDB Server command options, system variables, and status variables, see the MariaDB Knowledge Base. COPYRIGHT top Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2020 MariaDB Foundation This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see http://www.gnu.org/licenses/. SEE ALSO top For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ AUTHOR top MariaDB Foundation (http://www.mariadb.org/). COLOPHON top This page is part of the MariaDB (MariaDB database server) project. Information about the project can be found at http://mariadb.org/. If you have a bug report for this manual page, see https://mariadb.com/kb/en/mariadb/reporting-bugs/. This page was obtained from the project's upstream Git repository https://github.com/MariaDB/server on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-05-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] MariaDB 10.8 15 May 2020 MARIADBD(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. | # mysqld\n\n> Start the MySQL database server.\n> More information: <https://dev.mysql.com/doc/refman/en/mysqld.html>.\n\n- Start the MySQL database server:\n\n`mysqld`\n\n- Start the server, printing error messages to the console:\n\n`mysqld --console`\n\n- Start the server, saving logging output to a custom log file:\n\n`mysqld --log={{path/to/file.log}}`\n\n- Print the default arguments and their values and exit:\n\n`mysqld --print-defaults`\n\n- Start the server, reading arguments and values from a file:\n\n`mysqld --defaults-file={{path/to/file}}`\n\n- Start the server and listen on a custom port:\n\n`mysqld --port={{port}}`\n\n- Display help:\n\n`mysqld --verbose --help`\n |
mysqldump | mysqldump(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training mysqldump(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COPYRIGHT | SEE ALSO | AUTHOR | COLOPHON MARIADB-DUMP(1) MariaDB Database System MARIADB-DUMP(1) NAME top mariadb-dump - a database backup program (mysqldump is now a symlink to mariadb-dump) SYNOPSIS top mysqldump [options] [db_name [tbl_name ...]] DESCRIPTION top The mysqldump client is a backup program originally written by Igor Romanenko. It can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MariaDB server). The dump typically contains SQL statements to create the table, populate it, or both. However, mysqldump can also be used to generate files in CSV, other delimited text, or XML format. If you are doing a backup on the server and your tables all are MyISAM tables, consider using the mysqlhotcopy instead because it can accomplish faster backups and faster restores. See mysqlhotcopy(1). There are four general ways to invoke mysqldump: shell> mysqldump [options] db_name [tbl_name ...] shell> mysqldump [options] --databases db_name ... shell> mysqldump [options] --all-databases shell> mysqldump [options] --system={options} If you do not name any tables following db_name or if you use the --databases or --all-databases option, entire databases are dumped. mysqldump does not dump the INFORMATION_SCHEMA or performance_schema databases by default. To dump these, name them explicitly on the command line, although you must also use the --skip-lock-tables option. To see a list of the options your version of mysqldump supports, execute mysqldump --help. Some mysqldump options are shorthand for groups of other options: Use of --opt is the same as specifying --add-drop-table, --add-locks, --create-options, --disable-keys, --extended-insert, --lock-tables, --quick, and --set-charset. All of the options that --opt stands for also are on by default because --opt is on by default. Use of --compact is the same as specifying --skip-add-drop-table, --skip-add-locks, --skip-comments, --skip-disable-keys, and --skip-set-charset options. To reverse the effect of a group option, uses its --skip-xxx form (--skip-opt or --skip-compact). It is also possible to select only part of the effect of a group option by following it with options that enable or disable specific features. Here are some examples: To select the effect of --opt except for some features, use the --skip option for each feature. To disable extended inserts and memory buffering, use --opt --skip-extended-insert --skip-quick. (Actually, --skip-extended-insert --skip-quick is sufficient because --opt is on by default.) To reverse --opt for all features except index disabling and table locking, use --skip-opt --disable-keys --lock-tables. When you selectively enable or disable the effect of a group option, order is important because options are processed first to last. For example, --disable-keys --lock-tables --skip-opt would not have the intended effect; it is the same as --skip-opt by itself. mysqldump can retrieve and dump table contents row by row, or it can retrieve the entire content from a table and buffer it in memory before dumping it. Buffering in memory can be a problem if you are dumping large tables. To dump tables row by row, use the --quick option (or --opt, which enables --quick). The --opt option (and hence --quick) is enabled by default, so to enable memory buffering, use --skip-quick. If you are using a recent version of mysqldump to generate a dump to be reloaded into a very old MySQL server, you should not use the --opt or --extended-insert option. Use --skip-opt instead. mysqldump supports the following options, which can be specified on the command line or in the [mysqldump] and [client] option file groups. mysqldump also supports the options for processing option file. --help, -? Display a help message and exit. --add-drop-database Add a DROP DATABASE statement before each CREATE DATABASE statement. This option is typically used in conjunction with the --all-databases or --databases option because no CREATE DATABASE statements are written unless one of those options is specified. --add-drop-table Add a DROP TABLE statement before each CREATE TABLE statement. --add-drop-trigger Add a DROP TRIGGER statement before each CREATE TRIGGER statement. --add-locks Surround each table dump with LOCK TABLES and UNLOCK TABLES statements. This results in faster inserts when the dump file is reloaded. --all-databases, -A Dump all tables in all databases. This is the same as using the --databases option and naming all the databases on the command line. --all-tablespaces, -Y Adds to a table dump all SQL statements needed to create any tablespaces used by an NDBCLUSTER table. This information is not otherwise included in the output from mysqldump. This option is currently relevant only to MySQL Cluster tables. --allow-keywords Allow creation of column names that are keywords. This works by prefixing each column name with the table name. --apply-slave-statements Adds 'STOP SLAVE' prior to 'CHANGE MASTER' and 'START SLAVE' to bottom of dump. --character-sets-dir=path The directory where character sets are installed. --comments, -i Write additional information in the dump file such as program version, server version, and host. This option is enabled by default. To suppress this additional information, use --skip-comments. --compact Produce more compact output. This option enables the --skip-add-drop-table, --skip-add-locks, --skip-comments, --skip-disable-keys, and --skip-set-charset options. --compatible=name Produce output that is more compatible with other database systems or with older MySQL servers. The value of name can be ansi, mysql323, mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, or no_field_options. To use several values, separate them by commas. These values have the same meaning as the corresponding options for setting the server SQL mode. This option does not guarantee compatibility with other servers. It only enables those SQL mode values that are currently available for making dump output more compatible. For example, --compatible=oracle does not map data types to Oracle types or use Oracle comment syntax. --complete-insert, -c Use complete INSERT statements that include column names. --compress, -C Compress all information sent between the client and the server if both support compression. --copy-s3-tables By default S3 tables are ignored. With this option set, the result file will contain a CREATE statement for a similar Aria table, followed by the table data and ending with an ALTER TABLE xxx ENGINE=S3. --create-options, -a Include all MariaDB-specific table options in the CREATE TABLE statements. Use --skip-create-options to disable. --databases, -B Dump several databases. Normally, mysqldump treats the first name argument on the command line as a database name and following names as table names. With this option, it treats all name arguments as database names. CREATE DATABASE and USE statements are included in the output before each new database. --debug[=debug_options], -# [debug_options] Write a debugging log. A typical debug_options string is d:t:o,file_name. The default value is d:t:o,/tmp/mysqldump.trace. --debug-check Print some debugging information when the program exits. --debug-info Print debugging information and memory and CPU usage statistics when the program exits. --default-auth Default authentication client-side plugin to use. --default-character-set=charset_name Use charset_name as the default character set. If no character set is specified, mysqldump uses utf8. --defaults-extra-file=filename Set filename as the file to read default options from after the global defaults files has been read. Must be given as first option. --defaults-file=filename Set filename as the file to read default options from, override global defaults files. Must be given as first option. --defaults-group-suffix=str, Also read groups with a suffix of str. For example, since mysqldump normally reads the [client] and [mysqldump] groups, --defaults-group-suffix=x would cause it to also read the groups [mysqldump_x] and [client_x]. --delayed-insert Write INSERT DELAYED statements rather than INSERT statements. --delete-master-logs On a master replication server, delete the binary logs by sending a PURGE BINARY LOGS statement to the server after performing the dump operation. This option automatically enables --master-data. --disable-keys, -K For each table, surround the INSERT statements with /*!40000 ALTER TABLE tbl_name DISABLE KEYS */; and /*!40000 ALTER TABLE tbl_name ENABLE KEYS */; statements. This makes loading the dump file faster because the indexes are created after all rows are inserted. This option is effective only for nonunique indexes of MyISAM tables. --dump-date If the --comments option is given, mysqldump produces a comment at the end of the dump of the following form: -- Dump completed on DATE However, the date causes dump files taken at different times to appear to be different, even if the data are otherwise identical. --dump-date and --skip-dump-date control whether the date is added to the comment. The default is --dump-date (include the date in the comment). --skip-dump-date suppresses date printing --dump-slave[=value] Used for producing a dump file from a replication slave server that can be used to set up another slave server with the same master. Causes the binary log position and filename of the master to be appended to the dumped data output. Setting the value to 1 (the default) will print it as a CHANGE MASTER command in the dumped data output; if set to 2, that command will be prefixed with a comment symbol. This option will turn --lock-all-tables on, unless --single- transaction is specified too (in which case a global read lock is only taken a short time at the beginning of the dump - don't forget to read about --single-transaction below). In all cases any action on logs will happen at the exact moment of the dump. Option automatically turns --lock-tables off. Using this option causes mysqldump to stop the slave SQL thread before beginning the dump, and restart it again after completion. --events, -E Include Event Scheduler events for the dumped databases in the output. --extended-insert, -e Use multiple-row INSERT syntax that include several VALUES lists. This results in a smaller dump file and speeds up inserts when the file is reloaded. --fields-terminated-by=..., --fields-enclosed-by=..., --fields-optionally-enclosed-by=..., --fields-escaped-by=... These options are used with the --tab option and have the same meaning as the corresponding FIELDS clauses for LOAD DATA INFILE. --first-slave Removed in MariaDB 5.5. Use --lock-all-tables instead. --flashback, -B Support flashback mode. --flush-logs, -F Flush the MariaDB server log files before starting the dump. This option requires the RELOAD privilege. If you use this option in combination with the --all-databases option, the logs are flushed for each database dumped. The exception is when using --lock-all-tables or --master-data: In this case, the logs are flushed only once, corresponding to the moment that all tables are locked. If you want your dump and the log flush to happen at exactly the same moment, you should use --flush-logs together with either --lock-all-tables or --master-data. --flush-privileges Send a FLUSH PRIVILEGES statement to the server after dumping the mysql database. This option should be used any time the dump contains the mysql database and any other database that depends on the data in the mysql database for proper restoration. --force, -f Continue even if an SQL error occurs during a table dump. One use for this option is to cause mysqldump to continue executing even when it encounters a view that has become invalid because the definition refers to a table that has been dropped. Without --force, mysqldump exits with an error message. With --force, mysqldump prints the error message, but it also writes an SQL comment containing the view definition to the dump output and continues executing. --gtid Available from MariaDB 10.0.13, and is used together with --master-data and --dump-slave to more conveniently set up a new GTID slave. It causes those options to output SQL statements that configure the slave to use the global transaction ID to connect to the master instead of old-style filename/offset positions. The old-style positions are still included in comments when --gtid is used; likewise the GTID position is included in comments even if --gtid is not used. --hex-blob Dump binary columns using hexadecimal notation (for example, abc becomes 0x616263). The affected data types are BINARY, VARBINARY, the BLOB types, and BIT. --host=host_name, -h host_name Dump data from the MariaDB server on the given host. The default host is localhost. --ignore-table=db_name.tbl_name Do not dump the given table, which must be specified using both the database and table names. To ignore multiple tables, use this option multiple times. This option also can be used to ignore views. --include-master-host-port Add the MASTER_HOST and MASTER_PORT options for the CHANGE MASTER TO statement when using the --dump-slave option for a slave dump. --insert-ignore Write INSERT IGNORE statements rather than INSERT statements. --lines-terminated-by=... This option is used with the --tab option and has the same meaning as the corresponding LINES clause for LOAD DATA INFILE. --lock-all-tables, -x Lock all tables across all databases. This is achieved by acquiring a global read lock for the duration of the whole dump. This option automatically turns off --single-transaction and --lock-tables. --lock-tables, -l For each dumped database, lock all tables to be dumped before dumping them. The tables are locked with READ LOCAL to allow concurrent inserts in the case of MyISAM tables. For transactional tables such as InnoDB, --single-transaction is a much better option than --lock-tables because it does not need to lock the tables at all. Because --lock-tables locks tables for each database separately, this option does not guarantee that the tables in the dump file are logically consistent between databases. Tables in different databases may be dumped in completely different states. Use --skip-lock-tables to disable. --log-error=file_name Log warnings and errors by appending them to the named file. The default is to do no logging. --log-queries When restoring the dump, the server will, if logging is turned on, log the queries to the general and slow query log. Defaults to on; use --skip-log-queries to disable. --master-data[=value] Use this option to dump a master replication server to produce a dump file that can be used to set up another server as a slave of the master. It causes the dump output to include a CHANGE MASTER TO statement that indicates the binary log coordinates (file name and position) of the dumped server. These are the master server coordinates from which the slave should start replicating after you load the dump file into the slave. If the option value is 2, the CHANGE MASTER TO statement is written as an SQL comment, and thus is informative only; it has no effect when the dump file is reloaded. If the option value is 1, the statement is not written as a comment and takes effect when the dump file is reloaded. If no option value is specified, the default value is 1. This option requires the RELOAD privilege and the binary log must be enabled. The --master-data option automatically turns off --lock-tables. It also turns on --lock-all-tables, unless --single-transaction also is specified. In all cases, any action on logs happens at the exact moment of the dump. It is also possible to set up a slave by dumping an existing slave of the master. To do this, use the following procedure on the existing slave: 1. Stop the slaves SQL thread and get its current status: mysql> STOP SLAVE SQL_THREAD; mysql> SHOW SLAVE STATUS; 2. From the output of the SHOW SLAVE STATUS statement, the binary log coordinates of the master server from which the new slave should start replicating are the values of the Relay_Master_Log_File and Exec_Master_Log_Pos fields. Denote those values as file_name and file_pos. 3. Dump the slave server: shell> mysqldump --master-data=2 --all-databases > dumpfile 4. Restart the slave: mysql> START SLAVE; 5. On the new slave, load the dump file: shell> mysql < dumpfile 6. On the new slave, set the replication coordinates to those of the master server obtained earlier: mysql> CHANGE MASTER TO -> MASTER_LOG_FILE = file_name, MASTER_LOG_POS = file_pos; The CHANGE MASTER TO statement might also need other parameters, such as MASTER_HOST to point the slave to the correct master server host. Add any such parameters as necessary. --max-allowed-packet=length Sets the maximum packet length to send to or receive from server. --max-statement-time=seconds Sets the maximum time any statement can run before being timed out by the server. (Default value is 0 (no limit)) --net-buffer-length=length Sets the buffer size for TCP/IP and socket communication. --no-autocommit Enclose the INSERT statements for each dumped table within SET autocommit = 0 and COMMIT statements. --no-create-db, -n This option suppresses the CREATE DATABASE statements that are otherwise included in the output if the --databases or --all-databases option is given. --no-create-info, -t Do not write CREATE TABLE statements that re-create each dumped table. --no-data, -d Do not write any table row information (that is, do not dump table contents). This is useful if you want to dump only the CREATE TABLE statement for the table (for example, to create an empty copy of the table by loading the dump file). --no-defaults Do not read default options from any option file. This must be given as the first argument. --no-set-names, -N This has the same effect as --skip-set-charset. --opt This option is shorthand. It is the same as specifying --add-drop-table --add-locks --create-options --disable-keys --extended-insert --lock-tables --quick --set-charset. It should give you a fast dump operation and produce a dump file that can be reloaded into a MariaDB server quickly. The --opt option is enabled by default. Use --skip-opt to disable it. See the discussion at the beginning of this section for information about selectively enabling or disabling a subset of the options affected by --opt. --order-by-primary Dump each tables rows sorted by its primary key, or by its first unique index, if such an index exists. This is useful when dumping a MyISAM table to be loaded into an InnoDB table, but will make the dump operation take considerably longer. --password[=password], -p[password] The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, mysqldump prompts for one. Specifying a password on the command line should be considered insecure. You can use an option file to avoid giving the password on the command line. --pipe, -W On Windows, connect to the server via a named pipe. This option applies only if the server supports named-pipe connections. --plugin-dir Directory for client-side plugins. --port=port_num, -P port_num The TCP/IP port number to use for the connection. Forces --protocol=tcp when specified on the command line without other connection properties. --protocol={TCP|SOCKET|PIPE|MEMORY} The connection protocol to use for connecting to the server. It is useful when the other connection parameters normally would cause a protocol to be used other than the one you want. --quick, -q This option is useful for dumping large tables. It forces mysqldump to retrieve rows for a table from the server a row at a time rather than retrieving the entire row set and buffering it in memory before writing it out. --print-defaults Print the program argument list and exit. This must be given as the first argument. --quote-names, -Q Quote identifiers (such as database, table, and column names) within ` characters. If the ANSI_QUOTES SQL mode is enabled, identifiers are quoted within " characters. This option is enabled by default. It can be disabled with --skip-quote-names, but this option should be given after any option such as --compatible that may enable --quote-names. --replace Write REPLACE statements rather than INSERT statements. --result-file=file_name, -r file_name Direct output to a given file. This option should be used on Windows to prevent newline \n characters from being converted to \r\n carriage return/newline sequences. The result file is created and its previous contents overwritten, even if an error occurs while generating the dump. --routines, -R Included stored routines (procedures and functions) for the dumped databases in the output. Use of this option requires the SELECT privilege for the mysql.proc table. The output generated by using --routines contains CREATE PROCEDURE and CREATE FUNCTION statements to re-create the routines. However, these statements do not include attributes such as the routine creation and modification timestamps. This means that when the routines are reloaded, they will be created with the timestamps equal to the reload time. If you require routines to be re-created with their original timestamp attributes, do not use --routines. Instead, dump and reload the contents of the mysql.proc table directly, using a MariaDB account that has appropriate privileges for the mysql database. --set-charset Add SET NAMES default_character_set to the output. This option is enabled by default. To suppress the SET NAMES statement, use --skip-set-charset. --single-transaction This option sends a START TRANSACTION SQL statement to the server before dumping data. It is useful only with transactional tables such as InnoDB, because then it dumps the consistent state of the database at the time when BEGIN was issued without blocking any applications. When using this option, you should keep in mind that only InnoDB tables are dumped in a consistent state. For example, any MyISAM or MEMORY tables dumped while using this option may still change state. While a --single-transaction dump is in process, to ensure a valid dump file (correct table contents and binary log coordinates), no other connection should use the following statements: ALTER TABLE, CREATE TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE. A consistent read is not isolated from those statements, so use of them on a table to be dumped can cause the SELECT that is performed by mysqldump to retrieve the table contents to obtain incorrect contents or fail. The --single-transaction option and the --lock-tables option are mutually exclusive because LOCK TABLES causes any pending transactions to be committed implicitly. To dump large tables, you should combine the --single-transaction option with --quick. --skip-add-drop-table Disable the --add-drop-table option. --skip-add-locks Disable the --add-locks option. --skip-comments Disable the --comments option. --skip-compact Disable the --compact option. --skip-disable-keys Disable the --disable-keys option. --skip-extended-insert Disable the --extended-insert option. --skip-opt Disable the --opt option. --skip-quick Disable the --quick option. --skip-quote-names Disable the --quote-names option. --skip-set-charset Disable the --set-charset option. --skip-triggers Disable the --triggers option. --skip-tz-utc Disable the --tz-utc option. --socket=path, -S path For connections to localhost, the Unix socket file to use, or, on Windows, the name of the named pipe to use. Forces --protocol=socket when specified on the command line without other connection properties; on Windows, forces --protocol=pipe. --ssl Enable SSL for connection (automatically enabled with other flags). Disable with --skip-ssl. --ssl-ca=name CA file in PEM format (check OpenSSL docs, implies --ssl). --ssl-capath=name CA directory (check OpenSSL docs, implies --ssl). --ssl-cert=name X509 cert in PEM format (check OpenSSL docs, implies --ssl). --ssl-cipher=name SSL cipher to use (check OpenSSL docs, implies --ssl). --ssl-key=name X509 key in PEM format (check OpenSSL docs, implies --ssl). --ssl-crl=name Certificate revocation list (check OpenSSL docs, implies --ssl). --ssl-crlpath=name Certificate revocation list path (check OpenSSL docs, implies --ssl). --ssl-verify-server-cert Verify server's "Common Name" in its cert against hostname used when connecting. This option is disabled by default. --system={all, users, plugins, udfs, servers, stats, timezones} Dump the system tables in the mysql database in a logical form. This option is an empty set by default. One or more options can be listed in comma separated list. The options here are: all - an alias to enabling all of the below options. users - the users, roles and their grants outputed as CREATE USER, CREATE ROLE, GRANT, and SET DEFAULT ROLE (ALTER USER for MySQL-8.0+). plugins - active plugins of the server outputed as INSTALL PLUGIN. udfs - user define functions outputed as CREATE FUNCTION. servers - remote (federated) servers as CREATE SERVER. stats - statistics tables, InnoDB and Engine Independent Table Statistics (EITS), are dumped as REPLACE INTO (or INSERT IGNORE if --insert-ignore is specified) statements without (re)creating tables. timezones - timezone related system tables dumped as REPLACE INTO (or INSERT IGNORE if --insert-ignore is specified) statements without (re)creating tables. The format of the output is affected by --replace and --insert-ignore. The --replace option will output CREATE OR REPLACE forms of SQL, and also DROP IF EXISTS prior to CREATE, if a CREATE OR REPLACE option isn't available. With --system=user (or all), and --replace, SQL is generated to generate an error if attempting to import the dump with a connection user that is being replaced within the dump. The --insert-ignore option will cause CREATE IF NOT EXIST forms of SQL to generated if available. For stats, and timezones, --replace and --insert-ignore have the usual effects. Enabling specific options here will cause the relevant tables in the mysql database to be ignored when dumping the mysql database or --all-databases. To help in migrating from MySQL to MariaDB, this option is designed to be able to dump system information from MySQL-5.7 and 8.0 servers. SQL generated is also experimentally compatible with MySQL-5.7/8.0. Mappings of implementation specific grants/plugins isn't always one-to-one however between MariaDB and MySQL and will require manual changes. --tab=path, -T path Produce tab-separated text-format data files. For each dumped table, mysqldump creates a tbl_name.sql file that contains the CREATE TABLE statement that creates the table, and the server writes a tbl_name.txt file that contains its data. The option value is the directory in which to write the files. Note This option should be used only when mysqldump is run on the same machine as the mysqld server. You must have the FILE privilege, and the server must have permission to write files in the directory that you specify. By default, the .txt data files are formatted using tab characters between column values and a newline at the end of each line. The format can be specified explicitly using the --fields-xxx and --lines-terminated-by options. Column values are converted to the character set specified by the --default-character-set option. --tables Override the --databases or -B option. mysqldump regards all name arguments following the option as table names. --triggers Include triggers for each dumped table in the output. This option is enabled by default; disable it with --skip-triggers. --tz-utc This option enables TIMESTAMP columns to be dumped and reloaded between servers in different time zones. mysqldump sets its connection time zone to UTC and adds SET TIME_ZONE=+00:00 to the dump file. Without this option, TIMESTAMP columns are dumped and reloaded in the time zones local to the source and destination servers, which can cause the values to change if the servers are in different time zones. --tz-utc also protects against changes due to daylight saving time. --tz-utc is enabled by default. To disable it, use --skip-tz-utc. --user=user_name, -u user_name The MariaDB user name to use when connecting to the server. --verbose, -v Verbose mode. Print more information about what the program does. --version, -V Display version information and exit. --where=where_condition, -w where_condition Dump only rows selected by the given WHERE condition. Quotes around the condition are mandatory if it contains spaces or other characters that are special to your command interpreter. Examples: --where="user=jimf" -w"userid>1" -w"userid<1" --xml, -X Write dump output as well-formed XML. NULL, NULL, and Empty Values: For a column named column_name, the NULL value, an empty string, and the string value NULL are distinguished from one another in the output generated by this option as follows. Value: XML Representation: NULL (unknown value) <field name="column_name" xsi:nil="true" /> (empty string) <field name="column_name"></field> NULL (string value) <field name="column_name">NULL</field> The output from the mysql client when run using the --xml option also follows the preceding rules. (See the section called MYSQL OPTIONS.) XML output from mysqldump includes the XML namespace, as shown here: shell> mysqldump --xml -u root world City <?xml version="1.0"?> <mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <database name="world"> <table_structure name="City"> <field Field="ID" Type="int(11)" Null="NO" Key="PRI" Extra="auto_increment" /> <field Field="Name" Type="char(35)" Null="NO" Key="" Default="" Extra="" /> <field Field="CountryCode" Type="char(3)" Null="NO" Key="" Default="" Extra="" /> <field Field="District" Type="char(20)" Null="NO" Key="" Default="" Extra="" /> <field Field="Population" Type="int(11)" Null="NO" Key="" Default="0" Extra="" /> <key Table="City" Non_unique="0" Key_name="PRIMARY" Seq_in_index="1" Column_name="ID" Collation="A" Cardinality="4079" Null="" Index_type="BTREE" Comment="" /> <options Name="City" Engine="MyISAM" Version="10" Row_format="Fixed" Rows="4079" Avg_row_length="67" Data_length="273293" Max_data_length="18858823439613951" Index_length="43008" Data_free="0" Auto_increment="4080" Create_time="2007-03-31 01:47:01" Update_time="2007-03-31 01:47:02" Collation="latin1_swedish_ci" Create_options="" Comment="" /> </table_structure> <table_data name="City"> <row> <field name="ID">1</field> <field name="Name">Kabul</field> <field name="CountryCode">AFG</field> <field name="District">Kabol</field> <field name="Population">1780000</field> </row> ... <row> <field name="ID">4079</field> <field name="Name">Rafah</field> <field name="CountryCode">PSE</field> <field name="District">Rafah</field> <field name="Population">92020</field> </row> </table_data> </database> </mysqldump> You can also set the following variables by using --var_name=value syntax: max_allowed_packet The maximum size of the buffer for client/server communication. The maximum is 1GB. max_statement_time A query that has taken more than max_statement_time seconds will be aborted and the backup will fail. The argument will be treated as a decimal value with microsecond precision. A value of 0 (default) means no timeout. The maximum timeout is 31536000 seconds. net_buffer_length The initial size of the buffer for client/server communication. When creating multiple-row INSERT statements (as with the --extended-insert or --opt option), mysqldump creates rows up to net_buffer_length length. If you increase this variable, you should also ensure that the net_buffer_length variable in the MariaDB server is at least this large. A common use of mysqldump is for making a backup of an entire database: shell> mysqldump db_name > backup-file.sql You can load the dump file back into the server like this: shell> mysql db_name < backup-file.sql Or like this: shell> mysql -e "source /path-to-backup/backup-file.sql" db_name mysqldump is also very useful for populating databases by copying data from one MariaDB server to another: shell> mysqldump --opt db_name | mysql --host=remote_host -C db_name It is possible to dump several databases with one command: shell> mysqldump --databases db_name1 [db_name2 ...] > my_databases.sql To dump all databases, use the --all-databases option: shell> mysqldump --all-databases > all_databases.sql For InnoDB tables, mysqldump provides a way of making an online backup: shell> mysqldump --all-databases --single-transaction > all_databases.sql This backup acquires a global read lock on all tables (using FLUSH TABLES WITH READ LOCK) at the beginning of the dump. As soon as this lock has been acquired, the binary log coordinates are read and the lock is released. If long updating statements are running when the FLUSH statement is issued, the MariaDB server may get stalled until those statements finish. After that, the dump becomes lock free and does not disturb reads and writes on the tables. If the update statements that the MariaDB server receives are short (in terms of execution time), the initial lock period should not be noticeable, even with many updates. For point-in-time recovery (also known as roll-forward, when you need to restore an old backup and replay the changes that happened since that backup), it is often useful to rotate the binary log or at least know the binary log coordinates to which the dump corresponds: shell> mysqldump --all-databases --master-data=2 > all_databases.sql Or: shell> mysqldump --all-databases --flush-logs --master-data=2 > all_databases.sql The --master-data and --single-transaction options can be used simultaneously, which provides a convenient way to make an online backup suitable for use prior to point-in-time recovery if tables are stored using the InnoDB storage engine. If you encounter problems backing up views, please read the section that covers restrictions on views which describes a workaround for backing up views when this fails due to insufficient privileges. COPYRIGHT top Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2020 MariaDB Foundation This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see http://www.gnu.org/licenses/. SEE ALSO top For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ AUTHOR top MariaDB Foundation (http://www.mariadb.org/). COLOPHON top This page is part of the MariaDB (MariaDB database server) project. Information about the project can be found at http://mariadb.org/. If you have a bug report for this manual page, see https://mariadb.com/kb/en/mariadb/reporting-bugs/. This page was obtained from the project's upstream Git repository https://github.com/MariaDB/server on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-05-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] MariaDB 10.8 24 October 2020 MARIADB-DUMP(1) Pages that refer to this page: mysql(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. | # mysqldump\n\n> Backups MySQL databases.\n> See also `mysql` for restoring databases.\n> More information: <https://dev.mysql.com/doc/refman/en/mysqldump.html>.\n\n- Create a backup (user will be prompted for a password):\n\n`mysqldump --user {{user}} --password {{database_name}} --result-file={{path/to/file.sql}}`\n\n- Backup a specific table redirecting the output to a file (user will be prompted for a password):\n\n`mysqldump --user {{user}} --password {{database_name}} {{table_name}} > {{path/to/file.sql}}`\n\n- Backup all databases redirecting the output to a file (user will be prompted for a password):\n\n`mysqldump --user {{user}} --password --all-databases > {{path/to/file.sql}}`\n\n- Backup all databases from a remote host, redirecting the output to a file (user will be prompted for a password):\n\n`mysqldump --host={{ip_or_hostname}} --user {{user}} --password --all-databases > {{path/to/file.sql}}`\n |
mytop | mytop(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training mytop(1) Linux manual page NAME | SEE ALSO | AUTHOR | COLOPHON MYTOP(1) MariaDB Database System MYTOP(1) NAME top mytop - display MariaDB server performance info like 'top' SEE ALSO top For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ AUTHOR top MariaDB Foundation (http://www.mariadb.org/). COLOPHON top This page is part of the MariaDB (MariaDB database server) project. Information about the project can be found at http://mariadb.org/. If you have a bug report for this manual page, see https://mariadb.com/kb/en/mariadb/reporting-bugs/. This page was obtained from the project's upstream Git repository https://github.com/MariaDB/server on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-05-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] MariaDB 10.8 15 May 2020 MYTOP(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. | # mytop\n\n> Display MySQL server performance info like `top`.\n> More information: <http://jeremy.zawodny.com/mysql/mytop/mytop.html>.\n\n- Start `mytop`:\n\n`mytop`\n\n- Connect with a specified username and password:\n\n`mytop -u {{user}} -p {{password}}`\n\n- Connect with a specified username (the user will be prompted for a password):\n\n`mytop -u {{user}} --prompt`\n\n- Do not show any idle (sleeping) threads:\n\n`mytop -u {{user}} -p {{password}} --noidle`\n |
namei | namei(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training namei(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | BUGS | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY NAMEI(1) User Commands NAMEI(1) NAME top namei - follow a pathname until a terminal point is found SYNOPSIS top namei [options] pathname... DESCRIPTION top namei interprets its arguments as pathnames to any type of Unix file (symlinks, files, directories, and so forth). namei then follows each pathname until an endpoint is found (a file, a directory, a device node, etc). If it finds a symbolic link, it shows the link, and starts following it, indenting the output to show the context. This program is useful for finding "too many levels of symbolic links" problems. For each line of output, namei uses the following characters to identify the file type found: f: = the pathname currently being resolved d = directory l = symbolic link (both the link and its contents are output) s = socket b = block device c = character device p = FIFO (named pipe) - = regular file ? = an error of some kind namei prints an informative message when the maximum number of symbolic links this system can have has been exceeded. OPTIONS top -l, --long Use the long listing format (same as -m -o -v). -m, --modes Show the mode bits of each file type in the style of ls(1), for example 'rwxr-xr-x'. -n, --nosymlinks Dont follow symlinks. -o, --owners Show owner and group name of each file. -v, --vertical Vertically align the modes and owners. -x, --mountpoints Show mountpoint directories with a 'D' rather than a 'd'. -Z, --context Show security context of the file or "?" if not available. The support for security contexts is optional and does not have to be compiled to the namei binary. -h, --help Display help text and exit. -V, --version Print version and exit. BUGS top To be discovered. AUTHORS top The original namei program was written by Roger Southwick <[email protected]>. The program was rewritten by Karel Zak Karel Zak <[email protected]>. SEE ALSO top ls(1), stat(1), symlink(7) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The namei 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 NAMEI(1) Pages that refer to this page: symlink(2), symlink(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. | # namei\n\n> Follows a pathname (which can be a symbolic link) until a terminal point is found (a file/directory/char device etc).\n> This program is useful for finding "too many levels of symbolic links" problems.\n> More information: <https://manned.org/namei>.\n\n- Resolve the pathnames specified as the argument parameters:\n\n`namei {{path/to/a}} {{path/to/b}} {{path/to/c}}`\n\n- Display the results in a long-listing format:\n\n`namei --long {{path/to/a}} {{path/to/b}} {{path/to/c}}`\n\n- Show the mode bits of each file type in the style of `ls`:\n\n`namei --modes {{path/to/a}} {{path/to/b}} {{path/to/c}}`\n\n- Show owner and group name of each file:\n\n`namei --owners {{path/to/a}} {{path/to/b}} {{path/to/c}}`\n\n- Don't follow symlinks while resolving:\n\n`namei --nosymlinks {{path/to/a}} {{path/to/b}} {{path/to/c}}`\n |
ncat | ncat(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training ncat(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS SUMMARY | CONNECT MODE AND LISTEN MODE | PROTOCOL OPTIONS | CONNECT MODE OPTIONS | LISTEN MODE OPTIONS | SSL OPTIONS | PROXY OPTIONS | COMMAND EXECUTION OPTIONS | ACCESS CONTROL OPTIONS | TIMING OPTIONS | OUTPUT OPTIONS | MISC OPTIONS | UNIX DOMAIN SOCKETS | AF_VSOCK SOCKETS | EXAMPLES | EXIT CODE | BUGS | AUTHORS | LEGAL NOTICES | NOTES | COLOPHON NCAT(1) Ncat Reference Guide NCAT(1) NAME top ncat - Concatenate and redirect sockets SYNOPSIS top ncat [OPTIONS...] [hostname] [port] DESCRIPTION top Ncat is a feature-packed networking utility which reads and writes data across networks from the command line. Ncat was written for the Nmap Project and is the culmination of the currently splintered family of Netcat incarnations. It is designed to be a reliable back-end tool to instantly provide network connectivity to other applications and users. Ncat will not only work with IPv4 and IPv6 but provides the user with a virtually limitless number of potential uses. Among Ncat's vast number of features there is the ability to chain Ncats together; redirection of TCP, UDP, and SCTP ports to other sites; SSL support; and proxy connections via SOCKS4, SOCKS5 or HTTP proxies (with optional proxy authentication as well). Some general principles apply to most applications and thus give you the capability of instantly adding networking support to software that would normally never support it. OPTIONS SUMMARY top Ncat 7.94 ( https://nmap.org/ncat ) Usage: ncat [options] [hostname] [port] Options taking a time assume seconds. Append 'ms' for milliseconds, 's' for seconds, 'm' for minutes, or 'h' for hours (e.g. 500ms). -4 Use IPv4 only -6 Use IPv6 only -U, --unixsock Use Unix domain sockets only --vsock Use vsock sockets only -C, --crlf Use CRLF for EOL sequence -c, --sh-exec <command> Executes the given command via /bin/sh -e, --exec <command> Executes the given command --lua-exec <filename> Executes the given Lua script -g hop1[,hop2,...] Loose source routing hop points (8 max) -G <n> Loose source routing hop pointer (4, 8, 12, ...) -m, --max-conns <n> Maximum <n> simultaneous connections -h, --help Display this help screen -d, --delay <time> Wait between read/writes -o, --output <filename> Dump session data to a file -x, --hex-dump <filename> Dump session data as hex to a file -i, --idle-timeout <time> Idle read/write timeout -p, --source-port port Specify source port to use -s, --source addr Specify source address to use (doesn't affect -l) -l, --listen Bind and listen for incoming connections -k, --keep-open Accept multiple connections in listen mode -n, --nodns Do not resolve hostnames via DNS -t, --telnet Answer Telnet negotiations -u, --udp Use UDP instead of default TCP --sctp Use SCTP instead of default TCP -v, --verbose Set verbosity level (can be used several times) -w, --wait <time> Connect timeout -z Zero-I/O mode, report connection status only --append-output Append rather than clobber specified output files --send-only Only send data, ignoring received; quit on EOF --recv-only Only receive data, never send anything --no-shutdown Continue half-duplex when receiving EOF on stdin --allow Allow only given hosts to connect to Ncat --allowfile A file of hosts allowed to connect to Ncat --deny Deny given hosts from connecting to Ncat --denyfile A file of hosts denied from connecting to Ncat --broker Enable Ncat's connection brokering mode --chat Start a simple Ncat chat server --proxy <addr[:port]> Specify address of host to proxy through --proxy-type <type> Specify proxy type ("http", "socks4", "socks5") --proxy-auth <auth> Authenticate with HTTP or SOCKS proxy server --proxy-dns <type> Specify where to resolve proxy destination --ssl Connect or listen with SSL --ssl-cert Specify SSL certificate file (PEM) for listening --ssl-key Specify SSL private key (PEM) for listening --ssl-verify Verify trust and domain name of certificates --ssl-trustfile PEM file containing trusted SSL certificates --ssl-ciphers Cipherlist containing SSL ciphers to use --ssl-servername Request distinct server name (SNI) --ssl-alpn ALPN protocol list to use --version Display Ncat's version information and exit See the ncat(1) manpage for full options, descriptions and usage examples CONNECT MODE AND LISTEN MODE top Ncat operates in one of two primary modes: connect mode and listen mode. Other modes, such as the HTTP proxy server, act as special cases of these two. In connect mode, Ncat works as a client. In listen mode it is a server. In connect mode, the hostname and port arguments tell what to connect to. hostname is required, and may be a hostname or IP address. If port is supplied, it must be a decimal port number. If omitted, it defaults to 31337. In listen mode, hostname and port control the address the server will bind to. Both arguments are optional in listen mode. If hostname is omitted, it defaults to listening on all available addresses over IPv4 and IPv6. If port is omitted, it defaults to 31337. PROTOCOL OPTIONS top -4 (IPv4 only) Force the use of IPv4 only. -6 (IPv6 only) Force the use of IPv6 only. -U, --unixsock (Use Unix domain sockets) Use Unix domain sockets rather than network sockets. This option may be used on its own for stream sockets, or combined with --udp for datagram sockets. A description of -U mode is in the section called UNIX DOMAIN SOCKETS. -u, --udp (Use UDP) Use UDP for the connection (the default is TCP). --sctp (Use SCTP) Use SCTP for the connection (the default is TCP). SCTP support is implemented in TCP-compatible mode. --vsock (Use AF_VSOCK sockets) Use AF_VSOCK sockets rather than the default TCP sockets (Linux only). This option may be used on its own for stream sockets or combined with --udp for datagram sockets. A description of --vsock mode is in the section called AF_VSOCK SOCKETS. CONNECT MODE OPTIONS top -g hop1[,hop2,...] (Loose source routing) Sets hops for IPv4 loose source routing. You can use -g once with a comma-separated list of hops, use -g multiple times with single hops to build the list, or combine the two. Hops can be given as IP addresses or hostnames. -G ptr (Set source routing pointer) Sets the IPv4 source route pointer for use with -g. The argument must be a multiple of 4 and no more than 28. Not all operating systems support setting this pointer to anything other than four. -p port, --source-port port (Specify source port) Set the port number for Ncat to bind to. -s host, --source host (Specify source address) Set the address for Ncat to bind to. LISTEN MODE OPTIONS top See the section called ACCESS CONTROL OPTIONS for information on limiting the hosts that may connect to the listening Ncat process. -l, --listen (Listen for connections) Listen for connections rather than connecting to a remote machine -m numconns, --max-conns numconns (Specify maximum number of connections) The maximum number of simultaneous connections accepted by an Ncat instance. 100 is the default (60 on Windows). -k, --keep-open (Accept multiple connections) Normally a listening server accepts only one connection and then quits when the connection is closed. This option makes it accept multiple simultaneous connections and wait for more connections after they have all been closed. It must be combined with --listen. In this mode there is no way for Ncat to know when its network input is finished, so it will keep running until interrupted. This also means that it will never close its output stream, so any program reading from Ncat and looking for end-of-file will also hang. --broker (Connection brokering) Allow multiple parties to connect to a centralised Ncat server and communicate with each other. Ncat can broker communication between systems that are behind a NAT or otherwise unable to directly connect. This option is used in conjunction with --listen, which causes the --listen port to have broker mode enabled. --chat (Ad-hoc chat server) The --chat option enables chat mode, intended for the exchange of text between several users. In chat mode, connection brokering is turned on. Ncat prefixes each message received with an ID before relaying it to the other connections. The ID is unique for each connected client. This helps distinguish who sent what. Additionally, non-printing characters such as control characters are escaped to keep them from doing damage to a terminal. SSL OPTIONS top --ssl (Use SSL) In connect mode, this option transparently negotiates an SSL session with an SSL server to securely encrypt the connection. This is particularly handy for talking to SSL enabled HTTP servers, etc. In server mode, this option listens for incoming SSL connections, rather than plain untunneled traffic. In UDP mode, this option enables Datagram TLS (DTLS). --ssl-verify (Verify server certificates) In client mode, --ssl-verify is like --ssl except that it also requires verification of the server certificate. Ncat comes with a default set of trusted certificates in the file ca-bundle.crt. Some operating systems provide a default list of trusted certificates; these will also be used if available. Use --ssl-trustfile to give a custom list. Use -v one or more times to get details about verification failures. Ncat does not check for revoked certificates. This option has no effect in server mode. --ssl-cert certfile.pem (Specify SSL certificate) This option gives the location of a PEM-encoded certificate files used to authenticate the server (in listen mode) or the client (in connect mode). Use it in combination with --ssl-key. --ssl-key keyfile.pem (Specify SSL private key) This option gives the location of the PEM-encoded private key file that goes with the certificate named with --ssl-cert. --ssl-trustfile cert.pem (List trusted certificates) This option sets a list of certificates that are trusted for purposes of certificate verification. It has no effect unless combined with --ssl-verify. The argument to this option is the name of a PEM file containing trusted certificates. Typically, the file will contain certificates of certification authorities, though it may also contain server certificates directly. When this option is used, Ncat does not use its default certificates. --ssl-ciphers cipherlist (Specify SSL ciphersuites) This option sets the list of ciphersuites that Ncat will use when connecting to servers or when accepting SSL connections from clients. The syntax is described in the OpenSSL ciphers(1) man page, and defaults to ALL:!aNULL:!eNULL:!LOW:!EXP:!RC4:!MD5:@STRENGTH --ssl-servername name (Request distinct server name) In client mode, this option sets the TLS SNI (Server Name Indication) extension, which tells the server the name of the logical server Ncat is contacting. This is important when the target server hosts multiple virtual servers at a single underlying network address. If the option is not provided, the TLS SNI extension will be populated with the target server hostname. --ssl-alpn ALPN list (Specify ALPN protocol list) This option allows you to specify a comma-separated list of protocols to send via the Application-Layer Protocol Negotiation (ALPN) TLS extension. Not supported by all versions of OpenSSL. PROXY OPTIONS top --proxy host[:port] (Specify proxy address) Requests proxying through host:port, using the protocol specified by --proxy-type. If no port is specified, the proxy protocol's well-known port is used (1080 for SOCKS and 3128 for HTTP). When specifying an IPv6 HTTP proxy server using the IP address rather than the hostname, the square-bracket notation (for example [2001:db8::1]:8080) MUST be used to separate the port from the IPv6 address. If the proxy requires authentication, use --proxy-auth. --proxy-type proto (Specify proxy protocol) In connect mode, this option requests the protocol proto to connect through the proxy host specified by --proxy. In listen mode, this option has Ncat act as a proxy server using the specified protocol. The currently available protocols in connect mode are http (CONNECT), socks4 (SOCKSv4), and socks5 (SOCKSv5). The only server currently supported is http. If this option is not used, the default protocol is http. --proxy-auth user[:pass] (Specify proxy credentials) In connect mode, gives the credentials that will be used to connect to the proxy server. In listen mode, gives the credentials that will be required of connecting clients. For use with --proxy-type http or --proxy-type socks5, the form should be username:password. For --proxy-type socks4, it should be a username only. These credentials can be alternatively passed onto Ncat by setting environment variable NCAT_PROXY_AUTH, which reduces the risk of the credentials being captured in process logs. (Option --proxy-auth takes precedence.) --proxy-dns type (Specify where to resolve proxy destination) In connect mode, it provides control over whether proxy destination hostnames are resolved by the remote proxy server or locally, by Ncat itself. Possible values for type are: local - Hostnames are resolved locally on the Ncat host. Ncat exits with error if the hostname cannot be resolved. remote - Hostnames are passed directly onto the remote proxy server. This is the default behavior. both - Hostname resolution is first attempted on the Ncat host. Unresolvable hostnames are passed onto the remote proxy server. none - Hostname resolution is completely disabled. Only a literal IPv4 or IPv6 address can be used as the proxy destination. Local hostname resolution generally respects IP version specified with options -4 or -6, except for SOCKS4, which is incompatible with IPv6. COMMAND EXECUTION OPTIONS top -e command, --exec command (Execute command) Execute the specified command after a connection has been established. The command must be specified as a full pathname. All input from the remote client will be sent to the application and responses sent back to the remote client over the socket, thus making your command-line application interactive over a socket. Combined with --keep-open, Ncat will handle multiple simultaneous connections to your specified port/application like inetd. Ncat will only accept a maximum, definable, number of simultaneous connections controlled by the -m option. By default this is set to 100 (60 on Windows). -c command, --sh-exec command (Execute command via sh) Same as -e, except it tries to execute the command via /bin/sh. This means you don't have to specify the full path for the command, and shell facilities like environment variables are available. --lua-exec file (Execute a .lua script) Runs the specified file as a Lua script after a connection has been established, using a built-in interpreter. Both the script's standard input and the standard output are redirected to the connection data streams. All exec options add the following variables to the child's environment: NCAT_REMOTE_ADDR, NCAT_REMOTE_PORT The IP address and port number of the remote host. In connect mode, it's the target's address; in listen mode, it's the client's address. NCAT_LOCAL_ADDR, NCAT_LOCAL_PORT The IP address and port number of the local end of the connection. NCAT_PROTO The protocol in use: one of TCP, UDP, and SCTP. ACCESS CONTROL OPTIONS top --allow host[,host,...] (Allow connections) The list of hosts specified will be the only hosts allowed to connect to the Ncat process. All other connection attempts will be disconnected. In case of a conflict between --allow and --deny, --allow takes precedence. Host specifications follow the same syntax used by Nmap. --allowfile file (Allow connections from file) This has the same functionality as --allow, except that the allowed hosts are provided in a new-line delimited allow file, rather than directly on the command line. --deny host[,host,...] (Deny connections) Issue Ncat with a list of hosts that will not be allowed to connect to the listening Ncat process. Specified hosts will have their session silently terminated if they try to connect. In case of a conflict between --allow and --deny, --allow takes precedence. Host specifications follow the same syntax used by Nmap. --denyfile file (Deny connections from file) This is the same functionality as --deny, except that excluded hosts are provided in a new-line delimited deny file, rather than directly on the command line. TIMING OPTIONS top These options accept a time parameter. This is specified in seconds by default, though you can append ms, s, m, or h to the value to specify milliseconds, seconds, minutes, or hours. -d time, --delay time (Specify line delay) Set the delay interval for lines sent. This effectively limits the number of lines that Ncat will send in the specified period. This may be useful for low-bandwidth sites, or have other uses such as coping with annoying iptables --limit options. -i time, --idle-timeout time (Specify idle timeout) Set a fixed timeout for idle connections. If the idle timeout is reached, the connection is terminated. -w time, --wait time (Specify connect timeout) Set a fixed timeout for connection attempts. OUTPUT OPTIONS top -o file, --output file (Save session data) Dump session data to a file -x file, --hex-dump file (Save session data in hex) Dump session data in hex to a file. --append-output (Append output) Issue Ncat with --append-ouput along with -o and/or -x and it will append the resulted output rather than truncating the specified output files. -v, --verbose (Be verbose) Issue Ncat with -v and it will be verbose and display all kinds of useful connection based information. Use more than once (-vv, -vvv...) for greater verbosity. MISC OPTIONS top -C, --crlf (Use CRLF as EOL) This option tells Ncat to convert LF line endings to CRLF when taking input from standard input. This is useful for talking to some stringent servers directly from a terminal in one of the many common plain-text protocols that use CRLF for end-of-line. -h, --help (Help screen) Displays a short help screen with common options and parameters, and then exits. --recv-only (Only receive data) If this option is passed, Ncat will only receive data and will not try to send anything. --send-only (Only send data) If this option is passed, then Ncat will only send data and will ignore anything received. This option also causes Ncat to close the network connection and terminate after EOF is received on standard input. --no-shutdown (Do not shutdown into half-duplex mode) If this option is passed, Ncat will not invoke shutdown on a socket after seeing EOF on stdin. This is provided for backward-compatibility with OpenBSD netcat, which exhibits this behavior when executed with its '-d' option. -n, --nodns (Do not resolve hostnames) Completely disable hostname resolution across all Ncat options, such as the destination, source address, source routing hops, and the proxy. All addresses must be specified numerically. (Note that resolution of proxy destinations is controlled separately via option --proxy-dns.) -t, --telnet (Answer Telnet negotiations) Handle DO/DONT WILL/WONT Telnet negotiations. This makes it possible to script Telnet sessions with Ncat. --version (Display version) Displays the Ncat version number and exits. UNIX DOMAIN SOCKETS top The -U option (same as --unixsock) causes Ncat to use Unix domain sockets rather than network sockets. Unix domain sockets exist as an entry in the filesystem. You must give the name of a socket to connect to or to listen on. For example, to make a connection, ncat -U ~/unixsock To listen on a socket: ncat -l -U ~/unixsock Listen mode will create the socket if it doesn't exist. The socket will continue to exist after the program ends. Both stream and datagram domain sockets are supported. Use -U on its own for stream sockets, or combine it with --udp for datagram sockets. Datagram sockets require a source socket to connect from. By default, a source socket with a random filename will be created as needed, and deleted when the program ends. Use the --source with a path to use a source socket with a specific name. AF_VSOCK SOCKETS top The --vsock option causes Ncat to use AF_VSOCK sockets rather than network sockets. A CID must be given instead of a hostname or IP address. For example, to make a connection to the host, ncat --vsock 2 1234 To listen on a socket: ncat -l --vsock 1234 Both stream and datagram domain sockets are supported, but socket type availability depends on the hypervisor. Use --vsock on its own for stream sockets, or combine it with --udp for datagram sockets. EXAMPLES top Connect to example.org on TCP port 8080. ncat example.org 8080 Listen for connections on TCP port 8080. ncat -l 8080 Redirect TCP port 8080 on the local machine to host on port 80. ncat --sh-exec "ncat example.org 80" -l 8080 --keep-open Bind to TCP port 8081 and attach /bin/bash for the world to access freely. ncat --exec "/bin/bash" -l 8081 --keep-open Bind a shell to TCP port 8081, limit access to hosts on a local network, and limit the maximum number of simultaneous connections to 3. ncat --exec "/bin/bash" --max-conns 3 --allow 192.168.0.0/24 -l 8081 --keep-open Connect to smtphost:25 through a SOCKS4 server on port 1080. ncat --proxy socks4host --proxy-type socks4 --proxy-auth joe smtphost 25 Connect to smtphost:25 through a SOCKS5 server on port 1080. ncat --proxy socks5host --proxy-type socks5 --proxy-auth joe:secret smtphost 25 Create an HTTP proxy server on localhost port 8888. ncat -l --proxy-type http localhost 8888 Send a file over TCP port 9899 from host2 (client) to host1 (server). HOST1$ ncat -l 9899 > outputfile HOST2$ ncat HOST1 9899 < inputfile Transfer in the other direction, turning Ncat into a one file server. HOST1$ ncat -l 9899 < inputfile HOST2$ ncat HOST1 9899 > outputfile EXIT CODE top The exit code reflects whether a connection was made and completed successfully. 0 means there was no error. 1 means there was a network error of some kind, for example Connection refused or Connection reset. 2 is reserved for all other errors, like an invalid option or a nonexistent file. BUGS top Like its authors, Ncat isn't perfect. But you can help make it better by sending bug reports or even writing patches. If Ncat doesn't behave the way you expect, first upgrade to the latest version available from https://nmap.org . If the problem persists, do some research to determine whether it has already been discovered and addressed. Try Googling the error message or browsing the nmap-dev archives at https://seclists.org/ . Read this full manual page as well. If nothing comes of this, mail a bug report to <[email protected]>. Please include everything you have learned about the problem, as well as what version of Ncat you are running and what operating system version it is running on. Problem reports and Ncat usage questions sent to [email protected] are far more likely to be answered than those sent to Fyodor directly. Code patches to fix bugs are even better than bug reports. Basic instructions for creating patch files with your changes are available at https://svn.nmap.org/nmap/HACKING . Patches may be sent to nmap-dev (recommended) or to Fyodor directly. AUTHORS top Chris Gibson <[email protected]> Gordon Lyon (Fyodor)<[email protected]> (http://insecure.org ) Kris Katterjohn <[email protected]> Mixter <[email protected]> The original Netcat was written by *Hobbit* <[email protected]>. While Ncat isn't built on any code from the traditional Netcat (or any other implementation), Ncat is most definitely based on Netcat in spirit and functionality. LEGAL NOTICES top Ncat Copyright and Licensing Ncat is (C) 20052022 Nmap Software LLC. It is distributed as free and open source software under the same license terms as our Nmap software. Precise terms and further details are available from https://nmap.org/man/man-legal.html . Creative Commons License for this Ncat Guide This Ncat Reference Guide is (C) 20052022 Nmap Software LLC. It is hereby placed under version 3.0 of the Creative Commons Attribution License[1]. This allows you redistribute and modify the work as you desire, as long as you credit the original source. Alternatively, you may choose to treat this document as falling under the same license as Ncat itself (discussed previously). Source Code Availability and Community Contributions Source is provided to this software because we believe users have a right to know exactly what a program is going to do before they run it. This also allows you to audit the software for security holes (none have been found so far). Source code also allows you to port Nmap (which includes Ncat) to new platforms, fix bugs, and add new features. You are highly encouraged to send your changes to <[email protected]> for possible incorporation into the main distribution. By sending these changes to Fyodor or one of the Insecure.Org development mailing lists, it is assumed that you are offering the Nmap Project (Nmap Software LLC) the unlimited, non-exclusive right to reuse, modify, and relicense the code. Nmap will always be available open source, but this is important because the inability to relicense code has caused devastating problems for other Free Software projects (such as KDE and NASM). We also occasionally relicense the code to third parties as discussed in the Nmap man page. If you wish to specify special license conditions of your contributions, just say so when you send them. No Warranty This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Nmap Public Source License for more details at https://nmap.org/npsl/ , or in the LICENSE file included with Nmap. Inappropriate Usage Ncat should never be installed with special privileges (e.g. suid root). That would open up a major security vulnerability as other users on the system (or attackers) could use it for privilege escalation. Third-Party Software This product includes software developed by the Apache Software Foundation[2]. A modified version of the Libpcap portable packet capture library[3] is distributed along with Ncat. The Windows version of Ncat utilized the Libpcap-derived Npcap library[4] instead. Certain raw networking functions use the Libdnet[5] networking library, which was written by Dug Song. A modified version is distributed with Ncat. Ncat can optionally link with the OpenSSL cryptography toolkit[6] for SSL version detection support. All of the third-party software described in this paragraph is freely redistributable under BSD-style software licenses. NOTES top 1. Creative Commons Attribution License http://creativecommons.org/licenses/by/3.0/ 2. Apache Software Foundation http://www.apache.org 3. Libpcap portable packet capture library http://www.tcpdump.org 4. Npcap library https://npcap.com 5. Libdnet http://libdnet.sourceforge.net 6. OpenSSL cryptography toolkit http://www.openssl.org COLOPHON top This page is part of the nmap (a network scanner) project. Information about the project can be found at http://nmap.org/. 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 Subversion repository https://github.com/nmap/nmap 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] Ncat 05/17/2023 NCAT(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. | # ncat\n\n> Read, write, redirect, and encrypt data across a network.\n> An alternative implementation of a similar utility called `netcat`/`nc`.\n> More information: <https://nmap.org/ncat/guide/index.html>.\n\n- Listen for input on the specified port and write it to the specified file:\n\n`ncat -l {{port}} > {{path/to/file}}`\n\n- Accept multiple connections and keep ncat open after they have been closed:\n\n`ncat -lk {{port}}`\n\n- Write output of specified file to the specified host on the specified port:\n\n`ncat {{address}} {{port}} < {{path/to/file}}`\n\n- Accept multiple incoming connections on an encrypted channel evading detection of traffic content:\n\n`ncat --ssl -k -l {{port}}`\n\n- Connect to an open `ncat` connection over SSL:\n\n`ncat --ssl {{host}} {{port}}`\n\n- Check connectivity to a remote host on a particular port with timeout:\n\n`ncat -w {{seconds}} -vz {{host}} {{port}}`\n |
netstat | netstat(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training netstat(8) Linux manual page NAME | SYNOPSIS | NOTES | DESCRIPTION | OPTIONS | OUTPUT | FILES | SEE ALSO | BUGS | AUTHORS | COLOPHON NETSTAT(8) Linux System Administrator's Manual NETSTAT(8) NAME top netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships SYNOPSIS top netstat [address_family_options] [--tcp|-t] [--udp|-u] [--udplite|-U] [--sctp|-S] [--raw|-w] [--l2cap|-2] [--rfcomm|-f] [--listening|-l] [--all|-a] [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--symbolic|-N] [--extend|-e[--extend|-e]] [--timers|-o] [--program|-p] [--verbose|-v] [--continuous|-c] [--wide|-W] netstat {--route|-r} [address_family_options] [--extend|-e[--extend|-e]] [--verbose|-v] [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--continuous|-c] netstat {--interfaces|-i} [--all|-a] [--extend|-e[--extend|-e]] [--verbose|-v] [--program|-p] [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--continuous|-c] netstat {--groups|-g} [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--continuous|-c] netstat {--masquerade|-M} [--extend|-e] [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--continuous|-c] netstat {--statistics|-s} [--tcp|-t] [--udp|-u] [--udplite|-U] [--sctp|-S] [--raw|-w] netstat {--version|-V} netstat {--help|-h} address_family_options: [-4|--inet] [-6|--inet6] [--protocol={inet,inet6,unix,ipx,ax25,netrom,ddp,bluetooth, ... } ] [--unix|-x] [--inet|--ip|--tcpip] [--ax25] [--x25] [--rose] [--ash] [--bluetooth] [--ipx] [--netrom] [--ddp|--appletalk] [--econet|--ec] NOTES top This program is mostly obsolete. Replacement for netstat is ss. Replacement for netstat -r is ip route. Replacement for netstat -i is ip -s link. Replacement for netstat -g is ip maddr. DESCRIPTION top Netstat prints information about the Linux networking subsystem. The type of information printed is controlled by the first argument, as follows: (none) By default, netstat displays a list of open sockets. If you don't specify any address families, then the active sockets of all configured address families will be printed. --route, -r Display the kernel routing tables. See the description in route(8) for details. netstat -r and route -e produce the same output. --groups, -g Display multicast group membership information for IPv4 and IPv6. --interfaces, -i Display a table of all network interfaces and their respective reception and transmission errors counters. --masquerade, -M Display a list of masqueraded connections. --statistics, -s Display summary statistics for each protocol. OPTIONS top --verbose, -v Tell the user what is going on by being verbose. Especially print some useful information about unconfigured address families. --wide, -W Do not truncate IP addresses by using output as wide as needed. This is optional for now to not break existing scripts. --numeric, -n Show numerical addresses instead of trying to determine symbolic host, port or user names. --numeric-hosts shows numerical host addresses but does not affect the resolution of port or user names. --numeric-ports shows numerical port numbers but does not affect the resolution of host or user names. --numeric-users shows numerical user IDs but does not affect the resolution of host or port names. --protocol=family, -A Specifies the address families (perhaps better described as low level protocols) for which connections are to be shown. family is a comma (',') separated list of address family keywords like inet, inet6, unix, ipx, ax25, netrom, econet, ddp, and bluetooth. This has the same effect as using the --inet|-4, --inet6|-6, --unix|-x, --ipx, --ax25, --netrom, --ddp, and --bluetooth options. The address family inet (Iv4) includes raw, udp, udplite and tcp protocol sockets. The address family bluetooth (Iv4) includes l2cap and rfcomm protocol sockets. -c, --continuous This will cause netstat to print the selected information every second continuously. -e, --extend Display additional information. Use this option twice for maximum detail. -o, --timers Include information related to networking timers. -p, --program Show the PID and name of the program to which each socket belongs. A hyphen is shown if the socket belongs to the kernel (e.g. a kernel service, or the process has exited but the socket hasn't finished closing yet). -l, --listening Show only listening sockets. (These are omitted by default.) -a, --all Show both listening and non-listening sockets. With the --interfaces option, show interfaces that are not up -F Print routing information from the FIB. (This is the default.) -C Print routing information from the route cache. OUTPUT top Active Internet connections (TCP, UDP, UDPLite, raw) Proto The protocol (tcp, udp, udpl, raw) used by the socket. Recv-Q Established: The count of bytes not copied by the user program connected to this socket. Listening: Since Kernel 2.6.18 this column contains the current syn backlog. Send-Q Established: The count of bytes not acknowledged by the remote host. Listening: Since Kernel 2.6.18 this column contains the maximum size of the syn backlog. Local Address Address and port number of the local end of the socket. Unless the --numeric (-n) option is specified, the socket address is resolved to its canonical host name (FQDN), and the port number is translated into the corresponding service name. Foreign Address Address and port number of the remote end of the socket. Analogous to "Local Address". State The state of the socket. Since there are no states in raw mode and usually no states used in UDP and UDPLite, this column may be left blank. Normally this can be one of several values: ESTABLISHED The socket has an established connection. SYN_SENT The socket is actively attempting to establish a connection. SYN_RECV A connection request has been received from the network. FIN_WAIT1 The socket is closed, and the connection is shutting down. FIN_WAIT2 Connection is closed, and the socket is waiting for a shutdown from the remote end. TIME_WAIT The socket is waiting after close to handle packets still in the network. CLOSE The socket is not being used. CLOSE_WAIT The remote end has shut down, waiting for the socket to close. LAST_ACK The remote end has shut down, and the socket is closed. Waiting for acknowledgement. LISTEN The socket is listening for incoming connections. Such sockets are not included in the output unless you specify the --listening (-l) or --all (-a) option. CLOSING Both sockets are shut down but we still don't have all our data sent. UNKNOWN The state of the socket is unknown. User The username or the user id (UID) of the owner of the socket. PID/Program name Slash-separated pair of the process id (PID) and process name of the process that owns the socket. --program causes this column to be included. You will also need superuser privileges to see this information on sockets you don't own. This identification information is not yet available for IPX sockets. Timer TCP timer associated with this socket. The format is timer(a/b/c). The timer is one of the following values: off There is no timer set for this socket. on The retransmission timer is active for the socket. keepalive The keepalive timer is active for the socket. timewait The connection is closing and the timewait timer is active for the socket. The values in the brackets: a Timer value. b Number of retransmissions sent. c Number of keepalives sent. Active UNIX domain Sockets Proto The protocol (usually unix) used by the socket. RefCnt The reference count (i.e. attached processes via this socket). Flags The flags displayed is SO_ACCEPTON (displayed as ACC), SO_WAITDATA (W) or SO_NOSPACE (N). SO_ACCECPTON is used on unconnected sockets if their corresponding processes are waiting for a connect request. The other flags are not of normal interest. Type There are several types of socket access: SOCK_DGRAM The socket is used in Datagram (connectionless) mode. SOCK_STREAM This is a stream (connection) socket. SOCK_RAW The socket is used as a raw socket. SOCK_RDM This one serves reliably-delivered messages. SOCK_SEQPACKET This is a sequential packet socket. SOCK_PACKET Raw interface access socket. UNKNOWN Who ever knows what the future will bring us - just fill in here :-) State This field will contain one of the following Keywords: FREE The socket is not allocated LISTENING The socket is listening for a connection request. Such sockets are only included in the output if you specify the --listening (-l) or --all (-a) option. CONNECTING The socket is about to establish a connection. CONNECTED The socket is connected. DISCONNECTING The socket is disconnecting. (empty) The socket is not connected to another one. UNKNOWN This state should never happen. PID/Program name Process ID (PID) and process name of the process that has the socket open. More info available in Active Internet connections section written above. Path This is the path name as which the corresponding processes attached to the socket. Active IPX sockets (this needs to be done by somebody who knows it) Active NET/ROM sockets (this needs to be done by somebody who knows it) Active AX.25 sockets (this needs to be done by somebody who knows it) FILES top /etc/services -- The services translation file /proc -- Mount point for the proc filesystem, which gives access to kernel status information via the following files. /proc/net/dev -- device information /proc/net/raw -- raw socket information /proc/net/tcp -- TCP socket information /proc/net/udp -- UDP socket information /proc/net/udplite -- UDPLite socket information /proc/net/igmp -- IGMP multicast information /proc/net/unix -- Unix domain socket information /proc/net/ipx -- IPX socket information /proc/net/ax25 -- AX25 socket information /proc/net/appletalk -- DDP (appletalk) socket information /proc/net/nr -- NET/ROM socket information /proc/net/route -- IP routing information /proc/net/ax25_route -- AX25 routing information /proc/net/ipx_route -- IPX routing information /proc/net/nr_nodes -- NET/ROM nodelist /proc/net/nr_neigh -- NET/ROM neighbours /proc/net/ip_masquerade -- masqueraded connections /sys/kernel/debug/bluetooth/l2cap -- Bluetooth L2CAP information /sys/kernel/debug/bluetooth/rfcomm -- Bluetooth serial connections /proc/net/snmp -- statistics SEE ALSO top route(8), ifconfig(8), iptables(8), proc(5), ss(8), ip(8) BUGS top Occasionally strange information may appear if a socket changes as it is viewed. This is unlikely to occur. AUTHORS top The netstat user interface was written by Fred Baumgarten <[email protected]>, the man page basically by Matt Welsh <[email protected]>. It was updated by Alan Cox <[email protected]>, updated again by Tuan Hoang <[email protected]>. The man page and the command included in the net-tools package is totally rewritten by Bernd Eckenfels <[email protected]>. UDPLite options were added by Brian Micek <[email protected]> COLOPHON top This page is part of the net-tools (networking utilities) project. Information about the project can be found at http://net-tools.sourceforge.net/. If you have a bug report for this manual page, see http://net-tools.sourceforge.net/. This page was obtained from the project's upstream Git repository git://git.code.sf.net/p/net-tools/code on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-06-29.) 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] net-tools 2014-10-07 NETSTAT(8) Pages that refer to this page: networks(5), proc(5), icmp(7), arp(8), ifconfig(8), netcap(8), rarp(8), route(8), traceroute(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. | # netstat\n\n> Displays network-related information such as open connections, open socket ports, etc.\n> More information: <https://man7.org/linux/man-pages/man8/netstat.8.html>.\n\n- List all ports:\n\n`netstat --all`\n\n- List all listening ports:\n\n`netstat --listening`\n\n- List listening TCP ports:\n\n`netstat --tcp`\n\n- Display PID and program names:\n\n`netstat --program`\n\n- List information continuously:\n\n`netstat --continuous`\n\n- List routes and do not resolve IP addresses to hostnames:\n\n`netstat --route --numeric`\n\n- List listening TCP and UDP ports (+ user and process if you're root):\n\n`netstat --listening --program --numeric --tcp --udp --extend`\n |
networkctl | networkctl(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training networkctl(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COMMANDS | OPTIONS | EXIT STATUS | SEE ALSO | NOTES | COLOPHON NETWORKCTL(1) networkctl NETWORKCTL(1) NAME top networkctl - Query or modify the status of network links SYNOPSIS top networkctl [OPTIONS...] COMMAND [LINK...] DESCRIPTION top networkctl may be used to query or modify the state of the network links as seen by systemd-networkd. Please refer to systemd-networkd.service(8) for an introduction to the basic concepts, functionality, and configuration syntax. COMMANDS top The following commands are understood: list [PATTERN...] Show a list of existing links and their status. If one or more PATTERNs are specified, only links matching one of them are shown. If no further arguments are specified shows all links, otherwise just the specified links. Produces output similar to: IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 eth0 ether routable configured 3 virbr0 ether no-carrier unmanaged 4 virbr0-nic ether off unmanaged 4 links listed. The operational status is one of the following: missing The device is missing. Added in version 245. off The device is powered down. Added in version 240. no-carrier The device is powered up, but does not yet have a carrier. Added in version 240. dormant The device has a carrier, but is not yet ready for normal traffic. Added in version 240. degraded-carrier One of the bonding or bridge slave network interfaces is in off, no-carrier, or dormant state, and the master interface has no address. Added in version 242. carrier The link has carrier, or for bond or bridge master, all bonding or bridge slave network interfaces are enslaved to the master. Added in version 240. degraded The link has carrier and addresses valid on the local link configured. For bond or bridge master this means that not all slave network interfaces have carrier but at least one does. Added in version 240. enslaved The link has carrier and is enslaved to bond or bridge master network interface. Added in version 242. routable The link has carrier and routable address configured. For bond or bridge master it is not necessary for all slave network interfaces to have carrier, but at least one must. Added in version 240. The setup status is one of the following: pending systemd-udevd(8) is still processing the link, we don't yet know if we will manage it. Added in version 240. initialized systemd-udevd(8) has processed the link, but we don't yet know if we will manage it. Added in version 251. configuring Configuration for the link is being retrieved or the link is being configured. Added in version 240. configured Link has been configured successfully. Added in version 240. unmanaged systemd-networkd is not handling the link. Added in version 240. failed systemd-networkd failed to configure the link. Added in version 240. linger The link is gone, but has not yet been dropped by systemd-networkd. Added in version 240. Added in version 219. status [PATTERN...] Show information about the specified links: type, state, kernel module driver, hardware and IP address, configured DNS servers, etc. If one or more PATTERNs are specified, only links matching one of them are shown. When no links are specified, an overall network status is shown. Also see the option --all. Produces output similar to: State: routable Online state: online Address: 10.193.76.5 on eth0 192.168.122.1 on virbr0 169.254.190.105 on eth0 fe80::5054:aa:bbbb:cccc on eth0 Gateway: 10.193.11.1 (CISCO SYSTEMS, INC.) on eth0 DNS: 8.8.8.8 8.8.4.4 In the overall network status, the online state depends on the individual online state of all required links. Managed links are required for online by default. In this case, the online state is one of the following: unknown All links have unknown online status (i.e. there are no required links). Added in version 249. offline All required links are offline. Added in version 249. partial Some, but not all, required links are online. Added in version 249. online All required links are online. Added in version 249. Added in version 219. lldp [PATTERN...] Show discovered LLDP (Link Layer Discovery Protocol) neighbors. If one or more PATTERNs are specified only neighbors on those interfaces are shown. Otherwise shows discovered neighbors on all interfaces. Note that for this feature to work, LLDP= must be turned on for the specific interface, see systemd.network(5) for details. Produces output similar to: LINK CHASSIS ID SYSTEM NAME CAPS PORT ID PORT DESCRIPTION enp0s25 00:e0:4c:00:00:00 GS1900 ..b........ 2 Port #2 Capability Flags: o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router; t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN; s - Service VLAN, m - Two-port MAC Relay (TPMR) 1 neighbors listed. Added in version 219. label Show numerical address labels that can be used for address selection. This is the same information that ip-addrlabel(8) shows. See RFC 3484[1] for a discussion of address labels. Produces output similar to: Prefix/Prefixlen Label ::/0 1 fc00::/7 5 fec0::/10 11 2002::/16 2 3ffe::/16 12 2001:10::/28 7 2001::/32 6 ::ffff:0.0.0.0/96 4 ::/96 3 ::1/128 0 Added in version 234. delete DEVICE... Deletes virtual netdevs. Takes interface name or index number. Added in version 243. up DEVICE... Bring devices up. Takes interface name or index number. Added in version 246. down DEVICE... Bring devices down. Takes interface name or index number. Added in version 246. renew DEVICE... Renew dynamic configurations e.g. addresses received from DHCP server. Takes interface name or index number. Added in version 244. forcerenew DEVICE... Send a FORCERENEW message to all connected clients, triggering DHCP reconfiguration. Takes interface name or index number. Added in version 246. reconfigure DEVICE... Reconfigure network interfaces. Takes interface name or index number. Note that this does not reload .netdev or .network corresponding to the specified interface. So, if you edit config files, it is necessary to call networkctl reload first to apply new settings. Added in version 244. reload Reload .netdev and .network files. If a new .netdev file is found, then the corresponding netdev is created. Note that even if an existing .netdev is modified or removed, systemd-networkd does not update or remove the netdev. If a new, modified or removed .network file is found, then all interfaces which match the file are reconfigured. Added in version 244. edit FILE|@DEVICE... Edit network configuration files, which include .network, .netdev, and .link files. If no network config file matching the given name is found, a new one will be created under /etc/ or /run/, depending on whether --runtime is specified. Specially, if the name is prefixed by "@", it will be treated as a network interface, and editing will be performed on the network config files associated with it. Additionally, the interface name can be suffixed with ":network" (default) or ":link", in order to choose the type of network config to operate on. If --drop-in= is specified, edit the drop-in file instead of the main configuration file. Unless --no-reload is specified, systemd-networkd will be reloaded after the edit of the .network or .netdev files finishes. The same applies for .link files and systemd-udevd(8). Note that the changed link settings are not automatically applied after reloading. To achieve that, trigger uevents for the corresponding interface. Refer to systemd.link(5) for more information. Added in version 254. cat FILE|@DEVICE... Show network configuration files. This command honors the "@" prefix in the same way as edit. Added in version 254. mask FILE... Mask network configuration files, which include .network, .netdev, and .link files. A symlink of the given name will be created under /etc/ or /run/, depending on whether --runtime is specified, that points to /dev/null. If a non-empty config file with the specified name exists under the target directory or a directory with higher priority (e.g. --runtime is used while an existing config resides in /etc/), the operation is aborted. This command honors --no-reload in the same way as edit. Added in version 256. unmask FILE... Unmask network configuration files, i.e. reverting the effect of mask. Note that this command operates regardless of the scope of the directory, i.e. --runtime is of no effect. This command honors --no-reload in the same way as edit and mask. Added in version 256. OPTIONS top The following options are understood: -a --all Show all links with status. Added in version 219. -s --stats Show link statistics with status. Added in version 243. -l, --full Do not ellipsize the output. Added in version 245. -n, --lines= When used with status, controls the number of journal lines to show, counting from the most recent ones. Takes a positive integer argument. Defaults to 10. Added in version 245. --drop-in=NAME When used with edit, edit the drop-in file NAME instead of the main configuration file. Added in version 254. --no-reload When used with edit, mask, or unmask, systemd-networkd.service(8) or systemd-udevd.service(8) will not be reloaded after the operation finishes. Added in version 254. --runtime When used with edit or mask, operate on the file under /run/ instead of /etc/. Added in version 256. --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. --version Print a short version string and exit. --no-legend Do not print the legend, i.e. column headers and the footer with hints. --no-pager Do not pipe output into a pager. EXIT STATUS top On success, 0 is returned, a non-zero failure code otherwise. SEE ALSO top systemd-networkd.service(8), systemd.network(5), systemd.netdev(5), ip(8) NOTES top 1. RFC 3484 https://tools.ietf.org/html/rfc3484 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 NETWORKCTL(1) Pages that refer to this page: systemd.network(5), systemd.directives(7), systemd.index(7), systemd-networkd.service(8), systemd-networkd-wait-online.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. | # networkctl\n\n> Query the status of network links.\n> Manage the network configuration using `systemd-networkd`.\n> More information: <https://www.freedesktop.org/software/systemd/man/networkctl.html>.\n\n- List existing links with their status:\n\n`networkctl list`\n\n- Show an overall network status:\n\n`networkctl status`\n\n- Bring network devices up:\n\n`networkctl up {{interface1 interface2 ...}}`\n\n- Bring network devices down:\n\n`networkctl down {{interface1 interface2 ...}}`\n\n- Renew dynamic configurations (e.g. IP addresses received from a DHCP server):\n\n`networkctl renew {{interface1 interface2 ...}}`\n\n- Reload configuration files (.netdev and .network):\n\n`networkctl reload`\n\n- Reconfigure network interfaces (if you edited the config, you need to call `networkctl reload` first):\n\n`networkctl reconfigure {{interface1 interface2 ...}}`\n |
newgrp | newgrp(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training newgrp(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | CONFIGURATION | FILES | SEE ALSO | COLOPHON NEWGRP(1) User Commands NEWGRP(1) NAME top newgrp - log in to a new group SYNOPSIS top newgrp [-] [group] DESCRIPTION top The newgrp command is used to change the current group ID during a login session. If the optional - flag is given, the user's environment will be reinitialized as though the user had logged in, otherwise the current environment, including current working directory, remains unchanged. newgrp changes the current real group ID to the named group, or to the default group listed in /etc/passwd if no group name is given. newgrp also tries to add the group to the user groupset. If not root, the user will be prompted for a password if she does not have a password (in /etc/shadow if this user has an entry in the shadowed password file, or in /etc/passwd otherwise) and the group does, or if the user is not listed as a member and the group has a password. The user will be denied access if the group password is empty and the user is not listed as a member. If there is an entry for this group in /etc/gshadow, then the list of members and the password of this group will be taken from this file, otherwise, the entry in /etc/group is considered. CONFIGURATION top The following configuration variables in /etc/login.defs change the behavior of this tool: SYSLOG_SG_ENAB (boolean) Enable "syslog" logging of sg activity. FILES top /etc/passwd User account information. /etc/shadow Secure user account information. /etc/group Group account information. /etc/gshadow Secure group account information. SEE ALSO top id(1), login(1), su(1), sg(1), gpasswd(1), group(5), gshadow(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 NEWGRP(1) Pages that refer to this page: flock(1), gpasswd(1), groups(1@@shadow-utils), pmdammv(1), sg(1), group(5), gshadow(5), credentials(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. | # newgrp\n\n> Switch primary group membership.\n> More information: <https://manned.org/newgrp>.\n\n- Change user's primary group membership:\n\n`newgrp {{group_name}}`\n\n- Reset primary group membership to user's default group in `/etc/passwd`:\n\n`newgrp`\n |
nice | nice(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training nice(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON NICE(1) User Commands NICE(1) NAME top nice - run a program with modified scheduling priority SYNOPSIS top nice [OPTION] [COMMAND [ARG]...] DESCRIPTION top Run COMMAND with an adjusted niceness, which affects process scheduling. With no COMMAND, print the current niceness. Niceness values range from -20 (most favorable to the process) to 19 (least favorable to the process). Mandatory arguments to long options are mandatory for short options too. -n, --adjustment=N add integer N to the niceness (default 10) --help display this help and exit --version output version information and exit NOTE: your shell may have its own version of nice, which usually supersedes the version described here. Please refer to your shell's documentation for details about the options it supports. Exit status: 125 if the nice command itself fails 126 if COMMAND is found but cannot be invoked 127 if COMMAND cannot be found - the exit status of COMMAND otherwise 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 nice(2), renice(1) Full documentation <https://www.gnu.org/software/coreutils/nice> or available locally via: info '(coreutils) nice 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 NICE(1) Pages that refer to this page: chrt(1), kill(1@@procps-ng), ps(1), renice(1), skill(1), taskset(1), uclampset(1), getpriority(2), nice(2), sched(7), 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. | # nice\n\n> Execute a program with a custom scheduling priority (niceness).\n> Niceness values range from -20 (the highest priority) to 19 (the lowest).\n> More information: <https://www.gnu.org/software/coreutils/nice>.\n\n- Launch a program with altered priority:\n\n`nice -n {{niceness_value}} {{command}}`\n |
nl | nl(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training nl(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON NL(1) User Commands NL(1) NAME top nl - number lines of files SYNOPSIS top nl [OPTION]... [FILE]... DESCRIPTION top Write each FILE to standard output, with line numbers added. With no FILE, or when FILE is -, read standard input. Mandatory arguments to long options are mandatory for short options too. -b, --body-numbering=STYLE use STYLE for numbering body lines -d, --section-delimiter=CC use CC for logical page delimiters -f, --footer-numbering=STYLE use STYLE for numbering footer lines -h, --header-numbering=STYLE use STYLE for numbering header lines -i, --line-increment=NUMBER line number increment at each line -l, --join-blank-lines=NUMBER group of NUMBER empty lines counted as one -n, --number-format=FORMAT insert line numbers according to FORMAT -p, --no-renumber do not reset line numbers for each section -s, --number-separator=STRING add STRING after (possible) line number -v, --starting-line-number=NUMBER first line number for each section -w, --number-width=NUMBER use NUMBER columns for line numbers --help display this help and exit --version output version information and exit Default options are: -bt -d'\:' -fn -hn -i1 -l1 -n'rn' -s<TAB> -v1 -w6 CC are two delimiter characters used to construct logical page delimiters; a missing second character implies ':'. As a GNU extension one can specify more than two characters, and also specifying the empty string (-d '') disables section matching. STYLE is one of: a number all lines t number only nonempty lines n number no lines pBRE number only lines that contain a match for the basic regular expression, BRE FORMAT is one of: ln left justified, no leading zeros rn right justified, no leading zeros rz right justified, leading zeros AUTHOR top Written by Scott Bartram 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/nl> or available locally via: info '(coreutils) nl 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 NL(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. | # nl\n\n> Number lines from a file or from `stdin`.\n> More information: <https://manned.org/nl.1p>.\n\n- Number non-blank lines in a file:\n\n`nl {{path/to/file}}`\n\n- Read from `stdin`:\n\n`{{command}} | nl -`\n\n- Number [a]ll [b]ody lines including blank lines or do not [n]umber [b]ody lines:\n\n`nl --body-numbering {{a|n}} {{path/to/file}}`\n\n- Number only the [b]ody lines that match a basic regular expression (BRE) [p]attern:\n\n`nl --body-numbering p'FooBar[0-9]' {{path/to/file}}`\n\n- Use a specific [i]ncrement for line numbering:\n\n`nl --line-increment {{increment}} {{path/to/file}}`\n\n- Specify the line numbering format to [r]ight or [l]eft justified, keeping leading [z]eros or [n]ot:\n\n`nl --number-format {{rz|ln|rn}}`\n\n- Specify the line numbering's width (6 by default):\n\n`nl --number-width {{col_width}} {{path/to/file}}`\n\n- Use a specific string to separate the line numbers from the lines (TAB by default):\n\n`nl --number-separator {{separator}} {{path/to/file}}`\n |
nm | nm(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training nm(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | SEE ALSO | COPYRIGHT | COLOPHON NM(1) GNU Development Tools NM(1) NAME top nm - list symbols from object files SYNOPSIS top nm [-A|-o|--print-file-name] [-a|--debug-syms] [-B|--format=bsd] [-C|--demangle[=style]] [-D|--dynamic] [-fformat|--format=format] [-g|--extern-only] [-h|--help] [--ifunc-chars=CHARS] [-j|--format=just-symbols] [-l|--line-numbers] [--inlines] [-n|-v|--numeric-sort] [-P|--portability] [-p|--no-sort] [-r|--reverse-sort] [-S|--print-size] [-s|--print-armap] [-t radix|--radix=radix] [-u|--undefined-only] [-U|--defined-only] [-V|--version] [-W|--no-weak] [-X 32_64] [--no-demangle] [--no-recurse-limit|--recurse-limit]] [--plugin name] [--size-sort] [--special-syms] [--synthetic] [--target=bfdname] [--unicode=method] [--with-symbol-versions] [--without-symbol-versions] [objfile...] DESCRIPTION top GNU nm lists the symbols from object files objfile.... If no object files are listed as arguments, nm assumes the file a.out. For each symbol, nm shows: The symbol value, in the radix selected by options (see below), or hexadecimal by default. The symbol type. At least the following types are used; others are, as well, depending on the object file format. If lowercase, the symbol is usually local; if uppercase, the symbol is global (external). There are however a few lowercase symbols that are shown for special global symbols ("u", "v" and "w"). "A" The symbol's value is absolute, and will not be changed by further linking. "B" "b" The symbol is in the BSS data section. This section typically contains zero-initialized or uninitialized data, although the exact behavior is system dependent. "C" "c" The symbol is common. Common symbols are uninitialized data. When linking, multiple common symbols may appear with the same name. If the symbol is defined anywhere, the common symbols are treated as undefined references. The lower case c character is used when the symbol is in a special section for small commons. "D" "d" The symbol is in the initialized data section. "G" "g" The symbol is in an initialized data section for small objects. Some object file formats permit more efficient access to small data objects, such as a global int variable as opposed to a large global array. "i" For PE format files this indicates that the symbol is in a section specific to the implementation of DLLs. For ELF format files this indicates that the symbol is an indirect function. This is a GNU extension to the standard set of ELF symbol types. It indicates a symbol which if referenced by a relocation does not evaluate to its address, but instead must be invoked at runtime. The runtime execution will then return the value to be used in the relocation. Note - the actual symbols display for GNU indirect symbols is controlled by the --ifunc-chars command line option. If this option has been provided then the first character in the string will be used for global indirect function symbols. If the string contains a second character then that will be used for local indirect function symbols. "I" The symbol is an indirect reference to another symbol. "N" The symbol is a debugging symbol. "n" The symbol is in a non-data, non-code, non-debug read- only section. "p" The symbol is in a stack unwind section. "R" "r" The symbol is in a read only data section. "S" "s" The symbol is in an uninitialized or zero-initialized data section for small objects. "T" "t" The symbol is in the text (code) section. "U" The symbol is undefined. "u" The symbol is a unique global symbol. This is a GNU extension to the standard set of ELF symbol bindings. For such a symbol the dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. "V" "v" The symbol is a weak object. When a weak defined symbol is linked with a normal defined symbol, the normal defined symbol is used with no error. When a weak undefined symbol is linked and the symbol is not defined, the value of the weak symbol becomes zero with no error. On some systems, uppercase indicates that a default value has been specified. "W" "w" The symbol is a weak symbol that has not been specifically tagged as a weak object symbol. When a weak defined symbol is linked with a normal defined symbol, the normal defined symbol is used with no error. When a weak undefined symbol is linked and the symbol is not defined, the value of the symbol is determined in a system-specific manner without error. On some systems, uppercase indicates that a default value has been specified. "-" The symbol is a stabs symbol in an a.out object file. In this case, the next values printed are the stabs other field, the stabs desc field, and the stab type. Stabs symbols are used to hold debugging information. "?" The symbol type is unknown, or object file format specific. The symbol name. If a symbol has version information associated with it, then the version information is displayed as well. If the versioned symbol is undefined or hidden from linker, the version string is displayed as a suffix to the symbol name, preceded by an @ character. For example foo@VER_1. If the version is the default version to be used when resolving unversioned references to the symbol, then it is displayed as a suffix preceded by two @ characters. For example foo@@VER_2. OPTIONS top The long and short forms of options, shown here as alternatives, are equivalent. -A -o --print-file-name Precede each symbol by the name of the input file (or archive member) in which it was found, rather than identifying the input file once only, before all of its symbols. -a --debug-syms Display all symbols, even debugger-only symbols; normally these are not listed. -B The same as --format=bsd (for compatibility with the MIPS nm). -C --demangle[=style] Decode (demangle) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. Different compilers have different mangling styles. The optional demangling style argument can be used to choose an appropriate demangling style for your compiler. --no-demangle Do not demangle low-level symbol names. This is the default. --recurse-limit --no-recurse-limit --recursion-limit --no-recursion-limit Enables or disables a limit on the amount of recursion performed whilst demangling strings. Since the name mangling formats allow for an infinite level of recursion it is possible to create strings whose decoding will exhaust the amount of stack space available on the host machine, triggering a memory fault. The limit tries to prevent this from happening by restricting recursion to 2048 levels of nesting. The default is for this limit to be enabled, but disabling it may be necessary in order to demangle truly complicated names. Note however that if the recursion limit is disabled then stack exhaustion is possible and any bug reports about such an event will be rejected. -D --dynamic Display the dynamic symbols rather than the normal symbols. This is only meaningful for dynamic objects, such as certain types of shared libraries. -f format --format=format Use the output format format, which can be "bsd", "sysv", "posix" or "just-symbols". The default is "bsd". Only the first character of format is significant; it can be either upper or lower case. -g --extern-only Display only external symbols. -h --help Show a summary of the options to nm and exit. --ifunc-chars=CHARS When display GNU indirect function symbols nm will default to using the "i" character for both local indirect functions and global indirect functions. The --ifunc-chars option allows the user to specify a string containing one or two characters. The first character will be used for global indirect function symbols and the second character, if present, will be used for local indirect function symbols. j The same as --format=just-symbols. -l --line-numbers For each symbol, use debugging information to try to find a filename and line number. For a defined symbol, look for the line number of the address of the symbol. For an undefined symbol, look for the line number of a relocation entry which refers to the symbol. If line number information can be found, print it after the other symbol information. --inlines When option -l is active, if the address belongs to a function that was inlined, then this option causes the source information for all enclosing scopes back to the first non- inlined function to be printed as well. For example, if "main" inlines "callee1" which inlines "callee2", and address is from "callee2", the source information for "callee1" and "main" will also be printed. -n -v --numeric-sort Sort symbols numerically by their addresses, rather than alphabetically by their names. -p --no-sort Do not bother to sort the symbols in any order; print them in the order encountered. -P --portability Use the POSIX.2 standard output format instead of the default format. Equivalent to -f posix. -r --reverse-sort Reverse the order of the sort (whether numeric or alphabetic); let the last come first. -S --print-size Print both value and size of defined symbols for the "bsd" output style. This option has no effect for object formats that do not record symbol sizes, unless --size-sort is also used in which case a calculated size is displayed. -s --print-armap When listing symbols from archive members, include the index: a mapping (stored in the archive by ar or ranlib) of which modules contain definitions for which names. -t radix --radix=radix Use radix as the radix for printing the symbol values. It must be d for decimal, o for octal, or x for hexadecimal. -u --undefined-only Display only undefined symbols (those external to each object file). By default both defined and undefined symbols are displayed. -U --defined-only Display only defined symbols for each object file. By default both defined and undefined symbols are displayed. -V --version Show the version number of nm and exit. -X This option is ignored for compatibility with the AIX version of nm. It takes one parameter which must be the string 32_64. The default mode of AIX nm corresponds to -X 32, which is not supported by GNU nm. --plugin name Load the plugin called name to add support for extra target types. This option is only available if the toolchain has been built with plugin support enabled. If --plugin is not provided, but plugin support has been enabled then nm iterates over the files in ${libdir}/bfd-plugins in alphabetic order and the first plugin that claims the object in question is used. Please note that this plugin search directory is not the one used by ld's -plugin option. In order to make nm use the linker plugin it must be copied into the ${libdir}/bfd-plugins directory. For GCC based compilations the linker plugin is called liblto_plugin.so.0.0.0. For Clang based compilations it is called LLVMgold.so. The GCC plugin is always backwards compatible with earlier versions, so it is sufficient to just copy the newest one. --size-sort Sort symbols by size. For ELF objects symbol sizes are read from the ELF, for other object types the symbol sizes are computed as the difference between the value of the symbol and the value of the symbol with the next higher value. If the "bsd" output format is used the size of the symbol is printed, rather than the value, and -S must be used in order both size and value to be printed. Note - this option does not work if --undefined-only has been enabled as undefined symbols have no size. --special-syms Display symbols which have a target-specific special meaning. These symbols are usually used by the target for some special processing and are not normally helpful when included in the normal symbol lists. For example for ARM targets this option would skip the mapping symbols used to mark transitions between ARM code, THUMB code and data. --synthetic Include synthetic symbols in the output. These are special symbols created by the linker for various purposes. They are not shown by default since they are not part of the binary's original source code. --unicode=[default|invalid|locale|escape|hex|highlight] Controls the display of UTF-8 encoded multibyte characters in strings. The default (--unicode=default) is to give them no special treatment. The --unicode=locale option displays the sequence in the current locale, which may or may not support them. The options --unicode=hex and --unicode=invalid display them as hex byte sequences enclosed by either angle brackets or curly braces. The --unicode=escape option displays them as escape sequences (\uxxxx) and the --unicode=highlight option displays them as escape sequences highlighted in red (if supported by the output device). The colouring is intended to draw attention to the presence of unicode sequences where they might not be expected. -W --no-weak Do not display weak symbols. --with-symbol-versions --without-symbol-versions Enables or disables the display of symbol version information. The version string is displayed as a suffix to the symbol name, preceded by an @ character. For example foo@VER_1. If the version is the default version to be used when resolving unversioned references to the symbol then it is displayed as a suffix preceded by two @ characters. For example foo@@VER_2. By default, symbol version information is displayed. --target=bfdname Specify an object code format other than your system's default format. @file Read command-line options from file. The options read are inserted in place of the original @file option. If file does not exist, or cannot be read, then the option will be treated literally, and not removed. Options in file are separated by whitespace. A whitespace character may be included in an option by surrounding the entire option in either single or double quotes. Any character (including a backslash) may be included by prefixing the character to be included with a backslash. The file may itself contain additional @file options; any such options will be processed recursively. SEE ALSO top ar(1), objdump(1), ranlib(1), and the Info entries for binutils. COPYRIGHT top Copyright (c) 1991-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 binutils (a collection of tools for working with executable binaries) project. Information about the project can be found at http://www.gnu.org/software/binutils/. If you have a bug report for this manual page, see http://sourceware.org/bugzilla/enter_bug.cgi?product=binutils. This page was obtained from the tarball binutils-2.41.tar.gz fetched from https://ftp.gnu.org/gnu/binutils/ 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] binutils-2.41 2023-12-22 NM(1) Pages that refer to this page: ar(1), ld(1), objdump(1), ranlib(1), strings(1), elf(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. | # nm\n\n> List symbol names in object files.\n> More information: <https://manned.org/nm>.\n\n- List global (extern) functions in a file (prefixed with T):\n\n`nm -g {{path/to/file.o}}`\n\n- List only undefined symbols in a file:\n\n`nm -u {{path/to/file.o}}`\n\n- List all symbols, even debugging symbols:\n\n`nm -a {{path/to/file.o}}`\n\n- Demangle C++ symbols (make them readable):\n\n`nm --demangle {{path/to/file.o}}`\n |
nmap | nmap(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training nmap(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS SUMMARY | TARGET SPECIFICATION | HOST DISCOVERY | PORT SCANNING BASICS | PORT SCANNING TECHNIQUES | PORT SPECIFICATION AND SCAN ORDER | SERVICE AND VERSION DETECTION | OS DETECTION | NMAP SCRIPTING ENGINE (NSE) | TIMING AND PERFORMANCE | FIREWALL/IDS EVASION AND SPOOFING | OUTPUT | MISCELLANEOUS OPTIONS | RUNTIME INTERACTION | EXAMPLES | NMAP BOOK | BUGS | AUTHORS | LEGAL NOTICES | NOTES | COLOPHON NMAP(1) Nmap Reference Guide NMAP(1) NAME top nmap - Network exploration tool and security / port scanner SYNOPSIS top nmap [Scan Type...] [Options] {target specification} DESCRIPTION top Nmap (Network Mapper) is an open source tool for network exploration and security auditing. It was designed to rapidly scan large networks, although it works fine against single hosts. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. While Nmap is commonly used for security audits, many systems and network administrators find it useful for routine tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. The output from Nmap is a list of scanned targets, with supplemental information on each depending on the options used. Key among that information is the interesting ports table. That table lists the port number and protocol, service name, and state. The state is either open, filtered, closed, or unfiltered. Open means that an application on the target machine is listening for connections/packets on that port. Filtered means that a firewall, filter, or other network obstacle is blocking the port so that Nmap cannot tell whether it is open or closed. Closed ports have no application listening on them, though they could open up at any time. Ports are classified as unfiltered when they are responsive to Nmap's probes, but Nmap cannot determine whether they are open or closed. Nmap reports the state combinations open|filtered and closed|filtered when it cannot determine which of the two states describe a port. The port table may also include software version details when version detection has been requested. When an IP protocol scan is requested (-sO), Nmap provides information on supported IP protocols rather than listening ports. In addition to the interesting ports table, Nmap can provide further information on targets, including reverse DNS names, operating system guesses, device types, and MAC addresses. A typical Nmap scan is shown in Example 1. The only Nmap arguments used in this example are -A, to enable OS and version detection, script scanning, and traceroute; -T4 for faster execution; and then the hostname. Example 1. A representative Nmap scan # nmap -A -T4 scanme.nmap.org Nmap scan report for scanme.nmap.org (74.207.244.221) Host is up (0.029s latency). rDNS record for 74.207.244.221: li86-221.members.linode.com Not shown: 995 closed ports PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 5.3p1 Debian 3ubuntu7 (protocol 2.0) | ssh-hostkey: 1024 8d:60:f1:7c:ca:b7:3d:0a:d6:67:54:9d:69:d9:b9:dd (DSA) |_2048 79:f8:09:ac:d4:e2:32:42:10:49:d3:bd:20:82:85:ec (RSA) 80/tcp open http Apache httpd 2.2.14 ((Ubuntu)) |_http-title: Go ahead and ScanMe! 646/tcp filtered ldp 1720/tcp filtered H.323/Q.931 9929/tcp open nping-echo Nping echo Device type: general purpose Running: Linux 2.6.X OS CPE: cpe:/o:linux:linux_kernel:2.6.39 OS details: Linux 2.6.39 Network Distance: 11 hops Service Info: OS: Linux; CPE: cpe:/o:linux:kernel TRACEROUTE (using port 53/tcp) HOP RTT ADDRESS [Cut first 10 hops for brevity] 11 17.65 ms li86-221.members.linode.com (74.207.244.221) Nmap done: 1 IP address (1 host up) scanned in 14.40 seconds The newest version of Nmap can be obtained from https://nmap.org . The newest version of this man page is available at https://nmap.org/book/man.html . It is also included as a chapter of Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning (see https://nmap.org/book/ ). OPTIONS SUMMARY top This options summary is printed when Nmap is run with no arguments, and the latest version is always available at https://svn.nmap.org/nmap/docs/nmap.usage.txt . It helps people remember the most common options, but is no substitute for the in-depth documentation in the rest of this manual. Some obscure options aren't even included here. Nmap 7.94 ( https://nmap.org ) Usage: nmap [Scan Type(s)] [Options] {target specification} TARGET SPECIFICATION: Can pass hostnames, IP addresses, networks, etc. Ex: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254 -iL <inputfilename>: Input from list of hosts/networks -iR <num hosts>: Choose random targets --exclude <host1[,host2][,host3],...>: Exclude hosts/networks --excludefile <exclude_file>: Exclude list from file HOST DISCOVERY: -sL: List Scan - simply list targets to scan -sn: Ping Scan - disable port scan -Pn: Treat all hosts as online -- skip host discovery -PS/PA/PU/PY[portlist]: TCP SYN/ACK, UDP or SCTP discovery to given ports -PE/PP/PM: ICMP echo, timestamp, and netmask request discovery probes -PO[protocol list]: IP Protocol Ping -n/-R: Never do DNS resolution/Always resolve [default: sometimes] --dns-servers <serv1[,serv2],...>: Specify custom DNS servers --system-dns: Use OS's DNS resolver --traceroute: Trace hop path to each host SCAN TECHNIQUES: -sS/sT/sA/sW/sM: TCP SYN/Connect()/ACK/Window/Maimon scans -sU: UDP Scan -sN/sF/sX: TCP Null, FIN, and Xmas scans --scanflags <flags>: Customize TCP scan flags -sI <zombie host[:probeport]>: Idle scan -sY/sZ: SCTP INIT/COOKIE-ECHO scans -sO: IP protocol scan -b <FTP relay host>: FTP bounce scan PORT SPECIFICATION AND SCAN ORDER: -p <port ranges>: Only scan specified ports Ex: -p22; -p1-65535; -p U:53,111,137,T:21-25,80,139,8080,S:9 --exclude-ports <port ranges>: Exclude the specified ports from scanning -F: Fast mode - Scan fewer ports than the default scan -r: Scan ports sequentially - don't randomize --top-ports <number>: Scan <number> most common ports --port-ratio <ratio>: Scan ports more common than <ratio> SERVICE/VERSION DETECTION: -sV: Probe open ports to determine service/version info --version-intensity <level>: Set from 0 (light) to 9 (try all probes) --version-light: Limit to most likely probes (intensity 2) --version-all: Try every single probe (intensity 9) --version-trace: Show detailed version scan activity (for debugging) SCRIPT SCAN: -sC: equivalent to --script=default --script=<Lua scripts>: <Lua scripts> is a comma separated list of directories, script-files or script-categories --script-args=<n1=v1,[n2=v2,...]>: provide arguments to scripts --script-args-file=filename: provide NSE script args in a file --script-trace: Show all data sent and received --script-updatedb: Update the script database. --script-help=<Lua scripts>: Show help about scripts. <Lua scripts> is a comma-separated list of script-files or script-categories. OS DETECTION: -O: Enable OS detection --osscan-limit: Limit OS detection to promising targets --osscan-guess: Guess OS more aggressively TIMING AND PERFORMANCE: Options which take <time> are in seconds, or append 'ms' (milliseconds), 's' (seconds), 'm' (minutes), or 'h' (hours) to the value (e.g. 30m). -T<0-5>: Set timing template (higher is faster) --min-hostgroup/max-hostgroup <size>: Parallel host scan group sizes --min-parallelism/max-parallelism <numprobes>: Probe parallelization --min-rtt-timeout/max-rtt-timeout/initial-rtt-timeout <time>: Specifies probe round trip time. --max-retries <tries>: Caps number of port scan probe retransmissions. --host-timeout <time>: Give up on target after this long --scan-delay/--max-scan-delay <time>: Adjust delay between probes --min-rate <number>: Send packets no slower than <number> per second --max-rate <number>: Send packets no faster than <number> per second FIREWALL/IDS EVASION AND SPOOFING: -f; --mtu <val>: fragment packets (optionally w/given MTU) -D <decoy1,decoy2[,ME],...>: Cloak a scan with decoys -S <IP_Address>: Spoof source address -e <iface>: Use specified interface -g/--source-port <portnum>: Use given port number --proxies <url1,[url2],...>: Relay connections through HTTP/SOCKS4 proxies --data <hex string>: Append a custom payload to sent packets --data-string <string>: Append a custom ASCII string to sent packets --data-length <num>: Append random data to sent packets --ip-options <options>: Send packets with specified ip options --ttl <val>: Set IP time-to-live field --spoof-mac <mac address/prefix/vendor name>: Spoof your MAC address --badsum: Send packets with a bogus TCP/UDP/SCTP checksum OUTPUT: -oN/-oX/-oS/-oG <file>: Output scan in normal, XML, s|<rIpt kIddi3, and Grepable format, respectively, to the given filename. -oA <basename>: Output in the three major formats at once -v: Increase verbosity level (use -vv or more for greater effect) -d: Increase debugging level (use -dd or more for greater effect) --reason: Display the reason a port is in a particular state --open: Only show open (or possibly open) ports --packet-trace: Show all packets sent and received --iflist: Print host interfaces and routes (for debugging) --append-output: Append to rather than clobber specified output files --resume <filename>: Resume an aborted scan --noninteractive: Disable runtime interactions via keyboard --stylesheet <path/URL>: XSL stylesheet to transform XML output to HTML --webxml: Reference stylesheet from Nmap.Org for more portable XML --no-stylesheet: Prevent associating of XSL stylesheet w/XML output MISC: -6: Enable IPv6 scanning -A: Enable OS detection, version detection, script scanning, and traceroute --datadir <dirname>: Specify custom Nmap data file location --send-eth/--send-ip: Send using raw ethernet frames or IP packets --privileged: Assume that the user is fully privileged --unprivileged: Assume the user lacks raw socket privileges -V: Print version number -h: Print this help summary page. EXAMPLES: nmap -v -A scanme.nmap.org nmap -v -sn 192.168.0.0/16 10.0.0.0/8 nmap -v -iR 10000 -Pn -p 80 SEE THE MAN PAGE (https://nmap.org/book/man.html) FOR MORE OPTIONS AND EXAMPLES TARGET SPECIFICATION top Everything on the Nmap command-line that isn't an option (or option argument) is treated as a target host specification. The simplest case is to specify a target IP address or hostname for scanning. When a hostname is given as a target, it is resolved via the Domain Name System (DNS) to determine the IP address to scan. If the name resolves to more than one IP address, only the first one will be scanned. To make Nmap scan all the resolved addresses instead of only the first one, use the --resolve-all option. Sometimes you wish to scan a whole network of adjacent hosts. For this, Nmap supports CIDR-style addressing. You can append /numbits to an IP address or hostname and Nmap will scan every IP address for which the first numbits are the same as for the reference IP or hostname given. For example, 192.168.10.0/24 would scan the 256 hosts between 192.168.10.0 (binary: 11000000 10101000 00001010 00000000) and 192.168.10.255 (binary: 11000000 10101000 00001010 11111111), inclusive. 192.168.10.40/24 would scan exactly the same targets. Given that the host scanme.nmap.org is at the IP address 64.13.134.52, the specification scanme.nmap.org/16 would scan the 65,536 IP addresses between 64.13.0.0 and 64.13.255.255. The smallest allowed value is /0, which targets the whole Internet. The largest value for IPv4 is /32, which scans just the named host or IP address because all address bits are fixed. The largest value for IPv6 is /128, which does the same thing. CIDR notation is short but not always flexible enough. For example, you might want to scan 192.168.0.0/16 but skip any IPs ending with .0 or .255 because they may be used as subnet network and broadcast addresses. Nmap supports this through octet range addressing. Rather than specify a normal IP address, you can specify a comma-separated list of numbers or ranges for each octet. For example, 192.168.0-255.1-254 will skip all addresses in the range that end in .0 or .255, and 192.168.3-5,7.1 will scan the four addresses 192.168.3.1, 192.168.4.1, 192.168.5.1, and 192.168.7.1. Either side of a range may be omitted; the default values are 0 on the left and 255 on the right. Using - by itself is the same as 0-255, but remember to use 0- in the first octet so the target specification doesn't look like a command-line option. Ranges need not be limited to the final octets: the specifier 0-255.0-255.13.37 will perform an Internet-wide scan for all IP addresses ending in 13.37. This sort of broad sampling can be useful for Internet surveys and research. IPv6 addresses can be specified by their fully qualified IPv6 address or hostname or with CIDR notation for subnets. Octet ranges aren't yet supported for IPv6. IPv6 addresses with non-global scope need to have a zone ID suffix. On Unix systems, this is a percent sign followed by an interface name; a complete address might be fe80::a8bb:ccff:fedd:eeff%eth0. On Windows, use an interface index number in place of an interface name: fe80::a8bb:ccff:fedd:eeff%1. You can see a list of interface indexes by running the command netsh.exe interface ipv6 show interface. Nmap accepts multiple host specifications on the command line, and they don't need to be the same type. The command nmap scanme.nmap.org 192.168.0.0/8 10.0.0,1,3-7.- does what you would expect. While targets are usually specified on the command lines, the following options are also available to control target selection: -iL inputfilename (Input from list) Reads target specifications from inputfilename. Passing a huge list of hosts is often awkward on the command line, yet it is a common desire. For example, your DHCP server might export a list of 10,000 current leases that you wish to scan. Or maybe you want to scan all IP addresses except for those to locate hosts using unauthorized static IP addresses. Simply generate the list of hosts to scan and pass that filename to Nmap as an argument to the -iL option. Entries can be in any of the formats accepted by Nmap on the command line (IP address, hostname, CIDR, IPv6, or octet ranges). Each entry must be separated by one or more spaces, tabs, or newlines. You can specify a hyphen (-) as the filename if you want Nmap to read hosts from standard input rather than an actual file. The input file may contain comments that start with # and extend to the end of the line. -iR num hosts (Choose random targets) For Internet-wide surveys and other research, you may want to choose targets at random. The num hosts argument tells Nmap how many IPs to generate. Undesirable IPs such as those in certain private, multicast, or unallocated address ranges are automatically skipped. The argument 0 can be specified for a never-ending scan. Keep in mind that some network administrators bristle at unauthorized scans of their networks and may complain. Use this option at your own risk! If you find yourself really bored one rainy afternoon, try the command nmap -Pn -sS -p 80 -iR 0 --open to locate random web servers for browsing. --exclude host1[,host2[,...]] (Exclude hosts/networks) Specifies a comma-separated list of targets to be excluded from the scan even if they are part of the overall network range you specify. The list you pass in uses normal Nmap syntax, so it can include hostnames, CIDR netblocks, octet ranges, etc. This can be useful when the network you wish to scan includes untouchable mission-critical servers, systems that are known to react adversely to port scans, or subnets administered by other people. --excludefile exclude_file (Exclude list from file) This offers the same functionality as the --exclude option, except that the excluded targets are provided in a newline-, space-, or tab-delimited exclude_file rather than on the command line. The exclude file may contain comments that start with # and extend to the end of the line. -n (No DNS resolution) Tells Nmap to never do reverse DNS resolution on the active IP addresses it finds. Since DNS can be slow even with Nmap's built-in parallel stub resolver, this option can slash scanning times. -R (DNS resolution for all targets) Tells Nmap to always do reverse DNS resolution on the target IP addresses. Normally reverse DNS is only performed against responsive (online) hosts. --resolve-all (Scan each resolved address) If a hostname target resolves to more than one address, scan all of them. The default behavior is to only scan the first resolved address. Regardless, only addresses in the appropriate address family will be scanned: IPv4 by default, IPv6 with -6. --unique (Scan each address only once) Scan each IP address only once. The default behavior is to scan each address as many times as it is specified in the target list, such as when network ranges overlap or different hostnames resolve to the same address. --system-dns (Use system DNS resolver) By default, Nmap reverse-resolves IP addresses by sending queries directly to the name servers configured on your host and then listening for responses. Many requests (often dozens) are performed in parallel to improve performance. Specify this option to use your system resolver instead (one IP at a time via the getnameinfo call). This is slower and rarely useful unless you find a bug in the Nmap parallel resolver (please let us know if you do). The system resolver is always used for forward lookups (getting an IP address from a hostname). --dns-servers server1[,server2[,...]] (Servers to use for reverse DNS queries) By default, Nmap determines your DNS servers (for rDNS resolution) from your resolv.conf file (Unix) or the Registry (Win32). Alternatively, you may use this option to specify alternate servers. This option is not honored if you are using --system-dns. Using multiple DNS servers is often faster, especially if you choose authoritative servers for your target IP space. This option can also improve stealth, as your requests can be bounced off just about any recursive DNS server on the Internet. This option also comes in handy when scanning private networks. Sometimes only a few name servers provide proper rDNS information, and you may not even know where they are. You can scan the network for port 53 (perhaps with version detection), then try Nmap list scans (-sL) specifying each name server one at a time with --dns-servers until you find one which works. This option might not be honored if the DNS response exceeds the size of a UDP packet. In such a situation our DNS resolver will make the best effort to extract a response from the truncated packet, and if not successful it will fall back to using the system resolver. Also, responses that contain CNAME aliases will fall back to the system resolver. HOST DISCOVERY top One of the very first steps in any network reconnaissance mission is to reduce a (sometimes huge) set of IP ranges into a list of active or interesting hosts. Scanning every port of every single IP address is slow and usually unnecessary. Of course what makes a host interesting depends greatly on the scan purposes. Network administrators may only be interested in hosts running a certain service, while security auditors may care about every single device with an IP address. An administrator may be comfortable using just an ICMP ping to locate hosts on his internal network, while an external penetration tester may use a diverse set of dozens of probes in an attempt to evade firewall restrictions. Because host discovery needs are so diverse, Nmap offers a wide variety of options for customizing the techniques used. Host discovery is sometimes called ping scan, but it goes well beyond the simple ICMP echo request packets associated with the ubiquitous ping tool. Users can skip the discovery step entirely with a list scan (-sL) or by disabling host discovery (-Pn), or engage the network with arbitrary combinations of multi-port TCP SYN/ACK, UDP, SCTP INIT and ICMP probes. The goal of these probes is to solicit responses which demonstrate that an IP address is actually active (is being used by a host or network device). On many networks, only a small percentage of IP addresses are active at any given time. This is particularly common with private address space such as 10.0.0.0/8. That network has 16 million IPs, but I have seen it used by companies with less than a thousand machines. Host discovery can find those machines in a sparsely allocated sea of IP addresses. If no host discovery options are given, Nmap sends an ICMP echo request, a TCP SYN packet to port 443, a TCP ACK packet to port 80, and an ICMP timestamp request. (For IPv6, the ICMP timestamp request is omitted because it is not part of ICMPv6.) These defaults are equivalent to the -PE -PS443 -PA80 -PP options. The exceptions to this are the ARP (for IPv4) and Neighbor Discovery (for IPv6) scans which are used for any targets on a local ethernet network. For unprivileged Unix shell users, the default probes are a SYN packet to ports 80 and 443 using the connect system call. This host discovery is often sufficient when scanning local networks, but a more comprehensive set of discovery probes is recommended for security auditing. The -P* options (which select ping types) can be combined. You can increase your odds of penetrating strict firewalls by sending many probe types using different TCP ports/flags and ICMP codes. Also note that ARP/Neighbor Discovery is done by default against targets on a local Ethernet network even if you specify other -P* options, because it is almost always faster and more effective. By default, Nmap does host discovery and then performs a port scan against each host it determines is online. This is true even if you specify non-default host discovery types such as UDP probes (-PU). Read about the -sn option to learn how to perform only host discovery, or use -Pn to skip host discovery and port scan all target addresses. The following options control host discovery: -sL (List Scan) The list scan is a degenerate form of host discovery that simply lists each host of the network(s) specified, without sending any packets to the target hosts. By default, Nmap still does reverse-DNS resolution on the hosts to learn their names. It is often surprising how much useful information simple hostnames give out. For example, fw.chi is the name of one company's Chicago firewall. Nmap also reports the total number of IP addresses at the end. The list scan is a good sanity check to ensure that you have proper IP addresses for your targets. If the hosts sport domain names you do not recognize, it is worth investigating further to prevent scanning the wrong company's network. Since the idea is to simply print a list of target hosts, options for higher level functionality such as port scanning, OS detection, or host discovery cannot be combined with this. If you wish to disable host discovery while still performing such higher level functionality, read up on the -Pn (skip host discovery) option. -sn (No port scan) This option tells Nmap not to do a port scan after host discovery, and only print out the available hosts that responded to the host discovery probes. This is often known as a ping scan, but you can also request that traceroute and NSE host scripts be run. This is by default one step more intrusive than the list scan, and can often be used for the same purposes. It allows light reconnaissance of a target network without attracting much attention. Knowing how many hosts are up is more valuable to attackers than the list provided by list scan of every single IP and host name. Systems administrators often find this option valuable as well. It can easily be used to count available machines on a network or monitor server availability. This is often called a ping sweep, and is more reliable than pinging the broadcast address because many hosts do not reply to broadcast queries. The default host discovery done with -sn consists of an ICMP echo request, TCP SYN to port 443, TCP ACK to port 80, and an ICMP timestamp request by default. When executed by an unprivileged user, only SYN packets are sent (using a connect call) to ports 80 and 443 on the target. When a privileged user tries to scan targets on a local ethernet network, ARP requests are used unless --send-ip was specified. The -sn option can be combined with any of the discovery probe types (the -P* options) for greater flexibility. If any of those probe type and port number options are used, the default probes are overridden. When strict firewalls are in place between the source host running Nmap and the target network, using those advanced techniques is recommended. Otherwise hosts could be missed when the firewall drops probes or their responses. In previous releases of Nmap, -sn was known as -sP. -Pn (No ping) This option skips the host discovery stage altogether. Normally, Nmap uses this stage to determine active machines for heavier scanning and to gauge the speed of the network. By default, Nmap only performs heavy probing such as port scans, version detection, or OS detection against hosts that are found to be up. Disabling host discovery with -Pn causes Nmap to attempt the requested scanning functions against every target IP address specified. So if a /16 sized network is specified on the command line, all 65,536 IP addresses are scanned. Proper host discovery is skipped as with the list scan, but instead of stopping and printing the target list, Nmap continues to perform requested functions as if each target IP is active. Default timing parameters are used, which may result in slower scans. To skip host discovery and port scan, while still allowing NSE to run, use the two options -Pn -sn together. For machines on a local ethernet network, ARP scanning will still be performed (unless --disable-arp-ping or --send-ip is specified) because Nmap needs MAC addresses to further scan target hosts. In previous versions of Nmap, -Pn was -P0 and -PN. -PS port list (TCP SYN Ping) This option sends an empty TCP packet with the SYN flag set. The default destination port is 80 (configurable at compile time by changing DEFAULT_TCP_PROBE_PORT_SPEC in nmap.h). Alternate ports can be specified as a parameter. The syntax is the same as for the -p except that port type specifiers like T: are not allowed. Examples are -PS22 and -PS22-25,80,113,1050,35000. Note that there can be no space between -PS and the port list. If multiple probes are specified they will be sent in parallel. The SYN flag suggests to the remote system that you are attempting to establish a connection. Normally the destination port will be closed, and a RST (reset) packet sent back. If the port happens to be open, the target will take the second step of a TCP three-way-handshake by responding with a SYN/ACK TCP packet. The machine running Nmap then tears down the nascent connection by responding with a RST rather than sending an ACK packet which would complete the three-way-handshake and establish a full connection. The RST packet is sent by the kernel of the machine running Nmap in response to the unexpected SYN/ACK, not by Nmap itself. Nmap does not care whether the port is open or closed. Either the RST or SYN/ACK response discussed previously tell Nmap that the host is available and responsive. On Unix boxes, only the privileged user root is generally able to send and receive raw TCP packets. For unprivileged users, a workaround is automatically employed whereby the connect system call is initiated against each target port. This has the effect of sending a SYN packet to the target host, in an attempt to establish a connection. If connect returns with a quick success or an ECONNREFUSED failure, the underlying TCP stack must have received a SYN/ACK or RST and the host is marked available. If the connection attempt is left hanging until a timeout is reached, the host is marked as down. -PA port list (TCP ACK Ping) The TCP ACK ping is quite similar to the just-discussed SYN ping. The difference, as you could likely guess, is that the TCP ACK flag is set instead of the SYN flag. Such an ACK packet purports to be acknowledging data over an established TCP connection, but no such connection exists. So remote hosts should always respond with a RST packet, disclosing their existence in the process. The -PA option uses the same default port as the SYN probe (80) and can also take a list of destination ports in the same format. If an unprivileged user tries this, the connect workaround discussed previously is used. This workaround is imperfect because connect is actually sending a SYN packet rather than an ACK. The reason for offering both SYN and ACK ping probes is to maximize the chances of bypassing firewalls. Many administrators configure routers and other simple firewalls to block incoming SYN packets except for those destined for public services like the company web site or mail server. This prevents other incoming connections to the organization, while allowing users to make unobstructed outgoing connections to the Internet. This non-stateful approach takes up few resources on the firewall/router and is widely supported by hardware and software filters. The Linux Netfilter/iptables firewall software offers the --syn convenience option to implement this stateless approach. When stateless firewall rules such as this are in place, SYN ping probes (-PS) are likely to be blocked when sent to closed target ports. In such cases, the ACK probe shines as it cuts right through these rules. Another common type of firewall uses stateful rules that drop unexpected packets. This feature was initially found mostly on high-end firewalls, though it has become much more common over the years. The Linux Netfilter/iptables system supports this through the --state option, which categorizes packets based on connection state. A SYN probe is more likely to work against such a system, as unexpected ACK packets are generally recognized as bogus and dropped. A solution to this quandary is to send both SYN and ACK probes by specifying -PS and -PA. -PU port list (UDP Ping) Another host discovery option is the UDP ping, which sends a UDP packet to the given ports. For most ports, the packet will be empty, though some use a protocol-specific payload that is more likely to elicit a response. The payloads are the same probes used in service and version detection and are defined in the nmap-service-probes file. Packet content can also be affected with the --data, --data-string, and --data-length options. The port list takes the same format as with the previously discussed -PS and -PA options. If no ports are specified, the default is 40125. This default can be configured at compile-time by changing DEFAULT_UDP_PROBE_PORT_SPEC in nmap.h. A highly uncommon port is used by default because sending to open ports is often undesirable for this particular scan type. Upon hitting a closed port on the target machine, the UDP probe should elicit an ICMP port unreachable packet in return. This signifies to Nmap that the machine is up and available. Many other types of ICMP errors, such as host/network unreachables or TTL exceeded are indicative of a down or unreachable host. A lack of response is also interpreted this way. If an open port is reached, most services simply ignore the empty packet and fail to return any response. This is why the default probe port is 40125, which is highly unlikely to be in use. A few services, such as the Character Generator (chargen) protocol, will respond to an empty UDP packet, and thus disclose to Nmap that the machine is available. The primary advantage of this scan type is that it bypasses firewalls and filters that only screen TCP. For example, I once owned a Linksys BEFW11S4 wireless broadband router. The external interface of this device filtered all TCP ports by default, but UDP probes would still elicit port unreachable messages and thus give away the device. -PY port list (SCTP INIT Ping) This option sends an SCTP packet containing a minimal INIT chunk. The default destination port is 80 (configurable at compile time by changing DEFAULT_SCTP_PROBE_PORT_SPEC in nmap.h). Alternate ports can be specified as a parameter. The syntax is the same as for the -p except that port type specifiers like S: are not allowed. Examples are -PY22 and -PY22,80,179,5060. Note that there can be no space between -PY and the port list. If multiple probes are specified they will be sent in parallel. The INIT chunk suggests to the remote system that you are attempting to establish an association. Normally the destination port will be closed, and an ABORT chunk will be sent back. If the port happens to be open, the target will take the second step of an SCTP four-way-handshake by responding with an INIT-ACK chunk. If the machine running Nmap has a functional SCTP stack, then it tears down the nascent association by responding with an ABORT chunk rather than sending a COOKIE-ECHO chunk which would be the next step in the four-way-handshake. The ABORT packet is sent by the kernel of the machine running Nmap in response to the unexpected INIT-ACK, not by Nmap itself. Nmap does not care whether the port is open or closed. Either the ABORT or INIT-ACK response discussed previously tell Nmap that the host is available and responsive. On Unix boxes, only the privileged user root is generally able to send and receive raw SCTP packets. Using SCTP INIT Pings is currently not possible for unprivileged users. -PE; -PP; -PM (ICMP Ping Types) In addition to the unusual TCP, UDP and SCTP host discovery types discussed previously, Nmap can send the standard packets sent by the ubiquitous ping program. Nmap sends an ICMP type 8 (echo request) packet to the target IP addresses, expecting a type 0 (echo reply) in return from available hosts. Unfortunately for network explorers, many hosts and firewalls now block these packets, rather than responding as required by RFC 1122[2]. For this reason, ICMP-only scans are rarely reliable enough against unknown targets over the Internet. But for system administrators monitoring an internal network, they can be a practical and efficient approach. Use the -PE option to enable this echo request behavior. While echo request is the standard ICMP ping query, Nmap does not stop there. The ICMP standards (RFC 792[3] and RFC 950[4] ) also specify timestamp request, information request, and address mask request packets as codes 13, 15, and 17, respectively. While the ostensible purpose for these queries is to learn information such as address masks and current times, they can easily be used for host discovery. A system that replies is up and available. Nmap does not currently implement information request packets, as they are not widely supported. RFC 1122 insists that a host SHOULD NOT implement these messages. Timestamp and address mask queries can be sent with the -PP and -PM options, respectively. A timestamp reply (ICMP code 14) or address mask reply (code 18) discloses that the host is available. These two queries can be valuable when administrators specifically block echo request packets while forgetting that other ICMP queries can be used for the same purpose. -PO protocol list (IP Protocol Ping) One of the newer host discovery options is the IP protocol ping, which sends IP packets with the specified protocol number set in their IP header. The protocol list takes the same format as do port lists in the previously discussed TCP, UDP and SCTP host discovery options. If no protocols are specified, the default is to send multiple IP packets for ICMP (protocol 1), IGMP (protocol 2), and IP-in-IP (protocol 4). The default protocols can be configured at compile-time by changing DEFAULT_PROTO_PROBE_PORT_SPEC in nmap.h. Note that for the ICMP, IGMP, TCP (protocol 6), UDP (protocol 17) and SCTP (protocol 132), the packets are sent with the proper protocol headers while other protocols are sent with no additional data beyond the IP header (unless any of --data, --data-string, or --data-length options are specified). This host discovery method looks for either responses using the same protocol as a probe, or ICMP protocol unreachable messages which signify that the given protocol isn't supported on the destination host. Either type of response signifies that the target host is alive. --disable-arp-ping (No ARP or ND Ping) Nmap normally does ARP or IPv6 Neighbor Discovery (ND) discovery of locally connected ethernet hosts, even if other host discovery options such as -Pn or -PE are used. To disable this implicit behavior, use the --disable-arp-ping option. The default behavior is normally faster, but this option is useful on networks using proxy ARP, in which a router speculatively replies to all ARP requests, making every target appear to be up according to ARP scan. --discovery-ignore-rst In some cases, firewalls may spoof TCP reset (RST) replies in response to probes to unoccupied or disallowed addresses. Since Nmap ordinarily considers RST replies to be proof that the target is up, this can lead to wasted time scanning targets that aren't there. Using the --discovery-ignore-rst will prevent Nmap from considering these replies during host discovery. You may need to select extra host discovery options to ensure you don't miss targets in this case. --traceroute (Trace path to host) Traceroutes are performed post-scan using information from the scan results to determine the port and protocol most likely to reach the target. It works with all scan types except connect scans (-sT) and idle scans (-sI). All traces use Nmap's dynamic timing model and are performed in parallel. Traceroute works by sending packets with a low TTL (time-to-live) in an attempt to elicit ICMP Time Exceeded messages from intermediate hops between the scanner and the target host. Standard traceroute implementations start with a TTL of 1 and increment the TTL until the destination host is reached. Nmap's traceroute starts with a high TTL and then decrements the TTL until it reaches zero. Doing it backwards lets Nmap employ clever caching algorithms to speed up traces over multiple hosts. On average Nmap sends 510 fewer packets per host, depending on network conditions. If a single subnet is being scanned (i.e. 192.168.0.0/24) Nmap may only have to send two packets to most hosts. PORT SCANNING BASICS top While Nmap has grown in functionality over the years, it began as an efficient port scanner, and that remains its core function. The simple command nmap target scans 1,000 TCP ports on the host target. While many port scanners have traditionally lumped all ports into the open or closed states, Nmap is much more granular. It divides ports into six states: open, closed, filtered, unfiltered, open|filtered, or closed|filtered. These states are not intrinsic properties of the port itself, but describe how Nmap sees them. For example, an Nmap scan from the same network as the target may show port 135/tcp as open, while a scan at the same time with the same options from across the Internet might show that port as filtered. The six port states recognized by Nmap open An application is actively accepting TCP connections, UDP datagrams or SCTP associations on this port. Finding these is often the primary goal of port scanning. Security-minded people know that each open port is an avenue for attack. Attackers and pen-testers want to exploit the open ports, while administrators try to close or protect them with firewalls without thwarting legitimate users. Open ports are also interesting for non-security scans because they show services available for use on the network. closed A closed port is accessible (it receives and responds to Nmap probe packets), but there is no application listening on it. They can be helpful in showing that a host is up on an IP address (host discovery, or ping scanning), and as part of OS detection. Because closed ports are reachable, it may be worth scanning later in case some open up. Administrators may want to consider blocking such ports with a firewall. Then they would appear in the filtered state, discussed next. filtered Nmap cannot determine whether the port is open because packet filtering prevents its probes from reaching the port. The filtering could be from a dedicated firewall device, router rules, or host-based firewall software. These ports frustrate attackers because they provide so little information. Sometimes they respond with ICMP error messages such as type 3 code 13 (destination unreachable: communication administratively prohibited), but filters that simply drop probes without responding are far more common. This forces Nmap to retry several times just in case the probe was dropped due to network congestion rather than filtering. This slows down the scan dramatically. unfiltered The unfiltered state means that a port is accessible, but Nmap is unable to determine whether it is open or closed. Only the ACK scan, which is used to map firewall rulesets, classifies ports into this state. Scanning unfiltered ports with other scan types such as Window scan, SYN scan, or FIN scan, may help resolve whether the port is open. open|filtered Nmap places ports in this state when it is unable to determine whether a port is open or filtered. This occurs for scan types in which open ports give no response. The lack of response could also mean that a packet filter dropped the probe or any response it elicited. So Nmap does not know for sure whether the port is open or being filtered. The UDP, IP protocol, FIN, NULL, and Xmas scans classify ports this way. closed|filtered This state is used when Nmap is unable to determine whether a port is closed or filtered. It is only used for the IP ID idle scan. PORT SCANNING TECHNIQUES top As a novice performing automotive repair, I can struggle for hours trying to fit my rudimentary tools (hammer, duct tape, wrench, etc.) to the task at hand. When I fail miserably and tow my jalopy to a real mechanic, he invariably fishes around in a huge tool chest until pulling out the perfect gizmo which makes the job seem effortless. The art of port scanning is similar. Experts understand the dozens of scan techniques and choose the appropriate one (or combination) for a given task. Inexperienced users and script kiddies, on the other hand, try to solve every problem with the default SYN scan. Since Nmap is free, the only barrier to port scanning mastery is knowledge. That certainly beats the automotive world, where it may take great skill to determine that you need a strut spring compressor, then you still have to pay thousands of dollars for it. Most of the scan types are only available to privileged users. This is because they send and receive raw packets, which requires root access on Unix systems. Using an administrator account on Windows is recommended, though Nmap sometimes works for unprivileged users on that platform when Npcap has already been loaded into the OS. Requiring root privileges was a serious limitation when Nmap was released in 1997, as many users only had access to shared shell accounts. Now, the world is different. Computers are cheaper, far more people have always-on direct Internet access, and desktop Unix systems (including Linux and Mac OS X) are prevalent. A Windows version of Nmap is now available, allowing it to run on even more desktops. For all these reasons, users have less need to run Nmap from limited shared shell accounts. This is fortunate, as the privileged options make Nmap far more powerful and flexible. While Nmap attempts to produce accurate results, keep in mind that all of its insights are based on packets returned by the target machines (or firewalls in front of them). Such hosts may be untrustworthy and send responses intended to confuse or mislead Nmap. Much more common are non-RFC-compliant hosts that do not respond as they should to Nmap probes. FIN, NULL, and Xmas scans are particularly susceptible to this problem. Such issues are specific to certain scan types and so are discussed in the individual scan type entries. This section documents the dozen or so port scan techniques supported by Nmap. Only one method may be used at a time, except that UDP scan (-sU) and any one of the SCTP scan types (-sY, -sZ) may be combined with any one of the TCP scan types. As a memory aid, port scan type options are of the form -sC, where C is a prominent character in the scan name, usually the first. The one exception to this is the deprecated FTP bounce scan (-b). By default, Nmap performs a SYN Scan, though it substitutes a connect scan if the user does not have proper privileges to send raw packets (requires root access on Unix). Of the scans listed in this section, unprivileged users can only execute connect and FTP bounce scans. -sS (TCP SYN scan) SYN scan is the default and most popular scan option for good reasons. It can be performed quickly, scanning thousands of ports per second on a fast network not hampered by restrictive firewalls. It is also relatively unobtrusive and stealthy since it never completes TCP connections. SYN scan works against any compliant TCP stack rather than depending on idiosyncrasies of specific platforms as Nmap's FIN/NULL/Xmas, Maimon and idle scans do. It also allows clear, reliable differentiation between the open, closed, and filtered states. This technique is often referred to as half-open scanning, because you don't open a full TCP connection. You send a SYN packet, as if you are going to open a real connection and then wait for a response. A SYN/ACK indicates the port is listening (open), while a RST (reset) is indicative of a non-listener. If no response is received after several retransmissions, the port is marked as filtered. The port is also marked filtered if an ICMP unreachable error (type 3, code 0, 1, 2, 3, 9, 10, or 13) is received. The port is also considered open if a SYN packet (without the ACK flag) is received in response. This can be due to an extremely rare TCP feature known as a simultaneous open or split handshake connection (see https://nmap.org/misc/split-handshake.pdf ). -sT (TCP connect scan) TCP connect scan is the default TCP scan type when SYN scan is not an option. This is the case when a user does not have raw packet privileges. Instead of writing raw packets as most other scan types do, Nmap asks the underlying operating system to establish a connection with the target machine and port by issuing the connect system call. This is the same high-level system call that web browsers, P2P clients, and most other network-enabled applications use to establish a connection. It is part of a programming interface known as the Berkeley Sockets API. Rather than read raw packet responses off the wire, Nmap uses this API to obtain status information on each connection attempt. When SYN scan is available, it is usually a better choice. Nmap has less control over the high level connect call than with raw packets, making it less efficient. The system call completes connections to open target ports rather than performing the half-open reset that SYN scan does. Not only does this take longer and require more packets to obtain the same information, but target machines are more likely to log the connection. A decent IDS will catch either, but most machines have no such alarm system. Many services on your average Unix system will add a note to syslog, and sometimes a cryptic error message, when Nmap connects and then closes the connection without sending data. Truly pathetic services crash when this happens, though that is uncommon. An administrator who sees a bunch of connection attempts in her logs from a single system should know that she has been connect scanned. -sU (UDP scans) While most popular services on the Internet run over the TCP protocol, UDP[5] services are widely deployed. DNS, SNMP, and DHCP (registered ports 53, 161/162, and 67/68) are three of the most common. Because UDP scanning is generally slower and more difficult than TCP, some security auditors ignore these ports. This is a mistake, as exploitable UDP services are quite common and attackers certainly don't ignore the whole protocol. Fortunately, Nmap can help inventory UDP ports. UDP scan is activated with the -sU option. It can be combined with a TCP scan type such as SYN scan (-sS) to check both protocols during the same run. UDP scan works by sending a UDP packet to every targeted port. For some common ports such as 53 and 161, a protocol-specific payload is sent to increase response rate, but for most ports the packet is empty unless the --data, --data-string, or --data-length options are specified. If an ICMP port unreachable error (type 3, code 3) is returned, the port is closed. Other ICMP unreachable errors (type 3, codes 0, 1, 2, 9, 10, or 13) mark the port as filtered. Occasionally, a service will respond with a UDP packet, proving that it is open. If no response is received after retransmissions, the port is classified as open|filtered. This means that the port could be open, or perhaps packet filters are blocking the communication. Version detection (-sV) can be used to help differentiate the truly open ports from the filtered ones. A big challenge with UDP scanning is doing it quickly. Open and filtered ports rarely send any response, leaving Nmap to time out and then conduct retransmissions just in case the probe or response were lost. Closed ports are often an even bigger problem. They usually send back an ICMP port unreachable error. But unlike the RST packets sent by closed TCP ports in response to a SYN or connect scan, many hosts rate limit ICMP port unreachable messages by default. Linux and Solaris are particularly strict about this. For example, the Linux 2.4.20 kernel limits destination unreachable messages to one per second (in net/ipv4/icmp.c). Nmap detects rate limiting and slows down accordingly to avoid flooding the network with useless packets that the target machine will drop. Unfortunately, a Linux-style limit of one packet per second makes a 65,536-port scan take more than 18 hours. Ideas for speeding your UDP scans up include scanning more hosts in parallel, doing a quick scan of just the popular ports first, scanning from behind the firewall, and using --host-timeout to skip slow hosts. -sY (SCTP INIT scan) SCTP[6] is a relatively new alternative to the TCP and UDP protocols, combining most characteristics of TCP and UDP, and also adding new features like multi-homing and multi-streaming. It is mostly being used for SS7/SIGTRAN related services but has the potential to be used for other applications as well. SCTP INIT scan is the SCTP equivalent of a TCP SYN scan. It can be performed quickly, scanning thousands of ports per second on a fast network not hampered by restrictive firewalls. Like SYN scan, INIT scan is relatively unobtrusive and stealthy, since it never completes SCTP associations. It also allows clear, reliable differentiation between the open, closed, and filtered states. This technique is often referred to as half-open scanning, because you don't open a full SCTP association. You send an INIT chunk, as if you are going to open a real association and then wait for a response. An INIT-ACK chunk indicates the port is listening (open), while an ABORT chunk is indicative of a non-listener. If no response is received after several retransmissions, the port is marked as filtered. The port is also marked filtered if an ICMP unreachable error (type 3, code 0, 1, 2, 3, 9, 10, or 13) is received. -sN; -sF; -sX (TCP NULL, FIN, and Xmas scans) These three scan types (even more are possible with the --scanflags option described in the next section) exploit a subtle loophole in the TCP RFC[7] to differentiate between open and closed ports. Page 65 of RFC 793 says that if the [destination] port state is CLOSED .... an incoming segment not containing a RST causes a RST to be sent in response. Then the next page discusses packets sent to open ports without the SYN, RST, or ACK bits set, stating that: you are unlikely to get here, but if you do, drop the segment, and return. When scanning systems compliant with this RFC text, any packet not containing SYN, RST, or ACK bits will result in a returned RST if the port is closed and no response at all if the port is open. As long as none of those three bits are included, any combination of the other three (FIN, PSH, and URG) are OK. Nmap exploits this with three scan types: Null scan (-sN) Does not set any bits (TCP flag header is 0) FIN scan (-sF) Sets just the TCP FIN bit. Xmas scan (-sX) Sets the FIN, PSH, and URG flags, lighting the packet up like a Christmas tree. These three scan types are exactly the same in behavior except for the TCP flags set in probe packets. If a RST packet is received, the port is considered closed, while no response means it is open|filtered. The port is marked filtered if an ICMP unreachable error (type 3, code 0, 1, 2, 3, 9, 10, or 13) is received. The key advantage to these scan types is that they can sneak through certain non-stateful firewalls and packet filtering routers. Another advantage is that these scan types are a little more stealthy than even a SYN scan. Don't count on this thoughmost modern IDS products can be configured to detect them. The big downside is that not all systems follow RFC 793 to the letter. A number of systems send RST responses to the probes regardless of whether the port is open or not. This causes all of the ports to be labeled closed. Major operating systems that do this are Microsoft Windows, many Cisco devices, BSDI, and IBM OS/400. This scan does work against most Unix-based systems though. Another downside of these scans is that they can't distinguish open ports from certain filtered ones, leaving you with the response open|filtered. -sA (TCP ACK scan) This scan is different than the others discussed so far in that it never determines open (or even open|filtered) ports. It is used to map out firewall rulesets, determining whether they are stateful or not and which ports are filtered. The ACK scan probe packet has only the ACK flag set (unless you use --scanflags). When scanning unfiltered systems, open and closed ports will both return a RST packet. Nmap then labels them as unfiltered, meaning that they are reachable by the ACK packet, but whether they are open or closed is undetermined. Ports that don't respond, or send certain ICMP error messages back (type 3, code 0, 1, 2, 3, 9, 10, or 13), are labeled filtered. -sW (TCP Window scan) Window scan is exactly the same as ACK scan except that it exploits an implementation detail of certain systems to differentiate open ports from closed ones, rather than always printing unfiltered when a RST is returned. It does this by examining the TCP Window field of the RST packets returned. On some systems, open ports use a positive window size (even for RST packets) while closed ones have a zero window. So instead of always listing a port as unfiltered when it receives a RST back, Window scan lists the port as open or closed if the TCP Window value in that reset is positive or zero, respectively. This scan relies on an implementation detail of a minority of systems out on the Internet, so you can't always trust it. Systems that don't support it will usually return all ports closed. Of course, it is possible that the machine really has no open ports. If most scanned ports are closed but a few common port numbers (such as 22, 25, 53) are filtered, the system is most likely susceptible. Occasionally, systems will even show the exact opposite behavior. If your scan shows 1,000 open ports and three closed or filtered ports, then those three may very well be the truly open ones. -sM (TCP Maimon scan) The Maimon scan is named after its discoverer, Uriel Maimon. He described the technique in Phrack Magazine issue #49 (November 1996). Nmap, which included this technique, was released two issues later. This technique is exactly the same as NULL, FIN, and Xmas scans, except that the probe is FIN/ACK. According to RFC 793[7] (TCP), a RST packet should be generated in response to such a probe whether the port is open or closed. However, Uriel noticed that many BSD-derived systems simply drop the packet if the port is open. --scanflags (Custom TCP scan) Truly advanced Nmap users need not limit themselves to the canned scan types offered. The --scanflags option allows you to design your own scan by specifying arbitrary TCP flags. Let your creative juices flow, while evading intrusion detection systems whose vendors simply paged through the Nmap man page adding specific rules! The --scanflags argument can be a numerical flag value such as 9 (PSH and FIN), but using symbolic names is easier. Just mash together any combination of URG, ACK, PSH, RST, SYN, and FIN. For example, --scanflags URGACKPSHRSTSYNFIN sets everything, though it's not very useful for scanning. The order these are specified in is irrelevant. In addition to specifying the desired flags, you can specify a TCP scan type (such as -sA or -sF). That base type tells Nmap how to interpret responses. For example, a SYN scan considers no-response to indicate a filtered port, while a FIN scan treats the same as open|filtered. Nmap will behave the same way it does for the base scan type, except that it will use the TCP flags you specify instead. If you don't specify a base type, SYN scan is used. -sZ (SCTP COOKIE ECHO scan) SCTP COOKIE ECHO scan is a more advanced SCTP scan. It takes advantage of the fact that SCTP implementations should silently drop packets containing COOKIE ECHO chunks on open ports, but send an ABORT if the port is closed. The advantage of this scan type is that it is not as obvious a port scan than an INIT scan. Also, there may be non-stateful firewall rulesets blocking INIT chunks, but not COOKIE ECHO chunks. Don't be fooled into thinking that this will make a port scan invisible; a good IDS will be able to detect SCTP COOKIE ECHO scans too. The downside is that SCTP COOKIE ECHO scans cannot differentiate between open and filtered ports, leaving you with the state open|filtered in both cases. -sI zombie host[:probeport] (idle scan) This advanced scan method allows for a truly blind TCP port scan of the target (meaning no packets are sent to the target from your real IP address). Instead, a unique side-channel attack exploits predictable IP fragmentation ID sequence generation on the zombie host to glean information about the open ports on the target. IDS systems will display the scan as coming from the zombie machine you specify (which must be up and meet certain criteria). This fascinating scan type is too complex to fully describe in this reference guide, so I wrote and posted an informal paper with full details at https://nmap.org/book/idlescan.html . Besides being extraordinarily stealthy (due to its blind nature), this scan type permits mapping out IP-based trust relationships between machines. The port listing shows open ports from the perspective of the zombie host. So you can try scanning a target using various zombies that you think might be trusted (via router/packet filter rules). You can add a colon followed by a port number to the zombie host if you wish to probe a particular port on the zombie for IP ID changes. Otherwise Nmap will use the port it uses by default for TCP pings (80). -sO (IP protocol scan) IP protocol scan allows you to determine which IP protocols (TCP, ICMP, IGMP, etc.) are supported by target machines. This isn't technically a port scan, since it cycles through IP protocol numbers rather than TCP or UDP port numbers. Yet it still uses the -p option to select scanned protocol numbers, reports its results within the normal port table format, and even uses the same underlying scan engine as the true port scanning methods. So it is close enough to a port scan that it belongs here. Besides being useful in its own right, protocol scan demonstrates the power of open-source software. While the fundamental idea is pretty simple, I had not thought to add it nor received any requests for such functionality. Then in the summer of 2000, Gerhard Rieger conceived the idea, wrote an excellent patch implementing it, and sent it to the announce mailing list (then called nmap-hackers). I incorporated that patch into the Nmap tree and released a new version the next day. Few pieces of commercial software have users enthusiastic enough to design and contribute their own improvements! Protocol scan works in a similar fashion to UDP scan. Instead of iterating through the port number field of a UDP packet, it sends IP packet headers and iterates through the eight-bit IP protocol field. The headers are usually empty, containing no data and not even the proper header for the claimed protocol. The exceptions are TCP, UDP, ICMP, SCTP, and IGMP. A proper protocol header for those is included since some systems won't send them otherwise and because Nmap already has functions to create them. Instead of watching for ICMP port unreachable messages, protocol scan is on the lookout for ICMP protocol unreachable messages. If Nmap receives any response in any protocol from the target host, Nmap marks that protocol as open. An ICMP protocol unreachable error (type 3, code 2) causes the protocol to be marked as closed while port unreachable (type 3, code 3) marks the protocol open. Other ICMP unreachable errors (type 3, code 0, 1, 9, 10, or 13) cause the protocol to be marked filtered (though they prove that ICMP is open at the same time). If no response is received after retransmissions, the protocol is marked open|filtered -b FTP relay host (FTP bounce scan) An interesting feature of the FTP protocol (RFC 959[8]) is support for so-called proxy FTP connections. This allows a user to connect to one FTP server, then ask that files be sent to a third-party server. Such a feature is ripe for abuse on many levels, so most servers have ceased supporting it. One of the abuses this feature allows is causing the FTP server to port scan other hosts. Simply ask the FTP server to send a file to each interesting port of a target host in turn. The error message will describe whether the port is open or not. This is a good way to bypass firewalls because organizational FTP servers are often placed where they have more access to other internal hosts than any old Internet host would. Nmap supports FTP bounce scan with the -b option. It takes an argument of the form username:password@server:port. Server is the name or IP address of a vulnerable FTP server. As with a normal URL, you may omit username:password, in which case anonymous login credentials (user: anonymous password:-wwwuser@) are used. The port number (and preceding colon) may be omitted as well, in which case the default FTP port (21) on server is used. This vulnerability was widespread in 1997 when Nmap was released, but has largely been fixed. Vulnerable servers are still around, so it is worth trying when all else fails. If bypassing a firewall is your goal, scan the target network for port 21 (or even for any FTP services if you scan all ports with version detection) and use the ftp-bounce NSE script. Nmap will tell you whether the host is vulnerable or not. If you are just trying to cover your tracks, you don't need to (and, in fact, shouldn't) limit yourself to hosts on the target network. Before you go scanning random Internet addresses for vulnerable FTP servers, consider that sysadmins may not appreciate you abusing their servers in this way. PORT SPECIFICATION AND SCAN ORDER top In addition to all of the scan methods discussed previously, Nmap offers options for specifying which ports are scanned and whether the scan order is randomized or sequential. By default, Nmap scans the most common 1,000 ports for each protocol. -p port ranges (Only scan specified ports) This option specifies which ports you want to scan and overrides the default. Individual port numbers are OK, as are ranges separated by a hyphen (e.g. 1-1023). The beginning and/or end values of a range may be omitted, causing Nmap to use 1 and 65535, respectively. So you can specify -p- to scan ports from 1 through 65535. Scanning port zero is allowed if you specify it explicitly. For IP protocol scanning (-sO), this option specifies the protocol numbers you wish to scan for (0255). When scanning a combination of protocols (e.g. TCP and UDP), you can specify a particular protocol by preceding the port numbers by T: for TCP, U: for UDP, S: for SCTP, or P: for IP Protocol. The qualifier lasts until you specify another qualifier. For example, the argument -p U:53,111,137,T:21-25,80,139,8080 would scan UDP ports 53, 111,and 137, as well as the listed TCP ports. Note that to scan both UDP and TCP, you have to specify -sU and at least one TCP scan type (such as -sS, -sF, or -sT). If no protocol qualifier is given, the port numbers are added to all protocol lists. Ports can also be specified by name according to what the port is referred to in the nmap-services. You can even use the wildcards * and ? with the names. For example, to scan FTP and all ports whose names begin with http, use -p ftp,http*. Be careful about shell expansions and quote the argument to -p if unsure. Ranges of ports can be surrounded by square brackets to indicate ports inside that range that appear in nmap-services. For example, the following will scan all ports in nmap-services equal to or below 1024: -p [-1024]. Be careful with shell expansions and quote the argument to -p if unsure. --exclude-ports port ranges (Exclude the specified ports from scanning) This option specifies which ports you do want Nmap to exclude from scanning. The port ranges are specified similar to -p. For IP protocol scanning (-sO), this option specifies the protocol numbers you wish to exclude (0255). When ports are asked to be excluded, they are excluded from all types of scans (i.e. they will not be scanned under any circumstances). This also includes the discovery phase. -F (Fast (limited port) scan) Specifies that you wish to scan fewer ports than the default. Normally Nmap scans the most common 1,000 ports for each scanned protocol. With -F, this is reduced to 100. Nmap needs an nmap-services file with frequency information in order to know which ports are the most common. If port frequency information isn't available, perhaps because of the use of a custom nmap-services file, Nmap scans all named ports plus ports 1-1024. In that case, -F means to scan only ports that are named in the services file. -r (Don't randomize ports) By default, Nmap randomizes the scanned port order (except that certain commonly accessible ports are moved near the beginning for efficiency reasons). This randomization is normally desirable, but you can specify -r for sequential (sorted from lowest to highest) port scanning instead. --port-ratio ratio<decimal number between 0 and 1> Scans all ports in nmap-services file with a ratio greater than the one given. ratio must be between 0.0 and 1.0. --top-ports n Scans the n highest-ratio ports found in nmap-services file after excluding all ports specified by --exclude-ports. n must be 1 or greater. SERVICE AND VERSION DETECTION top Point Nmap at a remote machine and it might tell you that ports 25/tcp, 80/tcp, and 53/udp are open. Using its nmap-services database of about 2,200 well-known services, Nmap would report that those ports probably correspond to a mail server (SMTP), web server (HTTP), and name server (DNS) respectively. This lookup is usually accuratethe vast majority of daemons listening on TCP port 25 are, in fact, mail servers. However, you should not bet your security on this! People can and do run services on strange ports. Even if Nmap is right, and the hypothetical server above is running SMTP, HTTP, and DNS servers, that is not a lot of information. When doing vulnerability assessments (or even simple network inventories) of your companies or clients, you really want to know which mail and DNS servers and versions are running. Having an accurate version number helps dramatically in determining which exploits a server is vulnerable to. Version detection helps you obtain this information. After TCP and/or UDP ports are discovered using one of the other scan methods, version detection interrogates those ports to determine more about what is actually running. The nmap-service-probes database contains probes for querying various services and match expressions to recognize and parse responses. Nmap tries to determine the service protocol (e.g. FTP, SSH, Telnet, HTTP), the application name (e.g. ISC BIND, Apache httpd, Solaris telnetd), the version number, hostname, device type (e.g. printer, router), the OS family (e.g. Windows, Linux). When possible, Nmap also gets the Common Platform Enumeration (CPE) representation of this information. Sometimes miscellaneous details like whether an X server is open to connections, the SSH protocol version, or the KaZaA user name, are available. Of course, most services don't provide all of this information. If Nmap was compiled with OpenSSL support, it will connect to SSL servers to deduce the service listening behind that encryption layer. Some UDP ports are left in the open|filtered state after a UDP port scan is unable to determine whether the port is open or filtered. Version detection will try to elicit a response from these ports (just as it does with open ports), and change the state to open if it succeeds. open|filtered TCP ports are treated the same way. Note that the Nmap -A option enables version detection among other things. A paper documenting the workings, usage, and customization of version detection is available at https://nmap.org/book/vscan.html . When RPC services are discovered, the Nmap RPC grinder is automatically used to determine the RPC program and version numbers. It takes all the TCP/UDP ports detected as RPC and floods them with SunRPC program NULL commands in an attempt to determine whether they are RPC ports, and if so, what program and version number they serve up. Thus you can effectively obtain the same info as rpcinfo -p even if the target's portmapper is behind a firewall (or protected by TCP wrappers). Decoys do not currently work with RPC scan. When Nmap receives responses from a service but cannot match them to its database, it prints out a special fingerprint and a URL for you to submit it to if you know for sure what is running on the port. Please take a couple minutes to make the submission so that your find can benefit everyone. Thanks to these submissions, Nmap has about 6,500 pattern matches for more than 650 protocols such as SMTP, FTP, HTTP, etc. Version detection is enabled and controlled with the following options: -sV (Version detection) Enables version detection, as discussed above. Alternatively, you can use -A, which enables version detection among other things. -sR is an alias for -sV. Prior to March 2011, it was used to active the RPC grinder separately from version detection, but now these options are always combined. --allports (Don't exclude any ports from version detection) By default, Nmap version detection skips TCP port 9100 because some printers simply print anything sent to that port, leading to dozens of pages of HTTP GET requests, binary SSL session requests, etc. This behavior can be changed by modifying or removing the Exclude directive in nmap-service-probes, or you can specify --allports to scan all ports regardless of any Exclude directive. --version-intensity intensity (Set version scan intensity) When performing a version scan (-sV), Nmap sends a series of probes, each of which is assigned a rarity value between one and nine. The lower-numbered probes are effective against a wide variety of common services, while the higher-numbered ones are rarely useful. The intensity level specifies which probes should be applied. The higher the number, the more likely it is the service will be correctly identified. However, high intensity scans take longer. The intensity must be between 0 and 9. The default is 7. When a probe is registered to the target port via the nmap-service-probes ports directive, that probe is tried regardless of intensity level. This ensures that the DNS probes will always be attempted against any open port 53, the SSL probe will be done against 443, etc. --version-light (Enable light mode) This is a convenience alias for --version-intensity 2. This light mode makes version scanning much faster, but it is slightly less likely to identify services. --version-all (Try every single probe) An alias for --version-intensity 9, ensuring that every single probe is attempted against each port. --version-trace (Trace version scan activity) This causes Nmap to print out extensive debugging info about what version scanning is doing. It is a subset of what you get with --packet-trace. OS DETECTION top One of Nmap's best-known features is remote OS detection using TCP/IP stack fingerprinting. Nmap sends a series of TCP and UDP packets to the remote host and examines practically every bit in the responses. After performing dozens of tests such as TCP ISN sampling, TCP options support and ordering, IP ID sampling, and the initial window size check, Nmap compares the results to its nmap-os-db database of more than 2,600 known OS fingerprints and prints out the OS details if there is a match. Each fingerprint includes a freeform textual description of the OS, and a classification which provides the vendor name (e.g. Sun), underlying OS (e.g. Solaris), OS generation (e.g. 10), and device type (general purpose, router, switch, game console, etc). Most fingerprints also have a Common Platform Enumeration (CPE) representation, like cpe:/o:linux:linux_kernel:2.6. If Nmap is unable to guess the OS of a machine, and conditions are good (e.g. at least one open port and one closed port were found), Nmap will provide a URL you can use to submit the fingerprint if you know (for sure) the OS running on the machine. By doing this you contribute to the pool of operating systems known to Nmap and thus it will be more accurate for everyone. OS detection enables some other tests which make use of information that is gathered during the process anyway. One of these is TCP Sequence Predictability Classification. This measures approximately how hard it is to establish a forged TCP connection against the remote host. It is useful for exploiting source-IP based trust relationships (rlogin, firewall filters, etc) or for hiding the source of an attack. This sort of spoofing is rarely performed any more, but many machines are still vulnerable to it. The actual difficulty number is based on statistical sampling and may fluctuate. It is generally better to use the English classification such as worthy challenge or trivial joke. This is only reported in normal output in verbose (-v) mode. When verbose mode is enabled along with -O, IP ID sequence generation is also reported. Most machines are in the incremental class, which means that they increment the ID field in the IP header for each packet they send. This makes them vulnerable to several advanced information gathering and spoofing attacks. Another bit of extra information enabled by OS detection is a guess at a target's uptime. This uses the TCP timestamp option (RFC 1323[9]) to guess when a machine was last rebooted. The guess can be inaccurate due to the timestamp counter not being initialized to zero or the counter overflowing and wrapping around, so it is printed only in verbose mode. A paper documenting the workings, usage, and customization of OS detection is available at https://nmap.org/book/osdetect.html . OS detection is enabled and controlled with the following options: -O (Enable OS detection) Enables OS detection, as discussed above. Alternatively, you can use -A to enable OS detection along with other things. --osscan-limit (Limit OS detection to promising targets) OS detection is far more effective if at least one open and one closed TCP port are found. Set this option and Nmap will not even try OS detection against hosts that do not meet this criteria. This can save substantial time, particularly on -Pn scans against many hosts. It only matters when OS detection is requested with -O or -A. --osscan-guess; --fuzzy (Guess OS detection results) When Nmap is unable to detect a perfect OS match, it sometimes offers up near-matches as possibilities. The match has to be very close for Nmap to do this by default. Either of these (equivalent) options make Nmap guess more aggressively. Nmap will still tell you when an imperfect match is printed and display its confidence level (percentage) for each guess. --max-os-tries (Set the maximum number of OS detection tries against a target) When Nmap performs OS detection against a target and fails to find a perfect match, it usually repeats the attempt. By default, Nmap tries five times if conditions are favorable for OS fingerprint submission, and twice when conditions aren't so good. Specifying a lower --max-os-tries value (such as 1) speeds Nmap up, though you miss out on retries which could potentially identify the OS. Alternatively, a high value may be set to allow even more retries when conditions are favorable. This is rarely done, except to generate better fingerprints for submission and integration into the Nmap OS database. NMAP SCRIPTING ENGINE (NSE) top The Nmap Scripting Engine (NSE) is one of Nmap's most powerful and flexible features. It allows users to write (and share) simple scripts (using the Lua programming language[10] ) to automate a wide variety of networking tasks. Those scripts are executed in parallel with the speed and efficiency you expect from Nmap. Users can rely on the growing and diverse set of scripts distributed with Nmap, or write their own to meet custom needs. Tasks we had in mind when creating the system include network discovery, more sophisticated version detection, vulnerability detection. NSE can even be used for vulnerability exploitation. To reflect those different uses and to simplify the choice of which scripts to run, each script contains a field associating it with one or more categories. Currently defined categories are auth, broadcast, default. discovery, dos, exploit, external, fuzzer, intrusive, malware, safe, version, and vuln. These are all described at https://nmap.org/book/nse-usage.html#nse-categories . Scripts are not run in a sandbox and thus could accidentally or maliciously damage your system or invade your privacy. Never run scripts from third parties unless you trust the authors or have carefully audited the scripts yourself. The Nmap Scripting Engine is described in detail at https://nmap.org/book/nse.html and is controlled by the following options: -sC Performs a script scan using the default set of scripts. It is equivalent to --script=default. Some of the scripts in this category are considered intrusive and should not be run against a target network without permission. --script filename|category|directory/|expression[,...] Runs a script scan using the comma-separated list of filenames, script categories, and directories. Each element in the list may also be a Boolean expression describing a more complex set of scripts. Each element is interpreted first as an expression, then as a category, and finally as a file or directory name. There are two special features for advanced users only. One is to prefix script names and expressions with + to force them to run even if they normally wouldn't (e.g. the relevant service wasn't detected on the target port). The other is that the argument all may be used to specify every script in Nmap's database. Be cautious with this because NSE contains dangerous scripts such as exploits, brute force authentication crackers, and denial of service attacks. File and directory names may be relative or absolute. Absolute names are used directly. Relative paths are looked for in the scripts of each of the following places until found: --datadir $NMAPDIR ~/.nmap (not searched on Windows) APPDATA\nmap (only on Windows) the directory containing the nmap executable the directory containing the nmap executable, followed by ../share/nmap (not searched on Windows) NMAPDATADIR (not searched on Windows) the current directory. When a directory name ending in / is given, Nmap loads every file in the directory whose name ends with .nse. All other files are ignored and directories are not searched recursively. When a filename is given, it does not have to have the .nse extension; it will be added automatically if necessary. Nmap scripts are stored in a scripts subdirectory of the Nmap data directory by default (see https://nmap.org/book/data-files.html ). For efficiency, scripts are indexed in a database stored in scripts/script.db, which lists the category or categories in which each script belongs. When referring to scripts from script.db by name, you can use a shell-style * wildcard. nmap --script "http-*" Loads all scripts whose name starts with http-, such as http-auth and http-open-proxy. The argument to --script had to be in quotes to protect the wildcard from the shell. More complicated script selection can be done using the and, or, and not operators to build Boolean expressions. The operators have the same precedence[11] as in Lua: not is the highest, followed by and and then or. You can alter precedence by using parentheses. Because expressions contain space characters it is necessary to quote them. nmap --script "not intrusive" Loads every script except for those in the intrusive category. nmap --script "default or safe" This is functionally equivalent to nmap --script "default,safe". It loads all scripts that are in the default category or the safe category or both. nmap --script "default and safe" Loads those scripts that are in both the default and safe categories. nmap --script "(default or safe or intrusive) and not http-*" Loads scripts in the default, safe, or intrusive categories, except for those whose names start with http-. --script-args n1=v1,n2={n3=v3},n4={v4,v5} Lets you provide arguments to NSE scripts. Arguments are a comma-separated list of name=value pairs. Names and values may be strings not containing whitespace or the characters {, }, =, or ,. To include one of these characters in a string, enclose the string in single or double quotes. Within a quoted string, \ escapes a quote. A backslash is only used to escape quotation marks in this special case; in all other cases a backslash is interpreted literally. Values may also be tables enclosed in {}, just as in Lua. A table may contain simple string values or more name-value pairs, including nested tables. Many scripts qualify their arguments with the script name, as in xmpp-info.server_name. You may use that full qualified version to affect just the specified script, or you may pass the unqualified version (server_name in this case) to affect all scripts using that argument name. A script will first check for its fully qualified argument name (the name specified in its documentation) before it accepts an unqualified argument name. A complex example of script arguments is --script-args 'user=foo,pass=",{}=bar",whois={whodb=nofollow+ripe},xmpp-info.server_name=localhost'. The online NSE Documentation Portal at https://nmap.org/nsedoc/ lists the arguments that each script accepts. --script-args-file filename Lets you load arguments to NSE scripts from a file. Any arguments on the command line supersede ones in the file. The file can be an absolute path, or a path relative to Nmap's usual search path (NMAPDIR, etc.) Arguments can be comma-separated or newline-separated, but otherwise follow the same rules as for --script-args, without requiring special quoting and escaping, since they are not parsed by the shell. --script-help filename|category|directory|expression|all[,...] Shows help about scripts. For each script matching the given specification, Nmap prints the script name, its categories, and its description. The specifications are the same as those accepted by --script; so for example if you want help about the ftp-anon script, you would run nmap --script-help ftp-anon. In addition to getting help for individual scripts, you can use this as a preview of what scripts will be run for a specification, for example with nmap --script-help default. --script-trace This option does what --packet-trace does, just one ISO layer higher. If this option is specified all incoming and outgoing communication performed by a script is printed. The displayed information includes the communication protocol, the source, the target and the transmitted data. If more than 5% of all transmitted data is not printable, then the trace output is in a hex dump format. Specifying --packet-trace enables script tracing too. --script-updatedb This option updates the script database found in scripts/script.db which is used by Nmap to determine the available default scripts and categories. It is only necessary to update the database if you have added or removed NSE scripts from the default scripts directory or if you have changed the categories of any script. This option is generally used by itself: nmap --script-updatedb. TIMING AND PERFORMANCE top One of my highest Nmap development priorities has always been performance. A default scan (nmap hostname) of a host on my local network takes a fifth of a second. That is barely enough time to blink, but adds up when you are scanning hundreds or thousands of hosts. Moreover, certain scan options such as UDP scanning and version detection can increase scan times substantially. So can certain firewall configurations, particularly response rate limiting. While Nmap utilizes parallelism and many advanced algorithms to accelerate these scans, the user has ultimate control over how Nmap runs. Expert users carefully craft Nmap commands to obtain only the information they care about while meeting their time constraints. Techniques for improving scan times include omitting non-critical tests, and upgrading to the latest version of Nmap (performance enhancements are made frequently). Optimizing timing parameters can also make a substantial difference. Those options are listed below. Some options accept a time parameter. This is specified in seconds by default, though you can append ms, s, m, or h to the value to specify milliseconds, seconds, minutes, or hours. So the --host-timeout arguments 900000ms, 900, 900s, and 15m all do the same thing. --min-hostgroup numhosts; --max-hostgroup numhosts (Adjust parallel scan group sizes) Nmap has the ability to port scan or version scan multiple hosts in parallel. Nmap does this by dividing the target IP space into groups and then scanning one group at a time. In general, larger groups are more efficient. The downside is that host results can't be provided until the whole group is finished. So if Nmap started out with a group size of 50, the user would not receive any reports (except for the updates offered in verbose mode) until the first 50 hosts are completed. By default, Nmap takes a compromise approach to this conflict. It starts out with a group size as low as five so the first results come quickly and then increases the groupsize to as high as 1024. The exact default numbers depend on the options given. For efficiency reasons, Nmap uses larger group sizes for UDP or few-port TCP scans. When a maximum group size is specified with --max-hostgroup, Nmap will never exceed that size. Specify a minimum size with --min-hostgroup and Nmap will try to keep group sizes above that level. Nmap may have to use smaller groups than you specify if there are not enough target hosts left on a given interface to fulfill the specified minimum. Both may be set to keep the group size within a specific range, though this is rarely desired. These options do not have an effect during the host discovery phase of a scan. This includes plain ping scans (-sn). Host discovery always works in large groups of hosts to improve speed and accuracy. The primary use of these options is to specify a large minimum group size so that the full scan runs more quickly. A common choice is 256 to scan a network in /24 sized chunks. For a scan with many ports, exceeding that number is unlikely to help much. For scans of just a few port numbers, host group sizes of 2048 or more may be helpful. --min-parallelism numprobes; --max-parallelism numprobes (Adjust probe parallelization) These options control the total number of probes that may be outstanding for a host group. They are used for port scanning and host discovery. By default, Nmap calculates an ever-changing ideal parallelism based on network performance. If packets are being dropped, Nmap slows down and allows fewer outstanding probes. The ideal probe number slowly rises as the network proves itself worthy. These options place minimum or maximum bounds on that variable. By default, the ideal parallelism can drop to one if the network proves unreliable and rise to several hundred in perfect conditions. The most common usage is to set --min-parallelism to a number higher than one to speed up scans of poorly performing hosts or networks. This is a risky option to play with, as setting it too high may affect accuracy. Setting this also reduces Nmap's ability to control parallelism dynamically based on network conditions. A value of 10 might be reasonable, though I only adjust this value as a last resort. The --max-parallelism option is sometimes set to one to prevent Nmap from sending more than one probe at a time to hosts. The --scan-delay option, discussed later, is another way to do this. --min-rtt-timeout time, --max-rtt-timeout time, --initial-rtt-timeout time (Adjust probe timeouts) Nmap maintains a running timeout value for determining how long it will wait for a probe response before giving up or retransmitting the probe. This is calculated based on the response times of previous probes. If the network latency shows itself to be significant and variable, this timeout can grow to several seconds. It also starts at a conservative (high) level and may stay that way for a while when Nmap scans unresponsive hosts. Specifying a lower --max-rtt-timeout and --initial-rtt-timeout than the defaults can cut scan times significantly. This is particularly true for pingless (-Pn) scans, and those against heavily filtered networks. Don't get too aggressive though. The scan can end up taking longer if you specify such a low value that many probes are timing out and retransmitting while the response is in transit. If all the hosts are on a local network, 100 milliseconds (--max-rtt-timeout 100ms) is a reasonable aggressive value. If routing is involved, ping a host on the network first with the ICMP ping utility, or with a custom packet crafter such as Nping that is more likely to get through a firewall. Look at the maximum round trip time out of ten packets or so. You might want to double that for the --initial-rtt-timeout and triple or quadruple it for the --max-rtt-timeout. I generally do not set the maximum RTT below 100 ms, no matter what the ping times are. Nor do I exceed 1000 ms. --min-rtt-timeout is a rarely used option that could be useful when a network is so unreliable that even Nmap's default is too aggressive. Since Nmap only reduces the timeout down to the minimum when the network seems to be reliable, this need is unusual and should be reported as a bug to the nmap-dev mailing list. --max-retries numtries (Specify the maximum number of port scan probe retransmissions) When Nmap receives no response to a port scan probe, it could mean the port is filtered. Or maybe the probe or response was simply lost on the network. It is also possible that the target host has rate limiting enabled that temporarily blocked the response. So Nmap tries again by retransmitting the initial probe. If Nmap detects poor network reliability, it may try many more times before giving up on a port. While this benefits accuracy, it also lengthens scan times. When performance is critical, scans may be sped up by limiting the number of retransmissions allowed. You can even specify --max-retries 0 to prevent any retransmissions, though that is only recommended for situations such as informal surveys where occasional missed ports and hosts are acceptable. The default (with no -T template) is to allow ten retransmissions. If a network seems reliable and the target hosts aren't rate limiting, Nmap usually only does one retransmission. So most target scans aren't even affected by dropping --max-retries to a low value such as three. Such values can substantially speed scans of slow (rate limited) hosts. You usually lose some information when Nmap gives up on ports early, though that may be preferable to letting the --host-timeout expire and losing all information about the target. --host-timeout time (Give up on slow target hosts) Some hosts simply take a long time to scan. This may be due to poorly performing or unreliable networking hardware or software, packet rate limiting, or a restrictive firewall. The slowest few percent of the scanned hosts can eat up a majority of the scan time. Sometimes it is best to cut your losses and skip those hosts initially. Specify --host-timeout with the maximum amount of time you are willing to wait. For example, specify 30m to ensure that Nmap doesn't waste more than half an hour on a single host. Note that Nmap may be scanning other hosts at the same time during that half an hour, so it isn't a complete loss. A host that times out is skipped. No port table, OS detection, or version detection results are printed for that host. The special value 0 can be used to mean no timeout, which can be used to override the T5 timing template, which sets the host timeout to 15 minutes. --script-timeout time While some scripts complete in fractions of a second, others can take hours or more depending on the nature of the script, arguments passed in, network and application conditions, and more. The --script-timeout option sets a ceiling on script execution time. Any script instance which exceeds that time will be terminated and no output will be shown. If debugging (-d) is enabled, Nmap will report on each timeout. For host and service scripts, a script instance only scans a single target host or port and the timeout period will be reset for the next instance. The special value 0 can be used to mean no timeout, which can be used to override the T5 timing template, which sets the script timeout to 10 minutes. --scan-delay time; --max-scan-delay time (Adjust delay between probes) This option causes Nmap to wait at least the given amount of time between each probe it sends to a given host. This is particularly useful in the case of rate limiting. Solaris machines (among many others) will usually respond to UDP scan probe packets with only one ICMP message per second. Any more than that sent by Nmap will be wasteful. A --scan-delay of 1s will keep Nmap at that slow rate. Nmap tries to detect rate limiting and adjust the scan delay accordingly, but it doesn't hurt to specify it explicitly if you already know what rate works best. When Nmap adjusts the scan delay upward to cope with rate limiting, the scan slows down dramatically. The --max-scan-delay option specifies the largest delay that Nmap will allow. A low --max-scan-delay can speed up Nmap, but it is risky. Setting this value too low can lead to wasteful packet retransmissions and possible missed ports when the target implements strict rate limiting. Another use of --scan-delay is to evade threshold based intrusion detection and prevention systems (IDS/IPS). --min-rate number; --max-rate number (Directly control the scanning rate) Nmap's dynamic timing does a good job of finding an appropriate speed at which to scan. Sometimes, however, you may happen to know an appropriate scanning rate for a network, or you may have to guarantee that a scan will be finished by a certain time. Or perhaps you must keep Nmap from scanning too quickly. The --min-rate and --max-rate options are designed for these situations. When the --min-rate option is given Nmap will do its best to send packets as fast as or faster than the given rate. The argument is a positive real number representing a packet rate in packets per second. For example, specifying --min-rate 300 means that Nmap will try to keep the sending rate at or above 300 packets per second. Specifying a minimum rate does not keep Nmap from going faster if conditions warrant. Likewise, --max-rate limits a scan's sending rate to a given maximum. Use --max-rate 100, for example, to limit sending to 100 packets per second on a fast network. Use --max-rate 0.1 for a slow scan of one packet every ten seconds. Use --min-rate and --max-rate together to keep the rate inside a certain range. These two options are global, affecting an entire scan, not individual hosts. They only affect port scans and host discovery scans. Other features like OS detection implement their own timing. There are two conditions when the actual scanning rate may fall below the requested minimum. The first is if the minimum is faster than the fastest rate at which Nmap can send, which is dependent on hardware. In this case Nmap will simply send packets as fast as possible, but be aware that such high rates are likely to cause a loss of accuracy. The second case is when Nmap has nothing to send, for example at the end of a scan when the last probes have been sent and Nmap is waiting for them to time out or be responded to. It's normal to see the scanning rate drop at the end of a scan or in between hostgroups. The sending rate may temporarily exceed the maximum to make up for unpredictable delays, but on average the rate will stay at or below the maximum. Specifying a minimum rate should be done with care. Scanning faster than a network can support may lead to a loss of accuracy. In some cases, using a faster rate can make a scan take longer than it would with a slower rate. This is because Nmap's adaptive retransmission algorithms will detect the network congestion caused by an excessive scanning rate and increase the number of retransmissions in order to improve accuracy. So even though packets are sent at a higher rate, more packets are sent overall. Cap the number of retransmissions with the --max-retries option if you need to set an upper limit on total scan time. --defeat-rst-ratelimit Many hosts have long used rate limiting to reduce the number of ICMP error messages (such as port-unreachable errors) they send. Some systems now apply similar rate limits to the RST (reset) packets they generate. This can slow Nmap down dramatically as it adjusts its timing to reflect those rate limits. You can tell Nmap to ignore those rate limits (for port scans such as SYN scan which don't treat non-responsive ports as open) by specifying --defeat-rst-ratelimit. Using this option can reduce accuracy, as some ports will appear non-responsive because Nmap didn't wait long enough for a rate-limited RST response. With a SYN scan, the non-response results in the port being labeled filtered rather than the closed state we see when RST packets are received. This option is useful when you only care about open ports, and distinguishing between closed and filtered ports isn't worth the extra time. --defeat-icmp-ratelimit Similar to --defeat-rst-ratelimit, the --defeat-icmp-ratelimit option trades accuracy for speed, increasing UDP scanning speed against hosts that rate-limit ICMP error messages. Because this option causes Nmap to not delay in order to receive the port unreachable messages, a non-responsive port will be labeled closed|filtered instead of the default open|filtered. This has the effect of only treating ports which actually respond via UDP as open. Since many UDP services do not respond in this way, the chance for inaccuracy is greater with this option than with --defeat-rst-ratelimit. --nsock-engine iocp|epoll|kqueue|poll|select Enforce use of a given nsock IO multiplexing engine. Only the select(2)-based fallback engine is guaranteed to be available on your system. Engines are named after the name of the IO management facility they leverage. Engines currently implemented are epoll, kqueue, poll, and select, but not all will be present on any platform. By default, Nmap will use the "best" engine, i.e. the first one in this list that is supported. Use nmap -V to see which engines are supported on your platform. -T paranoid|sneaky|polite|normal|aggressive|insane (Set a timing template) While the fine-grained timing controls discussed in the previous section are powerful and effective, some people find them confusing. Moreover, choosing the appropriate values can sometimes take more time than the scan you are trying to optimize. Fortunately, Nmap offers a simpler approach, with six timing templates. You can specify them with the -T option and their number (05) or their name. The template names are paranoid (0), sneaky (1), polite (2), normal (3), aggressive (4), and insane (5). The first two are for IDS evasion. Polite mode slows down the scan to use less bandwidth and target machine resources. Normal mode is the default and so -T3 does nothing. Aggressive mode speeds scans up by making the assumption that you are on a reasonably fast and reliable network. Finally insane mode assumes that you are on an extraordinarily fast network or are willing to sacrifice some accuracy for speed. These templates allow the user to specify how aggressive they wish to be, while leaving Nmap to pick the exact timing values. The templates also make some minor speed adjustments for which fine-grained control options do not currently exist. For example, -T4 prohibits the dynamic scan delay from exceeding 10 ms for TCP ports and -T5 caps that value at 5 ms. Templates can be used in combination with fine-grained controls, and the fine-grained controls that you specify will take precedence over the timing template default for that parameter. I recommend using -T4 when scanning reasonably modern and reliable networks. Keep that option even when you add fine-grained controls so that you benefit from those extra minor optimizations that it enables. If you are on a decent broadband or ethernet connection, I would recommend always using -T4. Some people love -T5 though it is too aggressive for my taste. People sometimes specify -T2 because they think it is less likely to crash hosts or because they consider themselves to be polite in general. They often don't realize just how slow -T polite really is. Their scan may take ten times longer than a default scan. Machine crashes and bandwidth problems are rare with the default timing options (-T3) and so I normally recommend that for cautious scanners. Omitting version detection is far more effective than playing with timing values at reducing these problems. While -T0 and -T1 may be useful for avoiding IDS alerts, they will take an extraordinarily long time to scan thousands of machines or ports. For such a long scan, you may prefer to set the exact timing values you need rather than rely on the canned -T0 and -T1 values. The main effects of T0 are serializing the scan so only one port is scanned at a time, and waiting five minutes between sending each probe. T1 and T2 are similar but they only wait 15 seconds and 0.4 seconds, respectively, between probes. T3 is Nmap's default behavior, which includes parallelization. -T4 does the equivalent of --max-rtt-timeout 1250ms --min-rtt-timeout 100ms --initial-rtt-timeout 500ms --max-retries 6 and sets the maximum TCP and SCTP scan delay to 10ms. T5 does the equivalent of --max-rtt-timeout 300ms --min-rtt-timeout 50ms --initial-rtt-timeout 250ms --max-retries 2 --host-timeout 15m --script-timeout 10m as well as setting the maximum TCP and SCTP scan delay to 5ms. Maximum UDP scan delay is not set by T4 or T5, but it can be set with the --max-scan-delay option. FIREWALL/IDS EVASION AND SPOOFING top Many Internet pioneers envisioned a global open network with a universal IP address space allowing virtual connections between any two nodes. This allows hosts to act as true peers, serving and retrieving information from each other. People could access all of their home systems from work, changing the climate control settings or unlocking the doors for early guests. This vision of universal connectivity has been stifled by address space shortages and security concerns. In the early 1990s, organizations began deploying firewalls for the express purpose of reducing connectivity. Huge networks were cordoned off from the unfiltered Internet by application proxies, network address translation, and packet filters. The unrestricted flow of information gave way to tight regulation of approved communication channels and the content that passes over them. Network obstructions such as firewalls can make mapping a network exceedingly difficult. It will not get any easier, as stifling casual reconnaissance is often a key goal of implementing the devices. Nevertheless, Nmap offers many features to help understand these complex networks, and to verify that filters are working as intended. It even supports mechanisms for bypassing poorly implemented defenses. One of the best methods of understanding your network security posture is to try to defeat it. Place yourself in the mind-set of an attacker, and deploy techniques from this section against your networks. Launch an FTP bounce scan, idle scan, fragmentation attack, or try to tunnel through one of your own proxies. In addition to restricting network activity, companies are increasingly monitoring traffic with intrusion detection systems (IDS). All of the major IDSs ship with rules designed to detect Nmap scans because scans are sometimes a precursor to attacks. Many of these products have recently morphed into intrusion prevention systems (IPS) that actively block traffic deemed malicious. Unfortunately for network administrators and IDS vendors, reliably detecting bad intentions by analyzing packet data is a tough problem. Attackers with patience, skill, and the help of certain Nmap options can usually pass by IDSs undetected. Meanwhile, administrators must cope with large numbers of false positive results where innocent activity is misdiagnosed and alerted on or blocked. Occasionally people suggest that Nmap should not offer features for evading firewall rules or sneaking past IDSs. They argue that these features are just as likely to be misused by attackers as used by administrators to enhance security. The problem with this logic is that these methods would still be used by attackers, who would just find other tools or patch the functionality into Nmap. Meanwhile, administrators would find it that much harder to do their jobs. Deploying only modern, patched FTP servers is a far more powerful defense than trying to prevent the distribution of tools implementing the FTP bounce attack. There is no magic bullet (or Nmap option) for detecting and subverting firewalls and IDS systems. It takes skill and experience. A tutorial is beyond the scope of this reference guide, which only lists the relevant options and describes what they do. -f (fragment packets); --mtu (using the specified MTU) The -f option causes the requested scan (including host discovery scans) to use tiny fragmented IP packets. The idea is to split up the TCP header over several packets to make it harder for packet filters, intrusion detection systems, and other annoyances to detect what you are doing. Be careful with this! Some programs have trouble handling these tiny packets. The old-school sniffer named Sniffit segmentation faulted immediately upon receiving the first fragment. Specify this option once, and Nmap splits the packets into eight bytes or less after the IP header. So a 20-byte TCP header would be split into three packets. Two with eight bytes of the TCP header, and one with the final four. Of course each fragment also has an IP header. Specify -f again to use 16 bytes per fragment (reducing the number of fragments). Or you can specify your own offset size with the --mtu option. Don't also specify -f if you use --mtu. The offset must be a multiple of eight. While fragmented packets won't get by packet filters and firewalls that queue all IP fragments, such as the CONFIG_IP_ALWAYS_DEFRAG option in the Linux kernel, some networks can't afford the performance hit this causes and thus leave it disabled. Others can't enable this because fragments may take different routes into their networks. Some source systems defragment outgoing packets in the kernel. Linux with the iptables connection tracking module is one such example. Do a scan while a sniffer such as Wireshark is running to ensure that sent packets are fragmented. If your host OS is causing problems, try the --send-eth option to bypass the IP layer and send raw ethernet frames. Fragmentation is only supported for Nmap's raw packet features, which includes TCP and UDP port scans (except connect scan and FTP bounce scan) and OS detection. Features such as version detection and the Nmap Scripting Engine generally don't support fragmentation because they rely on your host's TCP stack to communicate with target services. -D decoy1[,decoy2][,ME][,...] (Cloak a scan with decoys) Causes a decoy scan to be performed, which makes it appear to the remote host that the host(s) you specify as decoys are scanning the target network too. Thus their IDS might report 510 port scans from unique IP addresses, but they won't know which IP was scanning them and which were innocent decoys. While this can be defeated through router path tracing, response-dropping, and other active mechanisms, it is generally an effective technique for hiding your IP address. Separate each decoy host with commas, and you can optionally use ME as one of the decoys to represent the position for your real IP address. If you put ME in the sixth position or later, some common port scan detectors (such as Solar Designer's excellent Scanlogd) are unlikely to show your IP address at all. If you don't use ME, Nmap will put you in a random position. You can also use RND to generate a random, non-reserved IP address, or RND:number to generate number addresses. Note that the hosts you use as decoys should be up or you might accidentally SYN flood your targets. Also it will be pretty easy to determine which host is scanning if only one is actually up on the network. You might want to use IP addresses instead of names (so the decoy networks don't see you in their nameserver logs). Right now random IP address generation is only supported with IPv4 Decoys are used both in the initial host discovery scan (using ICMP, SYN, ACK, or whatever) and during the actual port scanning phase. Decoys are also used during remote OS detection (-O). Decoys do not work with version detection or TCP connect scan. When a scan delay is in effect, the delay is enforced between each batch of spoofed probes, not between each individual probe. Because decoys are sent as a batch all at once, they may temporarily violate congestion control limits. It is worth noting that using too many decoys may slow your scan and potentially even make it less accurate. Also, some ISPs will filter out your spoofed packets, but many do not restrict spoofed IP packets at all. -S IP_Address (Spoof source address) In some circumstances, Nmap may not be able to determine your source address (Nmap will tell you if this is the case). In this situation, use -S with the IP address of the interface you wish to send packets through. Another possible use of this flag is to spoof the scan to make the targets think that someone else is scanning them. Imagine a company being repeatedly port scanned by a competitor! The -e option and -Pn are generally required for this sort of usage. Note that you usually won't receive reply packets back (they will be addressed to the IP you are spoofing), so Nmap won't produce useful reports. -e interface (Use specified interface) Tells Nmap what interface to send and receive packets on. Nmap should be able to detect this automatically, but it will tell you if it cannot. --source-port portnumber; -g portnumber (Spoof source port number) One surprisingly common misconfiguration is to trust traffic based only on the source port number. It is easy to understand how this comes about. An administrator will set up a shiny new firewall, only to be flooded with complaints from ungrateful users whose applications stopped working. In particular, DNS may be broken because the UDP DNS replies from external servers can no longer enter the network. FTP is another common example. In active FTP transfers, the remote server tries to establish a connection back to the client to transfer the requested file. Secure solutions to these problems exist, often in the form of application-level proxies or protocol-parsing firewall modules. Unfortunately there are also easier, insecure solutions. Noting that DNS replies come from port 53 and active FTP from port 20, many administrators have fallen into the trap of simply allowing incoming traffic from those ports. They often assume that no attacker would notice and exploit such firewall holes. In other cases, administrators consider this a short-term stop-gap measure until they can implement a more secure solution. Then they forget the security upgrade. Overworked network administrators are not the only ones to fall into this trap. Numerous products have shipped with these insecure rules. Even Microsoft has been guilty. The IPsec filters that shipped with Windows 2000 and Windows XP contain an implicit rule that allows all TCP or UDP traffic from port 88 (Kerberos). In another well-known case, versions of the Zone Alarm personal firewall up to 2.1.25 allowed any incoming UDP packets with the source port 53 (DNS) or 67 (DHCP). Nmap offers the -g and --source-port options (they are equivalent) to exploit these weaknesses. Simply provide a port number and Nmap will send packets from that port where possible. Most scanning operations that use raw sockets, including SYN and UDP scans, support the option completely. The option notably doesn't have an effect for any operations that use normal operating system sockets, including DNS requests, TCP connect scan, version detection, and script scanning. Setting the source port also doesn't work for OS detection, because Nmap must use different port numbers for certain OS detection tests to work properly. --data hex string (Append custom binary data to sent packets) This option lets you include binary data as payload in sent packets. hex string may be specified in any of the following formats: 0xAABBCCDDEEFF..., AABBCCDDEEFF... or \xAA\xBB\xCC\xDD\xEE\xFF.... Examples of use are --data 0xdeadbeef and --data \xCA\xFE\x09. Note that if you specify a number like 0x00ff no byte-order conversion is performed. Make sure you specify the information in the byte order expected by the receiver. --data-string string (Append custom string to sent packets) This option lets you include a regular string as payload in sent packets. string can contain any string. However, note that some characters may depend on your system's locale and the receiver may not see the same information. Also, make sure you enclose the string in double quotes and escape any special characters from the shell. Examples: --data-string "Scan conducted by Security Ops, extension 7192" or --data-string "Ph34r my l33t skills". Keep in mind that nobody is likely to actually see any comments left by this option unless they are carefully monitoring the network with a sniffer or custom IDS rules. --data-length number (Append random data to sent packets) Normally Nmap sends minimalist packets containing only a header. So its TCP packets are generally 40 bytes and ICMP echo requests are just 28. Some UDP ports and IP protocols get a custom payload by default. This option tells Nmap to append the given number of random bytes to most of the packets it sends, and not to use any protocol-specific payloads. (Use --data-length 0 for no random or protocol-specific payloads. OS detection (-O) packets are not affected because accuracy there requires probe consistency, but most pinging and portscan packets support this. It slows things down a little, but can make a scan slightly less conspicuous. --ip-options R|S [route]|L [route]|T|U ... ; --ip-options hex string (Send packets with specified ip options) The IP protocol[12] offers several options which may be placed in packet headers. Unlike the ubiquitous TCP options, IP options are rarely seen due to practicality and security concerns. In fact, many Internet routers block the most dangerous options such as source routing. Yet options can still be useful in some cases for determining and manipulating the network route to target machines. For example, you may be able to use the record route option to determine a path to a target even when more traditional traceroute-style approaches fail. Or if your packets are being dropped by a certain firewall, you may be able to specify a different route with the strict or loose source routing options. The most powerful way to specify IP options is to simply pass in values as the argument to --ip-options. Precede each hex number with \x then the two digits. You may repeat certain characters by following them with an asterisk and then the number of times you wish them to repeat. For example, \x01\x07\x04\x00*36\x01 is a hex string containing 36 NUL bytes. Nmap also offers a shortcut mechanism for specifying options. Simply pass the letter R, T, or U to request record-route, record-timestamp, or both options together, respectively. Loose or strict source routing may be specified with an L or S followed by a space and then a space-separated list of IP addresses. If you wish to see the options in packets sent and received, specify --packet-trace. For more information and examples of using IP options with Nmap, see https://seclists.org/nmap-dev/2006/q3/52 . --ttl value (Set IP time-to-live field) Sets the IPv4 time-to-live field in sent packets to the given value. --randomize-hosts (Randomize target host order) Tells Nmap to shuffle each group of up to 16384 hosts before it scans them. This can make the scans less obvious to various network monitoring systems, especially when you combine it with slow timing options. If you want to randomize over larger group sizes, increase PING_GROUP_SZ in nmap.h and recompile. An alternative solution is to generate the target IP list with a list scan (-sL -n -oN filename), randomize it with a Perl script, then provide the whole list to Nmap with -iL. --spoof-mac MAC address, prefix, or vendor name (Spoof MAC address) Asks Nmap to use the given MAC address for all of the raw ethernet frames it sends. This option implies --send-eth to ensure that Nmap actually sends ethernet-level packets. The MAC given can take several formats. If it is simply the number 0, Nmap chooses a completely random MAC address for the session. If the given string is an even number of hex digits (with the pairs optionally separated by a colon), Nmap will use those as the MAC. If fewer than 12 hex digits are provided, Nmap fills in the remainder of the six bytes with random values. If the argument isn't a zero or hex string, Nmap looks through nmap-mac-prefixes to find a vendor name containing the given string (it is case insensitive). If a match is found, Nmap uses the vendor's OUI (three-byte prefix) and fills out the remaining three bytes randomly. Valid --spoof-mac argument examples are Apple, 0, 01:02:03:04:05:06, deadbeefcafe, 0020F2, and Cisco. This option only affects raw packet scans such as SYN scan or OS detection, not connection-oriented features such as version detection or the Nmap Scripting Engine. --proxies Comma-separated list of proxy URLs (Relay TCP connections through a chain of proxies) Asks Nmap to establish TCP connections with a final target through supplied chain of one or more HTTP or SOCKS4 proxies. Proxies can help hide the true source of a scan or evade certain firewall restrictions, but they can hamper scan performance by increasing latency. Users may need to adjust Nmap timeouts and other scan parameters accordingly. In particular, a lower --max-parallelism may help because some proxies refuse to handle as many concurrent connections as Nmap opens by default. This option takes a list of proxies as argument, expressed as URLs in the format proto://host:port. Use commas to separate node URLs in a chain. No authentication is supported yet. Valid protocols are HTTP and SOCKS4. Warning: this feature is still under development and has limitations. It is implemented within the nsock library and thus has no effect on the ping, port scanning and OS discovery phases of a scan. Only NSE and version scan benefit from this option so farother features may disclose your true address. SSL connections are not yet supported, nor is proxy-side DNS resolution (hostnames are always resolved by Nmap). --badsum (Send packets with bogus TCP/UDP checksums) Asks Nmap to use an invalid TCP, UDP or SCTP checksum for packets sent to target hosts. Since virtually all host IP stacks properly drop these packets, any responses received are likely coming from a firewall or IDS that didn't bother to verify the checksum. For more details on this technique, see https://nmap.org/p60-12.html --adler32 (Use deprecated Adler32 instead of CRC32C for SCTP checksums) Asks Nmap to use the deprecated Adler32 algorithm for calculating the SCTP checksum. If --adler32 is not given, CRC-32C (Castagnoli) is used. RFC 2960[13] originally defined Adler32 as checksum algorithm for SCTP; RFC 4960[6] later redefined the SCTP checksums to use CRC-32C. Current SCTP implementations should be using CRC-32C, but in order to elicit responses from old, legacy SCTP implementations, it may be preferable to use Adler32. OUTPUT top Any security tool is only as useful as the output it generates. Complex tests and algorithms are of little value if they aren't presented in an organized and comprehensible fashion. Given the number of ways Nmap is used by people and other software, no single format can please everyone. So Nmap offers several formats, including the interactive mode for humans to read directly and XML for easy parsing by software. In addition to offering different output formats, Nmap provides options for controlling the verbosity of output as well as debugging messages. Output types may be sent to standard output or to named files, which Nmap can append to or clobber. Output files may also be used to resume aborted scans. Nmap makes output available in five different formats. The default is called interactive output, and it is sent to standard output (stdout). There is also normal output, which is similar to interactive except that it displays less runtime information and warnings since it is expected to be analyzed after the scan completes rather than interactively. XML output is one of the most important output types, as it can be converted to HTML, easily parsed by programs such as Nmap graphical user interfaces, or imported into databases. The two remaining output types are the simple grepable output which includes most information for a target host on a single line, and sCRiPt KiDDi3 0utPUt for users who consider themselves |<-r4d. While interactive output is the default and has no associated command-line options, the other four format options use the same syntax. They take one argument, which is the filename that results should be stored in. Multiple formats may be specified, but each format may only be specified once. For example, you may wish to save normal output for your own review while saving XML of the same scan for programmatic analysis. You might do this with the options -oX myscan.xml -oN myscan.nmap. While this chapter uses the simple names like myscan.xml for brevity, more descriptive names are generally recommended. The names chosen are a matter of personal preference, though I use long ones that incorporate the scan date and a word or two describing the scan, placed in a directory named after the company I'm scanning. While these options save results to files, Nmap still prints interactive output to stdout as usual. For example, the command nmap -oX myscan.xml target prints XML to myscan.xml and fills standard output with the same interactive results it would have printed if -oX wasn't specified at all. You can change this by passing a hyphen character as the argument to one of the format types. This causes Nmap to deactivate interactive output, and instead print results in the format you specified to the standard output stream. So the command nmap -oX - target will send only XML output to stdout. Serious errors may still be printed to the normal error stream, stderr. Unlike some Nmap arguments, the space between the logfile option flag (such as -oX) and the filename or hyphen is mandatory. If you omit the flags and give arguments such as -oG- or -oXscan.xml, a backwards compatibility feature of Nmap will cause the creation of normal format output files named G- and Xscan.xml respectively. All of these arguments support strftime-like conversions in the filename. %H, %M, %S, %m, %d, %y, and %Y are all exactly the same as in strftime. %T is the same as %H%M%S, %R is the same as %H%M, and %D is the same as %m%d%y. A % followed by any other character just yields that character (%% gives you a percent symbol). So -oX 'scan-%T-%D.xml' will use an XML file with a name in the form of scan-144840-121307.xml. Nmap also offers options to control scan verbosity and to append to output files rather than clobbering them. All of these options are described below. Nmap Output Formats -oN filespec (normal output) Requests that normal output be directed to the given filename. As discussed above, this differs slightly from interactive output. -oX filespec (XML output) Requests that XML output be directed to the given filename. Nmap includes a document type definition (DTD) which allows XML parsers to validate Nmap XML output. While it is primarily intended for programmatic use, it can also help humans interpret Nmap XML output. The DTD defines the legal elements of the format, and often enumerates the attributes and values they can take on. The latest version is always available from https://svn.nmap.org/nmap/docs/nmap.dtd . XML offers a stable format that is easily parsed by software. Free XML parsers are available for all major computer languages, including C/C++, Perl, Python, and Java. People have even written bindings for most of these languages to handle Nmap output and execution specifically. Examples are Nmap::Scanner[14] and Nmap::Parser[15] in Perl CPAN. In almost all cases that a non-trivial application interfaces with Nmap, XML is the preferred format. The XML output references an XSL stylesheet which can be used to format the results as HTML. The easiest way to use this is simply to load the XML output in a web browser such as Firefox or IE. By default, this will only work on the machine you ran Nmap on (or a similarly configured one) due to the hard-coded nmap.xsl filesystem path. Use the --webxml or --stylesheet options to create portable XML files that render as HTML on any web-connected machine. -oS filespec (ScRipT KIdd|3 oUTpuT) Script kiddie output is like interactive output, except that it is post-processed to better suit the l33t HaXXorZ who previously looked down on Nmap due to its consistent capitalization and spelling. Humor impaired people should note that this option is making fun of the script kiddies before flaming me for supposedly helping them. -oG filespec (grepable output) This output format is covered last because it is deprecated. The XML output format is far more powerful, and is nearly as convenient for experienced users. XML is a standard for which dozens of excellent parsers are available, while grepable output is my own simple hack. XML is extensible to support new Nmap features as they are released, while I often must omit those features from grepable output for lack of a place to put them. Nevertheless, grepable output is still quite popular. It is a simple format that lists each host on one line and can be trivially searched and parsed with standard Unix tools such as grep, awk, cut, sed, diff, and Perl. Even I usually use it for one-off tests done at the command line. Finding all the hosts with the SSH port open or that are running Solaris takes only a simple grep to identify the hosts, piped to an awk or cut command to print the desired fields. Grepable output consists of comments (lines starting with a pound (#)) and target lines. A target line includes a combination of six labeled fields, separated by tabs and followed with a colon. The fields are Host, Ports, Protocols, Ignored State, OS, Seq Index, IP ID, and Status. The most important of these fields is generally Ports, which gives details on each interesting port. It is a comma separated list of port entries. Each port entry represents one interesting port, and takes the form of seven slash (/) separated subfields. Those subfields are: Port number, State, Protocol, Owner, Service, SunRPC info, and Version info. As with XML output, this man page does not allow for documenting the entire format. A more detailed look at the Nmap grepable output format is available from https://nmap.org/book/output-formats-grepable-output.html . -oA basename (Output to all formats) As a convenience, you may specify -oA basename to store scan results in normal, XML, and grepable formats at once. They are stored in basename.nmap, basename.xml, and basename.gnmap, respectively. As with most programs, you can prefix the filenames with a directory path, such as ~/nmaplogs/foocorp/ on Unix or c:\hacking\sco on Windows. Verbosity and debugging options -v (Increase verbosity level), -vlevel (Set verbosity level) Increases the verbosity level, causing Nmap to print more information about the scan in progress. Open ports are shown as they are found and completion time estimates are provided when Nmap thinks a scan will take more than a few minutes. Use it twice or more for even greater verbosity: -vv, or give a verbosity level directly, for example -v3. Most changes only affect interactive output, and some also affect normal and script kiddie output. The other output types are meant to be processed by machines, so Nmap can give substantial detail by default in those formats without fatiguing a human user. However, there are a few changes in other modes where output size can be reduced substantially by omitting some detail. For example, a comment line in the grepable output that provides a list of all ports scanned is only printed in verbose mode because it can be quite long. -d (Increase debugging level), -dlevel (Set debugging level) When even verbose mode doesn't provide sufficient data for you, debugging is available to flood you with much more! As with the verbosity option (-v), debugging is enabled with a command-line flag (-d) and the debug level can be increased by specifying it multiple times, as in -dd, or by setting a level directly. For example, -d9 sets level nine. That is the highest effective level and will produce thousands of lines unless you run a very simple scan with very few ports and targets. Debugging output is useful when a bug is suspected in Nmap, or if you are simply confused as to what Nmap is doing and why. As this feature is mostly intended for developers, debug lines aren't always self-explanatory. You may get something like: Timeout vals: srtt: -1 rttvar: -1 to: 1000000 delta 14987 ==> srtt: 14987 rttvar: 14987 to: 100000. If you don't understand a line, your only recourses are to ignore it, look it up in the source code, or request help from the development list (nmap-dev). Some lines are self explanatory, but the messages become more obscure as the debug level is increased. --reason (Host and port state reasons) Shows the reason each port is set to a specific state and the reason each host is up or down. This option displays the type of the packet that determined a port or hosts state. For example, A RST packet from a closed port or an echo reply from an alive host. The information Nmap can provide is determined by the type of scan or ping. The SYN scan and SYN ping (-sS and -PS) are very detailed, but the TCP connect scan (-sT) is limited by the implementation of the connect system call. This feature is automatically enabled by the debug option (-d) and the results are stored in XML log files even if this option is not specified. --stats-every time (Print periodic timing stats) Periodically prints a timing status message after each interval of time. The time is a specification of the kind described in the section called TIMING AND PERFORMANCE; so for example, use --stats-every 10s to get a status update every 10 seconds. Updates are printed to interactive output (the screen) and XML output. --packet-trace (Trace packets and data sent and received) Causes Nmap to print a summary of every packet sent or received. This is often used for debugging, but is also a valuable way for new users to understand exactly what Nmap is doing under the covers. To avoid printing thousands of lines, you may want to specify a limited number of ports to scan, such as -p20-30. If you only care about the goings on of the version detection subsystem, use --version-trace instead. If you only care about script tracing, specify --script-trace. With --packet-trace, you get all of the above. --open (Show only open (or possibly open) ports) Sometimes you only care about ports you can actually connect to (open ones), and don't want results cluttered with closed, filtered, and closed|filtered ports. Output customization is normally done after the scan using tools such as grep, awk, and Perl, but this feature was added due to overwhelming requests. Specify --open to only see hosts with at least one open, open|filtered, or unfiltered port, and only see ports in those states. These three states are treated just as they normally are, which means that open|filtered and unfiltered may be condensed into counts if there are an overwhelming number of them. Beginning with Nmap 7.40, the --open option implies --defeat-rst-ratelimit, because that option only affects closed and filtered ports, which are hidden by --open. --iflist (List interfaces and routes) Prints the interface list and system routes as detected by Nmap and quits. This is useful for debugging routing problems or device mischaracterization (such as Nmap treating a PPP connection as ethernet). Miscellaneous output options --append-output (Append to rather than clobber output files) When you specify a filename to an output format flag such as -oX or -oN, that file is overwritten by default. If you prefer to keep the existing content of the file and append the new results, specify the --append-output option. All output filenames specified in that Nmap execution will then be appended to rather than clobbered. This doesn't work well for XML (-oX) scan data as the resultant file generally won't parse properly until you fix it up by hand. --resume filename (Resume aborted scan) Some extensive Nmap runs take a very long timeon the order of days. Such scans don't always run to completion. Restrictions may prevent Nmap from being run during working hours, the network could go down, the machine Nmap is running on might suffer a planned or unplanned reboot, or Nmap itself could crash. The administrator running Nmap could cancel it for any other reason as well, by pressing ctrl-C. Restarting the whole scan from the beginning may be undesirable. Fortunately, if scan output files were kept, the user can ask Nmap to resume scanning with the target it was working on when execution ceased. Simply specify the --resume option and pass the output file as its argument. No other arguments are permitted, as Nmap parses the output file to use the same ones specified previously. Simply call Nmap as nmap --resume logfilename. Nmap will append new results to the data files specified in the previous execution. Scans can be resumed from any of the 3 major output formats: Normal, Grepable, or XML --noninteractive (Disable runtime interactions) At times, such as when running Nmap in a shell background, it might be undesirable for Nmap to monitor and respond to user keyboard input when running. (See the section called RUNTIME INTERACTION about how to control Nmap during a scan.) Use option --noninteractive to prevent Nmap taking control of the terminal. --stylesheet path or URL (Set XSL stylesheet to transform XML output) Nmap ships with an XSL stylesheet named nmap.xsl for viewing or translating XML output to HTML. The XML output includes an xml-stylesheet directive which points to nmap.xml where it was initially installed by Nmap. Run the XML file through an XSLT processor such as xsltproc[16] to produce an HTML file. Directly opening the XML file in a browser no longer works well because modern browsers limit the locations a stylesheet may be loaded from. If you wish to use a different stylesheet, specify it as the argument to --stylesheet. You must pass the full pathname or URL. One common invocation is --stylesheet https://nmap.org/svn/docs/nmap.xsl. This tells an XSLT processor to load the latest version of the stylesheet from Nmap.Org. The --webxml option does the same thing with less typing and memorization. Loading the XSL from Nmap.Org makes it easier to view results on a machine that doesn't have Nmap (and thus nmap.xsl) installed. So the URL is often more useful, but the local filesystem location of nmap.xsl is used by default for privacy reasons. --webxml (Load stylesheet from Nmap.Org) This is a convenience option, nothing more than an alias for --stylesheet https://nmap.org/svn/docs/nmap.xsl. --no-stylesheet (Omit XSL stylesheet declaration from XML) Specify this option to prevent Nmap from associating any XSL stylesheet with its XML output. The xml-stylesheet directive is omitted. MISCELLANEOUS OPTIONS top This section describes some important (and not-so-important) options that don't really fit anywhere else. -6 (Enable IPv6 scanning) Nmap has IPv6 support for its most popular features. Ping scanning, port scanning, version detection, and the Nmap Scripting Engine all support IPv6. The command syntax is the same as usual except that you also add the -6 option. Of course, you must use IPv6 syntax if you specify an address rather than a hostname. An address might look like 3ffe:7501:4819:2000:210:f3ff:fe03:14d0, so hostnames are recommended. The output looks the same as usual, with the IPv6 address on the interesting ports line being the only IPv6 giveaway. While IPv6 hasn't exactly taken the world by storm, it gets significant use in some (usually Asian) countries and most modern operating systems support it. To use Nmap with IPv6, both the source and target of your scan must be configured for IPv6. If your ISP (like most of them) does not allocate IPv6 addresses to you, free tunnel brokers are widely available and work fine with Nmap. I use the free IPv6 tunnel broker service at http://www.tunnelbroker.net . Other tunnel brokers are listed at Wikipedia[17]. 6to4 tunnels are another popular, free approach. On Windows, raw-socket IPv6 scans are supported only on ethernet devices (not tunnels), and only on Windows Vista and later. Use the --unprivileged option in other situations. -A (Aggressive scan options) This option enables additional advanced and aggressive options. Presently this enables OS detection (-O), version scanning (-sV), script scanning (-sC) and traceroute (--traceroute). More features may be added in the future. The point is to enable a comprehensive set of scan options without people having to remember a large set of flags. However, because script scanning with the default set is considered intrusive, you should not use -A against target networks without permission. This option only enables features, and not timing options (such as -T4) or verbosity options (-v) that you might want as well. Options which require privileges (e.g. root access) such as OS detection and traceroute will only be enabled if those privileges are available. --datadir directoryname (Specify custom Nmap data file location) Nmap obtains some special data at runtime in files named nmap-service-probes, nmap-services, nmap-protocols, nmap-rpc, nmap-mac-prefixes, and nmap-os-db. If the location of any of these files has been specified (using the --servicedb or --versiondb options), that location is used for that file. After that, Nmap searches these files in the directory specified with the --datadir option (if any). Any files not found there, are searched for in the directory specified by the NMAPDIR environment variable. Next comes ~/.nmap for real and effective UIDs; or on Windows, HOME\AppData\Roaming\nmap (where HOME is the user's home directory, like C:\Users\user). This is followed by the location of the nmap executable and the same location with ../share/nmap appended. Then a compiled-in location such as /usr/local/share/nmap or /usr/share/nmap. --servicedb services file (Specify custom services file) Asks Nmap to use the specified services file rather than the nmap-services data file that comes with Nmap. Using this option also causes a fast scan (-F) to be used. See the description for --datadir for more information on Nmap's data files. --versiondb service probes file (Specify custom service probes file) Asks Nmap to use the specified service probes file rather than the nmap-service-probes data file that comes with Nmap. See the description for --datadir for more information on Nmap's data files. --send-eth (Use raw ethernet sending) Asks Nmap to send packets at the raw ethernet (data link) layer rather than the higher IP (network) layer. By default, Nmap chooses the one which is generally best for the platform it is running on. Raw sockets (IP layer) are generally most efficient for Unix machines, while ethernet frames are required for Windows operation since Microsoft disabled raw socket support. Nmap still uses raw IP packets on Unix despite this option when there is no other choice (such as non-ethernet connections). --send-ip (Send at raw IP level) Asks Nmap to send packets via raw IP sockets rather than sending lower level ethernet frames. It is the complement to the --send-eth option discussed previously. --privileged (Assume that the user is fully privileged) Tells Nmap to simply assume that it is privileged enough to perform raw socket sends, packet sniffing, and similar operations that usually require root privileges on Unix systems. By default Nmap quits if such operations are requested but geteuid is not zero. --privileged is useful with Linux kernel capabilities and similar systems that may be configured to allow unprivileged users to perform raw-packet scans. Be sure to provide this option flag before any flags for options that require privileges (SYN scan, OS detection, etc.). The NMAP_PRIVILEGED environment variable may be set as an equivalent alternative to --privileged. --unprivileged (Assume that the user lacks raw socket privileges) This option is the opposite of --privileged. It tells Nmap to treat the user as lacking network raw socket and sniffing privileges. This is useful for testing, debugging, or when the raw network functionality of your operating system is somehow broken. The NMAP_UNPRIVILEGED environment variable may be set as an equivalent alternative to --unprivileged. --release-memory (Release memory before quitting) This option is only useful for memory-leak debugging. It causes Nmap to release allocated memory just before it quits so that actual memory leaks are easier to spot. Normally Nmap skips this as the OS does this anyway upon process termination. -V; --version (Print version number) Prints the Nmap version number and exits. -h; --help (Print help summary page) Prints a short help screen with the most common command flags. Running Nmap without any arguments does the same thing. RUNTIME INTERACTION top During the execution of Nmap, all key presses are captured. This allows you to interact with the program without aborting and restarting it. Certain special keys will change options, while any other keys will print out a status message telling you about the scan. The convention is that lowercase letters increase the amount of printing, and uppercase letters decrease the printing. You may also press ? for help. v / V Increase / decrease the verbosity level d / D Increase / decrease the debugging Level p / P Turn on / off packet tracing ? Print a runtime interaction help screen Anything else Print out a status message like this: Stats: 0:00:07 elapsed; 20 hosts completed (1 up), 1 undergoing Service Scan Service scan Timing: About 33.33% done; ETC: 20:57 (0:00:12 remaining) EXAMPLES top Here are some Nmap usage examples, from the simple and routine to a little more complex and esoteric. Some actual IP addresses and domain names are used to make things more concrete. In their place you should substitute addresses/names from your own network. While I don't think port scanning other networks is or should be illegal, some network administrators don't appreciate unsolicited scanning of their networks and may complain. Getting permission first is the best approach. For testing purposes, you have permission to scan the host scanme.nmap.org. This permission only includes scanning via Nmap and not testing exploits or denial of service attacks. To conserve bandwidth, please do not initiate more than a dozen scans against that host per day. If this free scanning target service is abused, it will be taken down and Nmap will report Failed to resolve given hostname/IP: scanme.nmap.org. These permissions also apply to the hosts scanme2.nmap.org, scanme3.nmap.org, and so on, though those hosts do not currently exist. nmap -v scanme.nmap.org This option scans all reserved TCP ports on the machine scanme.nmap.org . The -v option enables verbose mode. nmap -sS -O scanme.nmap.org/24 Launches a stealth SYN scan against each machine that is up out of the 256 IPs on the /24 sized network where Scanme resides. It also tries to determine what operating system is running on each host that is up and running. This requires root privileges because of the SYN scan and OS detection. nmap -sV -p 22,53,110,143,4564 198.116.0-255.1-127 Launches host enumeration and a TCP scan at the first half of each of the 255 possible eight-bit subnets in the 198.116.0.0/16 address space. This tests whether the systems run SSH, DNS, POP3, or IMAP on their standard ports, or anything on port 4564. For any of these ports found open, version detection is used to determine what application is running. nmap -v -iR 100000 -Pn -p 80 Asks Nmap to choose 100,000 hosts at random and scan them for web servers (port 80). Host enumeration is disabled with -Pn since first sending a couple probes to determine whether a host is up is wasteful when you are only probing one port on each target host anyway. nmap -Pn -p80 -oX logs/pb-port80scan.xml -oG logs/pb-port80scan.gnmap 216.163.128.20/20 This scans 4096 IPs for any web servers (without pinging them) and saves the output in grepable and XML formats. NMAP BOOK top While this reference guide details all material Nmap options, it can't fully demonstrate how to apply those features to quickly solve real-world tasks. For that, we released Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning. Topics include subverting firewalls and intrusion detection systems, optimizing Nmap performance, and automating common networking tasks with the Nmap Scripting Engine. Hints and instructions are provided for common Nmap tasks such as taking network inventory, penetration testing, detecting rogue wireless access points, and quashing network worm outbreaks. Examples and diagrams show actual communication on the wire. More than half of the book is available free online. See https://nmap.org/book for more information. BUGS top Like its author, Nmap isn't perfect. But you can help make it better by sending bug reports or even writing patches. If Nmap doesn't behave the way you expect, first upgrade to the latest version available from https://nmap.org . If the problem persists, do some research to determine whether it has already been discovered and addressed. Try searching for the problem or error message on Google since that aggregates so many forums. If nothing comes of this, create an Issue on our tracker ( http://issues.nmap.org ) and/or mail a bug report to <[email protected]>. If you subscribe to the nmap-dev list before posting, your message will bypass moderation and get through more quickly. Subscribe at https://nmap.org/mailman/listinfo/dev . Please include everything you have learned about the problem, as well as what version of Nmap you are using and what operating system version it is running on. Other suggestions for improving Nmap may be sent to the Nmap dev mailing list as well. If you are able to write a patch improving Nmap or fixing a bug, that is even better! Instructions for submitting patches or git pull requests are available from https://github.com/nmap/nmap/blob/master/CONTRIBUTING.md Particularly sensitive issues such as a security reports may be sent directly to Nmap's author Fyodor directly at <[email protected]>. All other reports and comments should use the dev list or issue tracker instead because more people read, follow, and respond to those. AUTHORS top Gordon Fyodor Lyon <[email protected]> wrote and released Nmap in 1997. Since then, hundreds of people have made valuable contributions, as detailed in the CHANGELOG file distributed with Nmap and also available from https://nmap.org/changelog.html . David Fifield and Daniel Miller deserve special recognition for their enormous multi-year contributions! LEGAL NOTICES top Nmap Copyright and Licensing The Nmap Security Scanner is (C) 19962022 Nmap Software LLC ("The Nmap Project"). Nmap is also a registered trademark of the Nmap Project. It is published under the Nmap Public Source License[18]. This generally allows end users to download and use Nmap for free. It doesn't allow Nmap to be used and redistributed within commercial software or hardware products (including appliances, virtual machines, and traditional applications). We fund the project by selling a special Nmap OEM Edition for this purpose, as described at https://nmap.org/oem . Hundreds of large and small software vendors have already purchased OEM licenses to embed Nmap technology such as host discovery, port scanning, OS detection, version detection, and the Nmap Scripting Engine within their products. The Nmap Project has permission to redistribute Npcap, a packet capturing driver and library for the Microsoft Windows platform. Npcap is a separate work with it's own license rather than this Nmap license. Since the Npcap license does not permit redistribution without special permission, our Nmap Windows binary packages which contain Npcap may not be redistributed without special permission. Even though the NPSL is based on GPLv2, it contains different provisions and is not directly compatible. It is incompatible with some other open source licenses as well. In some cases we can relicense portions of Nmap or grant special permissions to use it in other open source software. Please contact [email protected] with any such requests. Similarly, we don't incorporate incompatible open source software into Nmap without special permission from the copyright holders. If you have received a written license agreement or contract for Nmap (such as an Nmap OEM license[19]) stating terms other than these, you may choose to use and redistribute Nmap under those terms instead. Creative Commons License for this Nmap Guide This Nmap Reference Guide is (C) 20052022 Nmap Software LLC. It is hereby placed under version 3.0 of the Creative Commons Attribution License[20]. This allows you redistribute and modify the work as you desire, as long as you credit the original source. Alternatively, you may choose to treat this document as falling under the same license as Nmap itself (discussed previously). Source Code Availability and Community Contributions Source is provided to this software because we believe users have a right to know exactly what a program is going to do before they run it. This also allows you to audit the software for security holes. Source code also allows you to port Nmap to new platforms, fix bugs, and add new features. You are highly encouraged to submit your changes as Github Pull Requests (PR) or send them to <[email protected]> for possible incorporation into the main distribution. By submitting such changes, it is assumed that you are offering the Nmap Project the unlimited, non-exclusive right to reuse, modify, and relicense the code. This is important because the inability to relicense code has caused devastating problems for other Free Software projects (such as KDE and NASM). We also sell commercial licenses to Nmap OEM[21]. If you wish to specify special license conditions of your contributions, just say so when you send them. No Warranty This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. It should also be noted that Nmap has occasionally been known to crash poorly written applications, TCP/IP stacks, and even operating systems. While this is extremely rare, it is important to keep in mind. Nmap should never be run against mission critical systems unless you are prepared to suffer downtime. We acknowledge here that Nmap may crash your systems or networks and we disclaim all liability for any damage or problems Nmap could cause. Inappropriate Usage Because of the slight risk of crashes and because a few black hats like to use Nmap for reconnaissance prior to attacking systems, there are administrators who become upset and may complain when their system is scanned. Thus, it is often advisable to request permission before doing even a light scan of a network. Nmap should never be installed with special privileges (e.g. suid root). That would open up a major security vulnerability as other users on the system (or attackers) could use it for privilege escalation. Nmap is not designed, manufactured, or intended for use in hazardous environments requiring fail- safe performance where the failure of the software could lead directly to death, personal injury, or significant physical or environmental damage. Third-Party Software and Funding Notices This product includes software developed by the Apache Software Foundation[22]. A modified version of the Libpcap portable packet capture library[23] is distributed along with Nmap. The Windows version of Nmap utilizes the Libpcap-derived Ncap library[24] instead. Regular expression support is provided by the PCRE library[25], which is open-source software, written by Philip Hazel. Certain raw networking functions use the Libdnet[26] networking library, which was written by Dug Song. A modified version is distributed with Nmap. Nmap can optionally link with the OpenSSL cryptography toolkit[27] for SSL version detection support. The Nmap Scripting Engine uses an embedded version of the Lua programming language[10]. The Liblinear linear classification library[28] is used for our IPv6 OS detection machine learning techniques[29]. All of the third-party software described in this paragraph is freely redistributable under BSD-style software licenses. Binary packages for Windows and Mac OS X include support libraries necessary to run Zenmap and Ndiff with Python and PyGTK. (Unix platforms commonly make these libraries easy to install, so they are not part of the packages.) A listing of these support libraries and their licenses is included in the LICENSES files. This software was supported in part through the Google Summer of Code[30] and the DARPA CINDER program[31] (DARPA-BAA-10-84). United States Export Control Nmap only uses encryption when compiled with the optional OpenSSL support and linked with OpenSSL. When compiled without OpenSSL support, the Nmap Project believes that Nmap is not subject to U.S. Export Administration Regulations (EAR)[32] export control. As such, there is no applicable ECCN (export control classification number) and exportation does not require any special license, permit, or other governmental authorization. When compiled with OpenSSL support or distributed as source code, the Nmap Project believes that Nmap falls under U.S. ECCN 5D002[33] (Information Security Software). We distribute Nmap under the TSU exception for publicly available encryption software defined in EAR 740.13(e)[34]. NOTES top 1. Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning https://nmap.org/book/ 2. RFC 1122 http://www.rfc-editor.org/rfc/rfc1122.txt 3. RFC 792 http://www.rfc-editor.org/rfc/rfc792.txt 4. RFC 950 http://www.rfc-editor.org/rfc/rfc950.txt 5. UDP http://www.rfc-editor.org/rfc/rfc768.txt 6. SCTP http://www.rfc-editor.org/rfc/rfc4960.txt 7. TCP RFC http://www.rfc-editor.org/rfc/rfc793.txt 8. RFC 959 http://www.rfc-editor.org/rfc/rfc959.txt 9. RFC 1323 http://www.rfc-editor.org/rfc/rfc1323.txt 10. Lua programming language https://lua.org 11. precedence http://www.lua.org/manual/5.4/manual.html#3.4.8 12. IP protocol http://www.rfc-editor.org/rfc/rfc791.txt 13. RFC 2960 http://www.rfc-editor.org/rfc/rfc2960.txt 14. Nmap::Scanner http://sourceforge.net/projects/nmap-scanner/ 15. Nmap::Parser http://nmapparser.wordpress.com/ 16. xsltproc http://xmlsoft.org/XSLT/ 17. listed at Wikipedia http://en.wikipedia.org/wiki/List_of_IPv6_tunnel_brokers 18. Nmap Public Source License https://nmap.org/npsl 19. Nmap OEM license https://nmap.org/oem/ 20. Creative Commons Attribution License http://creativecommons.org/licenses/by/3.0/ 21. Nmap OEM https://nmap.org/oem 22. Apache Software Foundation https://www.apache.org 23. Libpcap portable packet capture library https://www.tcpdump.org 24. Ncap library https://npcap.com 25. PCRE library https://pcre.org 26. Libdnet http://libdnet.sourceforge.net 27. OpenSSL cryptography toolkit https://openssl.org 28. Liblinear linear classification library https://www.csie.ntu.edu.tw/~cjlin/liblinear/ 29. IPv6 OS detection machine learning techniques https://nmap.org/book/osdetect-guess.html#osdetect-guess-ipv6 30. Google Summer of Code https://nmap.org/soc/ 31. DARPA CINDER program https://www.fbo.gov/index?s=opportunity&mode=form&id=585e02a51f77af5cb3c9e06b9cc82c48&tab=core&_cview=1 32. Export Administration Regulations (EAR) https://www.bis.doc.gov/index.php/regulations/export-administration-regulations-ear 33. 5D002 https://www.bis.doc.gov/index.php/documents/regulations-docs/federal-register-notices/federal-register-2014/951-ccl5-pt2/file 34. EAR 740.13(e) https://www.bis.doc.gov/index.php/documents/regulations-docs/2341-740-2/file COLOPHON top This page is part of the nmap (a network scanner) project. Information about the project can be found at http://nmap.org/. 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 Subversion repository https://github.com/nmap/nmap 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] Nmap 05/17/2023 NMAP(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. | # nmap\n\n> Network exploration tool and security/port scanner.\n> Some features (e.g. SYN scan) activate only when `nmap` is run with root privileges.\n> More information: <https://nmap.org/book/man.html>.\n\n- Scan the top 1000 ports of a remote host with various [v]erbosity levels:\n\n`nmap -v{{1|2|3}} {{ip_or_hostname}}`\n\n- Run a ping sweep over an entire subnet or individual hosts very aggressively:\n\n`nmap -T5 -sn {{192.168.0.0/24|ip_or_hostname1,ip_or_hostname2,...}}`\n\n- Enable OS detection, version detection, script scanning, and traceroute:\n\n`sudo nmap -A {{ip_or_hostname1,ip_or_hostname2,...}}`\n\n- Scan a specific list of ports (use `-p-` for all ports from 1 to 65535):\n\n`nmap -p {{port1,port2,...}} {{ip_or_host1,ip_or_host2,...}}`\n\n- Perform service and version detection of the top 1000 ports using default NSE scripts, writing results (`-oA`) to output files:\n\n`nmap -sC -sV -oA {{top-1000-ports}} {{ip_or_host1,ip_or_host2,...}}`\n\n- Scan target(s) carefully using `default and safe` NSE scripts:\n\n`nmap --script "default and safe" {{ip_or_host1,ip_or_host2,...}}`\n\n- Scan for web servers running on standard ports 80 and 443 using all available `http-*` NSE scripts:\n\n`nmap --script "http-*" {{ip_or_host1,ip_or_host2,...}} -p 80,443`\n\n- Attempt evading IDS/IPS detection by using an extremely slow scan (`-T0`), decoy source addresses (`-D`), [f]ragmented packets, random data and other methods:\n\n`sudo nmap -T0 -D {{decoy_ip1,decoy_ip2,...}} --source-port {{53}} -f --data-length {{16}} -Pn {{ip_or_host}}`\n |
nohup | nohup(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training nohup(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON NOHUP(1) User Commands NOHUP(1) NAME top nohup - run a command immune to hangups, with output to a non-tty SYNOPSIS top nohup COMMAND [ARG]... nohup OPTION DESCRIPTION top Run COMMAND, ignoring hangup signals. --help display this help and exit --version output version information and exit If standard input is a terminal, redirect it from an unreadable file. If standard output is a terminal, append output to 'nohup.out' if possible, '$HOME/nohup.out' otherwise. If standard error is a terminal, redirect it to standard output. To save output to FILE, use 'nohup COMMAND > FILE'. NOTE: your shell may have its own version of nohup, which usually supersedes the version described here. Please refer to your shell's documentation for details about the options it supports. Exit status: 125 if the nohup command itself fails 126 if COMMAND is found but cannot be invoked 127 if COMMAND cannot be found - the exit status of COMMAND otherwise 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/nohup> or available locally via: info '(coreutils) nohup 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 NOHUP(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. | # nohup\n\n> Allows for a process to live when the terminal gets killed.\n> More information: <https://www.gnu.org/software/coreutils/nohup>.\n\n- Run a process that can live beyond the terminal:\n\n`nohup {{command}} {{argument1 argument2 ...}}`\n\n- Launch `nohup` in background mode:\n\n`nohup {{command}} {{argument1 argument2 ...}} &`\n\n- Run a shell script that can live beyond the terminal:\n\n`nohup {{path/to/script.sh}} &`\n\n- Run a process and write the output to a specific file:\n\n`nohup {{command}} {{argument1 argument2 ...}} > {{path/to/output_file}} &`\n |
nologin | nologin(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training Another version of this page is provided by the shadow-utils project nologin(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | NOTES | HISTORY | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY NOLOGIN(8) System Administration NOLOGIN(8) NAME top nologin - politely refuse a login SYNOPSIS top nologin [-V] [-h] DESCRIPTION top nologin displays a message that an account is not available and exits non-zero. It is intended as a replacement shell field to deny login access to an account. If the file /etc/nologin.txt exists, nologin displays its contents to the user instead of the default message. The exit status returned by nologin is always 1. OPTIONS top -c, --command command --init-file -i --interactive --init-file file -i, --interactive -l, --login --noprofile --norc --posix --rcfile file -r, --restricted These shell command-line options are ignored to avoid nologin error. -h, --help Display help text and exit. -V, --version Print version and exit. NOTES top nologin is a per-account way to disable login (usually used for system accounts like http or ftp). nologin uses /etc/nologin.txt as an optional source for a non-default message, the login access is always refused independently of the file. pam_nologin(8) PAM module usually prevents all non-root users from logging into the system. pam_nologin(8) functionality is controlled by /var/run/nologin or the /etc/nologin file. HISTORY top The nologin command appeared in 4.4BSD. AUTHORS top Karel Zak <[email protected]> SEE ALSO top login(1), passwd(5), pam_nologin(8) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The nologin 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 NOLOGIN(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. | # nologin\n\n> Alternative shell that prevents a user from logging in.\n> More information: <https://manned.org/nologin.5>.\n\n- Set a user's login shell to `nologin` to prevent the user from logging in:\n\n`chsh -s {{user}} nologin`\n\n- Customize message for users with the login shell of `nologin`:\n\n`echo "{{declined_login_message}}" > /etc/nologin.txt`\n |
nping | nping(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training nping(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | TARGET SPECIFICATION | OPTION SPECIFICATION | GENERAL OPERATION | PROBE MODES | TCP CONNECT MODE | TCP MODE | UDP MODE | ICMP MODE | ARP MODE | IPV4 OPTIONS | IPV6 OPTIONS | ETHERNET OPTIONS | PAYLOAD OPTIONS | ECHO MODE | TIMING AND PERFORMANCE OPTIONS | MISCELLANEOUS OPTIONS | OUTPUT OPTIONS | BUGS | AUTHORS | NOTES | COLOPHON NPING(1) Nping Reference Guide NPING(1) NAME top nping - Network packet generation tool / ping utility SYNOPSIS top nping [Options] {targets} DESCRIPTION top Nping is an open-source tool for network packet generation, response analysis and response time measurement. Nping allows users to generate network packets of a wide range of protocols, letting them tune virtually any field of the protocol headers. While Nping can be used as a simple ping utility to detect active hosts, it can also be used as a raw packet generator for network stack stress tests, ARP poisoning, Denial of Service attacks, route tracing, and other purposes. Additionally, Nping offers a special mode of operation called the "Echo Mode", that lets users see how the generated probes change in transit, revealing the differences between the transmitted packets and the packets received at the other end. See section "Echo Mode" for details. The output from Nping is a list of the packets that are being sent and received. The level of detail depends on the options used. A typical Nping execution is shown in Example 1. The only Nping arguments used in this example are -c, to specify the number of times to target each host, --tcp to specify TCP Probe Mode, -p 80,433 to specify the target ports; and then the two target hostnames. Example 1. A representative Nping execution # nping -c 1 --tcp -p 80,433 scanme.nmap.org google.com Starting Nping ( https://nmap.org/nping ) SENT (0.0120s) TCP 96.16.226.135:50091 > 64.13.134.52:80 S ttl=64 id=52072 iplen=40 seq=1077657388 win=1480 RCVD (0.1810s) TCP 64.13.134.52:80 > 96.16.226.135:50091 SA ttl=53 id=0 iplen=44 seq=4158134847 win=5840 <mss 1460> SENT (1.0140s) TCP 96.16.226.135:50091 > 74.125.45.100:80 S ttl=64 id=13932 iplen=40 seq=1077657388 win=1480 RCVD (1.1370s) TCP 74.125.45.100:80 > 96.16.226.135:50091 SA ttl=52 id=52913 iplen=44 seq=2650443864 win=5720 <mss 1430> SENT (2.0140s) TCP 96.16.226.135:50091 > 64.13.134.52:433 S ttl=64 id=8373 iplen=40 seq=1077657388 win=1480 SENT (3.0140s) TCP 96.16.226.135:50091 > 74.125.45.100:433 S ttl=64 id=23624 iplen=40 seq=1077657388 win=1480 Statistics for host scanme.nmap.org (64.13.134.52): | Probes Sent: 2 | Rcvd: 1 | Lost: 1 (50.00%) |_ Max rtt: 169.720ms | Min rtt: 169.720ms | Avg rtt: 169.720ms Statistics for host google.com (74.125.45.100): | Probes Sent: 2 | Rcvd: 1 | Lost: 1 (50.00%) |_ Max rtt: 122.686ms | Min rtt: 122.686ms | Avg rtt: 122.686ms Raw packets sent: 4 (160B) | Rcvd: 2 (92B) | Lost: 2 (50.00%) Tx time: 3.00296s | Tx bytes/s: 53.28 | Tx pkts/s: 1.33 Rx time: 3.00296s | Rx bytes/s: 30.64 | Rx pkts/s: 0.67 Nping done: 2 IP addresses pinged in 4.01 seconds The newest version of Nping can be obtained with Nmap at https://nmap.org . The newest version of this man page is available at https://nmap.org/book/nping-man.html . --> .SH "OPTIONS SUMMARY" This options summary is printed when Nping is run with no arguments. It helps people remember the most common options, but is no substitute for the in-depth documentation in the rest of this manual. Some obscure options aren't even included here. Nping 0.7.92SVN ( https://nmap.org/nping ) Usage: nping [Probe mode] [Options] {target specification} TARGET SPECIFICATION: Targets may be specified as hostnames, IP addresses, networks, etc. Ex: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.*.1-24 PROBE MODES: --tcp-connect : Unprivileged TCP connect probe mode. --tcp : TCP probe mode. --udp : UDP probe mode. --icmp : ICMP probe mode. --arp : ARP/RARP probe mode. --tr, --traceroute : Traceroute mode (can only be used with TCP/UDP/ICMP modes). TCP CONNECT MODE: -p, --dest-port <port spec> : Set destination port(s). -g, --source-port <portnumber> : Try to use a custom source port. TCP PROBE MODE: -g, --source-port <portnumber> : Set source port. -p, --dest-port <port spec> : Set destination port(s). --seq <seqnumber> : Set sequence number. --flags <flag list> : Set TCP flags (ACK,PSH,RST,SYN,FIN...) --ack <acknumber> : Set ACK number. --win <size> : Set window size. --badsum : Use a random invalid checksum. UDP PROBE MODE: -g, --source-port <portnumber> : Set source port. -p, --dest-port <port spec> : Set destination port(s). --badsum : Use a random invalid checksum. ICMP PROBE MODE: --icmp-type <type> : ICMP type. --icmp-code <code> : ICMP code. --icmp-id <id> : Set identifier. --icmp-seq <n> : Set sequence number. --icmp-redirect-addr <addr> : Set redirect address. --icmp-param-pointer <pnt> : Set parameter problem pointer. --icmp-advert-lifetime <time> : Set router advertisement lifetime. --icmp-advert-entry <IP,pref> : Add router advertisement entry. --icmp-orig-time <timestamp> : Set originate timestamp. --icmp-recv-time <timestamp> : Set receive timestamp. --icmp-trans-time <timestamp> : Set transmit timestamp. ARP/RARP PROBE MODE: --arp-type <type> : Type: ARP, ARP-reply, RARP, RARP-reply. --arp-sender-mac <mac> : Set sender MAC address. --arp-sender-ip <addr> : Set sender IP address. --arp-target-mac <mac> : Set target MAC address. --arp-target-ip <addr> : Set target IP address. IPv4 OPTIONS: -S, --source-ip : Set source IP address. --dest-ip <addr> : Set destination IP address (used as an alternative to {target specification} ). --tos <tos> : Set type of service field (8bits). --id <id> : Set identification field (16 bits). --df : Set Don't Fragment flag. --mf : Set More Fragments flag. --evil : Set Reserved / Evil flag. --ttl <hops> : Set time to live [0-255]. --badsum-ip : Use a random invalid checksum. --ip-options <S|R [route]|L [route]|T|U ...> : Set IP options --ip-options <hex string> : Set IP options --mtu <size> : Set MTU. Packets get fragmented if MTU is small enough. IPv6 OPTIONS: -6, --IPv6 : Use IP version 6. --dest-ip : Set destination IP address (used as an alternative to {target specification}). --hop-limit : Set hop limit (same as IPv4 TTL). --traffic-class <class> : : Set traffic class. --flow <label> : Set flow label. ETHERNET OPTIONS: --dest-mac <mac> : Set destination mac address. (Disables ARP resolution) --source-mac <mac> : Set source MAC address. --ether-type <type> : Set EtherType value. PAYLOAD OPTIONS: --data <hex string> : Include a custom payload. --data-string <text> : Include a custom ASCII text. --data-length <len> : Include len random bytes as payload. ECHO CLIENT/SERVER: --echo-client <passphrase> : Run Nping in client mode. --echo-server <passphrase> : Run Nping in server mode. --echo-port <port> : Use custom <port> to listen or connect. --no-crypto : Disable encryption and authentication. --once : Stop the server after one connection. --safe-payloads : Erase application data in echoed packets. TIMING AND PERFORMANCE: Options which take <time> are in seconds, or append 'ms' (milliseconds), 's' (seconds), 'm' (minutes), or 'h' (hours) to the value (e.g. 30m, 0.25h). --delay <time> : Adjust delay between probes. --rate <rate> : Send num packets per second. MISC: -h, --help : Display help information. -V, --version : Display current version number. -c, --count <n> : Stop after <n> rounds. -e, --interface <name> : Use supplied network interface. -H, --hide-sent : Do not display sent packets. -N, --no-capture : Do not try to capture replies. --privileged : Assume user is fully privileged. --unprivileged : Assume user lacks raw socket privileges. --send-eth : Send packets at the raw Ethernet layer. --send-ip : Send packets using raw IP sockets. --bpf-filter <filter spec> : Specify custom BPF filter. OUTPUT: -v : Increment verbosity level by one. -v[level] : Set verbosity level. E.g: -v4 -d : Increment debugging level by one. -d[level] : Set debugging level. E.g: -d3 -q : Decrease verbosity level by one. -q[N] : Decrease verbosity level N times --quiet : Set verbosity and debug level to minimum. --debug : Set verbosity and debug to the max level. EXAMPLES: nping scanme.nmap.org nping --tcp -p 80 --flags rst --ttl 2 192.168.1.1 nping --icmp --icmp-type time --delay 500ms 192.168.254.254 nping --echo-server "public" -e wlan0 -vvv nping --echo-client "public" echo.nmap.org --tcp -p1-1024 --flags ack SEE THE MAN PAGE FOR MANY MORE OPTIONS, DESCRIPTIONS, AND EXAMPLES TARGET SPECIFICATION top Everything on the Nping command line that isn't an option or an option argument is treated as a target host specification. Nping uses the same syntax for target specifications that Nmap does. The simplest case is a single target given by IP address or hostname. Nping supports CIDR-style addressing. You can append /numbits to an IPv4 address or hostname and Nping will send probes to every IP address for which the first numbits are the same as for the reference IP or hostname given. For example, 192.168.10.0/24 would send probes to the 256 hosts between 192.168.10.0 (binary: 11000000 10101000 00001010 00000000) and 192.168.10.255 (binary: 11000000 10101000 00001010 11111111), inclusive. 192.168.10.40/24 would ping exactly the same targets. Given that the host scanme.nmap.org is at the IP address 64.13.134.52, the specification scanme.nmap.org/16 would send probes to the 65,536 IP addresses between 64.13.0.0 and 64.13.255.255. The smallest allowed value is /0, which targets the whole Internet. The largest value is /32, which targets just the named host or IP address because all address bits are fixed. CIDR notation is short but not always flexible enough. For example, you might want to send probes to 192.168.0.0/16 but skip any IPs ending with .0 or .255 because they may be used as subnet network and broadcast addresses. Nping supports this through octet range addressing. Rather than specify a normal IP address, you can specify a comma-separated list of numbers or ranges for each octet. For example, 192.168.0-255.1-254 will skip all addresses in the range that end in .0 or .255, and 192.168.3-5,7.1 will target the four addresses 192.168.3.1, 192.168.4.1, 192.168.5.1, and 192.168.7.1. Either side of a range may be omitted; the default values are 0 on the left and 255 on the right. Using - by itself is the same as 0-255, but remember to use 0- in the first octet so the target specification doesn't look like a command-line option. Ranges need not be limited to the final octets: the specifier 0-.-.13.37 will send probes to all IP addresses on the Internet ending in .13.37. This sort of broad sampling can be useful for Internet surveys and research. IPv6 addresses can only be specified by their fully qualified IPv6 address or hostname. CIDR and octet ranges aren't supported for IPv6 because they are rarely useful. Nping accepts multiple host specifications on the command line, and they don't need to be the same type. The command nping scanme.nmap.org 192.168.0.0/8 10.0.0,1,3-7.- does what you would expect. OPTION SPECIFICATION top Nping is designed to be very flexible and fit a wide variety of needs. As with most command-line tools, its behavior can be adjusted using command-line options. These general principles apply to option arguments, unless stated otherwise. Options that take integer numbers can accept values specified in decimal, octal or hexadecimal base. When a number starts with 0x, it will be treated as hexadecimal; when it simply starts with 0, it will be treated as octal. Otherwise, Nping will assume the number has been specified in base 10. Virtually all numbers that can be supplied from the command line are unsigned so, as a general rule, the minimum value is zero. Users may also specify the word random or rand to make Nping generate a random value within the expected range. IP addresses may be given as IPv4 addresses (e.g. 192.168.1.1), IPv6 addresses (e.g. 2001:db8:85a3::8e4c:760:7146), or hostnames, which will be resolved using the default DNS server configured in the host system. Options that take MAC addresses accept the usual colon-separated 6 hex byte format (e.g. 00:50:56:d4:01:98). Hyphens may also be used instead of colons (e.g. 00-50-56-c0-00-08). The special word random or rand sets a random address and the word broadcast or bcast sets ff:ff:ff:ff:ff:ff. GENERAL OPERATION top Unlike other ping and packet generation tools, Nping supports multiple target host and port specifications. While this provides great flexibility, it is not obvious how Nping handles situations where there is more than one host and/or more than one port to send probes to. This section explains how Nping behaves in these cases. When multiple target hosts are specified, Nping rotates among them in round-robin fashion. This gives slow hosts more time to send their responses before another probe is sent to them. Ports are also scheduled using round robin. So, unless only one port is specified, Nping never sends two probes to the same target host and port consecutively. The loop around targets is the inner loop and the loop around ports is the outer loop. All targets will be sent a probe for a given port before moving on to the next port. Between probes, Nping waits a configurable amount of time called the inter-probe delay, which is controlled by the --delay option. These examples show how it works. # nping --tcp -c 2 1.1.1.1 -p 100-102 Starting Nping ( https://nmap.org/nping ) SENT (0.0210s) TCP 192.168.1.77 > 1.1.1.1:100 SENT (1.0230s) TCP 192.168.1.77 > 1.1.1.1:101 SENT (2.0250s) TCP 192.168.1.77 > 1.1.1.1:102 SENT (3.0280s) TCP 192.168.1.77 > 1.1.1.1:100 SENT (4.0300s) TCP 192.168.1.77 > 1.1.1.1:101 SENT (5.0320s) TCP 192.168.1.77 > 1.1.1.1:102 # nping --tcp -c 2 1.1.1.1 2.2.2.2 3.3.3.3 -p 8080 Starting Nping ( https://nmap.org/nping ) SENT (0.0230s) TCP 192.168.0.21 > 1.1.1.1:8080 SENT (1.0240s) TCP 192.168.0.21 > 2.2.2.2:8080 SENT (2.0260s) TCP 192.168.0.21 > 3.3.3.3:8080 SENT (3.0270s) TCP 192.168.0.21 > 1.1.1.1:8080 SENT (4.0290s) TCP 192.168.0.21 > 2.2.2.2:8080 SENT (5.0310s) TCP 192.168.0.21 > 3.3.3.3:8080 # nping --tcp -c 1 --delay 500ms 1.1.1.1 2.2.2.2 3.3.3.3 -p 137-139 Starting Nping ( https://nmap.org/nping ) SENT (0.0230s) TCP 192.168.0.21 > 1.1.1.1:137 SENT (0.5250s) TCP 192.168.0.21 > 2.2.2.2:137 SENT (1.0250s) TCP 192.168.0.21 > 3.3.3.3:137 SENT (1.5280s) TCP 192.168.0.21 > 1.1.1.1:138 SENT (2.0280s) TCP 192.168.0.21 > 2.2.2.2:138 SENT (2.5310s) TCP 192.168.0.21 > 3.3.3.3:138 SENT (3.0300s) TCP 192.168.0.21 > 1.1.1.1:139 SENT (3.5330s) TCP 192.168.0.21 > 2.2.2.2:139 SENT (4.0330s) TCP 192.168.0.21 > 3.3.3.3:139 PROBE MODES top Nping supports a wide variety of protocols. Although in some cases Nping can automatically determine the mode from the options used, it is generally a good idea to specify it explicitly. --tcp-connect (TCP Connect mode) TCP connect mode is the default mode when a user does not have raw packet privileges. Instead of writing raw packets as most other modes do, Nping asks the underlying operating system to establish a connection with the target machine and port by issuing the connect system call. This is the same high-level system call that web browsers, P2P clients, and most other network-enabled applications use to establish a connection. It is part of a programming interface known as the Berkeley Sockets API. Rather than read raw packet responses off the wire, Nping uses this API to obtain status information on each connection attempt. For this reason, you will not be able to see the contents of the packets that are sent or received but only status information about the TCP connection establishment taking place. --tcp (TCP mode) TCP is the mode that lets users create and send any kind of TCP packet. TCP packets are sent embedded in IP packets that can also be tuned. This mode can be used for many different purposes. For example you could try to discover open ports by sending TCP SYN messages without completing the three-way handshake. This technique is often referred to as half-open scanning, because you don't open a full TCP connection. You send a SYN packet, as if you are going to open a real connection and then wait for a response. A SYN/ACK indicates the port is open, while a RST indicates it's closed. If no response is received one could assume that some intermediate network device is filtering the responses. Another use could be to see how a remote TCP/IP stack behaves when it receives a non-RFC-compliant packet, like one with both SYN and RST flags set. One could also do some evil by creating custom RST packets using an spoofed IP address with the intent of closing an active TCP connection. --udp (UDP mode) UDP mode can have two different behaviours. Under normal circumstances, it lets users create custom IP/UDP packets. However, if Nping is run by a user without raw packet privileges and no changes to the default protocol headers are requested, then Nping enters the unprivileged UDP mode which basically sends UDP packets to the specified target hosts and ports using the sendto system call. Note that in this unprivileged mode it is not possible to see low-level header information of the packets on the wire but only status information about the amount of bytes that are being transmitted and received. UDP mode can be used to interact with any UDP-based server. Examples are DNS servers, streaming servers, online gaming servers, and port knocking/single-packet authorization daemons. --icmp (ICMP mode) ICMP mode is the default mode when the user runs Nping with raw packet privileges. Any kind of ICMP message can be created. The default ICMP type is Echo, i.e., ping. ICMP mode can be used for many different purposes, from a simple request for a timestamp or a netmask to the transmission of fake destination unreachable messages, custom redirects, and router advertisements. --arp (ARP/RARP mode) ARP lets you create and send a few different ARP-related packets. These include ARP, RARP, DRARP, and InARP requests and replies. This mode can ban be used to perform low-level host discovery, and conduct ARP-cache poisoning attacks. --traceroute (Traceroute mode) Traceroute is not a mode by itself but a complement to TCP, UDP, and ICMP modes. When this option is specified Nping will set the IP TTL value of the first probe to 1. When the next router receives the packet it will drop it due to the expiration of the TTL and it will generate an ICMP destination unreachable message. The next probe will have a TTL of 2 so now the first router will forward the packet while the second router will be the one that drops the packet and generates the ICMP message. The third probe will have a TTL value of 3 and so on. By examining the source addresses of all those ICMP Destination Unreachable messages it is possible to determine the path that the probes take until they reach their final destination. TCP CONNECT MODE top -p port_spec, --dest-port port_spec (Target ports) This option specifies which ports you want to try to connect to. It can be a single port, a comma-separated list of ports (e.g. 80,443,8080), a range (e.g. 1-1023), and any combination of those (e.g. 21-25,80,443,1024-2048). The beginning and/or end values of a range may be omitted, causing Nping to use 1 and 65535, respectively. So you can specify -p- to target ports from 1 through 65535. Using port zero is allowed if you specify it explicitly. -g portnumber, --source-port portnumber (Spoof source port) This option asks Nping to use the specified port as source port for the TCP connections. Note that this might not work on all systems or may require root privileges. Specified value must be an integer in the range [065535]. TCP MODE top -p port_spec, --dest-port port_spec (Target ports) This option specifies which destination ports you want to send probes to. It can be a single port, a comma-separated list of ports (e.g. 80,443,8080), a range (e.g. 1-1023), and any combination of those (e.g. 21-25,80,443,1024-2048). The beginning and/or end values of a range may be omitted, causing Nping to use 1 and 65535, respectively. So you can specify -p- to target ports from 1 through 65535. Using port zero is allowed if you specify it explicitly. -g portnumber, --source-port portnumber (Spoof source port) This option asks Nping to use the specified port as source port for the TCP connections. Note that this might not work on all systems or may require root privileges. Specified value must be an integer in the range [065535]. --seq seqnumber (Sequence Number) Specifies the TCP sequence number. In SYN packets this is the initial sequence number (ISN). In a normal transmission this corresponds to the sequence number of the first byte of data in the segment. seqnumber must be a number in the range [04294967295]. --flags flags (TCP Flags) This option specifies which flags should be set in the TCP packet. flags may be specified in three different ways: 1. As a comma-separated list of flags, e.g. --flags syn,ack,rst 2. As a list of one-character flag initials, e.g. --flags SAR tells Nping to set flags SYN, ACK, and RST. 3. As an 8-bit hexadecimal number, where the supplied number is the exact value that will be placed in the flags field of the TCP header. The number should start with the prefix 0x and should be in the range [0x000xFF], e.g. --flags 0x20 sets the URG flag as 0x20 corresponds to binary 00100000 and the URG flag is represented by the third bit. There are 8 possible flags to set: CWR, ECN, URG, ACK, PSH, RST, SYN, and FIN. The special value ALL means to set all flags. NONE means to set no flags. It is important that if you don't want any flag to be set, you request it explicitly because in some cases the SYN flag may be set by default. Here is a brief description of the meaning of each flag: CWR (Congestion Window Reduced) Set by an ECN-Capable sender when it reduces its congestion window (due to a retransmit timeout, a fast retransmit or in response to an ECN notification. ECN (Explicit Congestion Notification) During the three-way handshake it indicates that sender is capable of performing explicit congestion notification. Normally it means that a packet with the IP Congestion Experienced flag set was received during normal transmission. See RFC 3168 for more information. URG (Urgent) Segment is urgent and the urgent pointer field carries valid information. ACK (Acknowledgement) The segment carries an acknowledgement and the value of the acknowledgement number field is valid and contains the next sequence number that is expected from the receiver. PSH (Push) The data in this segment should be immediately pushed to the application layer on arrival. RST (Reset) There was some problem and the sender wants to abort the connection. SYN (Synchronize) The segment is a request to synchronize sequence numbers and establish a connection. The sequence number field contains the sender's initial sequence number. FIN (Finish) The sender wants to close the connection. --win size (Window Size) Specifies the TCP window size, this is, the number of octets the sender of the segment is willing to accept from the receiver at one time. This is usually the size of the reception buffer that the OS allocates for a given connection. size must be a number in the range [065535]. --badsum (Invalid Checksum) Asks Nping to use an invalid TCP checksum for the packets sent to target hosts. Since virtually all host IP stacks properly drop these packets, any responses received are likely coming from a firewall or an IDS that didn't bother to verify the checksum. For more details on this technique, see https://nmap.org/p60-12.html . UDP MODE top -p port_spec, --dest-port port_spec (Target ports) This option specifies which ports you want UDP datagrams to be sent to. It can be a single port, a comma-separated list of ports (e.g. 80,443,8080), a range (e.g. 1-1023), and any combination of those (e.g. 21-25,80,443,1024-2048). The beginning and/or end values of a range may be omitted, causing Nping to use 1 and 65535, respectively. So you can specify -p- to target ports from 1 through 65535. Using port zero is allowed if you specify it explicitly. -g portnumber, --source-port portnumber (Spoof source port) This option asks Nping to use the specified port as source port for the transmitted datagrams. Note that this might not work on all systems or may require root privileges. Specified value must be an integer in the range [065535]. --badsum (Invalid Checksum) Asks Nping to use an invalid UDP checksum for the packets sent to target hosts. Since virtually all host IP stacks properly drop these packets, any responses received are likely coming from a firewall or an IDS that didn't bother to verify the checksum. For more details on this technique, see https://nmap.org/p60-12.html . ICMP MODE top --icmp-type type (ICMP type) This option specifies which type of ICMP messages should be generated. type can be supplied in two different ways. You can use the official type numbers assigned by IANA[1] (e.g. --icmp-type 8 for ICMP Echo Request), or you can use any of the mnemonics listed in the section called ICMP Types. --icmp-code code (ICMP code) This option specifies which ICMP code should be included in the generated ICMP messages. code can be supplied in two different ways. You can use the official code numbers assigned by IANA[1] (e.g. --icmp-code 1 for Fragment Reassembly Time Exceeded), or you can use any of the mnemonics listed in the section called ICMP Codes. --icmp-id id (ICMP identifier) This option specifies the value of the identifier used in some of the ICMP messages. In general it is used to match request and reply messages. id must be a number in the range [065535]. --icmp-seq seq (ICMP sequence) This option specifies the value of the sequence number field used in some ICMP messages. In general it is used to match request and reply messages. id must be a number in the range [065535]. --icmp-redirect-addr addr (ICMP Redirect address) This option sets the address field in ICMP Redirect messages. In other words, it sets the IP address of the router that should be used when sending IP datagrams to the original destination. addr can be either an IPv4 address or a hostname. --icmp-param-pointer pointer (ICMP Parameter Problem pointer) This option specifies the pointer that indicates the location of the problem in ICMP Parameter Problem messages. pointer should be a number in the range [0255]. Normally this option is only used when ICMP code is set to 0 ("Pointer indicates the error"). --icmp-advert-lifetime ttl (ICMP Router Advertisement Lifetime) This option specifies the router advertisement lifetime, this is, the number of seconds the information carried in an ICMP Router Advertisement can be considered valid for. ttl must be a positive integer in the range [065535]. --icmp-advert-entry addr,pref (ICMP Router Advertisement Entry) This option adds a Router Advertisement entry to an ICMP Router Advertisement message. The parameter must be two values separated by a comma. addr is the router's IP and can be specified either as an IP address in dot-decimal notation or as a hostname. pref is the preference level for the specified IP. It must be a number in the range [04294967295]. An example is --icmp-advert-entry 192.168.128.1,3. --icmp-orig-time timestamp (ICMP Originate Timestamp) This option sets the Originate Timestamp in ICMP Timestamp messages. The Originate Timestamp is expressed as the number of milliseconds since midnight UTC and it corresponds to the time the sender last touched the Timestamp message before its transmission. timestamp can be specified as a regular time (e.g. 10s, 3h, 1000ms), or the special string now. You can add or subtract values from now, for example --icmp-orig-time now-2s, --icmp-orig-time now+1h, --icmp-orig-time now+200ms. --icmp-recv-time timestamp (ICMP Receive Timestamp) This option sets the Receive Timestamp in ICMP Timestamp messages. The Receive Timestamp is expressed as the number of milliseconds since midnight UTC and it corresponds to the time the echoer first touched the Timestamp message on receipt. timestamp is as with --icmp-orig-time. --icmp-trans-time timestamp (ICMP Transmit Timestamp) This option sets the Transmit Timestamp in ICMP Timestamp messages. The Transmit Timestamp is expressed as the number of milliseconds since midnight UTC and it corresponds to the time the echoer last touched the Timestamp message before its transmission. timestamp is as with --icmp-orig-time. ICMP Types These identifiers may be used as mnemonics for the ICMP type numbers given to the --icmp-type option. In general there are three forms of each identifier: the full name (e.g. destination-unreachable), the short name (e.g. dest-unr), or the initials (e.g. du). In ICMP types that request something, the word "request" is omitted. echo-reply, echo-rep, er Echo Reply (type 0). This message is sent in response to an Echo Request message. destination-unreachable, dest-unr, du Destination Unreachable (type 3). This message indicates that a datagram could not be delivered to its destination. source-quench, sour-que, sq Source Quench (type 4). This message is used by a congested IP device to tell other device that is sending packets too fast and that it should slow down. redirect, redi, r Redirect (type 5). This message is normally used by routers to inform a host that there is a better route to use for sending datagrams. See also the --icmp-redirect-addr option. echo-request, echo, e Echo Request (type 8). This message is used to test the connectivity of another device on a network. router-advertisement, rout-adv, ra Router Advertisement (type 9). This message is used by routers to let hosts know of their existence and capabilities. See also the --icmp-advert-lifetime option. router-solicitation, rout-sol, rs Router Solicitation (type 10). This message is used by hosts to request Router Advertisement messages from any listening routers. time-exceeded, time-exc, te Time Exceeded (type 11). This message is generated by some intermediate device (normally a router) to indicate that a datagram has been discarded before reaching its destination because the IP TTL expired. parameter-problem, member-pro, pp Parameter Problem (type 12). This message is used when a device finds a problem with a parameter in an IP header and it cannot continue processing it. See also the --icmp-param-pointer option. timestamp, time, tm Timestamp Request (type 13). This message is used to request a device to send a timestamp value for propagation time calculation and clock synchronization. See also the --icmp-orig-time, --icmp-recv-time, and --icmp-trans-time. timestamp-reply, time-rep, tr Timestamp Reply (type 14). This message is sent in response to a Timestamp Request message. information, info, i Information Request (type 15). This message is now obsolete but it was originally used to request configuration information from another device. information-reply, info-rep, ir Information Reply (type 16). This message is now obsolete but it was originally sent in response to an Information Request message to provide configuration information. mask-request, mask, m Address Mask Request (type 17). This message is used to ask a device to send its subnet mask. mask-reply, mask-rep, mr Address Mask Reply (type 18). This message contains a subnet mask and is sent in response to a Address Mask Request message. traceroute, trace, tc Traceroute (type 30). This message is normally sent by an intermediate device when it receives an IP datagram with a traceroute option. ICMP Traceroute messages are still experimental, see RFC 1393 for more information. ICMP Codes These identifiers may be used as mnemonics for the ICMP code numbers given to the --icmp-code option. They are listed by the ICMP type they correspond to. Destination Unreachable network-unreachable, netw-unr, net Code 0. Datagram could not be delivered to its destination network (probably due to some routing problem). host-unreachable, host-unr, host Code 1. Datagram was delivered to the destination network but it was impossible to reach the specified host (probably due to some routing problem). protocol-unreachable, prot-unr, proto Code 2. The protocol specified in the Protocol field of the IP datagram is not supported by the host to which the datagram was delivered. port-unreachable, port-unr, port Code 3. The TCP/UDP destination port was invalid. needs-fragmentation, need-fra, frag Code 4. Datagram had the DF bit set but it was too large for the MTU of the next physical network so it had to be dropped. source-route-failed, sour-rou, routefail Code 5. IP datagram had a Source Route option but a router couldn't pass it to the next hop. network-unknown, netw-unk, net? Code 6. Destination network is unknown. This code is never used. Instead, Network Unreachable is used. host-unknown, host-unk, host? Code 7. Specified host is unknown. Usually generated by a router local to the destination host to inform of a bad address. host-isolated, host-iso, isolated Code 8. Source Host Isolated. Not used. network-prohibited, netw-pro, !net Code 9. Communication with destination network is administratively prohibited (source device is not allowed to send packets to the destination network). host-prohibited, host-pro, !host Code 10. Communication with destination host is administratively prohibited. (The source device is allowed to send packets to the destination network but not to the destination device.) network-tos, unreachable-network-tos, netw-tos, tosnet Code 11. Destination network unreachable because it cannot provide the type of service specified in the IP TOS field. host-tos, unreachable-host-tos, toshost Code 12. Destination host unreachable because it cannot provide the type of service specified in the IP TOS field. communication-prohibited, comm-pro, !comm Code 13. Datagram could not be forwarded due to filtering that blocks the message based on its contents. host-precedence-violation, precedence-violation, prec-vio, violation Code 14. Precedence value in the IP TOS field is not permitted. precedence-cutoff, prec-cut, cutoff Code 15. Precedence value in the IP TOS field is lower than the minimum allowed for the network. Redirect redirect-network, redi-net, net Code 0. Redirect all future datagrams with the same destination network as the original datagram, to the router specified in the Address field. The use of this code is prohibited by RFC 1812. redirect-host, redi-host, host Code 1. Redirect all future datagrams with the same destination host as the original datagram, to the router specified in the Address field. redirect-network-tos, redi-ntos, redir-ntos Code 2. Redirect all future datagrams with the same destination network and IP TOS value as the original datagram, to the router specified in the Address field. The use of this code is prohibited by RFC 1812. redirect-host-tos, redi-htos, redir-htos Code 3. Redirect all future datagrams with the same destination host and IP TOS value as the original datagram, to the router specified in the Address field. Router Advertisement normal-advertisement, norm-adv, normal, zero, default, def Code 0. Normal router advertisement. In Mobile IP: Mobility agent can act as a router for IP datagrams not related to mobile nodes. not-route-common-traffic, not-rou, mobile-ip, !route, !commontraffic Code 16. Used for Mobile IP. The mobility agent does not route common traffic. All foreign agents must forward to a default router any datagrams received from a registered mobile node Time Exceeded ttl-exceeded-in-transit, ttl-exc, ttl-transit Code 0. IP Time To Live expired during transit. fragment-reassembly-time-exceeded, frag-exc, frag-time Code 1. Fragment reassembly time has been exceeded. Parameter Problem pointer-indicates-error, poin-ind, pointer Code 0. The pointer field indicates the location of the problem. See the --icmp-param-pointer option. missing-required-option, miss-option, option-missing Code 1. IP datagram was expected to have an option that is not present. bad-length, bad-len, badlen Code 2. The length of the IP datagram is incorrect. ARP MODE top --arp-type type (ICMP Type) This option specifies which type of ARP messages should be generated. type can be supplied in two different ways. You can use the official numbers assigned by IANA[2] (e.g. --arp-type 1 for ARP Request), or you can use one of the mnemonics from the section called ARP Types. --arp-sender-mac mac (Sender MAC address) This option sets the Sender Hardware Address field of the ARP header. Although ARP supports many types of link layer addresses, currently Nping only supports MAC addresses. mac must be specified using the traditional MAC notation (e.g. 00:0a:8a:32:f4:ae). You can also use hyphens as separators (e.g. 00-0a-8a-32-f4-ae). --arp-sender-ip addr (Sender IP address) This option sets the Sender IP field of the ARP header. addr can be given as an IPv4 address or a hostname. --arp-target-mac mac (target MAC address) This option sets the Target Hardware Address field of the ARP header. --arp-target-ip addr (target ip address) This option sets the Target IP field of the ARP header. ARP Types These identifiers may be used as mnemonics for the ARP type numbers given to the --arp-type option. arp-request, arp, a ARP Request (type 1). ARP requests are used to translate network layer addresses (normally IP addresses) to link layer addresses (usually MAC addresses). Basically, and ARP request is a broadcasted message that asks the host in the same network segment that has a given IP address to provide its MAC address. arp-reply, arp-rep, ar ARP Reply (type 2). An ARP reply is a message that a host sends in response to an ARP request to provide its link layer address. rarp-request, rarp, r RARP Requests (type 3). RARP requests are used to translate a link layer address (normally a MAC address) to a network layer address (usually an IP address). Basically a RARP request is a broadcasted message sent by a host that wants to know his own IP address because it doesn't have any. It was the first protocol designed to solve the bootstrapping problem. However, RARP is now obsolete and DHCP is used instead. For more information about RARP see RFC 903. rarp-reply, rarp-rep, rr RARP Reply (type 4). A RARP reply is a message sent in response to a RARP request to provide an IP address to the host that sent the RARP request in the first place. drarp-request, drarp, d Dynamic RARP Request (type 5). Dynamic RARP is an extension to RARP used to obtain or assign a network layer address from a fixed link layer address. DRARP was used mainly in Sun Microsystems platforms in the late 90's but now it's no longer used. See RFC 1931 for more information. drarp-reply, drarp-rep, dr Dynamic RARP Reply (type 6). A DRARP reply is a message sent in response to a RARP request to provide network layer address. drarp-error, drarp-err, de DRARP Error (type 7). DRARP Error messages are usually sent in response to DRARP requests to inform of some error. In DRARP Error messages, the Target Protocol Address field is used to carry an error code (usually in the first byte). The error code is intended to tell why no target protocol address is being returned. For more information see RFC 1931. inarp-request, inarp, i Inverse ARP Request (type 8). InARP requests are used to translate a link layer address to a network layer address. It is similar to RARP request but in this case, the sender of the InARP request wants to know the network layer address of another node, not its own address. InARP is mainly used in Frame Relay and ATM networks. For more information see RFC 2390. inarp-reply, inarp-rep, ir Inverse ARP Reply (type 9). InARP reply messages are sent in response to InARP requests to provide the network layer address associated with the host that has a given link layer address. arp-nak, an ARP NAK (type 10). ARP NAK messages are an extension to the ATMARP protocol and they are used to improve the robustness of the ATMARP server mechanism. With ARP NAK, a client can determine the difference between a catastrophic server failure and an ATMARP table lookup failure. See RFC 1577 for more information. IPV4 OPTIONS top -S addr, --source-ip addr (Source IP Address) Sets the source IP address. This option lets you specify a custom IP address to be used as source IP address in sent packets. This allows spoofing the sender of the packets. addr can be an IPv4 address or a hostname. --dest-ip addr (Destination IP Address) Adds a target to Nping's target list. This option is provided for consistency but its use is deprecated in favor of plain target specifications. See the section called TARGET SPECIFICATION. --tos tos (Type of Service) Sets the IP TOS field. The TOS field is used to carry information to provide quality of service features. It is normally used to support a technique called Differentiated Services. See RFC 2474 for more information. tos must be a number in the range [0255]. --id id (Identification) Sets the IPv4 Identification field. The Identification field is a 16-bit value that is common to all fragments belonging to a particular message. The value is used by the receiver to reassemble the original message from the fragments received. id must be a number in the range [065535]. --df (Don't Fragment) Sets the Don't Fragment bit in sent packets. When an IP datagram has its DF flag set, intermediate devices are not allowed to fragment it so if it needs to travel across a network with a MTU smaller that datagram length the datagram will have to be dropped. Normally an ICMP Destination Unreachable message is generated and sent back to the sender. --mf (More Fragments) Sets the More Fragments bit in sent packets. The MF flag is set to indicate the receiver that the current datagram is a fragment of some larger datagram. When set to zero it indicates that the current datagram is either the last fragment in the set or that it is the only fragment. --evil (Reserved / Evil) Sets the Reserved / Evil bit in sent packets. The Evil flag helps firewalls and other network security systems to distinguish between datagrams that have malicious intent and those that are merely unusual. When set, it indicates that the datagram has evil intent, instructing insecure systems to succumb. Setting it to zero indicates no evil intent. The option is implied if environmental variable SCRIPT_KIDDIE is set to a non-zero value. --ttl hops (Time To Live) Sets the IPv4 Time-To-Live (TTL) field in sent packets to the given value. The TTL field specifies how long the datagram is allowed to exist on the network. It was originally intended to represent a number of seconds but it actually represents the number of hops a packet can traverse before being dropped. The TTL tries to avoid a situation in which undeliverable datagrams keep being forwarded from one router to another endlessly. hops must be a number in the range [0255]. --badsum-ip (Invalid IP checksum) Asks Nping to use an invalid IP checksum for packets sent to target hosts. Note that some systems (like most Linux kernels), may fix the checksum before placing the packet on the wire, so even if Nping shows the incorrect checksum in its output, the packets may be transparently corrected by the kernel. --ip-options R|S [route]|L [route]|T|U ..., --ip-options hex string (IP Options) The IP protocol offers several options which may be placed in packet headers. Unlike the ubiquitous TCP options, IP options are rarely seen due to practicality and security concerns. In fact, many Internet routers block the most dangerous options such as source routing. Yet options can still be useful in some cases for determining and manipulating the network route to target machines. For example, you may be able to use the record route option to determine a path to a target even when more traditional traceroute-style approaches fail. Or if your packets are being dropped by a certain firewall, you may be able to specify a different route with the strict or loose source routing options. The most powerful way to specify IP options is to simply pass in hexadecimal data as the argument to --ip-options. Precede each hex byte value with \x. You may repeat certain characters by following them with an asterisk and then the number of times you wish them to repeat. For example, \x01\x07\x04\x00*4 is the same as \x01\x07\x04\x00\x00\x00\x00. Note that if you specify a number of bytes that is not a multiple of four, an incorrect IP header length will be set in the IP packet. The reason for this is that the IP header length field can only express multiples of four. In those cases, the length is computed by dividing the header length by 4 and rounding down. This will affect the way the header that follows the IP header is interpreted, showing bogus information in Nping or in the output of any sniffer. Although this kind of situation might be useful for some stack stress tests, users would normally want to specify explicit padding, so the correct header length is set. Nping also offers a shortcut mechanism for specifying options. Simply pass the letter R, T, or U to request record-route, record-timestamp, or both options together, respectively. Loose or strict source routing may be specified with an L or S followed by a space and then a space-separated list of IP addresses. For more information and examples of using IP options with Nping, see the mailing list post at https://seclists.org/nmap-dev/2006/q3/0052.html . --mtu size (Maximum Transmission Unit) This option sets a fictional MTU in Nping so IP datagrams larger than size are fragmented before transmission. size must be specified in bytes and corresponds to the number of octets that can be carried on a single link-layer frame. IPV6 OPTIONS top -6, --ipv6 (Use IPv6) Tells Nping to use IP version 6 instead of the default IPv4. It is generally a good idea to specify this option as early as possible in the command line so Nping can parse it soon and know in advance that the rest of the parameters refer to IPv6. The command syntax is the same as usual except that you also add the -6 option. Of course, you must use IPv6 syntax if you specify an address rather than a hostname. An address might look like 3ffe:7501:4819:2000:210:f3ff:fe03:14d0, so hostnames are recommended. While IPv6 hasn't exactly taken the world by storm, it gets significant use in some (usually Asian) countries and most modern operating systems support it. To use Nping with IPv6, both the source and target of your packets must be configured for IPv6. If your ISP (like most of them) does not allocate IPv6 addresses to you, free tunnel brokers are widely available and work fine with Nping. You can use the free IPv6 tunnel broker service at http://www.tunnelbroker.net . Please note that IPv6 support is still highly experimental and many modes and options may not work with it. -S addr, --source-ip addr (Source IP Address) Sets the source IP address. This option lets you specify a custom IP address to be used as source IP address in sent packets. This allows spoofing the sender of the packets. addr can be an IPv6 address or a hostname. --dest-ip addr (Destination IP Address) Adds a target to Nping's target list. This option is provided for consistency but its use is deprecated in favor of plain target specifications. See the section called TARGET SPECIFICATION. --flow label (Flow Label) Sets the IPv6 Flow Label. The Flow Label field is 20 bits long and is intended to provide certain quality-of-service properties for real-time datagram delivery. However, it has not been widely adopted, and not all routers or endpoints support it. Check RFC 2460 for more information. label must be an integer in the range [01048575]. --traffic-class class (Traffic Class) Sets the IPv6 Traffic Class. This field is similar to the TOS field in IPv4, and is intended to provide the Differentiated Services method, enabling scalable service discrimination in the Internet without the need for per-flow state and signaling at every hop. Check RFC 2474 for more information. class must be an integer in the range [0255]. --hop-limit hops (Hop Limit) Sets the IPv6 Hop Limit field in sent packets to the given value. The Hop Limit field specifies how long the datagram is allowed to exist on the network. It represents the number of hops a packet can traverse before being dropped. As with the TTL in IPv4, IPv6 Hop Limit tries to avoid a situation in which undeliverable datagrams keep being forwarded from one router to another endlessly. hops must be a number in the range [0255]. ETHERNET OPTIONS top In most cases Nping sends packets at the raw IP level. This means that Nping creates its own IP packets and transmits them through a raw socket. However, in some cases it may be necessary to send packets at the raw Ethernet level. This happens, for example, when Nping is run under Windows (as Microsoft has disabled raw socket support since Windows XP SP2), or when Nping is asked to send ARP packets. Since in some cases it is necessary to construct ethernet frames, Nping offers some options to manipulate the different fields. --dest-mac mac (Ethernet Destination MAC Address) This option sets the destination MAC address that should be set in outgoing Ethernet frames. This is useful in case Nping can't determine the next hop's MAC address or when you want to route probes through a router other than the configured default gateway. The MAC address should have the usual format of six colon-separated bytes, e.g. 00:50:56:d4:01:98. Alternatively, hyphens may be used instead of colons. Use the word random or rand to generate a random address, and broadcast or bcast to use ff:ff:ff:ff:ff:ff. If you set up a bogus destination MAC address your probes may not reach the intended targets. --source-mac mac (Ethernet Source MAC Address) This option sets the source MAC address that should be set in outgoing Ethernet frames. This is useful in case Nping can't determine your network interface MAC address or when you want to inject traffic into the network while hiding your network card's real address. The syntax is the same as for --dest-mac. If you set up a bogus source MAC address you may not receive probe replies. --ether-type type (Ethertype) This option sets the Ethertype field of the ethernet frame. The Ethertype is used to indicate which protocol is encapsulated in the payload. type can be supplied in two different ways. You can use the official numbers listed by the IEEE[3] (e.g. --ether-type 0x0800 for IP version 4), or one of the mnemonics from the section called Ethernet Types. Ethernet Types These identifiers may be used as mnemonics for the Ethertype numbers given to the --arp-type option. ipv4, ip, 4 Internet Protocol version 4 (type 0x0800). ipv6, 6 Internet Protocol version 6 (type 0x86DD). arp Address Resolution Protocol (type 0x0806). rarp Reverse Address Resolution Protocol (type 0x8035). frame-relay, frelay, fr Frame Relay (type 0x0808). ppp Point-to-Point Protocol (type 0x880B). gsmp General Switch Management Protocol (type 0x880C). mpls Multiprotocol Label Switching (type 0x8847). mps-ual, mps Multiprotocol Label Switching with Upstream-assigned Label (type 0x8848). mcap Multicast Channel Allocation Protocol (type 0x8861). pppoe-discovery, pppoe-d PPP over Ethernet Discovery Stage (type 0x8863). pppoe-session, pppoe-s PPP over Ethernet Session Stage (type 0x8864). ctag Customer VLAN Tag Type (type 0x8100). epon Ethernet Passive Optical Network (type 0x8808). pbnac Port-based network access control (type 0x888E). stag Service VLAN tag identifier (type 0x88A8). ethexp1 Local Experimental Ethertype 1 (type 0x88B5). ethexp2 Local Experimental Ethertype 2 (type 0x88B6). ethoui OUI Extended Ethertype (type 0x88B7). preauth Pre-Authentication (type 0x88C7). lldp Link Layer Discovery Protocol (type 0x88CC). mac-security, mac-sec, macsec Media Access Control Security (type 0x88E5). mvrp Multiple VLAN Registration Protocol (type 0x88F5). mmrp Multiple Multicast Registration Protocol (type 0x88F6). frrr Fast Roaming Remote Request (type 0x890D). PAYLOAD OPTIONS top --data hex string (Append custom binary data to sent packets) This option lets you include binary data as payload in sent packets. hex string may be specified in any of the following formats: 0xAABBCCDDEEFF..., AABBCCDDEEFF... or \xAA\xBB\xCC\xDD\xEE\xFF.... Examples of use are --data 0xdeadbeef and --data \xCA\xFE\x09. Note that if you specify a number like 0x00ff no byte-order conversion is performed. Make sure you specify the information in the byte order expected by the receiver. --data-string string (Append custom string to sent packets) This option lets you include a regular string as payload in sent packets. string can contain any string. However, note that some characters may depend on your system's locale and the receiver may not see the same information. Also, make sure you enclose the string in double quotes and escape any special characters from the shell. Example: --data-string "Jimmy Jazz...". --data-length len (Append random data to sent packets) This option lets you include len random bytes of data as payload in sent packets. len must be an integer in the range [065400]. However, values higher than 1400 are not recommended because it may not be possible to transmit packets due to network MTU limitations. ECHO MODE top The "Echo Mode" is a novel technique implemented by Nping which lets users see how network packets change in transit, from the host where they originated to the target machine. Basically, the Echo mode turns Nping into two different pieces: the Echo server and the Echo client. The Echo server is a network service that has the ability to capture packets from the network and send a copy ("echo them") to the originating client through a side TCP channel. The Echo client is the part that generates such network packets, transmits them to the server, and receives their echoed version through a side TCP channel that it has previously established with the Echo server. This scheme lets the client see the differences between the packets that it sends and what is actually received by the server. By having the server send back copies of the received packets through the side channel, things like NAT devices become immediately apparent to the client because it notices the changes in the source IP address (and maybe even source port). Other devices like those that perform traffic shaping, changing TCP window sizes or adding TCP options transparently between hosts, turn up too. The Echo mode is also useful for troubleshooting routing and firewall issues. Among other things, it can be used to determine if the traffic generated by the Nping client is being dropped in transit and never gets to its destination or if the responses are the ones that don't get back to it. Internally, client and server communicate over an encrypted and authenticated channel, using the Nping Echo Protocol (NEP), whose technical specification can be found in https://nmap.org/svn/nping/docs/EchoProtoRFC.txt The following paragraphs describe the different options available in Nping's Echo mode. --ec passphrase, --echo-client passphrase (Run Echo client) This option tells Nping to run as an Echo client. passphrase is a sequence of ASCII characters that is used used to generate the cryptographic keys needed for encryption and authentication in a given session. The passphrase should be a secret that is also known by the server, and it may contain any number of printable ASCII characters. Passphrases that contain whitespace or special characters must be enclosed in double quotes. When running Nping as an Echo client, most options from the regular raw probe modes apply. The client may be configured to send specific probes using flags like --tcp, --icmp or --udp. Protocol header fields may be manipulated normally using the appropriate options (e.g. --ttl, --seq, --icmp-type, etc.). The only exceptions are ARP-related flags, which are not supported in Echo mode, as protocols like ARP are closely related to the data link layer and its probes can't pass through different network segments. --es passphrase, --echo-server passphrase (Run Echo server) This option tells Nping to run as an Echo server. passphrase is a sequence of ASCII characters that is used used to generate the cryptographic keys needed for encryption and authentication in a given session. The passphrase should be a secret that is also known by the clients, and it may contain any number of printable ASCII characters. Passphrases that contain whitespace or special characters must be enclosed in double quotes. Note that although it is not recommended, it is possible to use empty passphrases, supplying --echo-server "". However, if what you want is to set up an open Echo server, it is better to use option --no-crypto. See below for details. --ep port, --echo-port port (Set Echo TCP port number) This option asks Nping to use the specified TCP port number for the Echo side channel connection. If this option is used with --echo-server, it specifies the port on which the server listens for connections. If it is used with --echo-client, it specifies the port to connect to on the remote host. By default, port number 9929 is used. --nc, --no-crypto (Disable encryption and authentication) This option asks Nping not to use any cryptographic operations during an Echo session. In practical terms, this means that the Echo side channel session data will be transmitted in the clear, and no authentication will be performed by the server or client during the session establishment phase. When --no-crypto is used, the passphrase supplied with --echo-server or --echo-client is ignored. This option must be specified if Nping was compiled without openSSL support. Note that, for technical reasons, a passphrase still needs to be supplied after the --echo-client or --echo-server flags, even though it will be ignored. The --no-crypto flag might be useful when setting up a public Echo server, because it allows users to connect to the Echo server without the need for any passphrase or shared secret. However, it is strongly recommended to not use --no-crypto unless absolutely necessary. Public Echo servers should be configured to use the passphrase "public" or the empty passphrase (--echo-server "") as the use of cryptography does not only provide confidentiality and authentication but also message integrity. --once (Serve one client and quit) This option asks the Echo server to quit after serving one client. This is useful when only a single Echo session wants to be established as it eliminates the need to access the remote host to shutdown the server. --safe-payloads (Zero application data before echoing a packet) This option asks the Echo server to erase any application layer data found in client packets before echoing them. When the option is enabled, the Echo server parses the packets received from Echo clients and tries to determine if they contain data beyond the transport layer. If such data is found, it is overwritten with zeroes before transmitting the packets to the appropriate Echo client. Echo servers can handle multiple simultaneous clients running multiple echo sessions in parallel. In order to determine which packet needs to be echoed to which client and through which session, the Echo server uses an heuristic algorithm. Although we have taken every security measure that we could think of to prevent that a client receives an echoed packet that it did not generate, there is always a risk that our algorithm makes a mistake and delivers a packet to the wrong client. The --safe-payloads option is useful for public echo servers or critical deployments where that kind of mistake cannot be afforded. The following examples illustrate how Nping's Echo mode can be used to discover intermediate devices. Example 2. Discovering NAT devices # nping --echo-client "public" echo.nmap.org --udp Starting Nping ( https://nmap.org/nping ) SENT (1.0970s) UDP 10.1.20.128:53 > 178.79.165.17:40125 ttl=64 id=32523 iplen=28 CAPT (1.1270s) UDP 80.38.10.21:45657 > 178.79.165.17:40125 ttl=54 id=32523 iplen=28 RCVD (1.1570s) ICMP 178.79.165.17 > 10.1.20.128 Port unreachable (type=3/code=3) ttl=49 id=16619 iplen=56 [...] SENT (5.1020s) UDP 10.1.20.128:53 > 178.79.165.17:40125 ttl=64 id=32523 iplen=28 CAPT (5.1335s) UDP 80.38.10.21:45657 > 178.79.165.17:40125 ttl=54 id=32523 iplen=28 RCVD (5.1600s) ICMP 178.79.165.17 > 10.1.20.128 Port unreachable (type=3/code=3) ttl=49 id=16623 iplen=56 Max rtt: 60.628ms | Min rtt: 58.378ms | Avg rtt: 59.389ms Raw packets sent: 5 (140B) | Rcvd: 5 (280B) | Lost: 0 (0.00%)| Echoed: 5 (140B) Tx time: 4.00459s | Tx bytes/s: 34.96 | Tx pkts/s: 1.25 Rx time: 5.00629s | Rx bytes/s: 55.93 | Rx pkts/s: 1.00 Nping done: 1 IP address pinged in 6.18 seconds The output clearly shows the presence of a NAT device in the client's local network. Note how the captured packet (CAPT) differs from the SENT packet: the source address for the original packets is in the reserved 10.0.0.0/8 range, while the address seen by the server is 80.38.10.21, the Internet side address of the NAT device. The source port was also modified by the device. The line starting with RCVD corresponds to the responses generated by the TCP/IP stack of the machine where the Echo server is run. Example 3. Discovering a transparent proxy # nping --echo-client "public" echo.nmap.org --tcp -p80 Starting Nping ( https://nmap.org/nping ) SENT (1.2160s) TCP 10.0.1.77:41659 > 178.79.165.17:80 S ttl=64 id=3317 iplen=40 seq=567704200 win=1480 RCVD (1.2180s) TCP 178.79.165.17:80 > 10.0.1.77:41659 SA ttl=128 id=13177 iplen=44 seq=3647106954 win=16384 <mss 1460> SENT (2.2150s) TCP 10.0.1.77:41659 > 178.79.165.17:80 S ttl=64 id=3317 iplen=40 seq=567704200 win=1480 SENT (3.2180s) TCP 10.0.1.77:41659 > 178.79.165.17:80 S ttl=64 id=3317 iplen=40 seq=567704200 win=1480 SENT (4.2190s) TCP 10.0.1.77:41659 > 178.79.165.17:80 S ttl=64 id=3317 iplen=40 seq=567704200 win=1480 SENT (5.2200s) TCP 10.0.1.77:41659 > 178.79.165.17:80 S ttl=64 id=3317 iplen=40 seq=567704200 win=1480 Max rtt: 2.062ms | Min rtt: 2.062ms | Avg rtt: 2.062ms Raw packets sent: 5 (200B) | Rcvd: 1 (46B) | Lost: 4 (80.00%)| Echoed: 0 (0B) Tx time: 4.00504s | Tx bytes/s: 49.94 | Tx pkts/s: 1.25 Rx time: 5.00618s | Rx bytes/s: 9.19 | Rx pkts/s: 0.20 Nping done: 1 IP address pinged in 6.39 seconds In this example, the output is a bit more tricky. The absence of error messages shows that the Echo client has successfully established an Echo session with the server. However, no CAPT packets can be seen in the output. This means that none of the transmitted packets reached the server. Interestingly, a TCP SYN-ACK packet was received in response to the first TCP-SYN packet (and also, it is known that the target host does not have port 80 open). This behavior reveals the presence of a transparent web proxy cache server (which in this case is an old MS ISA server). TIMING AND PERFORMANCE OPTIONS top --delay time (Delay between probes) This option lets you control for how long will Nping wait before sending the next probe. Like in many other ping tools, the default delay is one second. time must be a positive integer or floating point number. By default it is specified in seconds, however you can give an explicit unit by appending ms for milliseconds, s for seconds, m for minutes, or h for hours (e.g. 2.5s, 45m, 2h). --rate rate (Send probes at a given rate) This option specifies the number of probes that Nping should send per second. This option and --delay are inverses; --rate 20 is the same as --delay 0.05. If both options are used, only the last one in the parameter list counts. MISCELLANEOUS OPTIONS top -h, --help (Display help) Displays help information and exits. -V, --version (Display version) Displays the program's version number and quits. -c rounds, --count rounds (Stop after a given number of rounds) This option lets you specify the number of times that Nping should loop over target hosts (and in some cases target ports). Nping calls these rounds. In a basic execution with only one target (and only one target port in TCP/UDP modes), the number of rounds matches the number of probes sent to the target host. However, in more complex executions where Nping is run against multiple targets and multiple ports, the number of rounds is the number of times that Nping sends a complete set of probes that covers all target IPs and all target ports. For example, if Nping is asked to send TCP SYN packets to hosts 192.168.1.0-255 and ports 80 and 433, then 256 2 = 512 packets are sent in one round. So if you specify -c 100, Nping will loop over the different target hosts and ports 100 times, sending a total of 256 2 100 = 51200 packets. By default Nping runs for 5 rounds. If a value of 0 is specified, Nping will run continuously. -e name, --interface name (Set the network interface to be used) This option tells Nping what interface should be used to send and receive packets. Nping should be able to detect this automatically, but it will tell you if it cannot. name must be the name of an existing network interface with an assigned IP address. --privileged (Assume that the user is fully privileged) Tells Nping to simply assume that it is privileged enough to perform raw socket sends, packet sniffing, and similar operations that usually require special privileges. By default Nping quits if such operations are requested by a user that has no root or administrator privileges. This option may be useful on Linux, BSD or similar systems that can be configured to allow unprivileged users to perform raw-packet transmissions. The NPING_PRIVILEGED environment variable may be set as an alternative to using --privileged. --unprivileged (Assume that the user lacks raw socket privileges) This option is the opposite of --privileged. It tells Nping to treat the user as lacking network raw socket and sniffing privileges. This is useful for testing, debugging, or when the raw network functionality of your operating system is somehow broken. The NPING_UNPRIVILEGED environment variable may be set as an alternative to using --unprivileged. --send-eth (Use raw ethernet sending) Asks Nping to send packets at the raw ethernet (data link) layer rather than the higher IP (network) layer. By default, Nping chooses the one which is generally best for the platform it is running on. Raw sockets (IP layer) are generally most efficient for Unix machines, while ethernet frames are required for Windows operation since Microsoft disabled raw socket support. Nping still uses raw IP packets despite this option when there is no other choice (such as non-ethernet connections). --send-ip (Send at raw IP level) Asks Nping to send packets via raw IP sockets rather than sending lower level ethernet frames. It is the complement to the --send-eth option. --bpf-filter filter spec --filter filter spec (Set custom BPF filter) This option lets you use a custom BPF filter. By default Nping chooses a filter that is intended to capture most common responses to the particular probes that are sent. For example, when sending TCP packets, the filter is set to capture packets whose destination port matches the probe's source port or ICMP error messages that may be generated by the target or any intermediate device as a result of the probe. If for some reason you expect strange packets in response to sent probes or you just want to sniff a particular kind of traffic, you can specify a custom filter using the BPF syntax used by tools like tcpdump. See the documentation at http://www.tcpdump.org/ for more information. -H, --hide-sent (Do not display sent packets) This option tells Nping not to print information about sent packets. This can be useful when using very short inter-probe delays (i.e., when flooding), because printing information to the standard output has a computational cost and disabling it can probably speed things up a bit. Also, it may be useful when using Nping to detect active hosts or open ports (e.g. sending probes to all TCP ports in a /24 subnet). In that case, users may not want to see thousands of sent probes but just the replies generated by active hosts. -N, --no-capture (Do not attempt to capture replies) This option tells Nping to skip packet capture. This means that packets in response to sent probes will not be processed or displayed. This can be useful when doing flooding and network stack stress tests. Note that when this option is specified, most of the statistics shown at the end of the execution will be useless. This option does not work with TCP Connect mode. OUTPUT OPTIONS top -v[level], --verbose [level] (Increase or set verbosity level) Increases the verbosity level, causing Nping to print more information during its execution. There are 9 levels of verbosity (-4 to 4). Every instance of -v increments the verbosity level by one (from its default value, level 0). Every instance of option -q decrements the verbosity level by one. Alternatively you can specify the level directly, as in -v3 or -v-1. These are the available levels: Level -4 No output at all. In some circumstances you may not want Nping to produce any output (like when one of your work mates is watching over your shoulder). In that case level -4 can be useful because although you won't see any response packets, probes will still be sent. Level -3 Like level -4 but displays fatal error messages so you can actually see if Nping is running or it failed due to some error. Level -2 Like level -3 but also displays warnings and recoverable errors. Level -1 Displays traditional run-time information (version, start time, statistics, etc.) but does not display sent or received packets. Level 0 This is the default verbosity level. It behaves like level -1 but also displays sent and received packets and some other important information. Level 1 Like level 0 but it displays detailed information about timing, flags, protocol details, etc. Level 2 Like level 1 but displays very detailed information about sent and received packets and other interesting information. Level 3 Like level 2 but also displays the raw hexadecimal dump of sent and received packets. Level 4 and higher Same as level 3. -q[level], --reduce-verbosity [level] (Decrease verbosity level) Decreases the verbosity level, causing Nping to print less information during its execution. -d[level] (Increase or set debugging level) When even verbose mode doesn't provide sufficient data for you, debugging is available to flood you with much more! As with the -v, debugging is enabled with a command-line flag -d and the debug level can be increased by specifying it multiple times. There are 7 debugging levels (0 to 6). Every instance of -d increments debugging level by one. Provide an argument to -d to set the level directly; for example -d4. Debugging output is useful when you suspect a bug in Nping, or if you are simply confused as to what Nping is doing and why. As this feature is mostly intended for developers, debug lines aren't always self-explanatory. You may get something like NSOCK (1.0000s) Callback: TIMER SUCCESS for EID 12; tcpconnect_event_handler(): Received callback of type TIMER with status SUCCESS If you don't understand a line, your only recourses are to ignore it, look it up in the source code, or request help from the development list (nmap-dev). Some lines are self-explanatory, but the messages become more obscure as the debug level is increased. These are the available levels: Level 0 Level 0. No debug information at all. This is the default level. Level 1 In this level, only very important or high-level debug information will be printed. Level 2 Like level 1 but also displays important or medium-level debug information Level 3 Like level 2 but also displays regular and low-level debug information. Level 4 Like level 3 but also displays messages only a real Nping freak would want to see. Level 5 Like level 4 but it enables basic debug information related to external libraries like Nsock. Level 6 Like level 5 but it enables full, very detailed, debug information related to external libraries like Nsock. BUGS top Like its authors, Nping isn't perfect. But you can help make it better by sending bug reports or even writing patches. If Nping doesn't behave the way you expect, first upgrade to the latest version available from https://nmap.org . If the problem persists, do some research to determine whether it has already been discovered and addressed. Try searching for the problem or error message on Google since that aggregates so many forums. If nothing comes of this, create an Issue on our tracker ( http://issues.nmap.org ) and/or mail a bug report to <[email protected]>. If you subscribe to the nmap-dev list before posting, your message will bypass moderation and get through more quickly. Subscribe at https://nmap.org/mailman/listinfo/dev . Please include everything you have learned about the problem, as well as what version of Nping you are using and what operating system version it is running on. Other suggestions for improving Nping may be sent to the Nmap dev mailing list as well. If you are able to write a patch improving Nping or fixing a bug, that is even better! Instructions for submitting patches or git pull requests are available from https://github.com/nmap/nmap/blob/master/CONTRIBUTING.md Particularly sensitive issues such as a security reports may be sent directly to Fyodor directly at <[email protected]>. All other reports and comments should use the dev list or issue tracker instead because more people read, follow, and respond to those. AUTHORS top Luis MartinGarcia <[email protected]> (http://www.luismg.com ) Fyodor <[email protected]> (https://insecure.org ) NOTES top 1. official type numbers assigned by IANA http://www.iana.org/assignments/icmp-parameters 2. official numbers assigned by IANA http://www.iana.org/assignments/arp-parameters/ 3. official numbers listed by the IEEE http://standards.ieee.org/regauth/ethertype/eth.txt COLOPHON top This page is part of the nmap (a network scanner) project. Information about the project can be found at http://nmap.org/. 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 Subversion repository https://github.com/nmap/nmap 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] Nping 05/17/2023 NPING(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. | # nping\n\n> Network packet generation tool/ping utility.\n> More information: <https://nmap.org/nping/>.\n\n- Ping a specified host using ICMP if the user is allowed to, otherwise using TCP:\n\n`nping {{example.com}}`\n\n- Ping a specified host using ICMP assuming that the user is allowed to do so:\n\n`nping --icmp --privileged {{example.com}}`\n\n- Ping a specified host using UDP:\n\n`nping --udp {{example.com}}`\n\n- Ping a specified host on a given port using TCP:\n\n`nping --tcp --dest-port {{443}} {{example.com}}`\n\n- Ping a certain number of times:\n\n`nping --count {{10}} {{example.com}}`\n\n- Wait a certain amount of time between each ping:\n\n`nping --delay {{5s}} {{example.com}}`\n\n- Send the request over a specified interface:\n\n`nping --interface {{eth0}} {{example.com}}`\n\n- Set the Reserved/Evil bit in sent packets:\n\n`nping --evil {{example.com}}`\n |
nproc | nproc(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training nproc(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON NPROC(1) User Commands NPROC(1) NAME top nproc - print the number of processing units available SYNOPSIS top nproc [OPTION]... DESCRIPTION top Print the number of processing units available to the current process, which may be less than the number of online processors --all print the number of installed processors --ignore=N if possible, exclude N processing units --help display this help and exit --version output version information and exit AUTHOR top Written by Giuseppe Scrivano. 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/nproc> or available locally via: info '(coreutils) nproc 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 NPROC(1) Pages that refer to this page: sched_setaffinity(2), get_nprocs(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. | # nproc\n\n> Print the number of processing units (normally CPUs) available.\n> More information: <https://www.gnu.org/software/coreutils/nproc>.\n\n- Display the number of available processing units:\n\n`nproc`\n\n- Display the number of installed processing units, including any inactive ones:\n\n`nproc --all`\n\n- If possible, subtract a given number of units from the returned value:\n\n`nproc --ignore {{count}}`\n |
nsenter | nsenter(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training nsenter(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | NOTES | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY NSENTER(1) User Commands NSENTER(1) NAME top nsenter - run program in different namespaces SYNOPSIS top nsenter [options] [program [arguments]] DESCRIPTION top The nsenter command executes program in the namespace(s) that are specified in the command-line options (described below). If program is not given, then "${SHELL}" is run (default: /bin/sh). Enterable namespaces are: 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 for the shared flag). For further details, see mount_namespaces(7) and the discussion of the CLONE_NEWNS flag in clone(2). 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 set of PID to process mappings separate from the nsenter process. nsenter will fork by default if changing the PID namespace, so that the new program and its children share the same PID namespace and are visible to each other. If --no-fork is used, the new program will be execed without forking. For further details, see pid_namespaces(7). user namespace The process will have a distinct set of UIDs, GIDs and capabilities. For further details, see user_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). 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 Various of the options below that relate to namespaces take an optional file argument. This should be one of the /proc/[pid]/ns/* files described in namespaces(7), or the pathname of a bind mount that was created on one of those files. -a, --all Enter all namespaces of the target process by the default /proc/[pid]/ns/* namespace paths. The default paths to the target process namespaces may be overwritten by namespace specific options (e.g., --all --mount=[path]). The user namespace will be ignored if the same as the callers current user namespace. It prevents a caller that has dropped capabilities from regaining those capabilities via a call to setns(). See setns(2) for more details. -t, --target PID Specify a target process to get contexts from. The paths to the contexts specified by pid are: /proc/pid/ns/mnt the mount namespace /proc/pid/ns/uts the UTS namespace /proc/pid/ns/ipc the IPC namespace /proc/pid/ns/net the network namespace /proc/pid/ns/pid the PID namespace /proc/pid/ns/user the user namespace /proc/pid/ns/cgroup the cgroup namespace /proc/pid/ns/time the time namespace /proc/pid/root the root directory /proc/pid/cwd the working directory respectively -m, --mount[=file] Enter the mount namespace. If no file is specified, enter the mount namespace of the target process. If file is specified, enter the mount namespace specified by file. -u, --uts[=file] Enter the UTS namespace. If no file is specified, enter the UTS namespace of the target process. If file is specified, enter the UTS namespace specified by file. -i, --ipc[=file] Enter the IPC namespace. If no file is specified, enter the IPC namespace of the target process. If file is specified, enter the IPC namespace specified by file. -n, --net[=file] Enter the network namespace. If no file is specified, enter the network namespace of the target process. If file is specified, enter the network namespace specified by file. -p, --pid[=file] Enter the PID namespace. If no file is specified, enter the PID namespace of the target process. If file is specified, enter the PID namespace specified by file. -U, --user[=file] Enter the user namespace. If no file is specified, enter the user namespace of the target process. If file is specified, enter the user namespace specified by file. See also the --setuid and --setgid options. --user-parent Enter the parent user namespace. Parent user namespace will be acquired from any other enabled namespace. If combined with --user option the parent user namespace will be fetched from the user namespace and replace it. -C, --cgroup[=file] Enter the cgroup namespace. If no file is specified, enter the cgroup namespace of the target process. If file is specified, enter the cgroup namespace specified by file. -T, --time[=file] Enter the time namespace. If no file is specified, enter the time namespace of the target process. If file is specified, enter the time namespace specified by file. -G, --setgid gid Set the group ID which will be used in the entered namespace and drop supplementary groups. nsenter always sets GID for user namespaces, the default is 0. If the argument "follow" is specified the GID of the target process is used. -S, --setuid uid Set the user ID which will be used in the entered namespace. nsenter always sets UID for user namespaces, the default is 0. If the argument "follow" is specified the UID of the target process is used. --keep-caps When the --user option is given, ensure that capabilities granted in the user namespace are preserved in the child process. --preserve-credentials Dont modify UID and GID when enter user namespace. The default is to drops supplementary groups and sets GID and UID to 0. -r, --root[=directory] Set the root directory. If no directory is specified, set the root directory to the root directory of the target process. If directory is specified, set the root directory to the specified directory. The specified directory is open before it switches to the requested namespaces. -w, --wd[=directory] Set the working directory. If no directory is specified, set the working directory to the working directory of the target process. If directory is specified, set the working directory to the specified directory. The specified directory is open before it switches to the requested namespaces, it means the specified directory works as "tunnel" to the current namespace. See also --wdns. -W, --wdns[=directory] Set the working directory. The directory is open after switch to the requested namespaces and after chroot(2) call. The options --wd and --wdns are mutually exclusive. -e, --env Pass environment variables from the target process to the new process being created. If this option is not provided, the environment variables will remain the same as in the current namespace.. -F, --no-fork Do not fork before execing the specified program. By default, when entering a PID namespace, nsenter calls fork before calling exec so that any children will also be in the newly entered PID namespace. -Z, --follow-context Set the SELinux security context used for executing a new process according to already running process specified by --target PID. (The util-linux has to be compiled with SELinux support otherwise the option is unavailable.) -c, --join-cgroup Add the initiated process to the cgroup of the target process. -h, --help Display help text and exit. -V, --version Print version and exit. NOTES top The --user-parent option requires Linux 4.9 or higher, older kernels will raise inappropriate ioctl for device error. AUTHORS top Eric Biederman <[email protected]>, Karel Zak <[email protected]> SEE ALSO top clone(2), setns(2), namespaces(7) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The nsenter 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 NSENTER(1) Pages that refer to this page: unshare(1), setns(2), ipc_namespaces(7), mount_namespaces(7), namespaces(7), network_namespaces(7), time_namespaces(7), uts_namespaces(7), 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. | # nsenter\n\n> Run a new command in a running process' namespace.\n> Particularly useful for Docker images or chroot jails.\n> More information: <https://manned.org/nsenter>.\n\n- Run a specific command using the same namespaces as an existing process:\n\n`nsenter --target {{pid}} --all {{command}} {{command_arguments}}`\n\n- Run a specific command in an existing process's network namespace:\n\n`nsenter --target {{pid}} --net {{command}} {{command_arguments}}`\n\n- Run a specific command in an existing process's PID namespace:\n\n`nsenter --target {{pid}} --pid {{command}} {{command_arguments}}`\n\n- Run a specific command in an existing process's IPC namespace:\n\n`nsenter --target {{pid}} --ipc {{command}} {{command_arguments}}`\n\n- Run a specific command in an existing process's UTS, time, and IPC namespaces:\n\n`nsenter --target {{pid}} --uts --time --ipc -- {{command}} {{command_arguments}}`\n\n- Run a specific command in an existing process's namespace by referencing procfs:\n\n`nsenter --pid=/proc/{{pid}}/pid/net -- {{command}} {{command_arguments}}`\n |
numactl | numactl(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training numactl(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | NOTES | FILES | COPYRIGHT | SEE ALSO | COLOPHON NUMACTL(8) Linux Administrator's Manual NUMACTL(8) NAME top numactl - Control NUMA policy for processes or shared memory SYNOPSIS top numactl [ --all ] [ --balancing ] [ --interleave nodes ] [ --preferred node ] [ --preferred-many nodes ] [ --membind nodes ] [ --cpunodebind nodes ] [ --physcpubind cpus ] [ --localalloc ] [--] command {arguments ...} numactl --show numactl --hardware numactl [ --huge ] [ --offset offset ] [ --shmmode shmmode ] [ --length length ] [ --strict ] [ --shmid id ] --shm shmkeyfile | --file tmpfsfile [ --touch ] [ --dump ] [ --dump-nodes ] memory policy DESCRIPTION top numactl runs processes with a specific NUMA scheduling or memory placement policy. The policy is set for command and inherited by all of its children. In addition it can set persistent policy for shared memory segments or files. Use -- before command if using command options that could be confused with numactl options. nodes may be specified as N,N,N or N-N or N,N-N or N-N,N-N and so forth. Relative nodes may be specified as +N,N,N or +N-N or +N,N-N and so forth. The + indicates that the node numbers are relative to the process' set of allowed nodes in its current cpuset. A !N-N notation indicates the inverse of N-N, in other words all nodes except N-N. If used with + notation, specify !+N-N. When same is specified the previous nodemask specified on the command line is used. all means all nodes in the current cpuset. Instead of a number a node can also be: netdev:DEV The node connected to network device DEV. file:PATH The node the block device of PATH. ip:HOST The node of the network device of HOST block:PATH The node of block device PATH pci:[seg:]bus:dev[:func] The node of a PCI device. Note that block resolves the kernel block device names only for udev names in /dev use file: Policy settings are: --all, -a Unset default cpuset awareness, so user can use all possible CPUs/nodes for following policy settings. --interleave=nodes, -i nodes Set a memory interleave policy. Memory will be allocated using round robin on nodes. When memory cannot be allocated on the current interleave target fall back to other nodes. Multiple nodes may be specified on --interleave, --membind and --cpunodebind. --membind=nodes, -m nodes Only allocate memory from nodes. Allocation will fail when there is not enough memory available on these nodes. nodes may be specified as noted above. --cpunodebind=nodes, -N nodes Only execute command on the CPUs of nodes. Note that nodes may consist of multiple CPUs. nodes may be specified as noted above. --physcpubind=cpus, -C cpus Only execute process on cpus. This accepts cpu numbers as shown in the processor fields of /proc/cpuinfo, or relative cpus as in relative to the current cpuset. You may specify "all", which means all cpus in the current cpuset. Physical cpus may be specified as N,N,N or N-N or N,N-N or N-N,N-N and so forth. Relative cpus may be specified as +N,N,N or +N-N or +N,N-N and so forth. The + indicates that the cpu numbers are relative to the process' set of allowed cpus in its current cpuset. A !N- N notation indicates the inverse of N-N, in other words all cpus except N-N. If used with + notation, specify !+N-N. --localalloc, -l Try to allocate on the current node of the process, but if memory cannot be allocated there fall back to other nodes. --preferred=node Preferably allocate memory on node, but if memory cannot be allocated there fall back to other nodes. This option takes only a single node number. Relative notation may be used. --balancing, -b Enable Linux kernel NUMA balancing for the process if it is supported by kernel. This should only be used with --membind, -m only, otherwise ignored. --preferred-many=node Preferably allocate memory on nodes, but if memory cannot be allocated there fall back to other nodes. This option takes a mask of preferred nodes where the closest node to local is considered most preferred. Relative notation may be used. --show, -s Show NUMA policy settings of the current process. --hardware, -H Show inventory of available nodes on the system. Numactl can set up policy for a SYSV shared memory segment or a file in shmfs/hugetlbfs. This policy is persistent and will be used by all mappings from that shared memory. The order of options matters here. The specification must at least include either of --shm, --shmid, --file to specify the shared memory segment or file and a memory policy like described above ( --interleave, --localalloc, --preferred, --preferred-many, --membind ). --huge When creating a SYSV shared memory segment use huge pages. Only valid before --shmid or --shm --offset Specify offset into the shared memory segment. Default 0. Valid units are m (for MB), g (for GB), k (for KB), otherwise it specifies bytes. --strict Give an error when a page in the policied area in the shared memory segment already was faulted in with a conflicting policy. Default is to silently ignore this. --shmmode shmmode Only valid before --shmid or --shm When creating a shared memory segment set it to numeric mode shmmode. --length length Apply policy to length range in the shared memory segment or make the segment length long Default is to use the remaining length Required when a shared memory segment is created and specifies the length of the new segment then. Valid units are m (for MB), g (for GB), k (for KB), otherwise it specifies bytes. --shmid id Create or use a shared memory segment with numeric ID id --shm shmkeyfile Create or use a shared memory segment, with the ID generated using ftok(3) from shmkeyfile --file tmpfsfile Set policy for a file in tmpfs or hugetlbfs --touch Touch pages to enforce policy early. Default is to not touch them, the policy is applied when an applications maps and accesses a page. --dump Dump policy in the specified range. --dump-nodes Dump all nodes of the specific range (very verbose!) Valid node specifiers all All nodes number Node number number1{,number2} Node number1 and Node number2 number1-number2 Nodes from number1 to number2 ! nodes Invert selection of the following specification. EXAMPLES top numactl --physcpubind=+0-4,8-12 myapplic arguments Run myapplic on cpus 0-4 and 8-12 of the current cpuset. numactl --interleave=all bigdatabase arguments Run big database with its memory interleaved on all CPUs. numactl --cpunodebind=0 --membind=0,1 process Run process on node 0 with memory allocated on node 0 and 1. numactl --cpunodebind=0 --membind=0,1 -- process -l Run process as above, but with an option (-l) that would be confused with a numactl option. numactl --cpunodebind=0 --balancing --membind=0,1 process Run process on node 0 with memory allocated on node 0 and 1. Optimize the page placement with Linux kernel NUMA balancing mechanism if possible. numactl --cpunodebind=netdev:eth0 --membind=netdev:eth0 network- server Run network-server on the node of network device eth0 with its memory also in the same node. numactl --preferred=1 numactl --show Set preferred node 1 and show the resulting state. numactl --preferred-many=0x3 numactl --show Set preferred nodes 1 and 2, and show the resulting state. numactl --interleave=all --shm /tmp/shmkey Interleave all of the sysv shared memory region specified by /tmp/shmkey over all nodes. Place a tmpfs file on 2 nodes: numactl --membind=2 dd if=/dev/zero of=/dev/shm/A bs=1M count=1024 numactl --membind=3 dd if=/dev/zero of=/dev/shm/A seek=1024 bs=1M count=1024 numactl --localalloc /dev/shm/file Reset the policy for the shared memory file file to the default localalloc policy. NOTES top Requires a NUMA policy aware kernel. Command is not executed using a shell. If you want to use shell metacharacters in the child use sh -c as wrapper. Setting policy for a hugetlbfs file does currently not work because it cannot be extended by truncate. Shared memory segments larger than numactl's address space cannot be completely policied. This could be a problem on 32bit architectures. Changing it piece by piece may work. The old --cpubind which accepts node numbers, not cpu numbers, is deprecated and replaced with the new --cpunodebind and --physcpubind options. FILES top /proc/cpuinfo for the listing of active CPUs. See proc(5) for details. /sys/devices/system/node/node*/numastat for NUMA memory hit statistics. COPYRIGHT top Copyright 2002,2004 Andi Kleen, SuSE Labs. numactl and the demo programs are under the GNU General Public License, v.2 SEE ALSO top set_mempolicy(2) , get_mempolicy(2) , mbind(2) , sched_setaffinity(2) , sched_getaffinity(2) , proc(5) , ftok(3) , shmat(2) , migratepages(8) COLOPHON top This page is part of the numactl (NUMA commands) project. Information about the project can be found at http://oss.sgi.com/projects/libnuma/. 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/numactl/numactl.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-09-05.) 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] SuSE Labs Mar 2004 NUMACTL(8) Pages that refer to this page: get_mempolicy(2), mbind(2), sched_setaffinity(2), set_mempolicy(2), numa(3), cpuset(7), numa(7), migratepages(8), migspeed(8), numastat(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. | # numactl\n\n> Control NUMA policy for processes or shared memory.\n> More information: <https://man7.org/linux/man-pages/man8/numactl.8.html>.\n\n- Run a command on node 0 with memory allocated on node 0 and 1:\n\n`numactl --cpunodebind={{0}} --membind={{0,1}} -- {{command}} {{command_arguments}}`\n\n- Run a command on CPUs (cores) 0-4 and 8-12 of the current cpuset:\n\n`numactl --physcpubind={{+0-4,8-12}} -- {{command}} {{command_arguments}}`\n\n- Run a command with its memory interleaved on all CPUs:\n\n`numactl --interleave={{all}} -- {{command}} {{command_arguments}}`\n |
numfmt | numfmt(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training numfmt(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON NUMFMT(1) User Commands NUMFMT(1) NAME top numfmt - Convert numbers from/to human-readable strings SYNOPSIS top numfmt [OPTION]... [NUMBER]... DESCRIPTION top Reformat NUMBER(s), or the numbers from standard input if none are specified. Mandatory arguments to long options are mandatory for short options too. --debug print warnings about invalid input -d, --delimiter=X use X instead of whitespace for field delimiter --field=FIELDS replace the numbers in these input fields (default=1); see FIELDS below --format=FORMAT use printf style floating-point FORMAT; see FORMAT below for details --from=UNIT auto-scale input numbers to UNITs; default is 'none'; see UNIT below --from-unit=N specify the input unit size (instead of the default 1) --grouping use locale-defined grouping of digits, e.g. 1,000,000 (which means it has no effect in the C/POSIX locale) --header[=N] print (without converting) the first N header lines; N defaults to 1 if not specified --invalid=MODE failure mode for invalid numbers: MODE can be: abort (default), fail, warn, ignore --padding=N pad the output to N characters; positive N will right-align; negative N will left-align; padding is ignored if the output is wider than N; the default is to automatically pad if a whitespace is found --round=METHOD use METHOD for rounding when scaling; METHOD can be: up, down, from-zero (default), towards-zero, nearest --suffix=SUFFIX add SUFFIX to output numbers, and accept optional SUFFIX in input numbers --to=UNIT auto-scale output numbers to UNITs; see UNIT below --to-unit=N the output unit size (instead of the default 1) -z, --zero-terminated line delimiter is NUL, not newline --help display this help and exit --version output version information and exit UNIT options: none no auto-scaling is done; suffixes will trigger an error auto accept optional single/two letter suffix: 1K = 1000, 1Ki = 1024, 1M = 1000000, 1Mi = 1048576, si accept optional single letter suffix: 1K = 1000, 1M = 1000000, ... iec accept optional single letter suffix: 1K = 1024, 1M = 1048576, ... iec-i accept optional two-letter suffix: 1Ki = 1024, 1Mi = 1048576, ... FIELDS supports cut(1) style field ranges: N N'th field, counted from 1 N- from N'th field, to end of line N-M from N'th to M'th field (inclusive) -M from first to M'th field (inclusive) - all fields Multiple fields/ranges can be separated with commas FORMAT must be suitable for printing one floating-point argument '%f'. Optional quote (%'f) will enable --grouping (if supported by current locale). Optional width value (%10f) will pad output. Optional zero (%010f) width will zero pad the number. Optional negative values (%-10f) will left align. Optional precision (%.1f) will override the input determined precision. Exit status is 0 if all input numbers were successfully converted. By default, numfmt will stop at the first conversion error with exit status 2. With --invalid='fail' a warning is printed for each conversion error and the exit status is 2. With --invalid='warn' each conversion error is diagnosed, but the exit status is 0. With --invalid='ignore' conversion errors are not diagnosed and the exit status is 0. EXAMPLES top $ numfmt --to=si 1000 -> "1.0K" $ numfmt --to=iec 2048 -> "2.0K" $ numfmt --to=iec-i 4096 -> "4.0Ki" $ echo 1K | numfmt --from=si -> "1000" $ echo 1K | numfmt --from=iec -> "1024" $ df -B1 | numfmt --header --field 2-4 --to=si $ ls -l | numfmt --header --field 5 --to=iec $ ls -lh | numfmt --header --field 5 --from=iec --padding=10 $ ls -lh | numfmt --header --field 5 --from=iec --format %10f AUTHOR top Written by Assaf Gordon. 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/numfmt> or available locally via: info '(coreutils) numfmt 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 NUMFMT(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. | # numfmt\n\n> Convert numbers to and from human-readable strings.\n> More information: <https://www.gnu.org/software/coreutils/numfmt>.\n\n- Convert 1.5K (SI Units) to 1500:\n\n`numfmt --from={{si}} {{1.5K}}`\n\n- Convert 5th field (1-indexed) to IEC Units without converting header:\n\n`ls -l | numfmt --header={{1}} --field={{5}} --to={{iec}}`\n\n- Convert to IEC units, pad with 5 characters, left aligned:\n\n`du -s * | numfmt --to={{iec}} --format="{{%-5f}}"`\n |
objdump | objdump(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training objdump(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | SEE ALSO | COPYRIGHT | COLOPHON OBJDUMP(1) GNU Development Tools OBJDUMP(1) NAME top objdump - display information from object files SYNOPSIS top objdump [-a|--archive-headers] [-b bfdname|--target=bfdname] [-C|--demangle[=style] ] [-d|--disassemble[=symbol]] [-D|--disassemble-all] [-z|--disassemble-zeroes] [-EB|-EL|--endian={big | little }] [-f|--file-headers] [-F|--file-offsets] [--file-start-context] [-g|--debugging] [-e|--debugging-tags] [-h|--section-headers|--headers] [-i|--info] [-j section|--section=section] [-l|--line-numbers] [-S|--source] [--source-comment[=text]] [-m machine|--architecture=machine] [-M options|--disassembler-options=options] [-p|--private-headers] [-P options|--private=options] [-r|--reloc] [-R|--dynamic-reloc] [-s|--full-contents] [-W[lLiaprmfFsoORtUuTgAck]| --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links]] [-WK|--dwarf=follow-links] [-WN|--dwarf=no-follow-links] [-wD|--dwarf=use-debuginfod] [-wE|--dwarf=do-not-use-debuginfod] [-L|--process-links] [--ctf=section] [--sframe=section] [-G|--stabs] [-t|--syms] [-T|--dynamic-syms] [-x|--all-headers] [-w|--wide] [--start-address=address] [--stop-address=address] [--no-addresses] [--prefix-addresses] [--[no-]show-raw-insn] [--adjust-vma=offset] [--show-all-symbols] [--dwarf-depth=n] [--dwarf-start=n] [--ctf-parent=section] [--no-recurse-limit|--recurse-limit] [--special-syms] [--prefix=prefix] [--prefix-strip=level] [--insn-width=width] [--visualize-jumps[=color|=extended-color|=off] [--disassembler-color=[off|terminal|on|extended] [-U method] [--unicode=method] [-V|--version] [-H|--help] objfile... DESCRIPTION top objdump displays information about one or more object files. The options control what particular information to display. This information is mostly useful to programmers who are working on the compilation tools, as opposed to programmers who just want their program to compile and work. objfile... are the object files to be examined. When you specify archives, objdump shows information on each of the member object files. OPTIONS top The long and short forms of options, shown here as alternatives, are equivalent. At least one option from the list -a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-P,-r,-R,-s,-S,-t,-T,-V,-x must be given. -a --archive-header If any of the objfile files are archives, display the archive header information (in a format similar to ls -l). Besides the information you could list with ar tv, objdump -a shows the object file format of each archive member. --adjust-vma=offset When dumping information, first add offset to all the section addresses. This is useful if the section addresses do not correspond to the symbol table, which can happen when putting sections at particular addresses when using a format which can not represent section addresses, such as a.out. -b bfdname --target=bfdname Specify that the object-code format for the object files is bfdname. This option may not be necessary; objdump can automatically recognize many formats. For example, objdump -b oasys -m vax -h fu.o displays summary information from the section headers (-h) of fu.o, which is explicitly identified (-m) as a VAX object file in the format produced by Oasys compilers. You can list the formats available with the -i option. -C --demangle[=style] Decode (demangle) low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, this makes C++ function names readable. Different compilers have different mangling styles. The optional demangling style argument can be used to choose an appropriate demangling style for your compiler. --recurse-limit --no-recurse-limit --recursion-limit --no-recursion-limit Enables or disables a limit on the amount of recursion performed whilst demangling strings. Since the name mangling formats allow for an infinite level of recursion it is possible to create strings whose decoding will exhaust the amount of stack space available on the host machine, triggering a memory fault. The limit tries to prevent this from happening by restricting recursion to 2048 levels of nesting. The default is for this limit to be enabled, but disabling it may be necessary in order to demangle truly complicated names. Note however that if the recursion limit is disabled then stack exhaustion is possible and any bug reports about such an event will be rejected. -g --debugging Display debugging information. This attempts to parse STABS debugging format information stored in the file and print it out using a C like syntax. If no STABS debugging was found this option falls back on the -W option to print any DWARF information in the file. -e --debugging-tags Like -g, but the information is generated in a format compatible with ctags tool. -d --disassemble --disassemble=symbol Display the assembler mnemonics for the machine instructions from the input file. This option only disassembles those sections which are expected to contain instructions. If the optional symbol argument is given, then display the assembler mnemonics starting at symbol. If symbol is a function name then disassembly will stop at the end of the function, otherwise it will stop when the next symbol is encountered. If there are no matches for symbol then nothing will be displayed. Note if the --dwarf=follow-links option is enabled then any symbol tables in linked debug info files will be read in and used when disassembling. -D --disassemble-all Like -d, but disassemble the contents of all non-empty non- bss sections, not just those expected to contain instructions. -j may be used to select specific sections. This option also has a subtle effect on the disassembly of instructions in code sections. When option -d is in effect objdump will assume that any symbols present in a code section occur on the boundary between instructions and it will refuse to disassemble across such a boundary. When option -D is in effect however this assumption is supressed. This means that it is possible for the output of -d and -D to differ if, for example, data is stored in code sections. If the target is an ARM architecture this switch also has the effect of forcing the disassembler to decode pieces of data found in code sections as if they were instructions. Note if the --dwarf=follow-links option is enabled then any symbol tables in linked debug info files will be read in and used when disassembling. --no-addresses When disassembling, don't print addresses on each line or for symbols and relocation offsets. In combination with --no-show-raw-insn this may be useful for comparing compiler output. --prefix-addresses When disassembling, print the complete address on each line. This is the older disassembly format. -EB -EL --endian={big|little} Specify the endianness of the object files. This only affects disassembly. This can be useful when disassembling a file format which does not describe endianness information, such as S-records. -f --file-headers Display summary information from the overall header of each of the objfile files. -F --file-offsets When disassembling sections, whenever a symbol is displayed, also display the file offset of the region of data that is about to be dumped. If zeroes are being skipped, then when disassembly resumes, tell the user how many zeroes were skipped and the file offset of the location from where the disassembly resumes. When dumping sections, display the file offset of the location from where the dump starts. --file-start-context Specify that when displaying interlisted source code/disassembly (assumes -S) from a file that has not yet been displayed, extend the context to the start of the file. -h --section-headers --headers Display summary information from the section headers of the object file. File segments may be relocated to nonstandard addresses, for example by using the -Ttext, -Tdata, or -Tbss options to ld. However, some object file formats, such as a.out, do not store the starting address of the file segments. In those situations, although ld relocates the sections correctly, using objdump -h to list the file section headers cannot show the correct addresses. Instead, it shows the usual addresses, which are implicit for the target. Note, in some cases it is possible for a section to have both the READONLY and the NOREAD attributes set. In such cases the NOREAD attribute takes precedence, but objdump will report both since the exact setting of the flag bits might be important. -H --help Print a summary of the options to objdump and exit. -i --info Display a list showing all architectures and object formats available for specification with -b or -m. -j name --section=name Display information for section name. This option may be specified multiple times. -L --process-links Display the contents of non-debug sections found in separate debuginfo files that are linked to the main file. This option automatically implies the -WK option, and only sections requested by other command line options will be displayed. -l --line-numbers Label the display (using debugging information) with the filename and source line numbers corresponding to the object code or relocs shown. Only useful with -d, -D, or -r. -m machine --architecture=machine Specify the architecture to use when disassembling object files. This can be useful when disassembling object files which do not describe architecture information, such as S-records. You can list the available architectures with the -i option. For most architectures it is possible to supply an architecture name and a machine name, separated by a colon. For example foo:bar would refer to the bar machine type in the foo architecture. This can be helpful if objdump has been configured to support multiple architectures. If the target is an ARM architecture then this switch has an additional effect. It restricts the disassembly to only those instructions supported by the architecture specified by machine. If it is necessary to use this switch because the input file does not contain any architecture information, but it is also desired to disassemble all the instructions use -marm. -M options --disassembler-options=options Pass target specific information to the disassembler. Only supported on some targets. If it is necessary to specify more than one disassembler option then multiple -M options can be used or can be placed together into a comma separated list. For ARC, dsp controls the printing of DSP instructions, spfp selects the printing of FPX single precision FP instructions, dpfp selects the printing of FPX double precision FP instructions, quarkse_em selects the printing of special QuarkSE-EM instructions, fpuda selects the printing of double precision assist instructions, fpus selects the printing of FPU single precision FP instructions, while fpud selects the printing of FPU double precision FP instructions. Additionally, one can choose to have all the immediates printed in hexadecimal using hex. By default, the short immediates are printed using the decimal representation, while the long immediate values are printed as hexadecimal. cpu=... allows one to enforce a particular ISA when disassembling instructions, overriding the -m value or whatever is in the ELF file. This might be useful to select ARC EM or HS ISA, because architecture is same for those and disassembler relies on private ELF header data to decide if code is for EM or HS. This option might be specified multiple times - only the latest value will be used. Valid values are same as for the assembler -mcpu=... option. If the target is an ARM architecture then this switch can be used to select which register name set is used during disassembler. Specifying -M reg-names-std (the default) will select the register names as used in ARM's instruction set documentation, but with register 13 called 'sp', register 14 called 'lr' and register 15 called 'pc'. Specifying -M reg- names-apcs will select the name set used by the ARM Procedure Call Standard, whilst specifying -M reg-names-raw will just use r followed by the register number. There are also two variants on the APCS register naming scheme enabled by -M reg-names-atpcs and -M reg-names- special-atpcs which use the ARM/Thumb Procedure Call Standard naming conventions. (Either with the normal register names or the special register names). This option can also be used for ARM architectures to force the disassembler to interpret all instructions as Thumb instructions by using the switch --disassembler-options=force-thumb. This can be useful when attempting to disassemble thumb code produced by other compilers. For AArch64 targets this switch can be used to set whether instructions are disassembled as the most general instruction using the -M no-aliases option or whether instruction notes should be generated as comments in the disasssembly using -M notes. For the x86, some of the options duplicate functions of the -m switch, but allow finer grained control. "x86-64" "i386" "i8086" Select disassembly for the given architecture. "intel" "att" Select between intel syntax mode and AT&T syntax mode. "amd64" "intel64" Select between AMD64 ISA and Intel64 ISA. "intel-mnemonic" "att-mnemonic" Select between intel mnemonic mode and AT&T mnemonic mode. Note: "intel-mnemonic" implies "intel" and "att-mnemonic" implies "att". "addr64" "addr32" "addr16" "data32" "data16" Specify the default address size and operand size. These five options will be overridden if "x86-64", "i386" or "i8086" appear later in the option string. "suffix" When in AT&T mode and also for a limited set of instructions when in Intel mode, instructs the disassembler to print a mnemonic suffix even when the suffix could be inferred by the operands or, for certain instructions, the execution mode's defaults. For PowerPC, the -M argument raw selects disasssembly of hardware insns rather than aliases. For example, you will see "rlwinm" rather than "clrlwi", and "addi" rather than "li". All of the -m arguments for gas that select a CPU are supported. These are: 403, 405, 440, 464, 476, 601, 603, 604, 620, 7400, 7410, 7450, 7455, 750cl, 821, 850, 860, a2, booke, booke32, cell, com, e200z2, e200z4, e300, e500, e500mc, e500mc64, e500x2, e5500, e6500, efs, power4, power5, power6, power7, power8, power9, power10, ppc, ppc32, ppc64, ppc64bridge, ppcps, pwr, pwr2, pwr4, pwr5, pwr5x, pwr6, pwr7, pwr8, pwr9, pwr10, pwrx, titan, vle, and future. 32 and 64 modify the default or a prior CPU selection, disabling and enabling 64-bit insns respectively. In addition, altivec, any, lsp, htm, vsx, spe and spe2 add capabilities to a previous or later CPU selection. any will disassemble any opcode known to binutils, but in cases where an opcode has two different meanings or different arguments, you may not see the disassembly you expect. If you disassemble without giving a CPU selection, a default will be chosen from information gleaned by BFD from the object files headers, but the result again may not be as you expect. For MIPS, this option controls the printing of instruction mnemonic names and register names in disassembled instructions. Multiple selections from the following may be specified as a comma separated string, and invalid options are ignored: "no-aliases" Print the 'raw' instruction mnemonic instead of some pseudo instruction mnemonic. I.e., print 'daddu' or 'or' instead of 'move', 'sll' instead of 'nop', etc. "msa" Disassemble MSA instructions. "virt" Disassemble the virtualization ASE instructions. "xpa" Disassemble the eXtended Physical Address (XPA) ASE instructions. "gpr-names=ABI" Print GPR (general-purpose register) names as appropriate for the specified ABI. By default, GPR names are selected according to the ABI of the binary being disassembled. "fpr-names=ABI" Print FPR (floating-point register) names as appropriate for the specified ABI. By default, FPR numbers are printed rather than names. "cp0-names=ARCH" Print CP0 (system control coprocessor; coprocessor 0) register names as appropriate for the CPU or architecture specified by ARCH. By default, CP0 register names are selected according to the architecture and CPU of the binary being disassembled. "hwr-names=ARCH" Print HWR (hardware register, used by the "rdhwr" instruction) names as appropriate for the CPU or architecture specified by ARCH. By default, HWR names are selected according to the architecture and CPU of the binary being disassembled. "reg-names=ABI" Print GPR and FPR names as appropriate for the selected ABI. "reg-names=ARCH" Print CPU-specific register names (CP0 register and HWR names) as appropriate for the selected CPU or architecture. For any of the options listed above, ABI or ARCH may be specified as numeric to have numbers printed rather than names, for the selected types of registers. You can list the available values of ABI and ARCH using the --help option. For VAX, you can specify function entry addresses with -M entry:0xf00ba. You can use this multiple times to properly disassemble VAX binary files that don't contain symbol tables (like ROM dumps). In these cases, the function entry mask would otherwise be decoded as VAX instructions, which would probably lead the rest of the function being wrongly disassembled. -p --private-headers Print information that is specific to the object file format. The exact information printed depends upon the object file format. For some object file formats, no additional information is printed. -P options --private=options Print information that is specific to the object file format. The argument options is a comma separated list that depends on the format (the lists of options is displayed with the help). For XCOFF, the available options are: "header" "aout" "sections" "syms" "relocs" "lineno," "loader" "except" "typchk" "traceback" "toc" "ldinfo" For PE, the available options are: "header" "sections" Not all object formats support this option. In particular the ELF format does not use it. -r --reloc Print the relocation entries of the file. If used with -d or -D, the relocations are printed interspersed with the disassembly. -R --dynamic-reloc Print the dynamic relocation entries of the file. This is only meaningful for dynamic objects, such as certain types of shared libraries. As for -r, if used with -d or -D, the relocations are printed interspersed with the disassembly. -s --full-contents Display the full contents of sections, often used in combination with -j to request specific sections. By default all non-empty non-bss sections are displayed. -S --source Display source code intermixed with disassembly, if possible. Implies -d. --show-all-symbols When disassembling, show all the symbols that match a given address, not just the first one. --source-comment[=txt] Like the -S option, but all source code lines are displayed with a prefix of txt. Typically txt will be a comment string which can be used to distinguish the assembler code from the source code. If txt is not provided then a default string of "# " (hash followed by a space), will be used. --prefix=prefix Specify prefix to add to the absolute paths when used with -S. --prefix-strip=level Indicate how many initial directory names to strip off the hardwired absolute paths. It has no effect without --prefix=prefix. --show-raw-insn When disassembling instructions, print the instruction in hex as well as in symbolic form. This is the default except when --prefix-addresses is used. --no-show-raw-insn When disassembling instructions, do not print the instruction bytes. This is the default when --prefix-addresses is used. --insn-width=width Display width bytes on a single line when disassembling instructions. --visualize-jumps[=color|=extended-color|=off] Visualize jumps that stay inside a function by drawing ASCII art between the start and target addresses. The optional =color argument adds color to the output using simple terminal colors. Alternatively the =extended-color argument will add color using 8bit colors, but these might not work on all terminals. If it is necessary to disable the visualize-jumps option after it has previously been enabled then use visualize-jumps=off. --disassembler-color=off --disassembler-color=terminal --disassembler-color=on|color|colour --disassembler-color=extened|extended-color|extened-colour Enables or disables the use of colored syntax highlighting in disassembly output. The default behaviour is determined via a configure time option. Note, not all architectures support colored syntax highlighting, and depending upon the terminal used, colored output may not actually be legible. The on argument adds colors using simple terminal colors. The terminal argument does the same, but only if the output device is a terminal. The extended-color argument is similar to the on argument, but it uses 8-bit colors. These may not work on all terminals. The off argument disables colored disassembly. -W[lLiaprmfFsoORtUuTgAckK] --dwarf[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links] Displays the contents of the DWARF debug sections in the file, if any are present. Compressed debug sections are automatically decompressed (temporarily) before they are displayed. If one or more of the optional letters or words follows the switch then only those type(s) of data will be dumped. The letters and words refer to the following information: "a" "=abbrev" Displays the contents of the .debug_abbrev section. "A" "=addr" Displays the contents of the .debug_addr section. "c" "=cu_index" Displays the contents of the .debug_cu_index and/or .debug_tu_index sections. "f" "=frames" Display the raw contents of a .debug_frame section. "F" "=frames-interp" Display the interpreted contents of a .debug_frame section. "g" "=gdb_index" Displays the contents of the .gdb_index and/or .debug_names sections. "i" "=info" Displays the contents of the .debug_info section. Note: the output from this option can also be restricted by the use of the --dwarf-depth and --dwarf-start options. "k" "=links" Displays the contents of the .gnu_debuglink, .gnu_debugaltlink and .debug_sup sections, if any of them are present. Also displays any links to separate dwarf object files (dwo), if they are specified by the DW_AT_GNU_dwo_name or DW_AT_dwo_name attributes in the .debug_info section. "K" "=follow-links" Display the contents of any selected debug sections that are found in linked, separate debug info file(s). This can result in multiple versions of the same debug section being displayed if it exists in more than one file. In addition, when displaying DWARF attributes, if a form is found that references the separate debug info file, then the referenced contents will also be displayed. Note - in some distributions this option is enabled by default. It can be disabled via the N debug option. The default can be chosen when configuring the binutils via the --enable-follow-debug-links=yes or --enable-follow-debug-links=no options. If these are not used then the default is to enable the following of debug links. Note - if support for the debuginfod protocol was enabled when the binutils were built then this option will also include an attempt to contact any debuginfod servers mentioned in the DEBUGINFOD_URLS environment variable. This could take some time to resolve. This behaviour can be disabled via the =do-not-use-debuginfod debug option. "N" "=no-follow-links" Disables the following of links to separate debug info files. "D" "=use-debuginfod" Enables contacting debuginfod servers if there is a need to follow debug links. This is the default behaviour. "E" "=do-not-use-debuginfod" Disables contacting debuginfod servers when there is a need to follow debug links. "l" "=rawline" Displays the contents of the .debug_line section in a raw format. "L" "=decodedline" Displays the interpreted contents of the .debug_line section. "m" "=macro" Displays the contents of the .debug_macro and/or .debug_macinfo sections. "o" "=loc" Displays the contents of the .debug_loc and/or .debug_loclists sections. "O" "=str-offsets" Displays the contents of the .debug_str_offsets section. "p" "=pubnames" Displays the contents of the .debug_pubnames and/or .debug_gnu_pubnames sections. "r" "=aranges" Displays the contents of the .debug_aranges section. "R" "=Ranges" Displays the contents of the .debug_ranges and/or .debug_rnglists sections. "s" "=str" Displays the contents of the .debug_str, .debug_line_str and/or .debug_str_offsets sections. "t" "=pubtype" Displays the contents of the .debug_pubtypes and/or .debug_gnu_pubtypes sections. "T" "=trace_aranges" Displays the contents of the .trace_aranges section. "u" "=trace_abbrev" Displays the contents of the .trace_abbrev section. "U" "=trace_info" Displays the contents of the .trace_info section. Note: displaying the contents of .debug_static_funcs, .debug_static_vars and debug_weaknames sections is not currently supported. --dwarf-depth=n Limit the dump of the ".debug_info" section to n children. This is only useful with --debug-dump=info. The default is to print all DIEs; the special value 0 for n will also have this effect. With a non-zero value for n, DIEs at or deeper than n levels will not be printed. The range for n is zero-based. --dwarf-start=n Print only DIEs beginning with the DIE numbered n. This is only useful with --debug-dump=info. If specified, this option will suppress printing of any header information and all DIEs before the DIE numbered n. Only siblings and children of the specified DIE will be printed. This can be used in conjunction with --dwarf-depth. --dwarf-check Enable additional checks for consistency of Dwarf information. --ctf[=section] Display the contents of the specified CTF section. CTF sections themselves contain many subsections, all of which are displayed in order. By default, display the name of the section named .ctf, which is the name emitted by ld. --ctf-parent=member If the CTF section contains ambiguously-defined types, it will consist of an archive of many CTF dictionaries, all inheriting from one dictionary containing unambiguous types. This member is by default named .ctf, like the section containing it, but it is possible to change this name using the "ctf_link_set_memb_name_changer" function at link time. When looking at CTF archives that have been created by a linker that uses the name changer to rename the parent archive member, --ctf-parent can be used to specify the name used for the parent. --sframe[=section] Display the contents of the specified SFrame section. By default, display the name of the section named .sframe, which is the name emitted by ld. -G --stabs Display the full contents of any sections requested. Display the contents of the .stab and .stab.index and .stab.excl sections from an ELF file. This is only useful on systems (such as Solaris 2.0) in which ".stab" debugging symbol-table entries are carried in an ELF section. In most other file formats, debugging symbol-table entries are interleaved with linkage symbols, and are visible in the --syms output. --start-address=address Start displaying data at the specified address. This affects the output of the -d, -r and -s options. --stop-address=address Stop displaying data at the specified address. This affects the output of the -d, -r and -s options. -t --syms Print the symbol table entries of the file. This is similar to the information provided by the nm program, although the display format is different. The format of the output depends upon the format of the file being dumped, but there are two main types. One looks like this: [ 4](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 1) 0x00000000 .bss [ 6](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 fred where the number inside the square brackets is the number of the entry in the symbol table, the sec number is the section number, the fl value are the symbol's flag bits, the ty number is the symbol's type, the scl number is the symbol's storage class and the nx value is the number of auxiliary entries associated with the symbol. The last two fields are the symbol's value and its name. The other common output format, usually seen with ELF based files, looks like this: 00000000 l d .bss 00000000 .bss 00000000 g .text 00000000 fred Here the first number is the symbol's value (sometimes referred to as its address). The next field is actually a set of characters and spaces indicating the flag bits that are set on the symbol. These characters are described below. Next is the section with which the symbol is associated or *ABS* if the section is absolute (ie not connected with any section), or *UND* if the section is referenced in the file being dumped, but not defined there. After the section name comes another field, a number, which for common symbols is the alignment and for other symbol is the size. Finally the symbol's name is displayed. The flag characters are divided into 7 groups as follows: "l" "g" "u" "!" The symbol is a local (l), global (g), unique global (u), neither global nor local (a space) or both global and local (!). A symbol can be neither local or global for a variety of reasons, e.g., because it is used for debugging, but it is probably an indication of a bug if it is ever both local and global. Unique global symbols are a GNU extension to the standard set of ELF symbol bindings. For such a symbol the dynamic linker will make sure that in the entire process there is just one symbol with this name and type in use. "w" The symbol is weak (w) or strong (a space). "C" The symbol denotes a constructor (C) or an ordinary symbol (a space). "W" The symbol is a warning (W) or a normal symbol (a space). A warning symbol's name is a message to be displayed if the symbol following the warning symbol is ever referenced. "I" "i" The symbol is an indirect reference to another symbol (I), a function to be evaluated during reloc processing (i) or a normal symbol (a space). "d" "D" The symbol is a debugging symbol (d) or a dynamic symbol (D) or a normal symbol (a space). "F" "f" "O" The symbol is the name of a function (F) or a file (f) or an object (O) or just a normal symbol (a space). -T --dynamic-syms Print the dynamic symbol table entries of the file. This is only meaningful for dynamic objects, such as certain types of shared libraries. This is similar to the information provided by the nm program when given the -D (--dynamic) option. The output format is similar to that produced by the --syms option, except that an extra field is inserted before the symbol's name, giving the version information associated with the symbol. If the version is the default version to be used when resolving unversioned references to the symbol then it's displayed as is, otherwise it's put into parentheses. --special-syms When displaying symbols include those which the target considers to be special in some way and which would not normally be of interest to the user. -U [d|i|l|e|x|h] --unicode=[default|invalid|locale|escape|hex|highlight] Controls the display of UTF-8 encoded multibyte characters in strings. The default (--unicode=default) is to give them no special treatment. The --unicode=locale option displays the sequence in the current locale, which may or may not support them. The options --unicode=hex and --unicode=invalid display them as hex byte sequences enclosed by either angle brackets or curly braces. The --unicode=escape option displays them as escape sequences (\uxxxx) and the --unicode=highlight option displays them as escape sequences highlighted in red (if supported by the output device). The colouring is intended to draw attention to the presence of unicode sequences where they might not be expected. -V --version Print the version number of objdump and exit. -x --all-headers Display all available header information, including the symbol table and relocation entries. Using -x is equivalent to specifying all of -a -f -h -p -r -t. -w --wide Format some lines for output devices that have more than 80 columns. Also do not truncate symbol names when they are displayed. -z --disassemble-zeroes Normally the disassembly output will skip blocks of zeroes. This option directs the disassembler to disassemble those blocks, just like any other data. @file Read command-line options from file. The options read are inserted in place of the original @file option. If file does not exist, or cannot be read, then the option will be treated literally, and not removed. Options in file are separated by whitespace. A whitespace character may be included in an option by surrounding the entire option in either single or double quotes. Any character (including a backslash) may be included by prefixing the character to be included with a backslash. The file may itself contain additional @file options; any such options will be processed recursively. SEE ALSO top nm(1), readelf(1), and the Info entries for binutils. COPYRIGHT top Copyright (c) 1991-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 binutils (a collection of tools for working with executable binaries) project. Information about the project can be found at http://www.gnu.org/software/binutils/. If you have a bug report for this manual page, see http://sourceware.org/bugzilla/enter_bug.cgi?product=binutils. This page was obtained from the tarball binutils-2.41.tar.gz fetched from https://ftp.gnu.org/gnu/binutils/ 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] binutils-2.41 2023-12-22 OBJDUMP(1) Pages that refer to this page: ld(1), nm(1), objcopy(1), readelf(1), size(1), strings(1), dl_iterate_phdr(3), end(3), deb-symbols(5), elf(5), tc-bpf(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. | # objdump\n\n> View information about object files.\n> More information: <https://manned.org/objdump>.\n\n- Display the file header information:\n\n`objdump -f {{binary}}`\n\n- Display all header information:\n\n`objdump -x {{binary}}`\n\n- Display the disassembled output of executable sections:\n\n`objdump -d {{binary}}`\n\n- Display the disassembled executable sections in intel syntax:\n\n`objdump -M intel -d {{binary}}`\n\n- Display a complete binary hex dump of all sections:\n\n`objdump -s {{binary}}`\n |
od | od(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training od(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON OD(1) User Commands OD(1) NAME top od - dump files in octal and other formats SYNOPSIS top od [OPTION]... [FILE]... od [-abcdfilosx]... [FILE] [[+]OFFSET[.][b]] od --traditional [OPTION]... [FILE] [[+]OFFSET[.][b] [+][LABEL][.][b]] DESCRIPTION top Write an unambiguous representation, octal bytes by default, of FILE to standard output. With more than one FILE argument, concatenate them in the listed order to form the input. With no FILE, or when FILE is -, read standard input. If first and second call formats both apply, the second format is assumed if the last operand begins with + or (if there are 2 operands) a digit. An OFFSET operand means -j OFFSET. LABEL is the pseudo-address at first byte printed, incremented when dump is progressing. For OFFSET and LABEL, a 0x or 0X prefix indicates hexadecimal; suffixes may be . for octal and b for multiply by 512. Mandatory arguments to long options are mandatory for short options too. -A, --address-radix=RADIX output format for file offsets; RADIX is one of [doxn], for Decimal, Octal, Hex or None --endian={big|little} swap input bytes according the specified order -j, --skip-bytes=BYTES skip BYTES input bytes first -N, --read-bytes=BYTES limit dump to BYTES input bytes -S BYTES, --strings[=BYTES] show only NUL terminated strings of at least BYTES (3) printable characters -t, --format=TYPE select output format or formats -v, --output-duplicates do not use * to mark line suppression -w[BYTES], --width[=BYTES] output BYTES bytes per output line; 32 is implied when BYTES is not specified --traditional accept arguments in third form above --help display this help and exit --version output version information and exit Traditional format specifications may be intermixed; they accumulate: -a same as -t a, select named characters, ignoring high-order bit -b same as -t o1, select octal bytes -c same as -t c, select printable characters or backslash escapes -d same as -t u2, select unsigned decimal 2-byte units -f same as -t fF, select floats -i same as -t dI, select decimal ints -l same as -t dL, select decimal longs -o same as -t o2, select octal 2-byte units -s same as -t d2, select decimal 2-byte units -x same as -t x2, select hexadecimal 2-byte units TYPE is made up of one or more of these specifications: a named character, ignoring high-order bit c printable character or backslash escape d[SIZE] signed decimal, SIZE bytes per integer f[SIZE] floating point, SIZE bytes per float o[SIZE] octal, SIZE bytes per integer u[SIZE] unsigned decimal, SIZE bytes per integer x[SIZE] hexadecimal, SIZE bytes per integer SIZE is a number. For TYPE in [doux], SIZE may also be C for sizeof(char), S for sizeof(short), I for sizeof(int) or L for sizeof(long). If TYPE is f, SIZE may also be F for sizeof(float), D for sizeof(double) or L for sizeof(long double). Adding a z suffix to any type displays printable characters at the end of each output line. BYTES is hex with 0x or 0X prefix, and may have a multiplier suffix: b 512 KB 1000 K 1024 MB 1000*1000 M 1024*1024 and so on for G, T, P, E, Z, Y, R, Q. Binary prefixes can be used, too: KiB=K, MiB=M, and so on. EXAMPLES top od -A x -t x1z -v Display hexdump format output od -A o -t oS -w16 The default output format used by od 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/od> or available locally via: info '(coreutils) od 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 OD(1) Pages that refer to this page: scr_dump(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. | # od\n\n> Display file contents in octal, decimal or hexadecimal format.\n> Optionally display the byte offsets and/or printable representation for each line.\n> More information: <https://www.gnu.org/software/coreutils/od>.\n\n- Display file using default settings: octal format, 8 bytes per line, byte offsets in octal, and duplicate lines replaced with `*`:\n\n`od {{path/to/file}}`\n\n- Display file in verbose mode, i.e. without replacing duplicate lines with `*`:\n\n`od -v {{path/to/file}}`\n\n- Display file in hexadecimal format (2-byte units), with byte offsets in decimal format:\n\n`od --format={{x}} --address-radix={{d}} -v {{path/to/file}}`\n\n- Display file in hexadecimal format (1-byte units), and 4 bytes per line:\n\n`od --format={{x1}} --width={{4}} -v {{path/to/file}}`\n\n- Display file in hexadecimal format along with its character representation, and do not print byte offsets:\n\n`od --format={{xz}} --address-radix={{n}} -v {{path/to/file}}`\n\n- Read only 100 bytes of a file starting from the 500th byte:\n\n`od --read-bytes {{100}} --skip-bytes={{500}} -v {{path/to/file}}`\n |
oomctl | oomctl(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training oomctl(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COMMANDS | OPTIONS | EXIT STATUS | SEE ALSO | COLOPHON OOMCTL(1) oomctl OOMCTL(1) NAME top oomctl - Analyze the state stored in systemd-oomd SYNOPSIS top oomctl [OPTIONS...] {COMMAND} DESCRIPTION top oomctl may be used to get information about the various contexts read in by the systemd(1) userspace out-of-memory (OOM) killer, systemd-oomd(8). COMMANDS top The following commands are understood: dump Show the current state of the cgroups and system contexts stored by systemd-oomd. Added in version 247. OPTIONS top The following options are understood: -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. SEE ALSO top systemd(1), systemd-oomd.service(8), oomd.conf(5) 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 OOMCTL(1) Pages that refer to this page: oomd.conf(5), systemd.directives(7), systemd.index(7), systemd-oomd.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. | # oomctl\n\n> Analyze the state stored in `systemd-oomd`.\n> More information: <https://www.freedesktop.org/software/systemd/man/oomctl.html>.\n\n- Show the current state of the cgroups and system contexts stored by `systemd-oomd`:\n\n`oomctl dump`\n |
parted | parted(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training parted(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | COMMANDS | REPORTING BUGS | SEE ALSO | AUTHOR | COLOPHON PARTED(8) GNU Parted Manual PARTED(8) NAME top parted - a partition manipulation program SYNOPSIS top parted [options] [device [command [options...]...]] DESCRIPTION top parted is a program to manipulate disk partitions. It supports multiple partition table formats, including MS-DOS and GPT. It is useful for creating space for new operating systems, reorganising disk usage, and copying data to new hard disks. This manual page documents parted briefly. Complete documentation is distributed with the package in GNU Info format. OPTIONS top -h, --help displays a help message -l, --list lists partition layout on all block devices -m, --machine displays machine parseable output -j, --json displays JSON output -s, --script never prompts for user intervention -f, --fix automatically answer "fix" to exceptions in script mode -v, --version displays the version -a alignment-type, --align alignment-type Set alignment for newly created partitions, valid alignment types are: none Use the minimum alignment allowed by the disk type. cylinder Align partitions to cylinders. minimal Use minimum alignment as given by the disk topology information. This and the opt value will use layout information provided by the disk to align the logical partition table addresses to actual physical blocks on the disks. The min value is the minimum alignment needed to align the partition properly to physical blocks, which avoids performance degradation. optimal Use optimum alignment as given by the disk topology information. This aligns to a multiple of the physical block size in a way that guarantees optimal performance. COMMANDS top [device] The block device to be used. When none is given, parted will use the first block device it finds. [command [options]] Specifies the command to be executed. If no command is given, parted will present a command prompt. Possible commands are: help [command] Print general help, or help on command if specified. align-check type partition Check if partition satisfies the alignment constraint of type. type must be "minimal" or "optimal". mklabel label-type Create a new disklabel (partition table) of label- type. label-type should be one of "aix", "amiga", "bsd", "dvh", "gpt", "loop", "mac", "msdos", "pc98", or "sun". mkpart [part-type name fs-type] start end Create a new partition. part-type may be specified only with msdos and dvh partition tables, it should be one of "primary", "logical", or "extended". name is required for GPT partition tables and fs- type is optional. fs-type can be one of "btrfs", "ext2", "ext3", "ext4", "fat16", "fat32", "hfs", "hfs+", "linux-swap", "ntfs", "reiserfs", "udf", or "xfs". name partition name Set the name of partition to name. This option works only on Mac, PC98, and GPT disklabels. The name can be placed in double quotes, if necessary. And depending on the shell may need to also be wrapped in single quotes so that the shell doesn't strip off the double quotes. print print-type Display the partition table. print-type is optional, and can be one of devices, free, list, or all. quit Exit from parted. rescue start end Rescue a lost partition that was located somewhere between start and end. If a partition is found, parted will ask if you want to create an entry for it in the partition table. resizepart partition end Change the end position of partition. Note that this does not modify any filesystem present in the partition. rm partition Delete partition. select device Choose device as the current device to edit. device should usually be a Linux hard disk device, but it can be a partition, software raid device, or an LVM logical volume if necessary. set partition flag state Change the state of the flag on partition to state. Supported flags are: "boot", "root", "swap", "hidden", "raid", "lvm", "lba", "legacy_boot", "irst", "msftres", "esp", "chromeos_kernel", "bls_boot", "linux-home", "no_automount", "bios_grub", and "palo". state should be either "on" or "off". unit unit Set unit as the unit to use when displaying locations and sizes, and for interpreting those given by the user when not suffixed with an explicit unit. unit can be one of "s" (sectors), "B" (bytes), "kB", "MB", "KiB", "MiB", "GB", "GiB", "TB", "TiB", "%" (percentage of device size), "cyl" (cylinders), "chs" (cylinders, heads, sectors), or "compact" (megabytes for input, and a human- friendly form for output). toggle partition flag Toggle the state of flag on partition. type partition id or uuid On MS-DOS set the type aka. partition id of partition to id. The id is a value between "0x01" and "0xff". On GPT the type-uuid of partition to uuid. disk_set flag state Change a flag on the disk to state. A flag can be either "on" or "off". Some or all of these flags will be available, depending on what disk label you are using. Supported flags are: "pmbr_boot" on GPT to enable the boot flag on the GPT's protective MBR partition. disk_toggle flag Toggle the state of the disk flag. version Display version information and a copyright message. REPORTING BUGS top Report bugs to <[email protected]> SEE ALSO top fdisk(8), mkfs(8), The parted program is fully documented in the info(1) format GNU partitioning software manual. AUTHOR top This manual page was written by Timshel Knoll <[email protected]>, for the Debian GNU/Linux system (but may be used by others). COLOPHON top This page is part of the GNU parted (partition table manipulation) project. Information about the project can be found at http://www.gnu.org/software/parted/. 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.savannah.gnu.org/parted.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-19.) 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] parted 2021 September 28 PARTED(8) Pages that refer to this page: addpart(8), btrfs-filesystem(8), cfdisk(8), delpart(8), partprobe(8), partx(8), resizepart(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. | # parted\n\n> A partition manipulation program.\n> See also: `partprobe`.\n> More information: <https://www.gnu.org/software/parted/parted.html>.\n\n- List partitions on all block devices:\n\n`sudo parted --list`\n\n- Start interactive mode with the specified disk selected:\n\n`sudo parted {{/dev/sdX}}`\n\n- Create a new partition table of the specified label-type:\n\n`sudo parted --script {{/dev/sdX}} mklabel {{aix|amiga|bsd|dvh|gpt|loop|mac|msdos|pc98|sun}}`\n\n- Show partition information in interactive mode:\n\n`print`\n\n- Select a disk in interactive mode:\n\n`select {{/dev/sdX}}`\n\n- Create a 16 GB partition with the specified filesystem in interactive mode:\n\n`mkpart {{primary|logical|extended}} {{btrfs|ext2|ext3|ext4|fat16|fat32|hfs|hfs+|linux-swap|ntfs|reiserfs|udf|xfs}} {{0%}} {{16G}}`\n\n- Resize a partition in interactive mode:\n\n`resizepart {{/dev/sdXN}} {{end_position_of_partition}}`\n\n- Remove a partition in interactive mode:\n\n`rm {{/dev/sdXN}}`\n |
partprobe | partprobe(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training partprobe(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | REPORTING BUGS | SEE ALSO | AUTHOR | COLOPHON PARTPROBE(8) GNU Parted Manual PARTPROBE(8) NAME top partprobe - inform the OS of partition table changes SYNOPSIS top partprobe [-d] [-s] [devices...] DESCRIPTION top This manual page documents briefly the partprobe command. partprobe is a program that informs the operating system kernel of partition table changes. OPTIONS top This program uses short UNIX style options. -d, --dry-run Don't update the kernel. -s, --summary Show a summary of devices and their partitions. -h, --help Show summary of options. -v, --version Show version of program. REPORTING BUGS top Report bugs to <[email protected]> SEE ALSO top parted(8). AUTHOR top This manual page was written by Timshel Knoll <[email protected]>, for the Debian GNU/Linux system (but may be used by others). COLOPHON top This page is part of the GNU parted (partition table manipulation) project. Information about the project can be found at http://www.gnu.org/software/parted/. 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.savannah.gnu.org/parted.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-12-19.) 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] parted March 18, 2002 PARTPROBE(8) Pages that refer to this page: addpart(8), cfdisk(8), delpart(8), partx(8), resizepart(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. | # partprobe\n\n> Notify the operating system kernel of partition table changes.\n> More information: <https://manned.org/partprobe>.\n\n- Notify the operating system kernel of partition table changes:\n\n`sudo partprobe`\n\n- Notify the kernel of partition table changes and show a summary of devices and their partitions:\n\n`sudo partprobe --summary`\n\n- Show a summary of devices and their partitions but don't notify the kernel:\n\n`sudo partprobe --summary --dry-run`\n |
partx | partx(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training partx(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | ENVIRONMENT | EXAMPLE | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY PARTX(8) System Administration PARTX(8) NAME top partx - tell the kernel about the presence and numbering of on-disk partitions SYNOPSIS top partx [-a|-d|-P|-r|-s|-u] [-t type] [-n M:_N_] [-] disk partx [-a|-d|-P|-r|-s|-u] [-t type] partition [disk] DESCRIPTION top Given a device or disk-image, partx tries to parse the partition table and list its contents. It can also tell the kernel to add or remove partitions from its bookkeeping. The disk argument is optional when a partition argument is provided. To force scanning a partition as if it were a whole disk (for example to list nested subpartitions), use the argument "-" (hyphen-minus). For example: partx --show - /dev/sda3 This will see sda3 as a whole-disk rather than as a partition. partx is not an fdisk program - adding and removing partitions does not change the disk, it just tells the kernel about the presence and numbering of on-disk partitions. OPTIONS top -a, --add Add the specified partitions, or read the disk and add all partitions. -b, --bytes Print the sizes in bytes rather than in a human-readable format. By default, the unit, sizes are expressed in, is byte, and unit prefixes are in power of 2^10 (1024). Abbreviations of symbols are exhibited truncated in order to reach a better readability, by exhibiting alone the first letter of them; examples: "1 KiB" and "1 MiB" are respectively exhibited as "1 K" and "1 M", then omitting on purpose the mention "iB", which is part of these abbreviations. -d, --delete Delete the specified partitions or all partitions. It is not error to remove non-existing partitions, so this option is possible to use together with large --nr ranges without care about the current partitions set on the device. -g, --noheadings Do not print a header line with --show or --raw. -l, --list List the partitions. Note that all numbers are in 512-byte sectors. This output format is DEPRECATED in favour of --show. Do not use it in newly written scripts. -n, --nr M:N Specify the range of partitions. For backward compatibility also the format M-N is supported. The range may contain negative numbers, for example --nr -1:-1 means the last partition, and --nr -2:-1 means the last two partitions. Supported range specifications are: M Specifies just one partition (e.g. --nr 3). M: Specifies the lower limit only (e.g. --nr 2:). :N Specifies the upper limit only (e.g. --nr :4). M:N Specifies the lower and upper limits (e.g. --nr 2:4). -o, --output list Define the output columns to use for --show, --pairs and --raw output. If no output arrangement is specified, then a default set is used. Use --help to get list of all supported columns. This option cannot be combined with the --add, --delete, --update or --list options. --output-all Output all available columns. -P, --pairs List the partitions using the KEY="value" format. -r, --raw List the partitions using the raw output format. -s, --show List the partitions. The output columns can be selected and rearranged with the --output option. All numbers (except SIZE) are in 512-byte sectors. -t, --type type Specify the partition table type. --list-types List supported partition types and exit. -u, --update Update the specified partitions. -S, --sector-size size Overwrite default sector size. -v, --verbose Verbose mode. -h, --help Display help text and exit. -V, --version Print version and exit. ENVIRONMENT top LIBBLKID_DEBUG=all enables libblkid debug output. EXAMPLE top partx --show /dev/sdb3, partx --show --nr 3 /dev/sdb, partx --show /dev/sdb3 /dev/sdb All three commands list partition 3 of /dev/sdb. partx --show - /dev/sdb3 Lists all subpartitions on /dev/sdb3 (the device is used as whole-disk). partx -o START -g --nr 5 /dev/sdb Prints the start sector of partition 5 on /dev/sdb without header. partx -o SECTORS,SIZE /dev/sda5 /dev/sda Lists the length in sectors and human-readable size of partition 5 on /dev/sda. partx --add --nr 3:5 /dev/sdd Adds all available partitions from 3 to 5 (inclusive) on /dev/sdd. partx -d --nr :-1 /dev/sdd Removes the last partition on /dev/sdd. AUTHORS top Davidlohr Bueso <[email protected]>, Karel Zak <[email protected]> The original version was written by Andries E. Brouwer <[email protected]> SEE ALSO top addpart(8), delpart(8), fdisk(8), parted(8), partprobe(8) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The partx 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 PARTX(8) Pages that refer to this page: addpart(8), cfdisk(8), delpart(8), fdisk(8), findfs(8), resizepart(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. | # partx\n\n> Parse a partition table and tell the kernel about it.\n> More information: <https://man7.org/linux/man-pages/man8/partx.8.html>.\n\n- List the partitions on a block device or disk image:\n\n`sudo partx --list {{path/to/device_or_disk_image}}`\n\n- Add all the partitions found in a given block device to the kernel:\n\n`sudo partx --add --verbose {{path/to/device_or_disk_image}}`\n\n- Delete all the partitions found from the kernel (does not alter partitions on disk):\n\n`sudo partx --delete {{path/to/device_or_disk_image}}`\n |
passwd | passwd(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training passwd(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | CAVEATS | FILES | EXIT VALUES | SEE ALSO | COLOPHON PASSWD(1) User Commands PASSWD(1) NAME top passwd - change user password SYNOPSIS top passwd [options] [LOGIN] DESCRIPTION top The passwd command changes passwords for user accounts. A normal user may only change the password for their own account, while the superuser may change the password for any account. passwd also changes the account or associated password validity period. Password Changes The user is first prompted for their old password, if one is present. This password is then encrypted and compared against the stored password. The user has only one chance to enter the correct password. The superuser is permitted to bypass this step so that forgotten passwords may be changed. After the password has been entered, password aging information is checked to see if the user is permitted to change the password at this time. If not, passwd refuses to change the password and exits. The user is then prompted twice for a replacement password. The second entry is compared against the first and both are required to match in order for the password to be changed. Then, the password is tested for complexity. passwd will reject any password which is not suitably complex. Care must be taken not to include the system default erase or kill characters. Hints for user passwords The security of a password depends upon the strength of the encryption algorithm and the size of the key space. The legacy UNIX System encryption method is based on the NBS DES algorithm. More recent methods are now recommended (see ENCRYPT_METHOD). The size of the key space depends upon the randomness of the password which is selected. Compromises in password security normally result from careless password selection or handling. For this reason, you should not select a password which appears in a dictionary or which must be written down. The password should also not be a proper name, your license number, birth date, or street address. Any of these may be used as guesses to violate system security. As a general guideline, passwords should be long and random. It's fine to use simple character sets, such as passwords consisting only of lowercase letters, if that helps memorizing longer passwords. For a password consisting only of lowercase English letters randomly chosen, and a length of 32, there are 26^32 (approximately 2^150) different possible combinations. Being an exponential equation, it's apparent that the exponent (the length) is more important than the base (the size of the character set). You can find advice on how to choose a strong password on http://en.wikipedia.org/wiki/Password_strength OPTIONS top The options which apply to the passwd command are: -a, --all This option can be used only with -S and causes show status for all users. -d, --delete Delete a user's password (make it empty). This is a quick way to disable a password for an account. It will set the named account passwordless. -e, --expire Immediately expire an account's password. This in effect can force a user to change their password at the user's next login. -h, --help Display help message and exit. -i, --inactive INACTIVE This option is used to disable an account after the password has been expired for a number of days. After a user account has had an expired password for INACTIVE days, the user may no longer sign on to the account. -k, --keep-tokens Indicate password change should be performed only for expired authentication tokens (passwords). The user wishes to keep their non-expired tokens as before. -l, --lock Lock the password of the named account. This option disables a password by changing it to a value which matches no possible encrypted value (it adds a ! at the beginning of the password). Note that this does not disable the account. The user may still be able to login using another authentication token (e.g. an SSH key). To disable the account, administrators should use usermod --expiredate 1 (this set the account's expire date to Jan 2, 1970). Users with a locked password are not allowed to change their password. -n, --mindays MIN_DAYS Set the minimum number of days between password changes to MIN_DAYS. A value of zero for this field indicates that the user may change their password at any time. -q, --quiet Quiet mode. -r, --repository REPOSITORY change password in REPOSITORY repository -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, --status Display account status information. The status information consists of 7 fields. The first field is the user's login name. The second field indicates if the user account has a locked password (L), has no password (NP), or has a usable password (P). The third field gives the date of the last password change. The next four fields are the minimum age, maximum age, warning period, and inactivity period for the password. These ages are expressed in days. -u, --unlock Unlock the password of the named account. This option re-enables a password by changing the password back to its previous value (to the value before using the -l option). -w, --warndays WARN_DAYS Set the number of days of warning before a password change is required. The WARN_DAYS option is the number of days prior to the password expiring that a user will be warned that their password is about to expire. -x, --maxdays MAX_DAYS Set the maximum number of days a password remains valid. After MAX_DAYS, the password is required to be changed. Passing the number -1 as MAX_DAYS will remove checking a password's validity. CAVEATS top Password complexity checking may vary from site to site. The user is urged to select a password as complex as he or she feels comfortable with. Users may not be able to change their password on a system if NIS is enabled and they are not logged into the NIS server. passwd uses PAM to authenticate users and to change their passwords. FILES top /etc/passwd User account information. /etc/shadow Secure user account information. /etc/pam.d/passwd PAM configuration for passwd. EXIT VALUES top The passwd command exits with the following values: 0 success 1 permission denied 2 invalid combination of options 3 unexpected failure, nothing done 4 unexpected failure, passwd file missing 5 passwd file busy, try again 6 invalid argument to option SEE ALSO top chpasswd(8), makepasswd(1), passwd(5), shadow(5), usermod(8). The following web page comically (yet correctly) compares the strength of two different methods for choosing a password: "https://xkcd.com/936/" 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 PASSWD(1) Pages that refer to this page: ldappasswd(1), login(1), login(1@@shadow-utils), crypt(3), pts(4), login.defs(5), passwd(5), passwd(5@@shadow-utils), shadow(5), chpasswd(8), groupadd(8), groupdel(8), groupmems(8), groupmod(8), newusers(8), useradd(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. | # passwd\n\n> Change a user's password.\n> More information: <https://manned.org/passwd>.\n\n- Change the password of the current user interactively:\n\n`passwd`\n\n- Change the password of a specific user:\n\n`passwd {{username}}`\n\n- Get the current status of the user:\n\n`passwd -S`\n\n- Make the password of the account blank (it will set the named account passwordless):\n\n`passwd -d`\n |
paste | paste(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training paste(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON PASTE(1) User Commands PASTE(1) NAME top paste - merge lines of files SYNOPSIS top paste [OPTION]... [FILE]... DESCRIPTION top Write lines consisting of the sequentially corresponding lines from each FILE, separated by TABs, to standard output. With no FILE, or when FILE is -, read standard input. Mandatory arguments to long options are mandatory for short options too. -d, --delimiters=LIST reuse characters from LIST instead of TABs -s, --serial paste one file at a time instead of in parallel -z, --zero-terminated line delimiter is NUL, not newline --help display this help and exit --version output version information and exit AUTHOR top Written by David M. Ihnat 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/paste> or available locally via: info '(coreutils) paste 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 PASTE(1) Pages that refer to this page: colrm(1), column(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. | # paste\n\n> Merge lines of files.\n> More information: <https://www.gnu.org/software/coreutils/paste>.\n\n- Join all the lines into a single line, using TAB as delimiter:\n\n`paste -s {{path/to/file}}`\n\n- Join all the lines into a single line, using the specified delimiter:\n\n`paste -s -d {{delimiter}} {{path/to/file}}`\n\n- Merge two files side by side, each in its column, using TAB as delimiter:\n\n`paste {{file1}} {{file2}}`\n\n- Merge two files side by side, each in its column, using the specified delimiter:\n\n`paste -d {{delimiter}} {{file1}} {{file2}}`\n\n- Merge two files, with lines added alternatively:\n\n`paste -d '\n' {{file1}} {{file2}}`\n |
patch | patch(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training patch(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | ENVIRONMENT | FILES | SEE ALSO | NOTES FOR PATCH SENDERS | DIAGNOSTICS | CAVEATS | COMPATIBILITY ISSUES | BUGS | COPYING | AUTHORS | COLOPHON PATCH(1) General Commands Manual PATCH(1) NAME top patch - apply a diff file to an original SYNOPSIS top patch [options] [originalfile [patchfile]] but usually just patch -pnum <patchfile DESCRIPTION top patch takes a patch file patchfile containing a difference listing produced by the diff program and applies those differences to one or more original files, producing patched versions. Normally the patched versions are put in place of the originals. Backups can be made; see the -b or --backup option. The names of the files to be patched are usually taken from the patch file, but if there's just one file to be patched it can be specified on the command line as originalfile. Upon startup, patch attempts to determine the type of the diff listing, unless overruled by a -c (--context), -e (--ed), -n (--normal), or -u (--unified) option. Context diffs (old-style, new-style, and unified) and normal diffs are applied by the patch program itself, while ed diffs are simply fed to the ed(1) editor via a pipe. patch tries to skip any leading garbage, apply the diff, and then skip any trailing garbage. Thus you could feed an article or message containing a diff listing to patch, and it should work. If the entire diff is indented by a consistent amount, if lines end in CRLF, or if a diff is encapsulated one or more times by prepending "- " to lines starting with "-" as specified by Internet RFC 934, this is taken into account. After removing indenting or encapsulation, lines beginning with # are ignored, as they are considered to be comments. With context diffs, and to a lesser extent with normal diffs, patch can detect when the line numbers mentioned in the patch are incorrect, and attempts to find the correct place to apply each hunk of the patch. As a first guess, it takes the line number mentioned for the hunk, plus or minus any offset used in applying the previous hunk. If that is not the correct place, patch scans both forwards and backwards for a set of lines matching the context given in the hunk. First patch looks for a place where all lines of the context match. If no such place is found, and it's a context diff, and the maximum fuzz factor is set to 1 or more, then another scan takes place ignoring the first and last line of context. If that fails, and the maximum fuzz factor is set to 2 or more, the first two and last two lines of context are ignored, and another scan is made. (The default maximum fuzz factor is 2.) Hunks with less prefix context than suffix context (after applying fuzz) must apply at the start of the file if their first line number is 1. Hunks with more prefix context than suffix context (after applying fuzz) must apply at the end of the file. If patch cannot find a place to install that hunk of the patch, it puts the hunk out to a reject file, which normally is the name of the output file plus a .rej suffix, or # if .rej would generate a file name that is too long (if even appending the single character # makes the file name too long, then # replaces the file name's last character). The rejected hunk comes out in unified or context diff format. If the input was a normal diff, many of the contexts are simply null. The line numbers on the hunks in the reject file may be different than in the patch file: they reflect the approximate location patch thinks the failed hunks belong in the new file rather than the old one. As each hunk is completed, you are told if the hunk failed, and if so which line (in the new file) patch thought the hunk should go on. If the hunk is installed at a different line from the line number specified in the diff, you are told the offset. A single large offset may indicate that a hunk was installed in the wrong place. You are also told if a fuzz factor was used to make the match, in which case you should also be slightly suspicious. If the --verbose option is given, you are also told about hunks that match exactly. If no original file origfile is specified on the command line, patch tries to figure out from the leading garbage what the name of the file to edit is, using the following rules. First, patch takes an ordered list of candidate file names as follows: If the header is that of a context diff, patch takes the old and new file names in the header. A name is ignored if it does not have enough slashes to satisfy the -pnum or --strip=num option. The name /dev/null is also ignored. If there is an Index: line in the leading garbage and if either the old and new names are both absent or if patch is conforming to POSIX, patch takes the name in the Index: line. For the purpose of the following rules, the candidate file names are considered to be in the order (old, new, index), regardless of the order that they appear in the header. Then patch selects a file name from the candidate list as follows: If some of the named files exist, patch selects the first name if conforming to POSIX, and the best name otherwise. If patch is not ignoring RCS, ClearCase, Perforce, and SCCS (see the -g num or --get=num option), and no named files exist but an RCS, ClearCase, Perforce, or SCCS master is found, patch selects the first named file with an RCS, ClearCase, Perforce, or SCCS master. If no named files exist, no RCS, ClearCase, Perforce, or SCCS master was found, some names are given, patch is not conforming to POSIX, and the patch appears to create a file, patch selects the best name requiring the creation of the fewest directories. If no file name results from the above heuristics, you are asked for the name of the file to patch, and patch selects that name. To determine the best of a nonempty list of file names, patch first takes all the names with the fewest path name components; of those, it then takes all the names with the shortest basename; of those, it then takes all the shortest names; finally, it takes the first remaining name. Additionally, if the leading garbage contains a Prereq: line, patch takes the first word from the prerequisites line (normally a version number) and checks the original file to see if that word can be found. If not, patch asks for confirmation before proceeding. The upshot of all this is that you should be able to say, while in a news interface, something like the following: | patch -d /usr/src/local/blurfl and patch a file in the blurfl directory directly from the article containing the patch. If the patch file contains more than one patch, patch tries to apply each of them as if they came from separate patch files. This means, among other things, that it is assumed that the name of the file to patch must be determined for each diff listing, and that the garbage before each diff listing contains interesting things such as file names and revision level, as mentioned previously. OPTIONS top -b or --backup Make backup files. That is, when patching a file, rename or copy the original instead of removing it. When backing up a file that does not exist, an empty, unreadable backup file is created as a placeholder to represent the nonexistent file. See the -V or --version-control option for details about how backup file names are determined. --backup-if-mismatch Back up a file if the patch does not match the file exactly and if backups are not otherwise requested. This is the default unless patch is conforming to POSIX. --no-backup-if-mismatch Do not back up a file if the patch does not match the file exactly and if backups are not otherwise requested. This is the default if patch is conforming to POSIX. -B pref or --prefix=pref Use the simple method to determine backup file names (see the -V method or --version-control method option), and append pref to a file name when generating its backup file name. For example, with -B /junk/ the simple backup file name for src/patch/util.c is /junk/src/patch/util.c. --binary Write all files in binary mode, except for standard output and /dev/tty. When reading, disable the heuristic for transforming CRLF line endings into LF line endings. This option is needed on POSIX systems when applying patches generated on non-POSIX systems to non-POSIX files. (On POSIX systems, file reads and writes never transform line endings. On Windows, reads and writes do transform line endings by default, and patches should be generated by diff --binary when line endings are significant.) -c or --context Interpret the patch file as a ordinary context diff. -d dir or --directory=dir Change to the directory dir immediately, before doing anything else. -D define or --ifdef=define Use the #ifdef ... #endif construct to mark changes, with define as the differentiating symbol. --dry-run Print the results of applying the patches without actually changing any files. -e or --ed Interpret the patch file as an ed script. -E or --remove-empty-files Remove output files that are empty after the patches have been applied. Normally this option is unnecessary, since patch can examine the time stamps on the header to determine whether a file should exist after patching. However, if the input is not a context diff or if patch is conforming to POSIX, patch does not remove empty patched files unless this option is given. When patch removes a file, it also attempts to remove any empty ancestor directories. -f or --force Assume that the user knows exactly what he or she is doing, and do not ask any questions. Skip patches whose headers do not say which file is to be patched; patch files even though they have the wrong version for the Prereq: line in the patch; and assume that patches are not reversed even if they look like they are. This option does not suppress commentary; use -s for that. -F num or --fuzz=num Set the maximum fuzz factor. This option only applies to diffs that have context, and causes patch to ignore up to that many lines of context in looking for places to install a hunk. Note that a larger fuzz factor increases the odds of a faulty patch. The default fuzz factor is 2. A fuzz factor greater than or equal to the number of lines of context in the context diff, ordinarily 3, ignores all context. -g num or --get=num This option controls patch's actions when a file is under RCS or SCCS control, and does not exist or is read-only and matches the default version, or when a file is under ClearCase or Perforce control and does not exist. If num is positive, patch gets (or checks out) the file from the revision control system; if zero, patch ignores RCS, ClearCase, Perforce, and SCCS and does not get the file; and if negative, patch asks the user whether to get the file. The default value of this option is given by the value of the PATCH_GET environment variable if it is set; if not, the default value is zero. --help Print a summary of options and exit. -i patchfile or --input=patchfile Read the patch from patchfile. If patchfile is -, read from standard input, the default. -l or --ignore-whitespace Match patterns loosely, in case tabs or spaces have been munged in your files. Any sequence of one or more blanks in the patch file matches any sequence in the original file, and sequences of blanks at the ends of lines are ignored. Normal characters must still match exactly. Each line of the context must still match a line in the original file. --merge or --merge=merge or --merge=diff3 Merge a patch file into the original files similar to diff3(1) or merge(1). If a conflict is found, patch outputs a warning and brackets the conflict with <<<<<<< and >>>>>>> lines. A typical conflict will look like this: <<<<<<< lines from the original file ||||||| original lines from the patch ======= new lines from the patch >>>>>>> The optional argument of --merge determines the output format for conflicts: the diff3 format shows the ||||||| section with the original lines from the patch; in the merge format, this section is missing. The merge format is the default. This option implies --forward and does not take the --fuzz=num option into account. -n or --normal Interpret the patch file as a normal diff. -N or --forward When a patch does not apply, patch usually checks if the patch looks like it has been applied already by trying to reverse- apply the first hunk. The --forward option prevents that. See also -R. -o outfile or --output=outfile Send output to outfile instead of patching files in place. Do not use this option if outfile is one of the files to be patched. When outfile is -, send output to standard output, and send any messages that would usually go to standard output to standard error. -pnum or --strip=num Strip the smallest prefix containing num leading slashes from each file name found in the patch file. A sequence of one or more adjacent slashes is counted as a single slash. This controls how file names found in the patch file are treated, in case you keep your files in a different directory than the person who sent out the patch. For example, supposing the file name in the patch file was /u/howard/src/blurfl/blurfl.c setting -p0 gives the entire file name unmodified, -p1 gives u/howard/src/blurfl/blurfl.c without the leading slash, -p4 gives blurfl/blurfl.c and not specifying -p at all just gives you blurfl.c. Whatever you end up with is looked for either in the current directory, or the directory specified by the -d option. --posix Conform more strictly to the POSIX standard, as follows. Take the first existing file from the list (old, new, index) when intuiting file names from diff headers. Do not remove files that are empty after patching. Do not ask whether to get files from RCS, ClearCase, Perforce, or SCCS. Require that all options precede the files in the command line. Do not backup files when there is a mismatch. --quoting-style=word Use style word to quote output names. The word should be one of the following: literal Output names as-is. shell Quote names for the shell if they contain shell metacharacters or would cause ambiguous output. shell-always Quote names for the shell, even if they would normally not require quoting. c Quote names as for a C language string. escape Quote as with c except omit the surrounding double- quote characters. You can specify the default value of the --quoting-style option with the environment variable QUOTING_STYLE. If that environment variable is not set, the default value is shell. -r rejectfile or --reject-file=rejectfile Put rejects into rejectfile instead of the default .rej file. When rejectfile is -, discard rejects. -R or --reverse Assume that this patch was created with the old and new files swapped. (Yes, I'm afraid that does happen occasionally, human nature being what it is.) patch attempts to swap each hunk around before applying it. Rejects come out in the swapped format. The -R option does not work with ed diff scripts because there is too little information to reconstruct the reverse operation. If the first hunk of a patch fails, patch reverses the hunk to see if it can be applied that way. If it can, you are asked if you want to have the -R option set. If it can't, the patch continues to be applied normally. (Note: this method cannot detect a reversed patch if it is a normal diff and if the first command is an append (i.e. it should have been a delete) since appends always succeed, due to the fact that a null context matches anywhere. Luckily, most patches add or change lines rather than delete them, so most reversed normal diffs begin with a delete, which fails, triggering the heuristic.) --read-only=behavior Behave as requested when trying to modify a read-only file: ignore the potential problem, warn about it (the default), or fail. --reject-format=format Produce reject files in the specified format (either context or unified). Without this option, rejected hunks come out in unified diff format if the input patch was of that format, otherwise in ordinary context diff form. -s or --silent or --quiet Work silently, unless an error occurs. --follow-symlinks When looking for input files, follow symbolic links. Replaces the symbolic links, instead of modifying the files the symbolic links point to. Git-style patches to symbolic links will no longer apply. This option exists for backwards compatibility with previous versions of patch; its use is discouraged. -t or --batch Suppress questions like -f, but make some different assumptions: skip patches whose headers do not contain file names (the same as -f); skip patches for which the file has the wrong version for the Prereq: line in the patch; and assume that patches are reversed if they look like they are. -T or --set-time Set the modification and access times of patched files from time stamps given in context diff headers. Unless specified in the time stamps, assume that the context diff headers use local time. Use of this option with time stamps that do not include time zones is not recommended, because patches using local time cannot easily be used by people in other time zones, and because local time stamps are ambiguous when local clocks move backwards during daylight-saving time adjustments. Make sure that time stamps include time zones, or generate patches with UTC and use the -Z or --set-utc option instead. -u or --unified Interpret the patch file as a unified context diff. -v or --version Print out patch's revision header and patch level, and exit. -V method or --version-control=method Use method to determine backup file names. The method can also be given by the PATCH_VERSION_CONTROL (or, if that's not set, the VERSION_CONTROL) environment variable, which is overridden by this option. The method does not affect whether backup files are made; it affects only the names of any backup files that are made. The value of method is like the GNU Emacs `version-control' variable; patch also recognizes synonyms that are more descriptive. The valid values for method are (unique abbreviations are accepted): existing or nil Make numbered backups of files that already have them, otherwise simple backups. This is the default. numbered or t Make numbered backups. The numbered backup file name for F is F.~N~ where N is the version number. simple or never Make simple backups. The -B or --prefix, -Y or --basename-prefix, and -z or --suffix options specify the simple backup file name. If none of these options are given, then a simple backup suffix is used; it is the value of the SIMPLE_BACKUP_SUFFIX environment variable if set, and is .orig otherwise. With numbered or simple backups, if the backup file name is too long, the backup suffix ~ is used instead; if even appending ~ would make the name too long, then ~ replaces the last character of the file name. --verbose Output extra information about the work being done. -x num or --debug=num Set internal debugging flags of interest only to patch patchers. -Y pref or --basename-prefix=pref Use the simple method to determine backup file names (see the -V method or --version-control method option), and prefix pref to the basename of a file name when generating its backup file name. For example, with -Y .del/ the simple backup file name for src/patch/util.c is src/patch/.del/util.c. -z suffix or --suffix=suffix Use the simple method to determine backup file names (see the -V method or --version-control method option), and use suffix as the suffix. For example, with -z - the backup file name for src/patch/util.c is src/patch/util.c-. -Z or --set-utc Set the modification and access times of patched files from time stamps given in context diff headers. Unless specified in the time stamps, assume that the context diff headers use Coordinated Universal Time (UTC, often known as GMT). Also see the -T or --set-time option. The -Z or --set-utc and -T or --set-time options normally refrain from setting a file's time if the file's original time does not match the time given in the patch header, or if its contents do not match the patch exactly. However, if the -f or --force option is given, the file time is set regardless. Due to the limitations of diff output format, these options cannot update the times of files whose contents have not changed. Also, if you use these options, you should remove (e.g. with make clean) all files that depend on the patched files, so that later invocations of make do not get confused by the patched files' times. ENVIRONMENT top PATCH_GET This specifies whether patch gets missing or read-only files from RCS, ClearCase, Perforce, or SCCS by default; see the -g or --get option. POSIXLY_CORRECT If set, patch conforms more strictly to the POSIX standard by default: see the --posix option. QUOTING_STYLE Default value of the --quoting-style option. SIMPLE_BACKUP_SUFFIX Extension to use for simple backup file names instead of .orig. TMPDIR, TMP, TEMP Directory to put temporary files in; patch uses the first environment variable in this list that is set. If none are set, the default is system-dependent; it is normally /tmp on Unix hosts. VERSION_CONTROL or PATCH_VERSION_CONTROL Selects version control style; see the -v or --version-control option. FILES top $TMPDIR/p* temporary files /dev/tty controlling terminal; used to get answers to questions asked of the user SEE ALSO top diff(1), ed(1), merge(1). Marshall T. Rose and Einar A. Stefferud, Proposed Standard for Message Encapsulation, Internet RFC 934 <URL:ftp://ftp.isi.edu/in-notes/rfc934.txt> (1985-01). NOTES FOR PATCH SENDERS top There are several things you should bear in mind if you are going to be sending out patches. Create your patch systematically. A good method is the command diff -Naur old new where old and new identify the old and new directories. The names old and new should not contain any slashes. The diff command's headers should have dates and times in Universal Time using traditional Unix format, so that patch recipients can use the -Z or --set-utc option. Here is an example command, using Bourne shell syntax: LC_ALL=C TZ=UTC0 diff -Naur gcc-2.7 gcc-2.8 Tell your recipients how to apply the patch by telling them which directory to cd to, and which patch options to use. The option string -Np1 is recommended. Test your procedure by pretending to be a recipient and applying your patch to a copy of the original files. You can save people a lot of grief by keeping a patchlevel.h file which is patched to increment the patch level as the first diff in the patch file you send out. If you put a Prereq: line in with the patch, it won't let them apply patches out of order without some warning. You can create a file by sending out a diff that compares /dev/null or an empty file dated the Epoch (1970-01-01 00:00:00 UTC) to the file you want to create. This only works if the file you want to create doesn't exist already in the target directory. Conversely, you can remove a file by sending out a context diff that compares the file to be deleted with an empty file dated the Epoch. The file will be removed unless patch is conforming to POSIX and the -E or --remove-empty-files option is not given. An easy way to generate patches that create and remove files is to use GNU diff's -N or --new-file option. If the recipient is supposed to use the -pN option, do not send output that looks like this: diff -Naur v2.0.29/prog/README prog/README --- v2.0.29/prog/README Mon Mar 10 15:13:12 1997 +++ prog/README Mon Mar 17 14:58:22 1997 because the two file names have different numbers of slashes, and different versions of patch interpret the file names differently. To avoid confusion, send output that looks like this instead: diff -Naur v2.0.29/prog/README v2.0.30/prog/README --- v2.0.29/prog/README Mon Mar 10 15:13:12 1997 +++ v2.0.30/prog/README Mon Mar 17 14:58:22 1997 Avoid sending patches that compare backup file names like README.orig, since this might confuse patch into patching a backup file instead of the real file. Instead, send patches that compare the same base file names in different directories, e.g. old/README and new/README. Take care not to send out reversed patches, since it makes people wonder whether they already applied the patch. Try not to have your patch modify derived files (e.g. the file configure where there is a line configure: configure.in in your makefile), since the recipient should be able to regenerate the derived files anyway. If you must send diffs of derived files, generate the diffs using UTC, have the recipients apply the patch with the -Z or --set-utc option, and have them remove any unpatched files that depend on patched files (e.g. with make clean). While you may be able to get away with putting 582 diff listings into one file, it may be wiser to group related patches into separate files in case something goes haywire. DIAGNOSTICS top Diagnostics generally indicate that patch couldn't parse your patch file. If the --verbose option is given, the message Hmm... indicates that there is unprocessed text in the patch file and that patch is attempting to intuit whether there is a patch in that text and, if so, what kind of patch it is. patch's exit status is 0 if all hunks are applied successfully, 1 if some hunks cannot be applied or there were merge conflicts, and 2 if there is more serious trouble. When applying a set of patches in a loop it behooves you to check this exit status so you don't apply a later patch to a partially patched file. CAVEATS top Context diffs cannot reliably represent the creation or deletion of empty files, empty directories, or special files such as symbolic links. Nor can they represent changes to file metadata like ownership, permissions, or whether one file is a hard link to another. If changes like these are also required, separate instructions (e.g. a shell script) to accomplish them should accompany the patch. patch cannot tell if the line numbers are off in an ed script, and can detect bad line numbers in a normal diff only when it finds a change or deletion. A context diff using fuzz factor 3 may have the same problem. You should probably do a context diff in these cases to see if the changes made sense. Of course, compiling without errors is a pretty good indication that the patch worked, but not always. patch usually produces the correct results, even when it has to do a lot of guessing. However, the results are guaranteed to be correct only when the patch is applied to exactly the same version of the file that the patch was generated from. COMPATIBILITY ISSUES top The POSIX standard specifies behavior that differs from patch's traditional behavior. You should be aware of these differences if you must interoperate with patch versions 2.1 and earlier, which do not conform to POSIX. In traditional patch, the -p option's operand was optional, and a bare -p was equivalent to -p0. The -p option now requires an operand, and -p 0 is now equivalent to -p0. For maximum compatibility, use options like -p0 and -p1. Also, traditional patch simply counted slashes when stripping path prefixes; patch now counts pathname components. That is, a sequence of one or more adjacent slashes now counts as a single slash. For maximum portability, avoid sending patches containing // in file names. In traditional patch, backups were enabled by default. This behavior is now enabled with the -b or --backup option. Conversely, in POSIX patch, backups are never made, even when there is a mismatch. In GNU patch, this behavior is enabled with the --no-backup-if-mismatch option, or by conforming to POSIX with the --posix option or by setting the POSIXLY_CORRECT environment variable. The -b suffix option of traditional patch is equivalent to the -b -z suffix options of GNU patch. Traditional patch used a complicated (and incompletely documented) method to intuit the name of the file to be patched from the patch header. This method did not conform to POSIX, and had a few gotchas. Now patch uses a different, equally complicated (but better documented) method that is optionally POSIX-conforming; we hope it has fewer gotchas. The two methods are compatible if the file names in the context diff header and the Index: line are all identical after prefix-stripping. Your patch is normally compatible if each header's file names all contain the same number of slashes. When traditional patch asked the user a question, it sent the question to standard error and looked for an answer from the first file in the following list that was a terminal: standard error, standard output, /dev/tty, and standard input. Now patch sends questions to standard output and gets answers from /dev/tty. Defaults for some answers have been changed so that patch never goes into an infinite loop when using default answers. Traditional patch exited with a status value that counted the number of bad hunks, or with status 1 if there was real trouble. Now patch exits with status 1 if some hunks failed, or with 2 if there was real trouble. Limit yourself to the following options when sending instructions meant to be executed by anyone running GNU patch, traditional patch, or a patch that conforms to POSIX. Spaces are significant in the following list, and operands are required. -c -d dir -D define -e -l -n -N -o outfile -pnum -R -r rejectfile BUGS top Please report bugs via email to <[email protected]>. If code has been duplicated (for instance with #ifdef OLDCODE ... #else ... #endif), patch is incapable of patching both versions, and, if it works at all, will likely patch the wrong one, and tell you that it succeeded to boot. If you apply a patch you've already applied, patch thinks it is a reversed patch, and offers to un-apply the patch. This could be construed as a feature. Computing how to merge a hunk is significantly harder than using the standard fuzzy algorithm. Bigger hunks, more context, a bigger offset from the original location, and a worse match all slow the algorithm down. COPYING top Copyright (C) 1984, 1985, 1986, 1988 Larry Wall. Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2009 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be included in translations approved by the copyright holders instead of in the original English. AUTHORS top Larry Wall wrote the original version of patch. Paul Eggert removed patch's arbitrary limits; added support for binary files, setting file times, and deleting files; and made it conform better to POSIX. Other contributors include Wayne Davison, who added unidiff support, and David MacKenzie, who added configuration and backup support. Andreas Grnbacher added support for merging. COLOPHON top This page is part of the patch (GNU patch) project. Information about the project can be found at http://savannah.gnu.org/projects/patch/. If you have a bug report for this manual page, see http://savannah.gnu.org/bugs/?group=patch. This page was obtained from the project's upstream Git repository git://git.savannah.gnu.org/patch.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2022-05-10.) 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 PATCH(1) Pages that refer to this page: diff(1), dpkg-source(1), gendiff(1), quilt(1), suffixes(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. | # patch\n\n> Patch a file (or files) with a diff file.\n> Note that diff files should be generated by the `diff` command.\n> More information: <https://manned.org/patch>.\n\n- Apply a patch using a diff file (filenames must be included in the diff file):\n\n`patch < {{patch.diff}}`\n\n- Apply a patch to a specific file:\n\n`patch {{path/to/file}} < {{patch.diff}}`\n\n- Patch a file writing the result to a different file:\n\n`patch {{path/to/input_file}} -o {{path/to/output_file}} < {{patch.diff}}`\n\n- Apply a patch to the current directory:\n\n`patch -p1 < {{patch.diff}}`\n\n- Apply the reverse of a patch:\n\n`patch -R < {{patch.diff}}`\n |
pathchk | pathchk(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pathchk(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON PATHCHK(1) User Commands PATHCHK(1) NAME top pathchk - check whether file names are valid or portable SYNOPSIS top pathchk [OPTION]... NAME... DESCRIPTION top Diagnose invalid or non-portable file names. -p check for most POSIX systems -P check for empty names and leading "-" --portability check for all POSIX systems (equivalent to -p -P) --help display this help and exit --version output version information and exit AUTHOR top Written by Paul Eggert, David MacKenzie, and 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/pathchk> or available locally via: info '(coreutils) pathchk 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 PATHCHK(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. | # pathchk\n\n> Check the validity and portability of pathnames.\n> More information: <https://www.gnu.org/software/coreutils/pathchk>.\n\n- Check pathnames for validity in the current system:\n\n`pathchk {{path1 path2 }}`\n\n- Check pathnames for validity on a wider range of POSIX compliant systems:\n\n`pathchk -p {{path1 path2 }}`\n\n- Check pathnames for validity on all POSIX compliant systems:\n\n`pathchk --portability {{path1 path2 }}`\n\n- Only check for empty pathnames or leading dashes (-):\n\n`pathchk -P {{path1 path2 }}`\n |
pax | pax(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pax(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 PAX(1P) POSIX Programmer's Manual PAX(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 pax portable archive interchange SYNOPSIS top pax [-dv] [-c|-n] [-H|-L] [-o options] [-f archive] [-s replstr]... [pattern...] pax -r[-c|-n] [-dikuv] [-H|-L] [-f archive] [-o options]... [-p string]... [-s replstr]... [pattern...] pax -w [-dituvX] [-H|-L] [-b blocksize] [[-a] [-f archive]] [-o options]... [-s replstr]... [-x format] [file...] pax -r -w [-diklntuvX] [-H|-L] [-o options]... [-p string]... [-s replstr]... [file...] directory DESCRIPTION top The pax utility shall read, write, and write lists of the members of archive files and copy directory hierarchies. A variety of archive formats shall be supported; see the -x format option. The action to be taken depends on the presence of the -r and -w options. The four combinations of -r and -w are referred to as the four modes of operation: list, read, write, and copy modes, corresponding respectively to the four forms shown in the SYNOPSIS section. list In list mode (when neither -r nor -w are specified), pax shall write the names of the members of the archive file read from the standard input, with pathnames matching the specified patterns, to standard output. If a named file is of type directory, the file hierarchy rooted at that file shall be listed as well. read In read mode (when -r is specified, but -w is not), pax shall extract the members of the archive file read from the standard input, with pathnames matching the specified patterns. If an extracted file is of type directory, the file hierarchy rooted at that file shall be extracted as well. The extracted files shall be created performing pathname resolution with the directory in which pax was invoked as the current working directory. If an attempt is made to extract a directory when the directory already exists, this shall not be considered an error. If an attempt is made to extract a FIFO when the FIFO already exists, this shall not be considered an error. The ownership, access, and modification times, and file mode of the restored files are discussed under the -p option. write In write mode (when -w is specified, but -r is not), pax shall write the contents of the file operands to the standard output in an archive format. If no file operands are specified, a list of files to copy, one per line, shall be read from the standard input and each entry in this list shall be processed as if it had been a file operand on the command line. A file of type directory shall include all of the files in the file hierarchy rooted at the file. copy In copy mode (when both -r and -w are specified), pax shall copy the file operands to the destination directory. If no file operands are specified, a list of files to copy, one per line, shall be read from the standard input. A file of type directory shall include all of the files in the file hierarchy rooted at the file. The effect of the copy shall be as if the copied files were written to a pax format archive file and then subsequently extracted, except that copying of sockets may be supported even if archiving them in write mode is not supported, and that there may be hard links between the original and the copied files. If the destination directory is a subdirectory of one of the files to be copied, the results are unspecified. If the destination directory is a file of a type not defined by the System Interfaces volume of POSIX.12017, the results are implementation-defined; otherwise, it shall be an error for the file named by the directory operand not to exist, not be writable by the user, or not be a file of type directory. In read or copy modes, if intermediate directories are necessary to extract an archive member, pax shall perform actions equivalent to the mkdir() function defined in the System Interfaces volume of POSIX.12017, called with the following arguments: * The intermediate directory used as the path argument * The value of the bitwise-inclusive OR of S_IRWXU, S_IRWXG, and S_IRWXO as the mode argument If any specified pattern or file operands are not matched by at least one file or archive member, pax shall write a diagnostic message to standard error for each one that did not match and exit with a non-zero exit status. The archive formats described in the EXTENDED DESCRIPTION section shall be automatically detected on input. The default output archive format shall be implementation-defined. A single archive can span multiple files. The pax utility shall determine, in an implementation-defined manner, what file to read or write as the next file. If the selected archive format supports the specification of linked files, it shall be an error if these files cannot be linked when the archive is extracted. For archive formats that do not store file contents with each name that causes a hard link, if the file that contains the data is not extracted during this pax session, either the data shall be restored from the original file, or a diagnostic message shall be displayed with the name of a file that can be used to extract the data. In traversing directories, pax shall detect infinite loops; that is, entering a previously visited directory that is an ancestor of the last file visited. When it detects an infinite loop, pax shall write a diagnostic message to standard error and shall terminate. OPTIONS top The pax utility shall conform to the Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines, except that the order of presentation of the -o, -p, and -s options is significant. The following options shall be supported: -r Read an archive file from standard input. -w Write files to the standard output in the specified archive format. -a Append files to the end of the archive. It is implementation-defined which devices on the system support appending. Additional file formats unspecified by this volume of POSIX.12017 may impose restrictions on appending. -b blocksize Block the output at a positive decimal integer number of bytes per write to the archive file. Devices and archive formats may impose restrictions on blocking. Blocking shall be automatically determined on input. Conforming applications shall not specify a blocksize value larger than 32256. Default blocking when creating archives depends on the archive format. (See the -x option below.) -c Match all file or archive members except those specified by the pattern or file operands. -d Cause files of type directory being copied or archived or archive members of type directory being extracted or listed to match only the file or archive member itself and not the file hierarchy rooted at the file. -f archive Specify the pathname of the input or output archive, overriding the default standard input (in list or read modes) or standard output (write mode). -H If a symbolic link referencing a file of type directory is specified on the command line, pax shall archive the file hierarchy rooted in the file referenced by the link, using the name of the link as the root of the file hierarchy. Otherwise, if a symbolic link referencing a file of any other file type which pax can normally archive is specified on the command line, then pax shall archive the file referenced by the link, using the name of the link. The default behavior, when neither -H or -L are specified, shall be to archive the symbolic link itself. -i Interactively rename files or archive members. For each archive member matching a pattern operand or file matching a file operand, a prompt shall be written to the file /dev/tty. The prompt shall contain the name of the file or archive member, but the format is otherwise unspecified. A line shall then be read from /dev/tty. If this line is blank, the file or archive member shall be skipped. If this line consists of a single period, the file or archive member shall be processed with no modification to its name. Otherwise, its name shall be replaced with the contents of the line. The pax utility shall immediately exit with a non-zero exit status if end-of-file is encountered when reading a response or if /dev/tty cannot be opened for reading and writing. The results of extracting a hard link to a file that has been renamed during extraction are unspecified. -k Prevent the overwriting of existing files. -l (The letter ell.) In copy mode, hard links shall be made between the source and destination file hierarchies whenever possible. If specified in conjunction with -H or -L, when a symbolic link is encountered, the hard link created in the destination file hierarchy shall be to the file referenced by the symbolic link. If specified when neither -H nor -L is specified, when a symbolic link is encountered, the implementation shall create a hard link to the symbolic link in the source file hierarchy or copy the symbolic link to the destination. -L If a symbolic link referencing a file of type directory is specified on the command line or encountered during the traversal of a file hierarchy, pax shall archive the file hierarchy rooted in the file referenced by the link, using the name of the link as the root of the file hierarchy. Otherwise, if a symbolic link referencing a file of any other file type which pax can normally archive is specified on the command line or encountered during the traversal of a file hierarchy, pax shall archive the file referenced by the link, using the name of the link. The default behavior, when neither -H or -L are specified, shall be to archive the symbolic link itself. -n Select the first archive member that matches each pattern operand. No more than one archive member shall be matched for each pattern (although members of type directory shall still match the file hierarchy rooted at that file). -o options Provide information to the implementation to modify the algorithm for extracting or writing files. The value of options shall consist of one or more <comma>-separated keywords of the form: keyword[[:]=value][,keyword[[:]=value], ...] Some keywords apply only to certain file formats, as indicated with each description. Use of keywords that are inapplicable to the file format being processed produces undefined results. Keywords in the options argument shall be a string that would be a valid portable filename as described in the Base Definitions volume of POSIX.12017, Section 3.282, Portable Filename Character Set. Note: Keywords are not expected to be filenames, merely to follow the same character composition rules as portable filenames. Keywords can be preceded with white space. The value field shall consist of zero or more characters; within value, the application shall precede any literal <comma> with a <backslash>, which shall be ignored, but preserves the <comma> as part of value. A <comma> as the final character, or a <comma> followed solely by white space as the final characters, in options shall be ignored. Multiple -o options can be specified; if keywords given to these multiple -o options conflict, the keywords and values appearing later in command line sequence shall take precedence and the earlier shall be silently ignored. The following keyword values of options shall be supported for the file formats as indicated: delete=pattern (Applicable only to the -x pax format.) When used in write or copy mode, pax shall omit from extended header records that it produces any keywords matching the string pattern. When used in read or list mode, pax shall ignore any keywords matching the string pattern in the extended header records. In both cases, matching shall be performed using the pattern matching notation described in Section 2.13.1, Patterns Matching a Single Character and Section 2.13.2, Patterns Matching Multiple Characters. For example: -o delete=security.* would suppress security-related information. See pax Extended Header for extended header record keyword usage. When multiple -odelete=pattern options are specified, the patterns shall be additive; all keywords matching the specified string patterns shall be omitted from extended header records that pax produces. exthdr.name=string (Applicable only to the -x pax format.) This keyword allows user control over the name that is written into the ustar header blocks for the extended header produced under the circumstances described in pax Header Block. The name shall be the contents of string, after the following character substitutions have been made: string Includes: Replaced by: %d The directory name of the file, equivalent to the result of the dirname utility on the translated pathname. %f The filename of the file, equivalent to the result of the basename utility on the translated pathname. %p The process ID of the pax process. %% A '%' character. Any other '%' characters in string produce undefined results. If no -o exthdr.name=string is specified, pax shall use the following default value: %d/PaxHeaders.%p/%f globexthdr.name=string (Applicable only to the -x pax format.) When used in write or copy mode with the appropriate options, pax shall create global extended header records with ustar header blocks that will be treated as regular files by previous versions of pax. This keyword allows user control over the name that is written into the ustar header blocks for global extended header records. The name shall be the contents of string, after the following character substitutions have been made: string Includes: Replaced by: %n An integer that represents the sequence number of the global extended header record in the archive, starting at 1. %p The process ID of the pax process. %% A '%' character. Any other '%' characters in string produce undefined results. If no -o globexthdr.name=string is specified, pax shall use the following default value: $TMPDIR/GlobalHead.%p.%n where $TMPDIR represents the value of the TMPDIR environment variable. If TMPDIR is not set, pax shall use /tmp. invalid=action (Applicable only to the -x pax format.) This keyword allows user control over the action pax takes upon encountering values in an extended header record that, in read or copy mode, are invalid in the destination hierarchy or, in list mode, cannot be written in the codeset and current locale of the implementation. The following are invalid values that shall be recognized by pax: -- In read or copy mode, a filename or link name that contains character encodings invalid in the destination hierarchy. (For example, the name may contain embedded NULs.) -- In read or copy mode, a filename or link name that is longer than the maximum allowed in the destination hierarchy (for either a pathname component or the entire pathname). -- In list mode, any character string value (filename, link name, user name, and so on) that cannot be written in the codeset and current locale of the implementation. The following mutually-exclusive values of the action argument are supported: binary In write mode, pax shall generate a hdrcharset=BINARY extended header record for each file with a filename, link name, group name, owner name, or any other field in an extended header record that cannot be translated to the UTF8 codeset, allowing the archive to contain the files with unencoded extended header record values. In read or copy mode, pax shall use the values specified in the header without translation, regardless of whether this may overwrite an existing file with a valid name. In list mode, pax shall behave identically to the bypass action. bypass In read or copy mode, pax shall bypass the file, causing no change to the destination hierarchy. In list mode, pax shall write all requested valid values for the file, but its method for writing invalid values is unspecified. rename In read or copy mode, pax shall act as if the -i option were in effect for each file with invalid filename or link name values, allowing the user to provide a replacement name interactively. In list mode, pax shall behave identically to the bypass action. UTF8 When used in read, copy, or list mode and a filename, link name, owner name, or any other field in an extended header record cannot be translated from the pax UTF8 codeset format to the codeset and current locale of the implementation, pax shall use the actual UTF8 encoding for the name. If a hdrcharset extended header record is in effect for this file, the character set specified by that record shall be used instead of UTF8. If a hdrcharset=BINARY extended header record is in effect for this file, no translation shall be performed. write In read or copy mode, pax shall write the file, translating the name, regardless of whether this may overwrite an existing file with a valid name. In list mode, pax shall behave identically to the bypass action. If no -o invalid=option is specified, pax shall act as if -oinvalid=bypass were specified. Any overwriting of existing files that may be allowed by the -oinvalid= actions shall be subject to permission (-p) and modification time (-u) restrictions, and shall be suppressed if the -k option is also specified. linkdata (Applicable only to the -x pax format.) In write mode, pax shall write the contents of a file to the archive even when that file is merely a hard link to a file whose contents have already been written to the archive. listopt=format This keyword specifies the output format of the table of contents produced when the -v option is specified in list mode. See List Mode Format Specifications. To avoid ambiguity, the listopt=format shall be the only or final keyword=value pair in a -o option-argument; all characters in the remainder of the option- argument shall be considered part of the format string. When multiple -olistopt=format options are specified, the format strings shall be considered a single, concatenated string, evaluated in command line order. times (Applicable only to the -x pax format.) When used in write or copy mode, pax shall include atime and mtime extended header records for each file. See pax Extended Header File Times. In addition to these keywords, if the -x pax format is specified, any of the keywords and values defined in pax Extended Header, including implementation extensions, can be used in -o option-arguments, in either of two modes: keyword=value When used in write or copy mode, these keyword/value pairs shall be included at the beginning of the archive as typeflag g global extended header records. When used in read or list mode, these keyword/value pairs shall act as if they had been at the beginning of the archive as typeflag g global extended header records. keyword:=value When used in write or copy mode, these keyword/value pairs shall be included as records at the beginning of a typeflag x extended header for each file. (This shall be equivalent to the <equals-sign> form except that it creates no typeflag g global extended header records.) When used in read or list mode, these keyword/value pairs shall act as if they were included as records at the end of each extended header; thus, they shall override any global or file-specific extended header record keywords of the same names. For example, in the command: pax -r -o " gname:=mygroup, " <archive the group name will be forced to a new value for all files read from the archive. The precedence of -o keywords over various fields in the archive is described in pax Extended Header Keyword Precedence. If the -o delete=pattern, -o keyword=value, or -o keyword:=value options are used to override or remove any extended header data needed to find files in an archive (e.g., -o delete=size for a file whose size cannot be represented in a ustar header or -o size=100 for a file whose size is not 100 bytes), the behavior is undefined. -p string Specify one or more file characteristic options (privileges). The string option-argument shall be a string specifying file characteristics to be retained or discarded on extraction. The string shall consist of the specification characters a, e, m, o, and p. Other implementation-defined characters can be included. Multiple characteristics can be concatenated within the same string and multiple -p options can be specified. The meaning of the specification characters are as follows: a Do not preserve file access times. e Preserve the user ID, group ID, file mode bits (see the Base Definitions volume of POSIX.12017, Section 3.169, File Mode Bits), access time, modification time, and any other implementation- defined file characteristics. m Do not preserve file modification times. o Preserve the user ID and group ID. p Preserve the file mode bits. Other implementation-defined file mode attributes may be preserved. In the preceding list, ``preserve'' indicates that an attribute stored in the archive shall be given to the extracted file, subject to the permissions of the invoking process. The access and modification times of the file shall be preserved unless otherwise specified with the -p option or not stored in the archive. All attributes that are not preserved shall be determined as part of the normal file creation action (see Section 1.1.1.4, File Read, Write, and Creation). If neither the e nor the o specification character is specified, or the user ID and group ID are not preserved for any reason, pax shall not set the S_ISUID and S_ISGID bits of the file mode. If the preservation of any of these items fails for any reason, pax shall write a diagnostic message to standard error. Failure to preserve these items shall affect the final exit status, but shall not cause the extracted file to be deleted. If file characteristic letters in any of the string option-arguments are duplicated or conflict with each other, the ones given last shall take precedence. For example, if -p eme is specified, file modification times are preserved. -s replstr Modify file or archive member names named by pattern or file operands according to the substitution expression replstr, using the syntax of the ed utility. The concepts of ``address'' and ``line'' are meaningless in the context of the pax utility, and shall not be supplied. The format shall be: -s /old/new/[gp] where as in ed, old is a basic regular expression and new can contain an <ampersand>, '\n' (where n is a digit) back-references, or subexpression matching. The old string shall also be permitted to contain <newline> characters. Any non-null character can be used as a delimiter ('/' shown here). Multiple -s expressions can be specified; the expressions shall be applied in the order specified, terminating with the first successful substitution. The optional trailing 'g' is as defined in the ed utility. The optional trailing 'p' shall cause successful substitutions to be written to standard error. File or archive member names that substitute to the empty string shall be ignored when reading and writing archives. -t When reading files from the file system, and if the user has the permissions required by utime() to do so, set the access time of each file read to the access time that it had before being read by pax. -u Ignore files that are older (having a less recent file modification time) than a pre-existing file or archive member with the same name. In read mode, an archive member with the same name as a file in the file system shall be extracted if the archive member is newer than the file. In write mode, an archive file member with the same name as a file in the file system shall be superseded if the file is newer than the archive member. If -a is also specified, this is accomplished by appending to the archive; otherwise, it is unspecified whether this is accomplished by actual replacement in the archive or by appending to the archive. In copy mode, the file in the destination hierarchy shall be replaced by the file in the source hierarchy or by a link to the file in the source hierarchy if the file in the source hierarchy is newer. -v In list mode, produce a verbose table of contents (see the STDOUT section). Otherwise, write archive member pathnames to standard error (see the STDERR section). -x format Specify the output archive format. The pax utility shall support the following formats: cpio The cpio interchange format; see the EXTENDED DESCRIPTION section. The default blocksize for this format for character special archive files shall be 5120. Implementations shall support all blocksize values less than or equal to 32256 that are multiples of 512. pax The pax interchange format; see the EXTENDED DESCRIPTION section. The default blocksize for this format for character special archive files shall be 5120. Implementations shall support all blocksize values less than or equal to 32256 that are multiples of 512. ustar The tar interchange format; see the EXTENDED DESCRIPTION section. The default blocksize for this format for character special archive files shall be 10240. Implementations shall support all blocksize values less than or equal to 32256 that are multiples of 512. Implementation-defined formats shall specify a default block size as well as any other block sizes supported for character special archive files. Any attempt to append to an archive file in a format different from the existing archive format shall cause pax to exit immediately with a non-zero exit status. -X When traversing the file hierarchy specified by a pathname, pax shall not descend into directories that have a different device ID (st_dev; see the System Interfaces volume of POSIX.12017, stat()). Specifying more than one of the mutually-exclusive options -H and -L shall not be considered an error and the last option specified shall determine the behavior of the utility. The options that operate on the names of files or archive members (-c, -i, -n, -s, -u, and -v) shall interact as follows. In read mode, the archive members shall be selected based on the user- specified pattern operands as modified by the -c, -n, and -u options. Then, any -s and -i options shall modify, in that order, the names of the selected files. The -v option shall write names resulting from these modifications. In write mode, the files shall be selected based on the user- specified pathnames as modified by the -n and -u options. Then, any -s and -i options shall modify, in that order, the names of these selected files. The -v option shall write names resulting from these modifications. If both the -u and -n options are specified, pax shall not consider a file selected unless it is newer than the file to which it is compared. List Mode Format Specifications In list mode with the -o listopt=format option, the format argument shall be applied for each selected file. The pax utility shall append a <newline> to the listopt output for each selected file. The format argument shall be used as the format string described in the Base Definitions volume of POSIX.12017, Chapter 5, File Format Notation, with the exceptions 1. through 6. defined in the EXTENDED DESCRIPTION section of printf, plus the following exceptions: 7. The sequence (keyword) can occur before a format conversion specifier. The conversion argument is defined by the value of keyword. The implementation shall support the following keywords: -- Any of the Field Name entries in Table 4-14, ustar Header Block and Table 4-16, Octet-Oriented cpio Archive Entry. The implementation may support the cpio keywords without the leading c_ in addition to the form required by Table 4-16, Octet-Oriented cpio Archive Entry. -- Any keyword defined for the extended header in pax Extended Header. -- Any keyword provided as an implementation-defined extension within the extended header defined in pax Extended Header. For example, the sequence "%(charset)s" is the string value of the name of the character set in the extended header. The result of the keyword conversion argument shall be the value from the applicable header field or extended header, without any trailing NULs. All keyword values used as conversion arguments shall be translated from the UTF8 encoding (or alternative encoding specified by any hdrcharset extended header record) to the character set appropriate for the local file system, user database, and so on, as applicable. 8. An additional conversion specifier character, T, shall be used to specify time formats. The T conversion specifier character can be preceded by the sequence (keyword=subformat), where subformat is a date format as defined by date operands. The default keyword shall be mtime and the default subformat shall be: %b %e %H:%M %Y 9. An additional conversion specifier character, M, shall be used to specify the file mode string as defined in ls Standard Output. If (keyword) is omitted, the mode keyword shall be used. For example, %.1M writes the single character corresponding to the <entry type> field of the ls -l command. 10. An additional conversion specifier character, D, shall be used to specify the device for block or special files, if applicable, in an implementation-defined format. If not applicable, and (keyword) is specified, then this conversion shall be equivalent to %(keyword)u. If not applicable, and (keyword) is omitted, then this conversion shall be equivalent to <space>. 11. An additional conversion specifier character, F, shall be used to specify a pathname. The F conversion character can be preceded by a sequence of <comma>-separated keywords: (keyword[,keyword] ... ) The values for all the keywords that are non-null shall be concatenated together, each separated by a '/'. The default shall be (path) if the keyword path is defined; otherwise, the default shall be (prefix,name). 12. An additional conversion specifier character, L, shall be used to specify a symbolic link expansion. If the current file is a symbolic link, then %L shall expand to: "%s -> %s", <value of keyword>, <contents of link> Otherwise, the %L conversion specification shall be the equivalent of %F. OPERANDS top The following operands shall be supported: directory The destination directory pathname for copy mode. file A pathname of a file to be copied or archived. pattern A pattern matching one or more pathnames of archive members. A pattern must be given in the name-generating notation of the pattern matching notation in Section 2.13, Pattern Matching Notation, including the filename expansion rules in Section 2.13.3, Patterns Used for Filename Expansion. The default, if no pattern is specified, is to select all members in the archive. STDIN top In write mode, the standard input shall be used only if no file operands are specified. It shall be a file containing a list of pathnames, each terminated by a <newline> character. In list and read modes, if -f is not specified, the standard input shall be an archive file. Otherwise, the standard input shall not be used. INPUT FILES top The input file named by the archive option-argument, or standard input when the archive is read from there, shall be a file formatted according to one of the specifications in the EXTENDED DESCRIPTION section or some other implementation-defined format. The file /dev/tty shall be used to write prompts and read responses. ENVIRONMENT VARIABLES top The following environment variables shall affect the execution of pax: 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 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_COLLATE Determine the locale for the behavior of ranges, equivalence classes, and multi-character collating elements used in the pattern matching expressions for the pattern operand, the basic regular expression for the -s option, and the extended regular expression defined for the yesexpr locale keyword in the LC_MESSAGES category. 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), the behavior of character classes used in the extended regular expression defined for the yesexpr locale keyword in the LC_MESSAGES category, and pattern matching. LC_MESSAGES Determine the locale used to process affirmative responses, and the locale used to affect the format and contents of diagnostic messages and prompts written to standard error. LC_TIME Determine the format and contents of date and time strings when the -v option is specified. NLSPATH Determine the location of message catalogs for the processing of LC_MESSAGES. TMPDIR Determine the pathname that provides part of the default global extended header record file, as described for the -o globexthdr= keyword in the OPTIONS section. TZ Determine the timezone used to calculate date and time strings when the -v option is specified. If TZ is unset or null, an unspecified default timezone shall be used. ASYNCHRONOUS EVENTS top Default. STDOUT top In write mode, if -f is not specified, the standard output shall be the archive formatted according to one of the specifications in the EXTENDED DESCRIPTION section, or some other implementation-defined format (see -x format). In list mode, when the -olistopt=format has been specified, the selected archive members shall be written to standard output using the format described under List Mode Format Specifications. In list mode without the -olistopt=format option, the table of contents of the selected archive members shall be written to standard output using the following format: "%s\n", <pathname> If the -v option is specified in list mode, the table of contents of the selected archive members shall be written to standard output using the following formats. For pathnames representing hard links to previous members of the archive: "%s == %s\n", <ls -l listing>, <linkname> For all other pathnames: "%s\n", <ls -l listing> where <ls -l listing> shall be the format specified by the ls utility with the -l option. When writing pathnames in this format, it is unspecified what is written for fields for which the underlying archive format does not have the correct information, although the correct number of <blank>-separated fields shall be written. In list mode, standard output shall not be buffered more than a pathname (plus any associated information and a <newline> terminator) at a time. STDERR top If -v is specified in read, write, or copy modes, pax shall write the pathnames it processes to the standard error output using the following format: "%s\n", <pathname> These pathnames shall be written as soon as processing is begun on the file or archive member, and shall be flushed to standard error. The trailing <newline>, which shall not be buffered, is written when the file has been read or written. If the -s option is specified, and the replacement string has a trailing 'p', substitutions shall be written to standard error in the following format: "%s >> %s\n", <original pathname>, <new pathname> In all operating modes of pax, optional messages of unspecified format concerning the input archive format and volume number, the number of files, blocks, volumes, and media parts as well as other diagnostic messages may be written to standard error. In all formats, for both standard output and standard error, it is unspecified how non-printable characters in pathnames or link names are written. When using the -xpax archive format, if a filename, link name, group name, owner name, or any other field in an extended header record cannot be translated between the codeset in use for that extended header record and the character set of the current locale, pax shall write a diagnostic message to standard error, shall process the file as described for the -o invalid= option, and then shall continue processing with the next file. OUTPUT FILES top In read mode, the extracted output files shall be of the archived file type. In copy mode, the copied output files shall be the type of the file being copied. In either mode, existing files in the destination hierarchy shall be overwritten only when all permission (-p), modification time (-u), and invalid-value (-oinvalid=) tests allow it. In write mode, the output file named by the -f option-argument shall be a file formatted according to one of the specifications in the EXTENDED DESCRIPTION section, or some other implementation-defined format. EXTENDED DESCRIPTION top pax Interchange Format A pax archive tape or file produced in the -xpax format shall contain a series of blocks. The physical layout of the archive shall be identical to the ustar format described in ustar Interchange Format. Each file archived shall be represented by the following sequence: * An optional header block with extended header records. This header block is of the form described in pax Header Block, with a typeflag value of x or g. The extended header records, described in pax Extended Header, shall be included as the data for this header block. * A header block that describes the file. Any fields in the preceding optional extended header shall override the associated fields in this header block for this file. * Zero or more blocks that contain the contents of the file. At the end of the archive file there shall be two 512-byte blocks filled with binary zeros, interpreted as an end-of-archive indicator. A schematic of an example archive with global extended header records and two actual files is shown in Figure 4-1, pax Format Archive Example. In the example, the second file in the archive has no extended header preceding it, presumably because it has no need for extended attributes. Figure 4-1: pax Format Archive Example pax Header Block The pax header block shall be identical to the ustar header block described in ustar Interchange Format, except that two additional typeflag values are defined: x Represents extended header records for the following file in the archive (which shall have its own ustar header block). The format of these extended header records shall be as described in pax Extended Header. g Represents global extended header records for the following files in the archive. The format of these extended header records shall be as described in pax Extended Header. Each value shall affect all subsequent files that do not override that value in their own extended header record and until another global extended header record is reached that provides another value for the same field. The typeflag g global headers should not be used with interchange media that could suffer partial data loss in transporting the archive. For both of these types, the size field shall be the size of the extended header records in octets. The other fields in the header block are not meaningful to this version of the pax utility. However, if this archive is read by a pax utility conforming to the ISO POSIX2:1993 standard, the header block fields are used to create a regular file that contains the extended header records as data. Therefore, header block field values should be selected to provide reasonable file access to this regular file. A further difference from the ustar header block is that data blocks for files of typeflag 1 (the digit one) (hard link) may be included, which means that the size field may be greater than zero. Archives created by pax -o linkdata shall include these data blocks with the hard links. pax Extended Header A pax extended header contains values that are inappropriate for the ustar header block because of limitations in that format: fields requiring a character encoding other than that described in the ISO/IEC 646:1991 standard, fields representing file attributes not described in the ustar header, and fields whose format or length do not fit the requirements of the ustar header. The values in an extended header add attributes to the following file (or files; see the description of the typeflag g header block) or override values in the following header block(s), as indicated in the following list of keywords. An extended header shall consist of one or more records, each constructed as follows: "%d %s=%s\n", <length>, <keyword>, <value> The extended header records shall be encoded according to the ISO/IEC 106461:2000 standard UTF8 encoding. The <length> field, <blank>, <equals-sign>, and <newline> shown shall be limited to the portable character set, as encoded in UTF8. The <keyword> fields can be any UTF8 characters. The <length> field shall be the decimal length of the extended header record in octets, including the trailing <newline>. If there is a hdrcharset extended header in effect for a file, the value field for any gname, linkpath, path, and uname extended header records shall be encoded using the character set specified by the hdrcharset extended header record; otherwise, the value field shall be encoded using UTF8. The value field for all other keywords specified by POSIX.12008 shall be encoded using UTF8. The <keyword> field shall be one of the entries from the following list or a keyword provided as an implementation extension. Keywords consisting entirely of lowercase letters, digits, and periods are reserved for future standardization. A keyword shall not include an <equals-sign>. (In the following list, the notations ``file(s)'' or ``block(s)'' is used to acknowledge that a keyword affects the following single file after a typeflag x extended header, but possibly multiple files after typeflag g. Any requirements in the list for pax to include a record when in write or copy mode shall apply only when such a record has not already been provided through the use of the -o option. When used in copy mode, pax shall behave as if an archive had been created with applicable extended header records and then extracted.) atime The file access time for the following file(s), equivalent to the value of the st_atime member of the stat structure for a file, as described by the stat() function. The access time shall be restored if the process has appropriate privileges required to do so. The format of the <value> shall be as described in pax Extended Header File Times. charset The name of the character set used to encode the data in the following file(s). The entries in the following table are defined to refer to known standards; additional names may be agreed on between the originator and recipient. <value> Formal Standard ISO-IR 646 1990 ISO/IEC 646:1990 ISO-IR 8859 1 1998 ISO/IEC 88591:1998 ISO-IR 8859 2 1999 ISO/IEC 88592:1999 ISO-IR 8859 3 1999 ISO/IEC 88593:1999 ISO-IR 8859 4 1998 ISO/IEC 88594:1998 ISO-IR 8859 5 1999 ISO/IEC 88595:1999 ISO-IR 8859 6 1999 ISO/IEC 88596:1999 ISO-IR 8859 7 1987 ISO/IEC 88597:1987 ISO-IR 8859 8 1999 ISO/IEC 88598:1999 ISO-IR 8859 9 1999 ISO/IEC 88599:1999 ISO-IR 8859 10 1998 ISO/IEC 885910:1998 ISO-IR 8859 13 1998 ISO/IEC 885913:1998 ISO-IR 8859 14 1998 ISO/IEC 885914:1998 ISO-IR 8859 15 1999 ISO/IEC 885915:1999 ISO-IR 10646 2000 ISO/IEC 10646:2000 ISO-IR 10646 2000 UTF-8 ISO/IEC 10646, UTF-8 encoding BINARY None. The encoding is included in an extended header for information only; when pax is used as described in POSIX.12008, it shall not translate the file data into any other encoding. The BINARY entry indicates unencoded binary data. When used in write or copy mode, it is implementation- defined whether pax includes a charset extended header record for a file. comment A series of characters used as a comment. All characters in the <value> field shall be ignored by pax. gid The group ID of the group that owns the file, expressed as a decimal number using digits from the ISO/IEC 646:1991 standard. This record shall override the gid field in the following header block(s). When used in write or copy mode, pax shall include a gid extended header record for each file whose group ID is greater than 2097151 (octal 7777777). gname The group of the file(s), formatted as a group name in the group database. This record shall override the gid and gname fields in the following header block(s), and any gid extended header record. When used in read, copy, or list mode, pax shall translate the name from the encoding in the header record to the character set appropriate for the group database on the receiving system. If any of the characters cannot be translated, and if neither the -oinvalid=UTF8 option nor the -oinvalid=binary option is specified, the results are implementation-defined. When used in write or copy mode, pax shall include a gname extended header record for each file whose group name cannot be represented entirely with the letters and digits of the portable character set. hdrcharset The name of the character set used to encode the value field of the gname, linkpath, path, and uname pax extended header records. The entries in the following table are defined to refer to known standards; additional names may be agreed between the originator and the recipient. <value> Formal Standard ISO-IR 10646 2000 UTF-8 ISO/IEC 10646, UTF-8 encoding BINARY None. If no hdrcharset extended header record is specified, the default character set used to encode all values in extended header records shall be the ISO/IEC 106461:2000 standard UTF8 encoding. The BINARY entry indicates that all values recorded in extended headers for affected files are unencoded binary data from the underlying system. linkpath The pathname of a link being created to another file, of any type, previously archived. This record shall override the linkname field in the following ustar header block(s). The following ustar header block shall determine the type of link created. If typeflag of the following header block is 1, it shall be a hard link. If typeflag is 2, it shall be a symbolic link and the linkpath value shall be the contents of the symbolic link. The pax utility shall translate the name of the link (contents of the symbolic link) from the encoding in the header to the character set appropriate for the local file system. When used in write or copy mode, pax shall include a linkpath extended header record for each link whose pathname cannot be represented entirely with the members of the portable character set other than NUL. mtime The file modification time of the following file(s), equivalent to the value of the st_mtime member of the stat structure for a file, as described in the stat() function. This record shall override the mtime field in the following header block(s). The modification time shall be restored if the process has appropriate privileges required to do so. The format of the <value> shall be as described in pax Extended Header File Times. path The pathname of the following file(s). This record shall override the name and prefix fields in the following header block(s). The pax utility shall translate the pathname of the file from the encoding in the header to the character set appropriate for the local file system. When used in write or copy mode, pax shall include a path extended header record for each file whose pathname cannot be represented entirely with the members of the portable character set other than NUL. realtime.any The keywords prefixed by ``realtime.'' are reserved for future standardization. security.any The keywords prefixed by ``security.'' are reserved for future standardization. size The size of the file in octets, expressed as a decimal number using digits from the ISO/IEC 646:1991 standard. This record shall override the size field in the following header block(s). When used in write or copy mode, pax shall include a size extended header record for each file with a size value greater than 8589934591 (octal 77777777777). uid The user ID of the file owner, expressed as a decimal number using digits from the ISO/IEC 646:1991 standard. This record shall override the uid field in the following header block(s). When used in write or copy mode, pax shall include a uid extended header record for each file whose owner ID is greater than 2097151 (octal 7777777). uname The owner of the following file(s), formatted as a user name in the user database. This record shall override the uid and uname fields in the following header block(s), and any uid extended header record. When used in read, copy, or list mode, pax shall translate the name from the encoding in the header record to the character set appropriate for the user database on the receiving system. If any of the characters cannot be translated, and if neither the -oinvalid=UTF8 option nor the -oinvalid=binary option is specified, the results are implementation-defined. When used in write or copy mode, pax shall include a uname extended header record for each file whose user name cannot be represented entirely with the letters and digits of the portable character set. If the <value> field is zero length, it shall delete any header block field, previously entered extended header value, or global extended header value of the same name. If a keyword in an extended header record (or in a -o option- argument) overrides or deletes a corresponding field in the ustar header block, pax shall ignore the contents of that header block field. Unlike the ustar header block fields, NULs shall not delimit <value>s; all characters within the <value> field shall be considered data for the field. None of the length limitations of the ustar header block fields in Table 4-14, ustar Header Block shall apply to the extended header records. pax Extended Header Keyword Precedence This section describes the precedence in which the various header records and fields and command line options are selected to apply to a file in the archive. When pax is used in read or list modes, it shall determine a file attribute in the following sequence: 1. If -odelete=keyword-prefix is used, the affected attributes shall be determined from step 7., if applicable, or ignored otherwise. 2. If -okeyword:= is used, the affected attributes shall be ignored. 3. If -okeyword:=value is used, the affected attribute shall be assigned the value. 4. If there is a typeflag x extended header record, the affected attribute shall be assigned the <value>. When extended header records conflict, the last one given in the header shall take precedence. 5. If -okeyword=value is used, the affected attribute shall be assigned the value. 6. If there is a typeflag g global extended header record, the affected attribute shall be assigned the <value>. When global extended header records conflict, the last one given in the global header shall take precedence. 7. Otherwise, the attribute shall be determined from the ustar header block. pax Extended Header File Times The pax utility shall write an mtime record for each file in write or copy modes if the file's modification time cannot be represented exactly in the ustar header logical record described in ustar Interchange Format. This can occur if the time is out of ustar range, or if the file system of the underlying implementation supports non-integer time granularities and the time is not an integer. All of these time records shall be formatted as a decimal representation of the time in seconds since the Epoch. If a <period> ('.') decimal point character is present, the digits to the right of the point shall represent the units of a subsecond timing granularity, where the first digit is tenths of a second and each subsequent digit is a tenth of the previous digit. In read or copy mode, the pax utility shall truncate the time of a file to the greatest value that is not greater than the input header file time. In write or copy mode, the pax utility shall output a time exactly if it can be represented exactly as a decimal number, and otherwise shall generate only enough digits so that the same time shall be recovered if the file is extracted on a system whose underlying implementation supports the same time granularity. ustar Interchange Format A ustar archive tape or file shall contain a series of logical records. Each logical record shall be a fixed-size logical record of 512 octets (see below). Although this format may be thought of as being stored on 9-track industry-standard 12.7 mm (0.5 in) magnetic tape, other types of transportable media are not excluded. Each file archived shall be represented by a header logical record that describes the file, followed by zero or more logical records that give the contents of the file. At the end of the archive file there shall be two 512-octet logical records filled with binary zeros, interpreted as an end-of-archive indicator. The logical records may be grouped for physical I/O operations, as described under the -bblocksize and -x ustar options. Each group of logical records may be written with a single operation equivalent to the write() function. On magnetic tape, the result of this write shall be a single tape physical block. The last physical block shall always be the full size, so logical records after the two zero logical records may contain undefined data. The header logical record shall be structured as shown in the following table. All lengths and offsets are in decimal. Table 4-14: ustar Header Block Field Name Octet Offset Length (in Octets) name 0 100 mode 100 8 uid 108 8 gid 116 8 size 124 12 mtime 136 12 chksum 148 8 typeflag 156 1 linkname 157 100 magic 257 6 version 263 2 uname 265 32 gname 297 32 devmajor 329 8 devminor 337 8 prefix 345 155 All characters in the header logical record shall be represented in the coded character set of the ISO/IEC 646:1991 standard. For maximum portability between implementations, names should be selected from characters represented by the portable filename character set as octets with the most significant bit zero. If an implementation supports the use of characters outside of <slash> and the portable filename character set in names for files, users, and groups, one or more implementation-defined encodings of these characters shall be provided for interchange purposes. However, the pax utility shall never create filenames on the local system that cannot be accessed via the procedures described in POSIX.12008. If a filename is found on the medium that would create an invalid filename, it is implementation-defined whether the data from the file is stored on the file hierarchy and under what name it is stored. The pax utility may choose to ignore these files as long as it produces an error indicating that the file is being ignored. Each field within the header logical record is contiguous; that is, there is no padding used. Each character on the archive medium shall be stored contiguously. The fields magic, uname, and gname are character strings each terminated by a NUL character. The fields name, linkname, and prefix are NUL-terminated character strings except when all characters in the array contain non-NUL characters including the last character. The version field is two octets containing the characters "00" (zero-zero). The typeflag contains a single character. All other fields are leading zero-filled octal numbers using digits from the ISO/IEC 646:1991 standard IRV. Each numeric field is terminated by one or more <space> or NUL characters. The name and the prefix fields shall produce the pathname of the file. A new pathname shall be formed, if prefix is not an empty string (its first character is not NUL), by concatenating prefix (up to the first NUL character), a <slash> character, and name; otherwise, name is used alone. In either case, name is terminated at the first NUL character. If prefix begins with a NUL character, it shall be ignored. In this manner, pathnames of at most 256 characters can be supported. If a pathname does not fit in the space provided, pax shall notify the user of the error, and shall not store any part of the fileheader or dataon the medium. The linkname field, described below, shall not use the prefix to produce a pathname. As such, a linkname is limited to 100 characters. If the name does not fit in the space provided, pax shall notify the user of the error, and shall not attempt to store the link on the medium. The mode field provides 12 bits encoded in the ISO/IEC 646:1991 standard octal digit representation. The encoded bits shall represent the following values: Table: ustar mode Field Bit Value POSIX.12008 Bit Description 04000 S_ISUID Set UID on execution. 02000 S_ISGID Set GID on execution. 01000 <reserved> Reserved for future standardization. 00400 S_IRUSR Read permission for file owner class. 00200 S_IWUSR Write permission for file owner class. 00100 S_IXUSR Execute/search permission for file owner class. 00040 S_IRGRP Read permission for file group class. 00020 S_IWGRP Write permission for file group class. 00010 S_IXGRP Execute/search permission for file group class. 00004 S_IROTH Read permission for file other class. 00002 S_IWOTH Write permission for file other class. 00001 S_IXOTH Execute/search permission for file other class. When appropriate privileges are required to set one of these mode bits, and the user restoring the files from the archive does not have appropriate privileges, the mode bits for which the user does not have appropriate privileges shall be ignored. Some of the mode bits in the archive format are not mentioned elsewhere in this volume of POSIX.12017. If the implementation does not support those bits, they may be ignored. The uid and gid fields are the user and group ID of the owner and group of the file, respectively. The size field is the size of the file in octets. If the typeflag field is set to specify a file to be of type 1 (a link) or 2 (a symbolic link), the size field shall be specified as zero. If the typeflag field is set to specify a file of type 5 (directory), the size field shall be interpreted as described under the definition of that record type. No data logical records are stored for types 1, 2, or 5. If the typeflag field is set to 3 (character special file), 4 (block special file), or 6 (FIFO), the meaning of the size field is unspecified by this volume of POSIX.12017, and no data logical records shall be stored on the medium. Additionally, for type 6, the size field shall be ignored when reading. If the typeflag field is set to any other value, the number of logical records written following the header shall be (size+511)/512, ignoring any fraction in the result of the division. The mtime field shall be the modification time of the file at the time it was archived. It is the ISO/IEC 646:1991 standard representation of the octal value of the modification time obtained from the stat() function. The chksum field shall be the ISO/IEC 646:1991 standard IRV representation of the octal value of the simple sum of all octets in the header logical record. Each octet in the header shall be treated as an unsigned value. These values shall be added to an unsigned integer, initialized to zero, the precision of which is not less than 17 bits. When calculating the checksum, the chksum field is treated as if it were all <space> characters. The typeflag field specifies the type of file archived. If a particular implementation does not recognize the type, or the user does not have appropriate privileges to create that type, the file shall be extracted as if it were a regular file if the file type is defined to have a meaning for the size field that could cause data logical records to be written on the medium (see the previous description for size). If conversion to a regular file occurs, the pax utility shall produce an error indicating that the conversion took place. All of the typeflag fields shall be coded in the ISO/IEC 646:1991 standard IRV: 0 Represents a regular file. For backwards-compatibility, a typeflag value of binary zero ('\0') should be recognized as meaning a regular file when extracting files from the archive. Archives written with this version of the archive file format create regular files with a typeflag value of the ISO/IEC 646:1991 standard IRV '0'. 1 Represents a file linked to another file, of any type, previously archived. Such files are identified by having the same device and file serial numbers, and pathnames that refer to different directory entries. All such files shall be archived as linked files. The linked-to name is specified in the linkname field with a NUL-character terminator if it is less than 100 octets in length. 2 Represents a symbolic link. The contents of the symbolic link shall be stored in the linkname field. 3,4 Represent character special files and block special files respectively. In this case the devmajor and devminor fields shall contain information defining the device, the format of which is unspecified by this volume of POSIX.12017. Implementations may map the device specifications to their own local specification or may ignore the entry. 5 Specifies a directory or subdirectory. On systems where disk allocation is performed on a directory basis, the size field shall contain the maximum number of octets (which may be rounded to the nearest disk block allocation unit) that the directory may hold. A size field of zero indicates no such limiting. Systems that do not support limiting in this manner should ignore the size field. 6 Specifies a FIFO special file. Note that the archiving of a FIFO file archives the existence of this file and not its contents. 7 Reserved to represent a file to which an implementation has associated some high-performance attribute. Implementations without such extensions should treat this file as a regular file (type 0). AZ The letters 'A' to 'Z', inclusive, are reserved for custom implementations. All other values are reserved for future versions of this standard. It is unspecified whether files with pathnames that refer to the same directory entry are archived as linked files or as separate files. If they are archived as linked files, this means that attempting to extract both pathnames from the resulting archive will always cause an error (unless the -u option is used) because the link cannot be created. It is unspecified whether files with the same device and file serial numbers being appended to an archive are treated as linked files to members that were in the archive before the append. Attempts to archive a socket shall produce a diagnostic message when ustar interchange format is used, but may be allowed when pax interchange format is used. Handling of other file types is implementation-defined. The magic field is the specification that this archive was output in this archive format. If this field contains ustar (the five characters from the ISO/IEC 646:1991 standard IRV shown followed by NUL), the uname and gname fields shall contain the ISO/IEC 646:1991 standard IRV representation of the owner and group of the file, respectively (truncated to fit, if necessary). When the file is restored by a privileged, protection-preserving version of the utility, the user and group databases shall be scanned for these names. If found, the user and group IDs contained within these files shall be used rather than the values contained within the uid and gid fields. cpio Interchange Format The octet-oriented cpio archive format shall be a series of entries, each comprising a header that describes the file, the name of the file, and then the contents of the file. An archive may be recorded as a series of fixed-size blocks of octets. This blocking shall be used only to make physical I/O more efficient. The last group of blocks shall always be at the full size. For the octet-oriented cpio archive format, the individual entry information shall be in the order indicated and described by the following table; see also the <cpio.h> header. Table 4-16: Octet-Oriented cpio Archive Entry Header Field Name Length (in Octets) Interpreted as c_magic 6 Octal number c_dev 6 Octal number c_ino 6 Octal number c_mode 6 Octal number c_uid 6 Octal number c_gid 6 Octal number c_nlink 6 Octal number c_rdev 6 Octal number c_mtime 11 Octal number c_namesize 6 Octal number c_filesize 11 Octal number Filename Field Name Length Interpreted as c_name c_namesize Pathname string File Data Field Name Length Interpreted as c_filedata c_filesize Data cpio Header For each file in the archive, a header as defined previously shall be written. The information in the header fields is written as streams of the ISO/IEC 646:1991 standard characters interpreted as octal numbers. The octal numbers shall be extended to the necessary length by appending the ISO/IEC 646:1991 standard IRV zeros at the most-significant-digit end of the number; the result is written to the most-significant digit of the stream of octets first. The fields shall be interpreted as follows: c_magic Identify the archive as being a transportable archive by containing the identifying value "070707". c_dev, c_ino Contains values that uniquely identify the file within the archive (that is, no files contain the same pair of c_dev and c_ino values unless they are links to the same file). The values shall be determined in an unspecified manner. c_mode Contains the file type and access permissions as defined in the following table. Table 4-17: Values for cpio c_mode Field File Permissions Name Value Indicates C_IRUSR 000400 Read by owner C_IWUSR 000200 Write by owner C_IXUSR 000100 Execute by owner C_IRGRP 000040 Read by group C_IWGRP 000020 Write by group C_IXGRP 000010 Execute by group C_IROTH 000004 Read by others C_IWOTH 000002 Write by others C_IXOTH 000001 Execute by others C_ISUID 004000 Set uid C_ISGID 002000 Set gid C_ISVTX 001000 Reserved File Type Name Value Indicates C_ISDIR 040000 Directory C_ISFIFO 010000 FIFO C_ISREG 0100000 Regular file C_ISLNK 0120000 Symbolic link C_ISBLK 060000 Block special file C_ISCHR 020000 Character special file C_ISSOCK 0140000 Socket C_ISCTG 0110000 Reserved Directories, FIFOs, symbolic links, and regular files shall be supported on a system conforming to this volume of POSIX.12017; additional values defined previously are reserved for compatibility with existing systems. Additional file types may be supported; however, such files should not be written to archives intended to be transported to other systems. c_uid Contains the user ID of the owner. c_gid Contains the group ID of the group. c_nlink Contains a number greater than or equal to the number of links in the archive referencing the file. If the -a option is used to append to a cpio archive, then the pax utility need not account for the files in the existing part of the archive when calculating the c_nlink values for the appended part of the archive, and need not alter the c_nlink values in the existing part of the archive if additional files with the same c_dev and c_ino values are appended to the archive. c_rdev Contains implementation-defined information for character or block special files. c_mtime Contains the latest time of modification of the file at the time the archive was created. c_namesize Contains the length of the pathname, including the terminating NUL character. c_filesize Contains the length in octets of the data section following the header structure. cpio Filename The c_name field shall contain the pathname of the file. The length of this field in octets is the value of c_namesize. If a filename is found on the medium that would create an invalid pathname, it is implementation-defined whether the data from the file is stored on the file hierarchy and under what name it is stored. All characters shall be represented in the ISO/IEC 646:1991 standard IRV. For maximum portability between implementations, names should be selected from characters represented by the portable filename character set as octets with the most significant bit zero. If an implementation supports the use of characters outside the portable filename character set in names for files, users, and groups, one or more implementation-defined encodings of these characters shall be provided for interchange purposes. However, the pax utility shall never create filenames on the local system that cannot be accessed via the procedures described previously in this volume of POSIX.12017. If a filename is found on the medium that would create an invalid filename, it is implementation-defined whether the data from the file is stored on the local file system and under what name it is stored. The pax utility may choose to ignore these files as long as it produces an error indicating that the file is being ignored. cpio File Data Following c_name, there shall be c_filesize octets of data. Interpretation of such data occurs in a manner dependent on the file. For regular files, the data shall consist of the contents of the file. For symbolic links, the data shall consist of the contents of the symbolic link. If c_filesize is zero, no data shall be contained in c_filedata. When restoring from an archive: * If the user does not have appropriate privileges to create a file of the specified type, pax shall ignore the entry and write an error message to standard error. * Only regular files and symbolic links have data to be restored. Presuming a regular file meets any selection criteria that might be imposed on the format-reading utility by the user, such data shall be restored. * If a user does not have appropriate privileges to set a particular mode flag, the flag shall be ignored. Some of the mode flags in the archive format are not mentioned elsewhere in this volume of POSIX.12017. If the implementation does not support those flags, they may be ignored. cpio Special Entries FIFO special files, directories, and the trailer shall be recorded with c_filesize equal to zero. Symbolic links shall be recorded with c_filesize equal to the length of the contents of the symbolic link. For other special files, c_filesize is unspecified by this volume of POSIX.12017. The header for the next file entry in the archive shall be written directly after the last octet of the file entry preceding it. A header denoting the filename TRAILER!!! shall indicate the end of the archive; the contents of octets in the last block of the archive following such a header are undefined. EXIT STATUS top The following exit values shall be returned: 0 All files were processed successfully. >0 An error occurred. CONSEQUENCES OF ERRORS top If pax cannot create a file or a link when reading an archive or cannot find a file when writing an archive, or cannot preserve the user ID, group ID, or file mode when the -p option is specified, a diagnostic message shall be written to standard error and a non-zero exit status shall be returned, but processing shall continue. In the case where pax cannot create a link to a file, pax shall not, by default, create a second copy of the file. If the extraction of a file from an archive is prematurely terminated by a signal or error, pax may have only partially extracted the file or (if the -n option was not specified) may have extracted a file of the same name as that specified by the user, but which is not the file the user wanted. Additionally, the file modes of extracted directories may have additional bits from the S_IRWXU mask set as well as incorrect modification and access times. The following sections are informative. APPLICATION USAGE top Caution is advised when using the -a option to append to a cpio format archive. If any of the files being appended happen to be given the same c_dev and c_ino values as a file in the existing part of the archive, then they may be treated as links to that file on extraction. Thus, it is risky to use -a with cpio format except when it is done on the same system that the original archive was created on, and with the same pax utility, and in the knowledge that there has been little or no file system activity since the original archive was created that could lead to any of the files appended being given the same c_dev and c_ino values as an unrelated file in the existing part of the archive. Also, when (intentionally) appending additional links to a file in the existing part of the archive, the c_nlink values in the modified archive can be smaller than the number of links to the file in the archive, which may mean that the links are not preserved on extraction. The -p (privileges) option was invented to reconcile differences between historical tar and cpio implementations. In particular, the two utilities use -m in diametrically opposed ways. The -p option also provides a consistent means of extending the ways in which future file attributes can be addressed, such as for enhanced security systems or high-performance files. Although it may seem complex, there are really two modes that are most commonly used: -p e ``Preserve everything''. This would be used by the historical superuser, someone with all appropriate privileges, to preserve all aspects of the files as they are recorded in the archive. The e flag is the sum of o and p, and other implementation-defined attributes. -p p ``Preserve'' the file mode bits. This would be used by the user with regular privileges who wished to preserve aspects of the file other than the ownership. The file times are preserved by default, but two other flags are offered to disable these and use the time of extraction. The one pathname per line format of standard input precludes pathnames containing <newline> characters. Although such pathnames violate the portable filename guidelines, they may exist and their presence may inhibit usage of pax within shell scripts. This problem is inherited from historical archive programs. The problem can be avoided by listing filename arguments on the command line instead of on standard input. It is almost certain that appropriate privileges are required for pax to accomplish parts of this volume of POSIX.12017. Specifically, creating files of type block special or character special, restoring file access times unless the files are owned by the user (the -t option), or preserving file owner, group, and mode (the -p option) all probably require appropriate privileges. In read mode, implementations are permitted to overwrite files when the archive has multiple members with the same name. This may fail if permissions on the first version of the file do not permit it to be overwritten. The cpio and ustar formats can only support files up to 8589934592 bytes (8 2^30) in size. When archives containing binary header information are listed , the filenames printed may cause strange behavior on some terminals. When all of the following are true: 1. A file of type directory is being placed into an archive. 2. The ustar archive format is being used. 3. The pathname of the directory is less than or equal to 155 bytes long (it will fit in the prefix field in the ustar header block). 4. The last component of the pathname of the directory is longer than 100 bytes long (it will not fit in the name field in the ustar header block). some implementations of the pax utility will place the entire directory pathname in the prefix field, set the name field to an empty string, and place the directory in the archive. Other implementations of the pax utility will give an error under these conditions because the name field is not large enough to hold the last component of the directory name. This standard allows either behavior. However, when extracting a directory from a ustar format archive, this standard requires that all implementations be able to extract a directory even if the name field contains an empty string as long as the prefix field does not also contain an empty string. EXAMPLES top The following command: pax -w -f /dev/rmt/1m . copies the contents of the current directory to tape drive 1, medium density (assuming historical System V device naming proceduresthe historical BSD device name would be /dev/rmt9). The following commands: mkdir newdir pax -rw olddir newdir copy the olddir directory hierarchy to newdir. pax -r -s ',^//*usr//*,,' -f a.pax reads the archive a.pax, with all files rooted in /usr in the archive extracted relative to the current directory. Using the option: -o listopt="%M %(atime)T %(size)D %(name)s" overrides the default output description in Standard Output and instead writes: -rw-rw--- Jan 12 15:53 2003 1492 /usr/foo/bar Using the options: -o listopt='%L\t%(size)D\n%.7' \ -o listopt='(name)s\n%(atime)T\n%T' overrides the default output description in Standard Output and instead writes: /usr/foo/bar -> /tmp 1492 /usr/fo Jan 12 15:53 1991 Jan 31 15:53 2003 RATIONALE top The pax utility was new for the ISO POSIX2:1993 standard. It represents a peaceful compromise between advocates of the historical tar and cpio utilities. A fundamental difference between cpio and tar was in the way directories were treated. The cpio utility did not treat directories differently from other files, and to select a directory and its contents required that each file in the hierarchy be explicitly specified. For tar, a directory matched every file in the file hierarchy it rooted. The pax utility offers both interfaces; by default, directories map into the file hierarchy they root. The -d option causes pax to skip any file not explicitly referenced, as cpio historically did. The tar -style behavior was chosen as the default because it was believed that this was the more common usage and because tar is the more commonly available interface, as it was historically provided on both System V and BSD implementations. The data interchange format specification in this volume of POSIX.12017 requires that processes with ``appropriate privileges'' shall always restore the ownership and permissions of extracted files exactly as archived. If viewed from the historic equivalence between superuser and ``appropriate privileges'', there are two problems with this requirement. First, users running as superusers may unknowingly set dangerous permissions on extracted files. Second, it is needlessly limiting, in that superusers cannot extract files and own them as superuser unless the archive was created by the superuser. (It should be noted that restoration of ownerships and permissions for the superuser, by default, is historical practice in cpio, but not in tar.) In order to avoid these two problems, the pax specification has an additional ``privilege'' mechanism, the -p option. Only a pax invocation with the privileges needed, and which has the -p option set using the e specification character, has appropriate privileges to restore full ownership and permission information. Note also that this volume of POSIX.12017 requires that the file ownership and access permissions shall be set, on extraction, in the same fashion as the creat() function when provided with the mode stored in the archive. This means that the file creation mask of the user is applied to the file permissions. Users should note that directories may be created by pax while extracting files with permissions that are different from those that existed at the time the archive was created. When extracting sensitive information into a directory hierarchy that no longer exists, users are encouraged to set their file creation mask appropriately to protect these files during extraction. The table of contents output is written to standard output to facilitate pipeline processing. An early proposal had hard links displaying for all pathnames. This was removed because it complicates the output of the case where -v is not specified and does not match historical cpio usage. The hard-link information is available in the -v display. The description of the -l option allows implementations to make hard links to symbolic links. Earlier versions of this standard did not specify any way to create a hard link to a symbolic link, but many implementations provided this capability as an extension. If there are hard links to symbolic links when an archive is created, the implementation is required to archive the hard link in the archive (unless -H or -L is specified). When in read mode and in copy mode, implementations supporting hard links to symbolic links should use them when appropriate. The archive formats inherited from the POSIX.11990 standard have certain restrictions that have been brought along from historical usage. For example, there are restrictions on the length of pathnames stored in the archive. When pax is used in copy(-rw) mode (copying directory hierarchies), the ability to use extensions from the -xpax format overcomes these restrictions. The default blocksize value of 5120 bytes for cpio was selected because it is one of the standard block-size values for cpio, set when the -B option is specified. (The other default block-size value for cpio is 512 bytes, and this was considered to be too small.) The default block value of 10240 bytes for tar was selected because that is the standard block-size value for BSD tar. The maximum block size of 32256 bytes (215-512 bytes) is the largest multiple of 512 bytes that fits into a signed 16-bit tape controller transfer register. There are known limitations in some historical systems that would prevent larger blocks from being accepted. Historical values were chosen to improve compatibility with historical scripts using dd or similar utilities to manipulate archives. Also, default block sizes for any file type other than character special file has been deleted from this volume of POSIX.12017 as unimportant and not likely to affect the structure of the resulting archive. Implementations are permitted to modify the block-size value based on the archive format or the device to which the archive is being written. This is to provide implementations with the opportunity to take advantage of special types of devices, and it should not be used without a great deal of consideration as it almost certainly decreases archive portability. The intended use of the -n option was to permit extraction of one or more files from the archive without processing the entire archive. This was viewed by the standard developers as offering significant performance advantages over historical implementations. The -n option in early proposals had three effects; the first was to cause special characters in patterns to not be treated specially. The second was to cause only the first file that matched a pattern to be extracted. The third was to cause pax to write a diagnostic message to standard error when no file was found matching a specified pattern. Only the second behavior is retained by this volume of POSIX.12017, for many reasons. First, it is in general not acceptable for a single option to have multiple effects. Second, the ability to make pattern matching characters act as normal characters is useful for parts of pax other than file extraction. Third, a finer degree of control over the special characters is useful because users may wish to normalize only a single special character in a single filename. Fourth, given a more general escape mechanism, the previous behavior of the -n option can be easily obtained using the -s option or a sed script. Finally, writing a diagnostic message when a pattern specified by the user is unmatched by any file is useful behavior in all cases. In this version, the -n was removed from the copy mode synopsis of pax; it is inapplicable because there are no pattern operands specified in this mode. There is another method than pax for copying subtrees in POSIX.12008 described as part of the cp utility. Both methods are historical practice: cp provides a simpler, more intuitive interface, while pax offers a finer granularity of control. Each provides additional functionality to the other; in particular, pax maintains the hard-link structure of the hierarchy while cp does not. It is the intention of the standard developers that the results be similar (using appropriate option combinations in both utilities). The results are not required to be identical; there seemed insufficient gain to applications to balance the difficulty of implementations having to guarantee that the results would be exactly identical. A single archive may span more than one file. It is suggested that implementations provide informative messages to the user on standard error whenever the archive file is changed. The -d option (do not create intermediate directories not listed in the archive) found in early proposals was originally provided as a complement to the historic -d option of cpio. It has been deleted. The -s option in early proposals specified a subset of the substitution command from the ed utility. As there was no reason for only a subset to be supported, the -s option is now compatible with the current ed specification. Since the delimiter can be any non-null character, the following usage with single <space> characters is valid: pax -s " foo bar " ... The -t description is worded so as to note that this may cause the access time update caused by some other activity (which occurs while the file is being read) to be overwritten. The default behavior of pax with regard to file modification times is the same as historical implementations of tar. It is not the historical behavior of cpio. Because the -i option uses /dev/tty, utilities without a controlling terminal are not able to use this option. The -y option, found in early proposals, has been deleted because a line containing a single <period> for the -i option has equivalent functionality. The special lines for the -i option (a single <period> and the empty line) are historical practice in cpio. In early drafts, a -echarmap option was included to increase portability of files between systems using different coded character sets. This option was omitted because it was apparent that consensus could not be formed for it. In this version, the use of UTF8 should be an adequate substitute. The ISO POSIX2:1993 standard and ISO POSIX1 standard requirements for pax, however, made it very difficult to create a single archive containing files created using extended characters provided by different locales. This version adds the hdrcharset keyword to make it possible to archive files in these cases without dropping files due to translation errors. Translating filenames and other attributes from a locale's encoding to UTF8 and then back again can lose information, as the resulting filename might not be byte-for-byte equivalent to the original. To avoid this problem, users can specify the -o hdrcharset=binary option, which will cause the resulting archive to use binary format for all names and attributes. Such archives are not portable among hosts that use different native encodings (e.g., EBCDIC versus ASCII-based encodings), but they will allow interchange among the vast majority of POSIX file systems in practical use. Also, the -o hdrcharset=binary option will cause pax in copy mode to behave more like other standard utilities such as cp. If the values specified by the -o exthdr.name=value, -o globexthdr.name=value, or by $TMPDIR (if -o globexthdr.name is not specified) require a character encoding other than that described in the ISO/IEC 646:1991 standard, a path extended header record will have to be created for the file. If a hdrcharset extended header record is active for such headers, it will determine the codeset used for the value field in these extended path header records. These path extended header records always need to be created when writing an archive even if hdrcharset=binary has been specified and would contain the same (binary) data that appears in the ustar header record prefix and name fields. (In other words, an extended header path record is always required to be generated if the prefix or name fields contain non-ASCII characters even when hdrcharset=binary is also in effect for that file.) The -k option was added to address international concerns about the dangers involved in the character set transformations of -e (if the target character set were different from the source, the filenames might be transformed into names matching existing files) and also was made more general to protect files transferred between file systems with different {NAME_MAX} values (truncating a filename on a smaller system might also inadvertently overwrite existing files). As stated, it prevents any overwriting, even if the target file is older than the source. This version adds more granularity of options to solve this problem by introducing the -oinvalid=optionspecifically the UTF8 and binary actions. (Note that an existing file is still subject to overwriting in this case. The -k option closes that loophole.) Some of the file characteristics referenced in this volume of POSIX.12017 might not be supported by some archive formats. For example, neither the tar nor cpio formats contain the file access time. For this reason, the e specification character has been provided, intended to cause all file characteristics specified in the archive to be retained. It is required that extracted directories, by default, have their access and modification times and permissions set to the values specified in the archive. This has obvious problems in that the directories are almost certainly modified after being extracted and that directory permissions may not permit file creation. One possible solution is to create directories with the mode specified in the archive, as modified by the umask of the user, with sufficient permissions to allow file creation. After all files have been extracted, pax would then reset the access and modification times and permissions as necessary. The list-mode formatting description borrows heavily from the one defined by the printf utility. However, since there is no separate operand list to get conversion arguments, the format was extended to allow specifying the name of the conversion argument as part of the conversion specification. The T conversion specifier allows time fields to be displayed in any of the date formats. Unlike the ls utility, pax does not adjust the format when the date is less than six months in the past. This makes parsing the output more predictable. The D conversion specifier handles the ability to display the major/minor or file size, as with ls, by using %-8(size)D. The L conversion specifier handles the ls display for symbolic links. Conversion specifiers were added to generate existing known types used for ls. pax Interchange Format The new POSIX data interchange format was developed primarily to satisfy international concerns that the ustar and cpio formats did not provide for file, user, and group names encoded in characters outside a subset of the ISO/IEC 646:1991 standard. The standard developers realized that this new POSIX data interchange format should be very extensible because there were other requirements they foresaw in the near future: * Support international character encodings and locale information * Support security information (ACLs, and so on) * Support future file types, such as realtime or contiguous files * Include data areas for implementation use * Support systems with words larger than 32 bits and timers with subsecond granularity The following were not goals for this format because these are better handled by separate utilities or are inappropriate for a portable format: * Encryption * Compression * Data translation between locales and codesets * inode storage The format chosen to support the goals is an extension of the ustar format. Of the two formats previously available, only the ustar format was selected for extensions because: * It was easier to extend in an upwards-compatible way. It offered version flags and header block type fields with room for future standardization. The cpio format, while possessing a more flexible file naming methodology, could not be extended without breaking some theoretical implementation or using a dummy filename that could be a legitimate filename. * Industry experience since the original ``tar wars'' fought in developing the ISO POSIX1 standard has clearly been in favor of the ustar format, which is generally the default output format selected for pax implementations on new systems. The new format was designed with one additional goal in mind: reasonable behavior when an older tar or pax utility happened to read an archive. Since the POSIX.11990 standard mandated that a ``format-reading utility'' had to treat unrecognized typeflag values as regular files, this allowed the format to include all the extended information in a pseudo-regular file that preceded each real file. An option is given that allows the archive creator to set up reasonable names for these files on the older systems. Also, the normative text suggests that reasonable file access values be used for this ustar header block. Making these header files inaccessible for convenient reading and deleting would not be reasonable. File permissions of 600 or 700 are suggested. The ustar typeflag field was used to accommodate the additional functionality of the new format rather than magic or version because the POSIX.11990 standard (and, by reference, the previous version of pax), mandated the behavior of the format- reading utility when it encountered an unknown typeflag, but was silent about the other two fields. Early proposals for the first version of this standard contained a proposed archive format that was based on compatibility with the standard for tape files (ISO 1001, similar to the format used historically on many mainframes and minicomputers). This format was overly complex and required considerable overhead in volume and header records. Furthermore, the standard developers felt that it would not be acceptable to the community of POSIX developers, so it was later changed to be a format more closely related to historical practice on POSIX systems. The prefix and name split of pathnames in ustar was replaced by the single path extended header record for simplicity. The concept of a global extended header (typeflagg) was controversial. If this were applied to an archive being recorded on magnetic tape, a few unreadable blocks at the beginning of the tape could be a serious problem; a utility attempting to extract as many files as possible from a damaged archive could lose a large percentage of file header information in this case. However, if the archive were on a reliable medium, such as a CD ROM, the global extended header offers considerable potential size reductions by eliminating redundant information. Thus, the text warns against using the global method for unreliable media and provides a method for implanting global information in the extended header for each file, rather than in the typeflag g records. No facility for data translation or filtering on a per-file basis is included because the standard developers could not invent an interface that would allow this in an efficient manner. If a filter, such as encryption or compression, is to be applied to all the files, it is more efficient to apply the filter to the entire archive as a single file. The standard developers considered interfaces that would invoke a shell script for each file going into or out of the archive, but the system overhead in this approach was considered to be too high. One such approach would be to have filter= records that give a pathname for an executable. When the program is invoked, the file and archive would be open for standard input/output and all the header fields would be available as environment variables or command-line arguments. The standard developers did discuss such schemes, but they were omitted from POSIX.12008 due to concerns about excessive overhead. Also, the program itself would need to be in the archive if it were to be used portably. There is currently no portable means of identifying the character set(s) used for a file in the file system. Therefore, pax has not been given a mechanism to generate charset records automatically. The only portable means of doing this is for the user to write the archive using the -ocharset=string command line option. This assumes that all of the files in the archive use the same encoding. The ``implementation-defined'' text is included to allow for a system that can identify the encodings used for each of its files. The table of standards that accompanies the charset record description is acknowledged to be very limited. Only a limited number of character set standards is reasonable for maximal interchange. Any character set is, of course, possible by prior agreement. It was suggested that EBCDIC be listed, but it was omitted because it is not defined by a formal standard. Formal standards, and then only those with reasonably large followings, can be included here, simply as a matter of practicality. The <value>s represent names of officially registered character sets in the format required by the ISO 2375:1985 standard. The normal <comma> or <blank>-separated list rules are not followed in the case of keyword options to allow ease of argument parsing for getopts. Further information on character encodings is in pax Archive Character Set Encoding/Decoding. The standard developers have reserved keyword name space for vendor extensions. It is suggested that the format to be used is: VENDOR.keyword where VENDOR is the name of the vendor or organization in all uppercase letters. It is further suggested that the keyword following the <period> be named differently than any of the standard keywords so that it could be used for future standardization, if appropriate, by omitting the VENDOR prefix. The <length> field in the extended header record was included to make it simpler to step through the records, even if a record contains an unknown format (to a particular pax) with complex interactions of special characters. It also provides a minor integrity checkpoint within the records to aid a program attempting to recover files from a damaged archive. There are no extended header versions of the devmajor and devminor fields because the unspecified format ustar header field should be sufficient. If they are not, vendor-specific extended keywords (such as VENDOR.devmajor) should be used. Device and i-number labeling of files was not adopted from cpio; files are interchanged strictly on a symbolic name basis, as in ustar. Just as with the ustar format descriptions, the new format makes no special arrangements for multi-volume archives. Each of the pax archive types is assumed to be inside a single POSIX file and splitting that file over multiple volumes (diskettes, tape cartridges, and so on), processing their labels, and mounting each in the proper sequence are considered to be implementation details that cannot be described portably. The pax format is intended for interchange, not only for backup on a single (family of) systems. It is not as densely packed as might be possible for backup: * It contains information as coded characters that could be coded in binary. * It identifies extended records with name fields that could be omitted in favor of a fixed-field layout. * It translates names into a portable character set and identifies locale-related information, both of which are probably unnecessary for backup. The requirements on restoring from an archive are slightly different from the historical wording, allowing for non- monolithic privilege to bring forward as much as possible. In particular, attributes such as ``high performance file'' might be broadly but not universally granted while set-user-ID or chown() might be much more restricted. There is no implication in POSIX.12008 that the security information be honored after it is restored to the file hierarchy, in spite of what might be improperly inferred by the silence on that topic. That is a topic for another standard. Links are recorded in the fashion described here because a link can be to any file type. It is desirable in general to be able to restore part of an archive selectively and restore all of those files completely. If the data is not associated with each link, it is not possible to do this. However, the data associated with a file can be large, and when selective restoration is not needed, this can be a significant burden. The archive is structured so that files that have no associated data can always be restored by the name of any link name of any link, and the user may choose whether data is recorded with each instance of a file that contains data. The format permits mixing of both types of links in a single archive; this can be done for special needs, and pax is expected to interpret such archives on input properly, despite the fact that there is no pax option that would force this mixed case on output. (When -o linkdata is used, the output must contain the duplicate data, but the implementation is free to include it or omit it when -o linkdata is not used.) The time values are included as extended header records for those implementations needing more than the eleven octal digits allowed by the ustar format. Portable file timestamps cannot be negative. If pax encounters a file with a negative timestamp in copy or write mode, it can reject the file, substitute a non-negative timestamp, or generate a non-portable timestamp with a leading '-'. Even though some implementations can support finer file- time granularities than seconds, the normative text requires support only for seconds since the Epoch because the ISO POSIX1 standard states them that way. The ustar format includes only mtime; the new format adds atime and ctime for symmetry. The atime access time restored to the file system will be affected by the -p a and -p e options. The ctime creation time (actually inode modification time) is described with appropriate privileges so that it can be ignored when writing to the file system. POSIX does not provide a portable means to change file creation time. Nothing is intended to prevent a non-portable implementation of pax from restoring the value. The gid, size, and uid extended header records were included to allow expansion beyond the sizes specified in the regular tar header. New file system architectures are emerging that will exhaust the 12-digit size field. There are probably not many systems requiring more than 8 digits for user and group IDs, but the extended header values were included for completeness, allowing overrides for all of the decimal values in the tar header. The standard developers intended to describe the effective results of pax with regard to file ownerships and permissions; implementations are not restricted in timing or sequencing the restoration of such, provided the results are as specified. Much of the text describing the extended headers refers to use in ``write or copy modes''. The copy mode references are due to the normative text: ``The effect of the copy shall be as if the copied files were written to an archive file and then subsequently extracted ...''. There is certainly no way to test whether pax is actually generating the extended headers in copy mode, but the effects must be as if it had. pax Archive Character Set Encoding/Decoding There is a need to exchange archives of files between systems of different native codesets. Filenames, group names, and user names must be preserved to the fullest extent possible when an archive is read on the receiving platform. Translation of the contents of files is not within the scope of the pax utility. There will also be the need to represent characters that are not available on the receiving platform. These unsupported characters cannot be automatically folded to the local set of characters due to the chance of collisions. This could result in overwriting previous extracted files from the archive or pre-existing files on the system. For these reasons, the codeset used to represent characters within the extended header records of the pax archive must be sufficiently rich to handle all commonly used character sets. The fields requiring translation include, at a minimum, filenames, user names, group names, and link pathnames. Implementations may wish to have localized extended keywords that use non-portable characters. The standard developers considered the following options: * The archive creator specifies the well-defined name of the source codeset. The receiver must then recognize the codeset name and perform the appropriate translations to the destination codeset. * The archive creator includes within the archive the character mapping table for the source codeset used to encode extended header records. The receiver must then read the character mapping table and perform the appropriate translations to the destination codeset. * The archive creator translates the extended header records in the source codeset into a canonical form. The receiver must then perform the appropriate translations to the destination codeset. The approach that incorporates the name of the source codeset poses the problem of codeset name registration, and makes the archive useless to pax archive decoders that do not recognize that codeset. Because parts of an archive may be corrupted, the standard developers felt that including the character map of the source codeset was too fragile. The loss of this one key component could result in making the entire archive useless. (The difference between this and the global extended header decision was that the latter has a workaroundduplicating extended header records on unreliable mediabut this would be too burdensome for large character set maps.) Both of the above approaches also put an undue burden on the pax archive receiver to handle the cross-product of all source and destination codesets. To simplify the translation from the source codeset to the canonical form and from the canonical form to the destination codeset, the standard developers decided that the internal representation should be a stateless encoding. A stateless encoding is one where each codepoint has the same meaning, without regard to the decoder being in a specific state. An example of a stateful encoding would be the Japanese Shift-JIS; an example of a stateless encoding would be the ISO/IEC 646:1991 standard (equivalent to 7-bit ASCII). For these reasons, the standard developers decided to adopt a canonical format for the representation of file information strings. The obvious, well-endorsed candidate is the ISO/IEC 106461:2000 standard (based in part on Unicode), which can be used to represent the characters of virtually all standardized character sets. The standard developers initially agreed upon using UCS2 (16-bit Unicode) as the internal representation. This repertoire of characters provides a sufficiently rich set to represent all commonly-used codesets. However, the standard developers found that the 16-bit Unicode representation had some problems. It forced the issue of standardizing byte ordering. The 2-byte length of each character made the extended header records twice as long for the case of strings coded entirely from historical 7-bit ASCII. For these reasons, the standard developers chose the UTF8 defined in the ISO/IEC 106461:2000 standard. This multi-byte representation encodes UCS2 or UCS4 characters reliably and deterministically, eliminating the need for a canonical byte ordering. In addition, NUL octets and other characters possibly confusing to POSIX file systems do not appear, except to represent themselves. It was realized that certain national codesets take up more space after the encoding, due to their placement within the UCS range; it was felt that the usefulness of the encoding of the names outweighs the disadvantage of size increase for file, user, and group names. The encoding of UTF8 is as follows: UCS4 Hex Encoding UTF-8 Binary Encoding 00000000-0000007F 0xxxxxxx 00000080-000007FF 110xxxxx 10xxxxxx 00000800-0000FFFF 1110xxxx 10xxxxxx 10xxxxxx 00010000-001FFFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx 00200000-03FFFFFF 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 04000000-7FFFFFFF 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx where each 'x' represents a bit value from the character being translated. ustar Interchange Format The description of the ustar format reflects numerous enhancements over pre-1988 versions of the historical tar utility. The goal of these changes was not only to provide the functional enhancements desired, but also to retain compatibility between new and old versions. This compatibility has been retained. Archives written using the old archive format are compatible with the new format. Implementors should be aware that the previous file format did not include a mechanism to archive directory type files. For this reason, the convention of using a filename ending with <slash> was adopted to specify a directory on the archive. The total size of the name and prefix fields have been set to meet the minimum requirements for {PATH_MAX}. If a pathname will fit within the name field, it is recommended that the pathname be stored there without the use of the prefix field. Although the name field is known to be too small to contain {PATH_MAX} characters, the value was not changed in this version of the archive file format to retain backwards-compatibility, and instead the prefix was introduced. Also, because of the earlier version of the format, there is no way to remove the restriction on the linkname field being limited in size to just that of the name field. The size field is required to be meaningful in all implementation extensions, although it could be zero. This is required so that the data blocks can always be properly counted. It is suggested that if device special files need to be represented that cannot be represented in the standard format, that one of the extension types (AZ) be used, and that the additional information for the special file be represented as data and be reflected in the size field. Attempting to restore a special file type, where it is converted to ordinary data and conflicts with an existing filename, need not be specially detected by the utility. If run as an ordinary user, pax should not be able to overwrite the entries in, for example, /dev in any case (whether the file is converted to another type or not). If run as a privileged user, it should be able to do so, and it would be considered a bug if it did not. The same is true of ordinary data files and similarly named special files; it is impossible to anticipate the needs of the user (who could really intend to overwrite the file), so the behavior should be predictable (and thus regular) and rely on the protection system as required. The value 7 in the typeflag field is intended to define how contiguous files can be stored in a ustar archive. POSIX.12008 does not require the contiguous file extension, but does define a standard way of archiving such files so that all conforming systems can interpret these file types in a meaningful and consistent manner. On a system that does not support extended file types, the pax utility should do the best it can with the file and go on to the next. The file protection modes are those conventionally used by the ls utility. This is extended beyond the usage in the ISO POSIX2 standard to support the ``shared text'' or ``sticky'' bit. It is intended that the conformance document should not document anything beyond the existence of and support of such a mode. Further extensions are expected to these bits, particularly with overloading the set-user-ID and set-group-ID flags. cpio Interchange Format The reference to appropriate privileges in the cpio format refers to an error on standard output; the ustar format does not make comparable statements. The model for this format was the historical System V cpio-c data interchange format. This model documents the portable version of the cpio format and not the binary version. It has the flexibility to transfer data of any type described within POSIX.12008, yet is extensible to transfer data types specific to extensions beyond POSIX.12008 (for example, contiguous files). Because it describes existing practice, there is no question of maintaining upwards-compatibility. cpio Header There has been some concern that the size of the c_ino field of the header is too small to handle those systems that have very large inode numbers. However, the c_ino field in the header is used strictly as a hard-link resolution mechanism for archives. It is not necessarily the same value as the inode number of the file in the location from which that file is extracted. The name c_magic is based on historical usage. cpio Filename For most historical implementations of the cpio utility, {PATH_MAX} octets can be used to describe the pathname without the addition of any other header fields (the NUL character would be included in this count). {PATH_MAX} is the minimum value for pathname size, documented as 256 bytes. However, an implementation may use c_namesize to determine the exact length of the pathname. With the current description of the <cpio.h> header, this pathname size can be as large as a number that is described in six octal digits. Two values are documented under the c_mode field values to provide for extensibility for known file types: 0110 000 Reserved for contiguous files. The implementation may treat the rest of the information for this archive like a regular file. If this file type is undefined, the implementation may create the file as a regular file. This provides for extensibility of the cpio format while allowing for the ability to read old archives. Files of an unknown type may be read as ``regular files'' on some implementations. On a system that does not support extended file types, the pax utility should do the best it can with the file and go on to the next. FUTURE DIRECTIONS top None. SEE ALSO top Chapter 2, Shell Command Language, cp(1p), ed(1p), getopts(1p), ls(1p), printf(1p) The Base Definitions volume of POSIX.12017, Section 3.169, File Mode Bits, Chapter 5, File Format Notation, Chapter 8, Environment Variables, Section 12.2, Utility Syntax Guidelines, cpio.h(0p), tar.h(0p) The System Interfaces volume of POSIX.12017, chown(3p), creat(3p), fstatat(3p), mkdir(3p), mkfifo(3p), utime(3p), write(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 PAX(1P) Pages that refer to this page: cpio.h(0p), tar.h(0p), ar(1p), cp(1p), file(1p), find(1p), ln(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. | # pax\n\n> Archiving and copying utility.\n> More information: <https://manned.org/pax.1p>.\n\n- List the contents of an archive:\n\n`pax -f {{archive.tar}}`\n\n- List the contents of a `gzip` archive:\n\n`pax -zf {{archive.tar.gz}}`\n\n- Create an archive from files:\n\n`pax -wf {{target.tar}} {{path/to/file1 path/to/file2 ...}}`\n\n- Create an archive from files, using output redirection:\n\n`pax -w {{path/to/file1 path/to/file2 ...}} > {{target.tar}}`\n\n- Extract an archive into the current directory:\n\n`pax -rf {{source.tar}}`\n\n- Copy to a directory, while keeping the original metadata; `target/` must exist:\n\n`pax -rw {{path/to/file1}} {{path/to/directory1 path/to/directory2 ...}} {{target/}}`\n |
perf | perf(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training perf(1) Linux manual page NAME | SYNOPSIS | OPTIONS | DESCRIPTION | SEE ALSO | COLOPHON PERF(1) perf Manual PERF(1) NAME top perf - Performance analysis tools for Linux SYNOPSIS top perf [--version] [--help] [OPTIONS] COMMAND [ARGS] OPTIONS top -h, --help Run perf help command. -v, --version Display perf version. -vv Print the compiled-in status of libraries. --exec-path Display or set exec path. --html-path Display html documentation path. -p, --paginate Set up pager. --no-pager Do not set pager. --buildid-dir Setup buildid cache directory. It has higher priority than buildid.dir config file option. --list-cmds List the most commonly used perf commands. --list-opts List available perf options. --debugfs-dir Set debugfs directory or set environment variable PERF_DEBUGFS_DIR. --debug Setup debug variable (see list below) in value range (0, 10). Use like: --debug verbose # sets verbose = 1 --debug verbose=2 # sets verbose = 2 List of debug variables allowed to set: verbose - general debug messages ordered-events - ordered events object debug messages data-convert - data convert command debug messages stderr - write debug output (option -v) to stderr in browser mode perf-event-open - Print perf_event_open() arguments and return value DESCRIPTION top Performance counters for Linux are a new kernel-based subsystem that provide a framework for all things performance analysis. It covers hardware level (CPU/PMU, Performance Monitoring Unit) features and software features (software counters, tracepoints) as well. SEE ALSO top perf-stat(1), perf-top(1), perf-record(1), perf-report(1), perf-list(1) perf-annotate(1),perf-archive(1),perf-arm-spe(1), perf-bench(1), perf-buildid-cache(1), perf-buildid-list(1), perf-c2c(1), perf-config(1), perf-data(1), perf-diff(1), perf-evlist(1), perf-ftrace(1), perf-help(1), perf-inject(1), perf-intel-pt(1), perf-iostat(1), perf-kallsyms(1), perf-kmem(1), perf-kvm(1), perf-lock(1), perf-mem(1), perf-probe(1), perf-sched(1), perf-script(1), perf-test(1), perf-trace(1), perf-version(1) COLOPHON top This page is part of the perf (Performance analysis tools for Linux (in Linux source tree)) project. Information about the project can be found at https://perf.wiki.kernel.org/index.php/Main_Page. 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 http://git.kernel.org/cgit/linux/kernel/git/torvalds/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-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] perf 2022-04-14 PERF(1) Pages that refer to this page: perf-bench(1), perf-config(1), perf-data(1), perf-help(1), perf-lock(1), perf_event_open(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. | # perf\n\n> Framework for Linux performance counter measurements.\n> More information: <https://perf.wiki.kernel.org>.\n\n- Display basic performance counter stats for a command:\n\n`perf stat {{gcc hello.c}}`\n\n- Display system-wide real-time performance counter profile:\n\n`sudo perf top`\n\n- Run a command and record its profile into `perf.data`:\n\n`sudo perf record {{command}}`\n\n- Record the profile of an existing process into `perf.data`:\n\n`sudo perf record -p {{pid}}`\n\n- Read `perf.data` (created by `perf record`) and display the profile:\n\n`sudo perf report`\n |
pgrep | pgrep(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pgrep(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | EXAMPLES | EXIT STATUS | NOTES | BUGS | SEE ALSO | AUTHOR | REPORTING BUGS | COLOPHON PGREP(1) User Commands PGREP(1) NAME top pgrep, pkill, pidwait - look up, signal, or wait for processes based on name and other attributes SYNOPSIS top pgrep [options] pattern pkill [options] pattern pidwait [options] pattern DESCRIPTION top pgrep looks through the currently running processes and lists the process IDs which match the selection criteria to stdout. All the criteria have to match. For example, $ pgrep -u root sshd will only list the processes called sshd AND owned by root. On the other hand, $ pgrep -u root,daemon will list the processes owned by root OR daemon. pkill will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout. pidwait will wait for each process instead of listing them on stdout. OPTIONS top -signal --signal signal Defines the signal to send to each matched process. Either the numeric or the symbolic signal name can be used. In pgrep or pidwait mode only the long option can be used and has no effect unless used in conjunction with --require-handler to filter to processes with a userspace signal handler present for a particular signal. -c, --count Suppress normal output; instead print a count of matching processes. When count does not match anything, e.g. returns zero, the command will return non-zero value. Note that for pkill and pidwait, the count is the number of matching processes, not the processes that were successfully signaled or waited for. -d, --delimiter delimiter Sets the string used to delimit each process ID in the output (by default a newline). (pgrep only.) -e, --echo Display name and PID of the process being killed. (pkill only.) -f, --full The pattern is normally only matched against the process name. When -f is set, the full command line is used. -g, --pgroup pgrp,... Only match processes in the process group IDs listed. Process group 0 is translated into pgrep's, pkill's, or pidwait's own process group. -G, --group gid,... Only match processes whose real group ID is listed. Either the numerical or symbolical value may be used. -i, --ignore-case Match processes case-insensitively. -l, --list-name List the process name as well as the process ID. (pgrep only.) -a, --list-full List the full command line as well as the process ID. (pgrep only.) -n, --newest Select only the newest (most recently started) of the matching processes. -o, --oldest Select only the oldest (least recently started) of the matching processes. -O, --older secs Select processes older than secs. -P, --parent ppid,... Only match processes whose parent process ID is listed. -s, --session sid,... Only match processes whose process session ID is listed. Session ID 0 is translated into pgrep's, pkill's, or pidwait's own session ID. -t, --terminal term,... Only match processes whose controlling terminal is listed. The terminal name should be specified without the "/dev/" prefix. -u, --euid euid,... Only match processes whose effective user ID is listed. Either the numerical or symbolical value may be used. -U, --uid uid,... Only match processes whose real user ID is listed. Either the numerical or symbolical value may be used. -v, --inverse Negates the matching. This option is usually used in pgrep's or pidwait's context. In pkill's context the short option is disabled to avoid accidental usage of the option. -w, --lightweight Shows all thread ids instead of pids in pgrep's or pidwait's context. In pkill's context this option is disabled. -x, --exact Only match processes whose names (or command lines if -f is specified) exactly match the pattern. -F, --pidfile file Read PIDs from file. This option is more useful for pkill or pidwait than pgrep. -L, --logpidfile Fail if pidfile (see -F) not locked. -r, --runstates D,R,S,Z,... Match only processes which match the process state. -A, --ignore-ancestors Ignore all ancestors of pgrep, pkill, or pidwait. For example, this can be useful when elevating with sudo or similar tools. -H, --require-handler Only match processes with a userspace signal handler present for the signal to be sent. --cgroup name,... Match on provided control group (cgroup) v2 name. See cgroups(8) --env name[=value],... Match on process that have these environent variables. If the =value parameter is not defined then only the variable name is matched. --ns pid Match processes that belong to the same namespaces. Required to run as root to match processes from other users. See --nslist for how to limit which namespaces to match. --nslist name,... Match only the provided namespaces. Available namespaces: ipc, mnt, net, pid, user, uts. -q, --queue value Use sigqueue(3) rather than kill(2) and the value argument is used to specify an integer to be sent with the signal. If the receiving process has installed a handler for this signal using the SA_SIGINFO flag to sigaction(2), then it can obtain this data via the si_value field of the siginfo_t structure. -V, --version Display version information and exit. -h, --help Display help and exit. OPERANDS top pattern Specifies an Extended Regular Expression for matching against the process names or command lines. EXAMPLES top Example 1: Find the process ID of the named daemon: $ pgrep -u root named Example 2: Make syslog reread its configuration file: $ pkill -HUP syslogd Example 3: Give detailed information on all xterm processes: $ ps -fp $(pgrep -d, -x xterm) Example 4: Make all chrome processes run nicer: $ renice +4 $(pgrep chrome) EXIT STATUS top 0 One or more processes matched the criteria. For pkill and pidwait, one or more processes must also have been successfully signalled or waited for. 1 No processes matched or none of them could be signalled. 2 Syntax error in the command line. 3 Fatal error: out of memory etc. NOTES top The process name used for matching is limited to the 15 characters present in the output of /proc/pid/stat. Use the -f option to match against the complete command line, /proc/pid/cmdline. Threads may not have the same process name as the parent process but will have the same command line. The running pgrep, pkill, or pidwait process will never report itself as a match. The -O --older option will silently fail if /proc is mounted with the subset=pid option. BUGS top The options -n and -o and -v can not be combined. Let me know if you need to do this. Defunct processes are reported. pidwait requires the pidfd_open(2) system call which first appeared in Linux 5.3. SEE ALSO top ps(1), regex(7), signal(7), sigqueue(3), killall(1), skill(1), kill(1), kill(2), cgroups(8). AUTHOR top Kjetil Torgrim Homme [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-10-04 PGREP(1) Pages that refer to this page: fuser(1), kill(1@@procps-ng), killall(1), pidof(1), pmap(1), ps(1), pslog(1), pwdx(1), skill(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. | # pgrep\n\n> Find or signal processes by name.\n> More information: <https://www.man7.org/linux/man-pages/man1/pkill.1.html>.\n\n- Return PIDs of any running processes with a matching command string:\n\n`pgrep {{process_name}}`\n\n- Search for processes including their command-line options:\n\n`pgrep --full "{{process_name}} {{parameter}}"`\n\n- Search for processes run by a specific user:\n\n`pgrep --euid root {{process_name}}`\n |
pic | pic(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pic(1) Linux manual page Name | Synopsis | Description | Options | Usage | Files | Bugs | See also | COLOPHON pic(1) General Commands Manual pic(1) Name top pic - compile pictures for troff or TeX Synopsis top pic [-CnSU] [file ...] pic -t [-cCSUz] [file ...] pic --help pic -v pic --version Description top The GNU implementation of pic is part of the groff(1) document formatting system. pic is a troff(1) preprocessor that translates descriptions of diagrammatic pictures embedded in roff(7) or TeX input files into the language understood by TeX or troff. It copies each file's contents to the standard output stream, except for lines between .PS and any of .PE, .PF, or .PY which it interprets as picture descriptions. End a pic picture with .PE to leave the drawing position at the bottom of the picture, and with .PF or .PY to leave it at the top. Normally, pic is not executed directly by the user, but invoked by specifying the -p option to groff(1). If no file operands are present, or if file is -, pic reads the standard input stream. It is the user's responsibility to provide appropriate definitions of the PS, PE, and one or both of the PF and PY macros. When a macro package does not supply these, obtain simple definitions with the groff option -mpic; these will center each picture. GNU pic supports PY as a synonym of PF to work around a name space collision with the mm macro package, which defines PF as a page footer management macro. Use PF preferentially unless a similar problem faces your document. Options top --help displays a usage message, while -v and --version show version information; all exit afterward. -c Be more compatible with tpic; implies -t. Lines beginning with \ are not passed through transparently. Lines beginning with . are passed through with the initial . changed to \. A line beginning with .ps is given special treatment: it takes an optional integer argument specifying the line thickness (pen size) in milliinches; a missing argument restores the previous line thickness; the default line thickness is 8 milliinches. The line thickness thus specified takes effect only when a non- negative line thickness has not been specified by use of the thickness attribute or by setting the linethick variable. -C Recognize .PS, .PE, .PF, and .PY even when followed by a character other than space or newline. -n Don't use groff extensions to the troff drawing commands. Specify this option if a postprocessor you're using doesn't support these extensions, described in groff_out(5). This option also causes pic not to use zero-length lines to draw dots in troff mode. -S Operate in safer mode; sh commands are ignored. This mode, enabled by default, can be useful when operating on untrustworthy input. -t Produce TeX output. -U Operate in unsafe mode; sh commands are interpreted. -z In TeX mode, draw dots using zero-length lines. The following options supported by other versions of pic are ignored. -D Draw all lines using the \D escape sequence. GNU pic always does this. -T dev Generate output for the troff device dev. This is unnecessary because the troff output generated by GNU pic is device-independent. Usage top This section primarily discusses the differences between GNU pic and the Eighth Edition Unix version of AT&T pic (1985). Many of these differences also apply to later versions of AT&T pic. TeX mode TeX-compatible output is produced when the -t option is specified. You must use a TeX driver that supports tpic version 2 specials. (tpic was a fork of AT&T pic by Tim Morgan of the University of California at Irvine that diverged from its source around 1984. It is best known today for lending its name to a group of \special commands it produced for TeX.) Lines beginning with \ are passed through unaltered except for a % suffix to avoid unwanted spaces. Use this feature to change fonts or the value of \baselineskip. Other applications may produce undesirable results; use at your own risk. By default, lines beginning with a dot are not treated speciallybut see the -c option. In TeX mode, pic will define a vbox called \graph for each picture. Use GNU pic's figname command to change the name of the vbox. You must print that vbox yourself using the command \centerline{\box\graph} for instance. Since the vbox has a height of zeroit is defined with \vtopthis will produce slightly more vertical space above the picture than below it; \centerline{\raise 1em\box\graph} would avoid this. To give the vbox a positive height and a depth of zero (as used by LaTeX's graphics.sty, for example), define the following macro in your document. \def\gpicbox#1{% \vbox{\unvbox\csname #1\endcsname\kern 0pt}} You can then simply say \gpicbox{graph} instead of \box\graph. Commands Several commands new to GNU pic accept delimiters, shown in their synopses as braces { }. Nesting of braces is supported. Any other characters (except a space, tab, or newline) may be used as alternative delimiters, in which case the members of a given pair must be identical. Strings are recognized within delimiters of either kind; they may contain the delimiter character or unbalanced braces. for variable = expr1 to expr2 [by [*]expr3] do X body X Set variable to expr1. While the value of variable is less than or equal to expr2, do body and increment variable by expr3; if by is not given, increment variable by 1. expr3 can be negative, in which case variable is then tested whether it is greater than or equal to expr2. A * prefix on variable multiplies it by expr3 (which must be greater than zero) at each iteration rather than incrementing it. If the range constraint on expr3 isn't met, the loop will not execute. X can be any character not in body. if expr then X if-true X [else Y if-false Y] Evaluate expr; if it is non-zero then do if-true, otherwise do if-false. X can be any character not in if- true. Y can be any character not in if-false. print arg ... Concatenate and write arguments to the standard error stream followed by a newline. Each arg must be an expression, a position, or text. This feature is useful for debugging. command arg ... Concatenate arguments and pass them as a line to troff or TeX. Each arg must be an expression, a position, or text. command allows the values of pic variables to be passed to the formatter. Thus, .PS x = 14 command ".ds string x is " x "." .PE \*[string] produces x is 14. when formatted with troff. sh X command X Pass command to a shell. copy "filename" Include filename at this point in the file. copy ["filename"] thru X body X [until "word"] copy ["filename"] thru macro [until "word"] This construct does body once for each line of filename; the line is split into blank-delimited words, and occurrences of $i in body, for i between 1 and 9, are replaced by the i-th word of the line. If filename is not given, lines are taken from the current input up to .PE. If an until clause is specified, lines will be read only until a line the first word of which is word; that line will then be discarded. X can be any character not in body. For example, .PS copy thru % circle at ($1,$2) % until "END" 1 2 3 4 5 6 END box .PE and .PS circle at (1,2) circle at (3,4) circle at (5,6) box .PE are equivalent. The commands to be performed for each line can also be taken from a macro defined earlier by giving the name of the macro as the argument to thru. The argument after thru is looked up as a macro name first; if not defined, its first character is interpreted as a delimiter. reset reset pvar1[,] pvar2 ... Reset predefined variables pvar1, pvar2 ... to their default values; if no arguments are given, reset all predefined variables to their default values. Variable names may be separated by commas, spaces, or both. Assigning a value to scale also causes all predefined variables that control dimensions to be reset to their default values times the new value of scale. plot expr ["text"] Create a text object by using text as a format string for sprintf(3) with an argument of expr. If text is omitted, "%g" is implied. Attributes can be specified in the same way as for a normal text object. Caution: be very careful that you specify an appropriate format string in text; pic's validation of it is limited. plot is deprecated in favour of sprintf. var := expr Update an existing variable. var must already be defined, and expr will be assigned to var without creating a variable local to the current block. (By contrast, = defines var in the current block if it is not already defined there, and then changes the value in the current block only.) For example, .PS x = 3 y = 3 [ x := 5 y = 5 ] print x y .PE writes 5 3 to the standard error stream. Expressions The syntax for expressions has been significantly extended. x ^ y (exponentiation) sin(x) cos(x) atan2(y, x) log(x) (base 10) exp(x) (base 10, i.e. 10^x) sqrt(x) int(x) rand() (return a random number between 0 and 1) rand(x) (return a random number between 1 and x; deprecated) srand(x) (set the random number seed) max(e1, e2) min(e1, e2) !e e1 && e2 e1 || e2 e1 == e2 e1 != e2 e1 >= e2 e1 > e2 e1 <= e2 e1 < e2 "str1" == "str2" "str1" != "str2" String comparison expressions must be parenthesised in some contexts to avoid ambiguity. Other changes A bare expression, expr, is acceptable as an attribute; it is equivalent to dir expr, where dir is the current direction. For example, line 2i draws a line 2 inches long in the current direction. The i (or I) character is ignored; to use another measurement unit, set the scale variable to an appropriate value. The maximum width and height of the picture are taken from the variables maxpswid and maxpsht. Initially, these have values 8.5 and 11, respectively. Scientific notation is allowed for numbers, as with x = 5e-2. Text attributes can be compounded. For example, "foo" above ljust is valid. There is no limit to the depth to which blocks can be nested. For example, [A: [B: [C: box ]]] with .A.B.C.sw at 1,2 circle at last [].A.B.C is acceptable. Arcs have compass points determined by the circle of which the arc is a part. Circles, ellipses, and arcs can be dotted or dashed. In TeX mode, splines can be dotted or dashed as well. Boxes can have rounded corners. The rad attribute specifies the radius of the quarter-circles at each corner. If no rad or diam attribute is given, a radius of boxrad is used. Initially, boxrad has a value of 0. A box with rounded corners can be dotted or dashed. Boxes can have slanted sides, generalizing them from rectangles to parallelograms. The xslanted and yslanted attributes specify the x and y offsets of the box's upper right corner from its default position. The .PS line accepts a second argument specifying a maximum height for the picture. If a width of zero is specified, it will be ignored when computing the scaling factor for the picture. GNU pic will always scale a picture by the same amount vertically as well as horizontally. This is different from DWB 2.0 pic, which may scale a picture by a different amount vertically than horizontally if a height is specified. Each text object has an associated invisible box that determines its compass points and implicit motion. The dimensions of the box are taken from its width and height attributes. If the width attribute is not supplied, the value of textwid is assumed. If the height attribute is not supplied, the height will default to the number of text strings associated with the object times textht. Initially, textwid and textht have values of 0. In (almost all) places where a quoted text string can be used, an expression of the form sprintf("format", arg, ...) can be used instead; this will produce the arguments per the format, which should be a string as described in printf(3), and appropriate to the quantity of arguments supplied. Only the modifiers #, -, +, and [space]), a minimum field width, an optional precision, and the conversion specifiers %e, %E, %f, %g, %G, and %% are supported. The thickness of the lines used to draw objects is controlled by the linethick variable, which is measured in points. A negative value indicates the default thickness. In TeX output mode when the -c option is not given, this means 8 milliinches. In troff and TeX -c output modes, the default thickness corresponds to the type size. (Thus, if the type size is 10 points, a line is 10 points thick.) A linethick value of zero draws the thinnest possible line supported by the output device. Initially, linethick has a value of -1. A thick[ness] attribute is also available. For example, circle thickness 1.5 draws a circle with a line thickness of 1.5 points. The thickness of lines is not affected by the value of the scale variable, nor by the width or height given in the .PS line. Boxes (including boxes with rounded corners or slanted sides), circles, and ellipses can be filled by giving them an attribute of fill[ed], which takes an optional expression argument with a value between 0 and 1; 0 will fill it with white, 1 with black, values in between with a proportionally gray shade. A value greater than 1 is interpreted as the shade of gray that is being used for text and lines. Normally this will be black, but output devices may provide a mechanism for changing this. Without an argument, the value of the variable fillval is used. Initially, fillval has a value of 0.5. The invisible attribute does not affect the filling of objects. Text associated with a filled object is added after the object is filled, so that the text is not obscured by the filling. Additional modifiers are available to draw colored objects: outline[d] sets the color of the outline, shaded the fill color, and colo[u]r[ed] sets both. All expect a subsequent string argument specifying the color. circle shaded "green" outline "black" Color is not yet supported in TeX mode. Device macro files like ps.tmac declare color names; you can define additional ones with the defcolor request (see groff(7)). pic assumes at the beginning of each picture that the stroke and fill colors are set to the device defaults. To change the name of the vbox in TeX mode, set the pseudo- variable figname (which is actually a specially parsed command) within a picture. For example, .PS figname = foobar; circle "dig here"; .PE makes the picture available in the box \foobar. Arrow heads are drawn as solid triangles if the variable arrowhead is non-zero and either TeX mode is enabled or the -n option is not used. Initially, arrowhead has a value of 1. Solid arrow heads are always filled with the current outline (stroke) color. The troff output of pic is device-independent. The -T option is therefore redundant. Except where noted, all measurements and dimensions use inches implicitly; they are never interpreted as troff basic units. Objects can have an aligned attribute, but it is supported only by the grops(1) and gropdf(1) output drivers. Any text associated with an aligned object is rotated about the object's center such that it is oriented along a line connecting the start and end points of the object. aligned has no effect on objects whose start and end points are coincident. In places where nth is allowed, 'expr'th is also allowed. 'th is a single token: no space is allowed between the apostrophe and the th. For example, for i = 1 to 4 do { line from 'i'th box.nw to 'i+1'th box.se } Converting pic to other image formats To create a stand-alone graphics file from a pic file, first compose the picture. Bracket your pic code with .PS and .PE tokens. groff requests that don't produce formatted output may precede .PS, but no text should be formatted. That restriction applies to the injection of text by macro packages, which may include a page number even on the first page, as mm does by default. Writing a raw roff document that uses no macro package is an economical approach. Next, convert the roff/pic input into the desired format. groff distributes a simple utility, pic2graph(1), for this purpose. Other possibilities exist, particularly if you first transform your picture into PostScript format with groff -T ps. However, such a PostScript file will lack bounding box information; roff formatters produce page-sized output. Several tools with names beginning psto or ps2 exist that can infer the bounding box and perform a format conversion. One of these is the PostScript interpreter Ghostscript (gs(1)), which exposes format converters via its -sDEVICE= option. gs --help lists available devices. Alternatively, produce a PDF with groff -T pdf; gropdf(1)'s -p option will set the MediaBox of the file. The Encapsulated PostScript File (EPS) format is still sometimes seen. The aforementioned Ghostscript offers ps2epsi(1), and a standalone package and command ps2eps(1) is also available. For raster image formats, use pstopnm(1); the resulting pnm(5) file can be then converted to virtually any image format using the netpbm tools. Files top /usr/local/share/groff/1.23.0/tmac/pic.tmac offers simple definitions of the PS, PE, PF, and PY macros. Load it with the mso request when eschewing a full-service macro package, or using one that doesn't supply its own definitions for them. Bugs top Characters that are invalid as input to GNU troff (see the groff Texinfo manual or groff_char(7) for a list) are rejected even in TeX mode. The interpretation of fillval is incompatible with the pic in Research Tenth Edition Unix, which interprets 0 as black and 1 as white. See also top /usr/local/share/doc/groff-1.23.0/pic.ps Making Pictures with GNU pic, by Eric S. Raymond. This file, together with its source, pic.ms, is part of the groff distribution. PICA Graphics Language for Typesetting: User Manual, by Brian W. Kernighan, 1984 (revised 1991), AT&T Bell Laboratories Computing Science Technical Report No. 116 ps2eps is available from CTAN mirrors, e.g., ftp://ftp.dante.de/tex-archive/support/ps2eps/. W. Richard Stevens, Turning PIC into HTML http://www.kohala.com/start/troff/pic2html.html W. Richard Stevens, Examples of pic Macros http://www.kohala.com/start/troff/pic.examples.ps troff(1), groff_out(5), tex(1), gs(1), ps2eps(1), pstopnm(1), ps2epsi(1), pnm(5) 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 pic(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. | # pic\n\n> Picture preprocessor for the groff (GNU Troff) document formatting system.\n> See also `groff` and `troff`.\n> More information: <https://manned.org/pic>.\n\n- Process input with pictures, saving the output for future typesetting with groff to PostScript:\n\n`pic {{path/to/input.pic}} > {{path/to/output.roff}}`\n\n- Typeset input with pictures to PDF using the [me] macro package:\n\n`pic -T {{pdf}} {{path/to/input.pic}} | groff -{{me}} -T {{pdf}} > {{path/to/output.pdf}}`\n |
pidof | pidof(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pidof(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXIT STATUS | BUGS | SEE ALSO | AUTHOR | COLOPHON PIDOF(1) User Commands PIDOF(1) NAME top pidof - find the process ID of a running program SYNOPSIS top pidof [-s] [-c] [-q] [-w] [-x] [-o omitpid[,omitpid...]...] [-t] [-S separator] program [program...] DESCRIPTION top Pidof finds the process id's (pids) of the named programs. It prints those id's on the standard output. OPTIONS top -s Single shot - this instructs the program to only return one pid. -c Only return process ids that are running with the same root directory. This option is ignored for non-root users, as they will be unable to check the current root directory of processes they do not own. -q Quiet mode, suppress any output and only sets the exit status accordingly. -w Show also processes that do not have visible command line (e.g. kernel worker threads). -x Scripts too - this causes the program to also return process id's of shells running the named scripts. -o omitpid Tells pidof to omit processes with that process id. The special pid %PPID can be used to name the parent process of the pidof program, in other words the calling shell or shell script. -t Shows all thread ids instead of pids. -S separator Use separator as a separator put between pids. Used only when more than one pids are printed for the program. The -d option is an alias for this option for sysvinit pidof compatibility. EXIT STATUS top 0 At least one program was found with the requested name. 1 No program was found with the requested name. BUGS top When using the -x option, pidof only has a simple method for detecting scripts and will miss scripts that, for example, use env. This limitation is due to how the scripts look in the proc filesystem. SEE ALSO top pgrep(1), pkill(1) AUTHOR top Jaromir Capik [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] 2023-01-16 PIDOF(1) Pages that refer to this page: killall(1), lsfd(1), unshare(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. | # pidof\n\n> Gets the ID of a process using its name.\n> More information: <https://manned.org/pidof>.\n\n- List all process IDs with given name:\n\n`pidof {{bash}}`\n\n- List a single process ID with given name:\n\n`pidof -s {{bash}}`\n\n- List process IDs including scripts with given name:\n\n`pidof -x {{script.py}}`\n\n- Kill all processes with given name:\n\n`kill $(pidof {{name}})`\n |
pidstat | pidstat(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pidstat(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | ENVIRONMENT | EXAMPLES | BUGS | FILES | AUTHOR | SEE ALSO | COLOPHON PIDSTAT(1) Linux User's Manual PIDSTAT(1) NAME top pidstat - Report statistics for Linux tasks. SYNOPSIS top pidstat [ -d ] [ -H ] [ -h ] [ -I ] [ -l ] [ -R ] [ -r ] [ -s ] [ -t ] [ -U [ username ] ] [ -u ] [ -V ] [ -v ] [ -w ] [ -C comm ] [ -G process_name ] [ --dec={ 0 | 1 | 2 } ] [ --human ] [ -p { pid[,...] | SELF | ALL } ] [ -T { TASK | CHILD | ALL } ] [ interval [ count ] ] [ -e program args ] DESCRIPTION top The pidstat command is used for monitoring individual tasks currently being managed by the Linux kernel. It writes to standard output activities for every task selected with option -p or for every task managed by the Linux kernel if option -p ALL has been used. Not selecting any tasks is equivalent to specifying -p ALL but only active tasks (tasks with non-zero statistics values) will appear in the report. The pidstat command can also be used for monitoring the child processes of selected tasks. Read about option -T below. The interval parameter specifies the amount of time in seconds between each report. A value of 0 (or no parameters at all) indicates that tasks statistics are to be reported for the time since system startup (boot). The count parameter can be specified in conjunction with the interval parameter if this one is not set to zero. The value of count determines the number of reports generated at interval seconds apart. If the interval parameter is specified without the count parameter, the pidstat command generates reports continuously. You can select information about specific task activities using flags. Not specifying any flags selects only CPU activity. OPTIONS top -C comm Display only tasks whose command name includes the string comm. This string can be a regular expression. -d Report I/O statistics (kernels 2.6.20 and later only). The following values may be displayed: UID The real user identification number of the task being monitored. USER The name of the real user owning the task being monitored. PID The identification number of the task being monitored. kB_rd/s Number of kilobytes the task has caused to be read from disk per second. kB_wr/s Number of kilobytes the task has caused, or shall cause to be written to disk per second. kB_ccwr/s Number of kilobytes whose writing to disk has been cancelled by the task. This may occur when the task truncates some dirty pagecache. In this case, some IO which another task has been accounted for will not be happening. iodelay Block I/O delay of the task being monitored, measured in clock ticks. This metric includes the delays spent waiting for sync block I/O completion and for swapin block I/O completion. Command The command name of the task. --dec={ 0 | 1 | 2 } Specify the number of decimal places to use (0 to 2, default value is 2). -e program args Execute program with given arguments args and monitor it with pidstat. pidstat stops when program terminates. -G process_name Display only processes whose command name includes the string process_name. This string can be a regular expression. If option -t is used together with option -G then the threads belonging to that process are also displayed (even if their command name doesn't include the string process_name). -H Display timestamp in seconds since the epoch. -h Display all activities horizontally on a single line, with no average statistics at the end of the report. This is intended to make it easier to be parsed by other programs. --human Print sizes in human readable format (e.g. 1.0k, 1.2M, etc.) The units displayed with this option supersede any other default units (e.g. kilobytes, sectors...) associated with the metrics. -I In an SMP environment, indicate that tasks CPU usage (as displayed by option -u) should be divided by the total number of processors. -l Display the process command name and all its arguments. -p { pid[,...] | SELF | ALL } Select tasks (processes) for which statistics are to be reported. pid is the process identification number. The SELF keyword indicates that statistics are to be reported for the pidstat process itself, whereas the ALL keyword indicates that statistics are to be reported for all the tasks managed by the system. -R Report realtime priority and scheduling policy information. The following values may be displayed: UID The real user identification number of the task being monitored. USER The name of the real user owning the task being monitored. PID The identification number of the task being monitored. prio The realtime priority of the task being monitored. policy The scheduling policy of the task being monitored. Command The command name of the task. -r Report page faults and memory utilization. When reporting statistics for individual tasks, the following values may be displayed: UID The real user identification number of the task being monitored. USER The name of the real user owning the task being monitored. PID The identification number of the task being monitored. minflt/s Total number of minor faults the task has made per second, those which have not required loading a memory page from disk. majflt/s Total number of major faults the task has made per second, those which have required loading a memory page from disk. VSZ Virtual Size: The virtual memory usage of entire task in kilobytes. RSS Resident Set Size: The non-swapped physical memory used by the task in kilobytes. %MEM The tasks's currently used share of available physical memory. Command The command name of the task. When reporting global statistics for tasks and all their children, the following values may be displayed: UID The real user identification number of the task which is being monitored together with its children. USER The name of the real user owning the task which is being monitored together with its children. PID The identification number of the task which is being monitored together with its children. minflt-nr Total number of minor faults made by the task and all its children, and collected during the interval of time. majflt-nr Total number of major faults made by the task and all its children, and collected during the interval of time. Command The command name of the task which is being monitored together with its children. -s Report stack utilization. The following values may be displayed: UID The real user identification number of the task being monitored. USER The name of the real user owning the task being monitored. PID The identification number of the task being monitored. StkSize The amount of memory in kilobytes reserved for the task as stack, but not necessarily used. StkRef The amount of memory in kilobytes used as stack, referenced by the task. Command The command name of the task. -T { TASK | CHILD | ALL } This option specifies what has to be monitored by the pidstat command. The TASK keyword indicates that statistics are to be reported for individual tasks (this is the default option) whereas the CHILD keyword indicates that statistics are to be globally reported for the selected tasks and all their children. The ALL keyword indicates that statistics are to be reported for individual tasks and globally for the selected tasks and their children. Note: Global statistics for tasks and all their children are not available for all options of pidstat. Also these statistics are not necessarily relevant to current time interval: The statistics of a child process are collected only when it finishes or it is killed. -t Also display statistics for threads associated with selected tasks. This option adds the following values to the reports: TGID The identification number of the thread group leader. TID The identification number of the thread being monitored. -U [ username ] Display the real user name of the tasks being monitored instead of the UID. If username is specified, then only tasks belonging to the specified user are displayed. -u Report CPU utilization. When reporting statistics for individual tasks, the following values may be displayed: UID The real user identification number of the task being monitored. USER The name of the real user owning the task being monitored. PID The identification number of the task being monitored. %usr Percentage of CPU used by the task while executing at the user level (application), with or without nice priority. Note that this field does NOT include time spent running a virtual processor. %system Percentage of CPU used by the task while executing at the system level (kernel). %guest Percentage of CPU spent by the task in virtual machine (running a virtual processor). %wait Percentage of CPU spent by the task while waiting to run. %CPU Total percentage of CPU time used by the task. In an SMP environment, the task's CPU usage will be divided by the total number of CPU's if option -I has been entered on the command line. CPU Processor number to which the task is attached. Command The command name of the task. When reporting global statistics for tasks and all their children, the following values may be displayed: UID The real user identification number of the task which is being monitored together with its children. USER The name of the real user owning the task which is being monitored together with its children. PID The identification number of the task which is being monitored together with its children. usr-ms Total number of milliseconds spent by the task and all its children while executing at the user level (application), with or without nice priority, and collected during the interval of time. Note that this field does NOT include time spent running a virtual processor. system-ms Total number of milliseconds spent by the task and all its children while executing at the system level (kernel), and collected during the interval of time. guest-ms Total number of milliseconds spent by the task and all its children in virtual machine (running a virtual processor). Command The command name of the task which is being monitored together with its children. -V Print version number then exit. -v Report values of some kernel tables. The following values may be displayed: UID The real user identification number of the task being monitored. USER The name of the real user owning the task being monitored. PID The identification number of the task being monitored. threads Number of threads associated with current task. fd-nr Number of file descriptors associated with current task. Command The command name of the task. -w Report task switching activity (kernels 2.6.23 and later only). The following values may be displayed: UID The real user identification number of the task being monitored. USER The name of the real user owning the task being monitored. PID The identification number of the task being monitored. cswch/s Total number of voluntary context switches the task made per second. A voluntary context switch occurs when a task blocks because it requires a resource that is unavailable. nvcswch/s Total number of non voluntary context switches the task made per second. An involuntary context switch takes place when a task executes for the duration of its time slice and then is forced to relinquish the processor. Command The command name of the task. ENVIRONMENT top The pidstat command takes into account the following environment variables: S_COLORS By default statistics are displayed in color when the output is connected to a terminal. Use this variable to change the settings. Possible values for this variable are never, always or auto (the latter is equivalent to the default settings). Please note that the color (being red, yellow, or some other color) used to display a value is not indicative of any kind of issue simply because of the color. It only indicates different ranges of values. S_COLORS_SGR Specify the colors and other attributes used to display statistics on the terminal. Its value is a colon- separated list of capabilities that defaults to I=32;22:N=34;1:W=35;1:X=31;1:Z=34;22. Supported capabilities are: I= SGR (Select Graphic Rendition) substring for item values like PID, UID or CPU number. N= SGR substring for non-zero statistics values and for tasks names. W= (or M=) SGR substring for percentage values in the range from 75% to 90% (or in the range 10% to 25% depending on the metric's meaning). X= (or H=) SGR substring for percentage values greater than or equal to 90% (or lower than or equal to 10% depending on the metric's meaning). Z= SGR substring for zero values and for threads names. S_TIME_FORMAT If this variable exists and its value is ISO then the current locale will be ignored when printing the date in the report header. The pidstat command will use the ISO 8601 format (YYYY-MM-DD) instead. The timestamp will also be compliant with ISO 8601 format. EXAMPLES top pidstat 2 5 Display five reports of CPU statistics for every active task in the system at two second intervals. pidstat -r -p 1643 2 5 Display five reports of page faults and memory statistics for PID 1643 at two second intervals. pidstat -C "fox|bird" -r -p ALL Display global page faults and memory statistics for all the processes whose command name includes the string "fox" or "bird". pidstat -T CHILD -r 2 5 Display five reports of page faults statistics at two second intervals for the child processes of all tasks in the system. Only child processes with non-zero statistics values are displayed. BUGS top /proc filesystem must be mounted for the pidstat command to work. Although pidstat speaks of kilobytes (kB), megabytes (MB)..., it actually uses kibibytes (kiB), mebibytes (MiB)... A kibibyte is equal to 1024 bytes, and a mebibyte is equal to 1024 kibibytes. FILES top /proc contains various files with system statistics. AUTHOR top Sebastien Godard (sysstat <at> orange.fr) SEE ALSO top sar(1), top(1), ps(1), mpstat(1), iostat(1), vmstat(8) https://github.com/sysstat/sysstat https://sysstat.github.io/ COLOPHON top This page is part of the sysstat (sysstat performance monitoring tools) project. Information about the project can be found at http://sebastien.godard.pagesperso-orange.fr/. If you have a bug report for this manual page, send it to sysstat-AT-orange.fr. This page was obtained from the project's upstream Git repository https://github.com/sysstat/sysstat.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] Linux AUGUST 2023 PIDSTAT(1) Pages that refer to this page: cifsiostat(1), iostat(1), mpstat(1), pcp-pidstat(1), sar(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. | # pidstat\n\n> Show system resource usage, including CPU, memory, IO etc.\n> More information: <https://manned.org/pidstat>.\n\n- Show CPU statistics at a 2 second interval for 10 times:\n\n`pidstat {{2}} {{10}}`\n\n- Show page faults and memory utilization:\n\n`pidstat -r`\n\n- Show input/output usage per process ID:\n\n`pidstat -d`\n\n- Show information on a specific PID:\n\n`pidstat -p {{PID}}`\n\n- Show memory statistics for all processes whose command name include "fox" or "bird":\n\n`pidstat -C "{{fox|bird}}" -r -p ALL`\n |
ping | ping(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training ping(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | IPV6 LINK-LOCAL DESTINATIONS | ICMP PACKET DETAILS | DUPLICATE AND DAMAGED PACKETS | ID COLLISIONS | TRYING DIFFERENT DATA PATTERNS | TTL DETAILS | BUGS | SEE ALSO | HISTORY | SECURITY | AVAILABILITY | COLOPHON PING(8) iputils PING(8) NAME top ping - send ICMP ECHO_REQUEST to network hosts SYNOPSIS top ping [-aAbBdCDfhHLnOqrRUvV46] [-c count] [-e identifier] [-F flowlabel] [-i interval] [-I interface] [-l preload] [-m mark] [-M pmtudisc_option] [-N nodeinfo_option] [-w deadline] [-W timeout] [-p pattern] [-Q tos] [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp option] [hop...] {destination} DESCRIPTION top ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway. ECHO_REQUEST datagrams (pings) have an IP and ICMP header, followed by a struct timeval and then an arbitrary number of pad bytes used to fill out the packet. ping works with both IPv4 and IPv6. Using only one of them explicitly can be enforced by specifying -4 or -6. ping can also send IPv6 Node Information Queries (RFC4620). Intermediate hops may not be allowed, because IPv6 source routing was deprecated (RFC5095). OPTIONS top -4 Use IPv4 only. -6 Use IPv6 only. -a Audible ping. -A Adaptive ping. Interpacket interval adapts to round-trip time, so that effectively not more than one (or more, if preload is set) unanswered probe is present in the network. Minimal interval is 200msec unless super-user. On networks with low RTT this mode is essentially equivalent to flood mode. -b Allow pinging a broadcast address. -B Do not allow ping to change source address of probes. The address is bound to one selected when ping starts. -c count Stop after sending count ECHO_REQUEST packets. With deadline option, ping waits for count ECHO_REPLY packets, until the timeout expires. -C Call connect() syscall on socket creation. -d Set the SO_DEBUG option on the socket being used. Essentially, this socket option is not used by Linux kernel. -D Print timestamp (unix time + microseconds as in gettimeofday) before each line. -e identifier Set the identification field of ECHO_REQUEST. Value 0 implies using raw socket (not supported on ICMP datagram socket). The value of the field may be printed with -v option. -f Flood ping. For every ECHO_REQUEST sent a period . is printed, while for every ECHO_REPLY received a backspace is printed. This provides a rapid display of how many packets are being dropped. If interval is not given, it sets interval to zero and outputs packets as fast as they come back or one hundred times per second, whichever is more. Only the super-user may use this option with zero interval. -F flow label IPv6 only. Allocate and set 20 bit flow label (in hex) on echo request packets. If value is zero, kernel allocates random flow label. -h Show help. -H Force DNS name resolution for the output. Useful for numeric destination, or -f option, which by default do not perform it. Override previously defined -n option. -i interval Wait interval seconds between sending each packet. Real number allowed with dot as a decimal separator (regardless locale setup). The default is to wait for one second between each packet normally, or not to wait in flood mode. Only super-user may set interval to values less than 2 ms. Broadcast and multicast ping have even higher limitation for regular user: minimum is 1 sec. -I interface interface is either an address, an interface name or a VRF name. If interface is an address, it sets source address to specified interface address. If interface is an interface name, it sets source interface to specified interface. If interface is a VRF name, each packet is routed using the corresponding routing table; in this case, the -I option can be repeated to specify a source address. NOTE: For IPv6, when doing ping to a link-local scope address, link specification (by the '%'-notation in destination, or by this option) can be used but it is no longer required. -l preload If preload is specified, ping sends that many packets not waiting for reply. Only the super-user may select preload more than 3. -L Suppress loopback of multicast packets. This flag only applies if the ping destination is a multicast address. -m mark use mark to tag the packets going out. This is useful for variety of reasons within the kernel such as using policy routing to select specific outbound processing. -M pmtudisc_opt Select Path MTU Discovery strategy. pmtudisc_option may be either do (set DF flag but subject to PMTU checks by kernel, packets too large will be rejected), want (do PMTU discovery, fragment locally when packet size is large), probe (set DF flag and bypass PMTU checks, useful for probing), or dont (do not set DF flag). -N nodeinfo_option IPv6 only. Send IPv6 Node Information Queries (RFC4620), instead of Echo Request. CAP_NET_RAW capability is required. help Show help for NI support. name Queries for Node Names. ipv6 Queries for IPv6 Addresses. There are several IPv6 specific flags. ipv6-global Request IPv6 global-scope addresses. ipv6-sitelocal Request IPv6 site-local addresses. ipv6-linklocal Request IPv6 link-local addresses. ipv6-all Request IPv6 addresses on other interfaces. ipv4 Queries for IPv4 Addresses. There is one IPv4 specific flag. ipv4-all Request IPv4 addresses on other interfaces. subject-ipv6=ipv6addr IPv6 subject address. subject-ipv4=ipv4addr IPv4 subject address. subject-name=nodename Subject name. If it contains more than one dot, fully-qualified domain name is assumed. subject-fqdn=nodename Subject name. Fully-qualified domain name is always assumed. -n Numeric output only. No attempt will be made to lookup symbolic names for host addresses (no reverse DNS resolution). This is the default for numeric destination or -f option. Override previously defined -H option. -O Report outstanding ICMP ECHO reply before sending next packet. This is useful together with the timestamp -D to log output to a diagnostic file and search for missing answers. -p pattern You may specify up to 16 pad bytes to fill out the packet you send. This is useful for diagnosing data-dependent problems in a network. For example, -p ff will cause the sent packet to be filled with all ones. -q Quiet output. Nothing is displayed except the summary lines at startup time and when finished. -Q tos Set Quality of Service -related bits in ICMP datagrams. tos can be decimal (ping only) or hex number. In RFC2474, these fields are interpreted as 8-bit Differentiated Services (DS), consisting of: bits 0-1 (2 lowest bits) of separate data, and bits 2-7 (highest 6 bits) of Differentiated Services Codepoint (DSCP). In RFC2481 and RFC3168, bits 0-1 are used for ECN. Historically (RFC1349, obsoleted by RFC2474), these were interpreted as: bit 0 (lowest bit) for reserved (currently being redefined as congestion control), 1-4 for Type of Service and bits 5-7 (highest bits) for Precedence. -r Bypass the normal routing tables and send directly to a host on an attached interface. 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 provided the option -I is also used. -R ping only. Record route. Includes the RECORD_ROUTE option in the ECHO_REQUEST packet and displays the route buffer on returned packets. Note that the IP header is only large enough for nine such routes. Many hosts ignore or discard this option. -s packetsize Specifies the number of data bytes to be sent. The default is 56, which translates into 64 ICMP data bytes when combined with the 8 bytes of ICMP header data. -S sndbuf Set socket sndbuf. If not specified, it is selected to buffer not more than one packet. -t ttl ping only. Set the IP Time to Live. -T timestamp option Set special IP timestamp options. timestamp option may be either tsonly (only timestamps), tsandaddr (timestamps and addresses) or tsprespec host1 [host2 [host3 [host4]]] (timestamp prespecified hops). -U Print full user-to-user latency (the old behaviour). Normally ping prints network round trip time, which can be different f.e. due to DNS failures. -v Verbose output. Do not suppress DUP replies when pinging multicast address. -V Show version and exit. -w deadline Specify a timeout, in seconds, before ping exits regardless of how many packets have been sent or received. In this case ping does not stop after count packet are sent, it waits either for deadline expire or until count probes are answered or for some error notification from network. -W timeout Time to wait for a response, in seconds. The option affects only timeout in absence of any responses, otherwise ping waits for two RTTs. Real number allowed with dot as a decimal separator (regardless locale setup). 0 means infinite timeout. When using ping for fault isolation, it should first be run on the local host, to verify that the local network interface is up and running. Then, hosts and gateways further and further away should be pinged. Round-trip times and packet loss statistics are computed. If duplicate packets are received, they are not included in the packet loss calculation, although the round trip time of these packets is used in calculating the minimum/average/maximum/mdev round-trip time numbers. Population standard deviation (mdev), essentially an average of how far each ping RTT is from the mean RTT. The higher mdev is, the more variable the RTT is (over time). With a high RTT variability, you will have speed issues with bulk transfers (they will take longer than is strictly speaking necessary, as the variability will eventually cause the sender to wait for ACKs) and you will have middling to poor VoIP quality. When the specified number of packets have been sent (and received) or if the program is terminated with a SIGINT, a brief summary is displayed. Shorter current statistics can be obtained without termination of process with signal SIGQUIT. If ping does not receive any reply packets at all it will exit with code 1. If a packet count and deadline are both specified, and fewer than count packets are received by the time the deadline has arrived, it will also exit with code 1. On other error it exits with code 2. Otherwise it exits with code 0. This makes it possible to use the exit code to see if a host is alive or not. This program is intended for use in network testing, measurement and management. Because of the load it can impose on the network, it is unwise to use ping during normal operations or from automated scripts. IPV6 LINK-LOCAL DESTINATIONS top For IPv6, when the destination address has link-local scope and ping is using ICMP datagram sockets, the output interface must be specified. When ping is using raw sockets, it is not strictly necessary to specify the output interface but it should be done to avoid ambiguity when there are multiple possible output interfaces. There are two ways to specify the output interface: using the % notation The destination address is postfixed with % and the output interface name or ifindex, for example: ping fe80::5054:ff:fe70:67bc%eth0 ping fe80::5054:ff:fe70:67bc%2 using the -I option When using ICMP datagram sockets, this method is supported since the following kernel versions: 5.17, 5.15.19, 5.10.96, 5.4.176, 4.19.228, 4.14.265. Also it is not supported on musl libc. ICMP PACKET DETAILS top An IP header without options is 20 bytes. An ICMP ECHO_REQUEST packet contains an additional 8 bytes worth of ICMP header followed by an arbitrary amount of data. When a packetsize is given, this indicates the size of this extra piece of data (the default is 56). Thus the amount of data received inside of an IP packet of type ICMP ECHO_REPLY will always be 8 bytes more than the requested data space (the ICMP header). If the data space is at least of size of struct timeval ping uses the beginning bytes of this space to include a timestamp which it uses in the computation of round trip times. If the data space is shorter, no round trip times are given. DUPLICATE AND DAMAGED PACKETS top ping will report duplicate and damaged packets. Duplicate packets should never occur, and seem to be caused by inappropriate link-level retransmissions. Duplicates may occur in many situations and are rarely (if ever) a good sign, although the presence of low levels of duplicates may not always be cause for alarm. Damaged packets are obviously serious cause for alarm and often indicate broken hardware somewhere in the ping packet's path (in the network or in the hosts). ID COLLISIONS top Unlike TCP and UDP, which use port to uniquely identify the recipient to deliver data, ICMP uses identifier field (ID) for identification. Therefore, if on the same machine, at the same time, two ping processes use the same ID, echo reply can be delivered to a wrong recipient. This is a known problem due to the limited size of the 16-bit ID field. That is a historical limitation of the protocol that cannot be fixed at the moment unless we encode an ID into the ping packet payload. ping prints DIFFERENT ADDRESS error and packet loss is negative. ping uses PID to get unique number. The default value of /proc/sys/kernel/pid_max is 32768. On the systems that use ping heavily and with pid_max greater than 65535 collisions are bound to happen. TRYING DIFFERENT DATA PATTERNS top The (inter)network layer should never treat packets differently depending on the data contained in the data portion. Unfortunately, data-dependent problems have been known to sneak into networks and remain undetected for long periods of time. In many cases the particular pattern that will have problems is something that doesn't have sufficient transitions, such as all ones or all zeros, or a pattern right at the edge, such as almost all zeros. It isn't necessarily enough to specify a data pattern of all zeros (for example) on the command line because the pattern that is of interest is at the data link level, and the relationship between what you type and what the controllers transmit can be complicated. This means that if you have a data-dependent problem you will probably have to do a lot of testing to find it. If you are lucky, you may manage to find a file that either can't be sent across your network or that takes much longer to transfer than other similar length files. You can then examine this file for repeated patterns that you can test using the -p option of ping. TTL DETAILS top The TTL value of an IP packet represents the maximum number of IP routers that the packet can go through before being thrown away. In current practice you can expect each router in the Internet to decrement the TTL field by exactly one. The TTL field for TCP packets may take various values. The maximum possible value of this field is 255, a recommended initial value is 64. For more information, see the TCP/Lower-Level Interface section of RFC9293. In normal operation ping prints the TTL value from the packet it receives. When a remote system receives a ping packet, it can do one of three things with the TTL field in its response: Not change it; this is what Berkeley Unix systems did before the 4.3BSD Tahoe release. In this case the TTL value in the received packet will be 255 minus the number of routers in the round-trip path. Set it to 255; this is what current Berkeley Unix systems do. In this case the TTL value in the received packet will be 255 minus the number of routers in the path from the remote system to the pinging host. Set it to some other value. Some machines use the same value for ICMP packets that they use for TCP packets, for example either 30 or 60. Others may use completely wild values. BUGS top Many Hosts and Gateways ignore the RECORD_ROUTE option. The maximum IP header length is too small for options like RECORD_ROUTE to be completely useful. There's not much that can be done about this, however. Flood pinging is not recommended in general, and flood pinging the broadcast address should only be done under very controlled conditions. SEE ALSO top ip(8), ss(8). HISTORY top The ping command appeared in 4.3BSD. The version described here is its descendant specific to Linux. As of version s20150815, the ping6 binary doesn't exist anymore. It has been merged into ping. Creating a symlink named ping6 pointing to ping will result in the same functionality as before. SECURITY top ping requires CAP_NET_RAW capability to be executed 1) if the program is used for non-echo queries (see -N option) or when the identification field set to 0 for ECHO_REQUEST (see -e), or 2) if kernel does not support ICMP datagram sockets, or 3) if the user is not allowed to create an ICMP echo socket. The program may be used as set-uid root. AVAILABILITY top ping 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 PING(8) Pages that refer to this page: arping(8), clockdiff(8), tracepath(8), traceroute(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. | # ping\n\n> Send ICMP ECHO_REQUEST packets to network hosts.\n> More information: <https://manned.org/ping>.\n\n- Ping host:\n\n`ping {{host}}`\n\n- Ping a host only a specific number of times:\n\n`ping -c {{count}} {{host}}`\n\n- Ping host, specifying the interval in seconds between requests (default is 1 second):\n\n`ping -i {{seconds}} {{host}}`\n\n- Ping host without trying to lookup symbolic names for addresses:\n\n`ping -n {{host}}`\n\n- Ping host and ring the bell when a packet is received (if your terminal supports it):\n\n`ping -a {{host}}`\n\n- Also display a message if no response was received:\n\n`ping -O {{host}}`\n |
pinky | pinky(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pinky(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON PINKY(1) User Commands PINKY(1) NAME top pinky - lightweight finger SYNOPSIS top pinky [OPTION]... [USER]... DESCRIPTION top -l produce long format output for the specified USERs -b omit the user's home directory and shell in long format -h omit the user's project file in long format -p omit the user's plan file in long format -s do short format output, this is the default -f omit the line of column headings in short format -w omit the user's full name in short format -i omit the user's full name and remote host in short format -q omit the user's full name, remote host and idle time in short format --help display this help and exit --version output version information and exit A lightweight 'finger' program; print user information. The utmp file will be /var/run/utmp. AUTHOR top Written by Joseph Arceneaux, David MacKenzie, and Kaveh Ghazi. 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/pinky> or available locally via: info '(coreutils) pinky 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 PINKY(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. | # pinky\n\n> Print user information using the `finger` protocol.\n> More information: <https://manned.org/pinky>.\n\n- Display details about the current user:\n\n`pinky`\n\n- Display details for a specific user:\n\n`pinky {{user}}`\n\n- Display details in the long format:\n\n`pinky {{user}} -l`\n\n- Omit the user's home directory and shell in long format:\n\n`pinky {{user}} -lb`\n\n- Omit the user's project file in long format:\n\n`pinky {{user}} -lh`\n\n- Omit the column headings in short format:\n\n`pinky {{user}} -f`\n |
pkill | pgrep(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pgrep(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | EXAMPLES | EXIT STATUS | NOTES | BUGS | SEE ALSO | AUTHOR | REPORTING BUGS | COLOPHON PGREP(1) User Commands PGREP(1) NAME top pgrep, pkill, pidwait - look up, signal, or wait for processes based on name and other attributes SYNOPSIS top pgrep [options] pattern pkill [options] pattern pidwait [options] pattern DESCRIPTION top pgrep looks through the currently running processes and lists the process IDs which match the selection criteria to stdout. All the criteria have to match. For example, $ pgrep -u root sshd will only list the processes called sshd AND owned by root. On the other hand, $ pgrep -u root,daemon will list the processes owned by root OR daemon. pkill will send the specified signal (by default SIGTERM) to each process instead of listing them on stdout. pidwait will wait for each process instead of listing them on stdout. OPTIONS top -signal --signal signal Defines the signal to send to each matched process. Either the numeric or the symbolic signal name can be used. In pgrep or pidwait mode only the long option can be used and has no effect unless used in conjunction with --require-handler to filter to processes with a userspace signal handler present for a particular signal. -c, --count Suppress normal output; instead print a count of matching processes. When count does not match anything, e.g. returns zero, the command will return non-zero value. Note that for pkill and pidwait, the count is the number of matching processes, not the processes that were successfully signaled or waited for. -d, --delimiter delimiter Sets the string used to delimit each process ID in the output (by default a newline). (pgrep only.) -e, --echo Display name and PID of the process being killed. (pkill only.) -f, --full The pattern is normally only matched against the process name. When -f is set, the full command line is used. -g, --pgroup pgrp,... Only match processes in the process group IDs listed. Process group 0 is translated into pgrep's, pkill's, or pidwait's own process group. -G, --group gid,... Only match processes whose real group ID is listed. Either the numerical or symbolical value may be used. -i, --ignore-case Match processes case-insensitively. -l, --list-name List the process name as well as the process ID. (pgrep only.) -a, --list-full List the full command line as well as the process ID. (pgrep only.) -n, --newest Select only the newest (most recently started) of the matching processes. -o, --oldest Select only the oldest (least recently started) of the matching processes. -O, --older secs Select processes older than secs. -P, --parent ppid,... Only match processes whose parent process ID is listed. -s, --session sid,... Only match processes whose process session ID is listed. Session ID 0 is translated into pgrep's, pkill's, or pidwait's own session ID. -t, --terminal term,... Only match processes whose controlling terminal is listed. The terminal name should be specified without the "/dev/" prefix. -u, --euid euid,... Only match processes whose effective user ID is listed. Either the numerical or symbolical value may be used. -U, --uid uid,... Only match processes whose real user ID is listed. Either the numerical or symbolical value may be used. -v, --inverse Negates the matching. This option is usually used in pgrep's or pidwait's context. In pkill's context the short option is disabled to avoid accidental usage of the option. -w, --lightweight Shows all thread ids instead of pids in pgrep's or pidwait's context. In pkill's context this option is disabled. -x, --exact Only match processes whose names (or command lines if -f is specified) exactly match the pattern. -F, --pidfile file Read PIDs from file. This option is more useful for pkill or pidwait than pgrep. -L, --logpidfile Fail if pidfile (see -F) not locked. -r, --runstates D,R,S,Z,... Match only processes which match the process state. -A, --ignore-ancestors Ignore all ancestors of pgrep, pkill, or pidwait. For example, this can be useful when elevating with sudo or similar tools. -H, --require-handler Only match processes with a userspace signal handler present for the signal to be sent. --cgroup name,... Match on provided control group (cgroup) v2 name. See cgroups(8) --env name[=value],... Match on process that have these environent variables. If the =value parameter is not defined then only the variable name is matched. --ns pid Match processes that belong to the same namespaces. Required to run as root to match processes from other users. See --nslist for how to limit which namespaces to match. --nslist name,... Match only the provided namespaces. Available namespaces: ipc, mnt, net, pid, user, uts. -q, --queue value Use sigqueue(3) rather than kill(2) and the value argument is used to specify an integer to be sent with the signal. If the receiving process has installed a handler for this signal using the SA_SIGINFO flag to sigaction(2), then it can obtain this data via the si_value field of the siginfo_t structure. -V, --version Display version information and exit. -h, --help Display help and exit. OPERANDS top pattern Specifies an Extended Regular Expression for matching against the process names or command lines. EXAMPLES top Example 1: Find the process ID of the named daemon: $ pgrep -u root named Example 2: Make syslog reread its configuration file: $ pkill -HUP syslogd Example 3: Give detailed information on all xterm processes: $ ps -fp $(pgrep -d, -x xterm) Example 4: Make all chrome processes run nicer: $ renice +4 $(pgrep chrome) EXIT STATUS top 0 One or more processes matched the criteria. For pkill and pidwait, one or more processes must also have been successfully signalled or waited for. 1 No processes matched or none of them could be signalled. 2 Syntax error in the command line. 3 Fatal error: out of memory etc. NOTES top The process name used for matching is limited to the 15 characters present in the output of /proc/pid/stat. Use the -f option to match against the complete command line, /proc/pid/cmdline. Threads may not have the same process name as the parent process but will have the same command line. The running pgrep, pkill, or pidwait process will never report itself as a match. The -O --older option will silently fail if /proc is mounted with the subset=pid option. BUGS top The options -n and -o and -v can not be combined. Let me know if you need to do this. Defunct processes are reported. pidwait requires the pidfd_open(2) system call which first appeared in Linux 5.3. SEE ALSO top ps(1), regex(7), signal(7), sigqueue(3), killall(1), skill(1), kill(1), kill(2), cgroups(8). AUTHOR top Kjetil Torgrim Homme [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-10-04 PGREP(1) Pages that refer to this page: fuser(1), kill(1@@procps-ng), killall(1), pidof(1), pmap(1), ps(1), pslog(1), pwdx(1), skill(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. | # pkill\n\n> Signal process by name.\n> Mostly used for stopping processes.\n> More information: <https://www.man7.org/linux/man-pages/man1/pkill.1.html>.\n\n- Kill all processes which match:\n\n`pkill "{{process_name}}"`\n\n- Kill all processes which match their full command instead of just the process name:\n\n`pkill -f "{{command_name}}"`\n\n- Force kill matching processes (can't be blocked):\n\n`pkill -9 "{{process_name}}"`\n\n- Send SIGUSR1 signal to processes which match:\n\n`pkill -USR1 "{{process_name}}"`\n\n- Kill the main `firefox` process to close the browser:\n\n`pkill --oldest "{{firefox}}"`\n |
pmap | pmap(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pmap(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXIT STATUS | SEE ALSO | STANDARDS | REPORTING BUGS | COLOPHON PMAP(1) User Commands PMAP(1) NAME top pmap - report memory map of a process SYNOPSIS top pmap [options] pid [...] DESCRIPTION top The pmap command reports the memory map of a process or processes. OPTIONS top -x, --extended Show the extended format. -d, --device Show the device format. -q, --quiet Do not display some header or footer lines. -A, --range low,high Limit results to the given range to low and high address range. Notice that the low and high arguments are single string separated with comma. -X Show even more details than the -x option. WARNING: format changes according to /proc/PID/smaps -XX Show everything the kernel provides -p, --show-path Show full path to files in the mapping column -c, --read-rc Read the default configuration -C, --read-rc-from file Read the configuration from file -n, --create-rc Create new default configuration -N, --create-rc-to file Create new configuration to file -h, --help Display help text and exit. -V, --version Display version information and exit. EXIT STATUS top 0 Success. 1 Failure. 42 Did not find all processes asked for. SEE ALSO top ps(1), pgrep(1) STANDARDS top No standards apply, but pmap looks an awful lot like a SunOS command. 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 2020-06-04 PMAP(1) Pages that refer to this page: 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. | # pmap\n\n> Report memory map of a process or processes.\n> More information: <https://manned.org/pmap>.\n\n- Print memory map for a specific process ID (PID):\n\n`pmap {{pid}}`\n\n- Show the extended format:\n\n`pmap --extended {{pid}}`\n\n- Show the device format:\n\n`pmap --device {{pid}}`\n\n- Limit results to a memory address range specified by `low` and `high`:\n\n`pmap --range {{low}},{{high}}`\n\n- Print memory maps for multiple processes:\n\n`pmap {{pid1 pid2 ...}}`\n |
portablectl | portablectl(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training portablectl(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COMMANDS | OPTIONS | FILES AND DIRECTORIES | PROFILES | EXIT STATUS | ENVIRONMENT | SEE ALSO | NOTES | COLOPHON PORTABLECTL(1) portablectl PORTABLECTL(1) NAME top portablectl - Attach, detach or inspect portable service images SYNOPSIS top portablectl [OPTIONS...] {COMMAND} [NAME...] DESCRIPTION top portablectl may be used to attach, detach or inspect portable service images. It's primarily a command interfacing with systemd-portabled.service(8). Portable service images contain an OS file system tree along with systemd(1) unit file information. A service image may be "attached" to the local system. If attached, a set of unit files are copied from the image to the host, and extended with RootDirectory= or RootImage= assignments (in case of service units) pointing to the image file or directory, ensuring the services will run within the file system context of the image. Portable service images are an efficient way to bundle multiple related services and other units together, and transfer them as a whole between systems. When these images are attached the local system the contained units may run in most ways like regular system-provided units, either with full privileges or inside strict sandboxing, depending on the selected configuration. For more details, see Portable Services Documentation[1]. Specifically portable service images may be of the following kind: Directory trees containing an OS, including the top-level directories /usr/, /etc/, and so on. btrfs subvolumes containing OS trees, similar to normal directory trees. Binary "raw" disk images containing MBR or GPT partition tables and Linux file system partitions. (These must be regular files, with the .raw suffix.) COMMANDS top The following commands are understood: list List available portable service images. This will list all portable service images discovered in the portable image search paths (see below), along with brief metadata and state information. Note that many of the commands below may both operate on images inside and outside of the search paths. This command is hence mostly a convenience option, the commands are generally not restricted to what this list shows. Added in version 239. attach IMAGE [PREFIX...] Attach a portable service image to the host system. Expects a file system path to a portable service image file or directory as first argument. If the specified path contains no slash character ("/") it is understood as image filename that is searched for in the portable service image search paths (see below). To reference a file in the current working directory prefix the filename with "./" to avoid this search path logic. When a portable service is attached four operations are executed: 1. All unit files of types .service, .socket, .target, .timer and .path which match the indicated unit file name prefix are copied from the image to the host's /etc/systemd/system.attached/ directory (or /run/systemd/system.attached/ depending whether --runtime is specified, see below), which is included in the built-in unit search path of the system service manager. 2. For unit files of type .service a drop-in is added to these copies that adds RootDirectory= or RootImage= settings (see systemd.unit(5) for details), that ensures these services are run within the file system of the originating portable service image. 3. A second drop-in is created: the "profile" drop-in, that may contain additional security settings (and other settings). A number of profiles are available by default but administrators may define their own ones. See below. 4. If the portable service image file is not already in the search path (see below), a symbolic link to it is created in /etc/portables/ or /run/portables/, to make sure it is included in it. By default all unit files whose names start with a prefix generated from the image's file name are copied out. Specifically, the prefix is determined from the image file name with any suffix such as .raw removed, truncated at the first occurrence of an underscore character ("_"), if there is one. The underscore logic is supposed to be used to versioning so that the an image file foobar_47.11.raw will result in a unit file matching prefix of foobar. This prefix is then compared with all unit files names contained in the image in the usual directories, but only unit file names where the prefix is followed by "-", "." or "@" are considered. Example: if a portable service image file is named foobar_47.11.raw then by default all its unit files with names such as foobar-quux-waldi.service, foobar.service or [email protected] will be considered. It's possible to override the matching prefix: all strings listed on the command line after the image file name are considered prefixes, overriding the implicit logic where the prefix is derived from the image file name. By default, after the unit files are attached the service manager's configuration is reloaded, except when --no-reload is specified (see below). This ensures that the new units made available to the service manager are seen by it. If --now and/or --enable are passed, the portable services are immediately started (blocking operation unless --no-block is passed) and/or enabled after attaching the image. Added in version 239. detach IMAGE [PREFIX...] Detaches a portable service image from the host. This undoes the operations executed by the attach command above, and removes the unit file copies, drop-ins and image symlink again. This command expects an image name or path as parameter. Note that if a path is specified only the last component of it (i.e. the file or directory name itself, not the path to it) is used for finding matching unit files. This is a convenience feature to allow all arguments passed as attach also to detach. Added in version 239. If --now and/or --enable are passed, the portable services are immediately stopped (blocking operation) and/or disabled before detaching the image. Prefix(es) are also accepted, to be used in case the unit names do not match the image name as described in the attach. reattach IMAGE [PREFIX...] Detaches an existing portable service image from the host, and immediately attaches it again. This is useful in case the image was replaced. Running units are not stopped during the process. Partial matching, to allow for different versions in the image name, is allowed: only the part before the first "_" character has to match. If the new image doesn't exist, the existing one will not be detached. The parameters follow the same syntax as the attach command. Added in version 248. If --now and/or --enable are passed, the portable services are immediately stopped if removed, started and/or enabled if added, or restarted if updated. Prefixes are also accepted, in the same way as described in the attach case. inspect IMAGE [PREFIX...] Extracts various metadata from a portable service image and presents it to the caller. Specifically, the os-release(5) file of the image is retrieved as well as all matching unit files. By default a short summary showing the most relevant metadata in combination with a list of matching unit files is shown (that is the unit files attach would install to the host system). If combined with --cat (see above), the os-release data and the units files' contents is displayed unprocessed. This command is useful to determine whether an image qualifies as portable service image, and which unit files are included. This command expects the path to the image as parameter, optionally followed by a list of unit file prefixes to consider, similar to the attach command described above. Added in version 239. is-attached IMAGE Determines whether the specified image is currently attached or not. Unless combined with the --quiet switch this will show a short state identifier for the image. Specifically: Table 1. Image attachment states State Description detached The image is currently not attached. attached The image is currently attached, i.e. its unit files have been made available to the host system. attached-runtime Like attached, but the unit files have been made available transiently only, i.e. the attach command has been invoked with the --runtime option. enabled The image is currently attached, and at least one unit file associated with it has been enabled. enabled-runtime Like enabled, but the unit files have been made available transiently only, i.e. the attach command has been invoked with the --runtime option. running The image is currently attached, and at least one unit file associated with it is running. running-runtime The image is currently attached transiently, and at least one unit file associated with it is running. Added in version 239. read-only IMAGE [BOOL] Marks or (unmarks) a portable service image read-only. Takes an image name, followed by a boolean as arguments. If the boolean is omitted, positive is implied, i.e. the image is marked read-only. Added in version 239. remove IMAGE... Removes one or more portable service images. Note that this command will only remove the specified image path itself it refers to a symbolic link then the symbolic link is removed and not the image it points to. Added in version 239. set-limit [IMAGE] BYTES Sets the maximum size in bytes that a specific portable service image, or all images, may grow up to on disk (disk quota). Takes either one or two parameters. The first, optional parameter refers to a portable service image name. If specified, the size limit of the specified image is changed. If omitted, the overall size limit of the sum of all images stored locally is changed. The final argument specifies the size limit in bytes, possibly suffixed by the usual K, M, G, T units. If the size limit shall be disabled, specify "-" as size. Note that per-image size limits are only supported on btrfs file systems. Also, depending on BindPaths= settings in the portable service's unit files directories from the host might be visible in the image environment during runtime which are not affected by this setting, as only the image itself is counted against this limit. Added in version 239. OPTIONS top The following options are understood: -q, --quiet Suppresses additional informational output while running. Added in version 239. -p PROFILE, --profile=PROFILE When attaching an image, select the profile to use. By default the "default" profile is used. For details about profiles, see below. Added in version 239. --copy= When attaching an image, select whether to prefer copying or symlinking of files installed into the host system. Takes one of "copy" (to prefer copying of files), "symlink" (to prefer creation of symbolic links) or "auto" for an intermediary mode where security profile drop-ins are symlinked while unit files are copied. Note that this option expresses a preference only, in cases where symbolic links cannot be created for example when the image operated on is a raw disk image, and hence not directly referentiable from the host file system copying of files is used unconditionally. Added in version 239. --runtime When specified the unit and drop-in files are placed in /run/systemd/system.attached/ instead of /etc/systemd/system.attached/. Images attached with this option set hence remain attached only until the next reboot, while they are normally attached persistently. Added in version 239. --no-reload Don't reload the service manager after attaching or detaching a portable service image. Normally the service manager is reloaded to ensure it is aware of added or removed unit files. Added in version 239. --cat When inspecting portable service images, show the (unprocessed) contents of the metadata files pulled from the image, instead of brief summaries. Specifically, this will show the os-release(5) and unit file contents of the image. Added in version 239. --enable Immediately enable/disable the portable service after attaching/detaching. Added in version 245. --now Immediately start/stop/restart the portable service after attaching/before detaching/after upgrading. Added in version 245. --no-block Don't block waiting for attach --now to complete. Added in version 245. --extension=PATH Add an additional image PATH as an overlay on top of IMAGE when attaching/detaching. This argument can be specified multiple times, in which case the order in which images are laid down follows the rules specified in systemd.exec(5) for the ExtensionImages= directive and for the systemd-sysext(8) and. systemd-confext(8) tools. The images must contain an extension-release file with metadata that matches what is defined in the os-release of IMAGE. See: os-release(5). Images can be block images, btrfs subvolumes or directories. For more information on portable services with extensions, see the "Extension Images" paragraph on Portable Services Documentation[1]. Note that the same extensions have to be specified, in the same order, when attaching and detaching. Added in version 249. --force Skip safety checks and attach or detach images (with extensions) without first ensuring that the units are not running, and do not insist that the extension-release.NAME file in the extension image has to match the image filename. Added in version 252. -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. --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. --no-ask-password Do not query the user for authentication for privileged operations. -h, --help Print a short help text and exit. --version Print a short version string and exit. FILES AND DIRECTORIES top Portable service images are preferably stored in /var/lib/portables/, but are also searched for in /etc/portables/, /run/systemd/portables/, /usr/local/lib/portables/ and /usr/lib/portables/. It's recommended not to place image files directly in /etc/portables/ or /run/systemd/portables/ (as these are generally not suitable for storing large or non-textual data), but use these directories only for linking images located elsewhere into the image search path. When a portable service image is attached, matching unit files are copied onto the host into the /etc/systemd/system.attached/ and /run/systemd/system.attached/ directories. When an image is detached, the unit files are removed again from these directories. PROFILES top When portable service images are attached a "profile" drop-in is linked in, which may be used to enforce additional security (and other) restrictions locally. Four profile drop-ins are defined by default, and shipped in /usr/lib/systemd/portable/profile/. Additional, local profiles may be defined by placing them in /etc/systemd/portable/profile/. The default profiles are: Table 2. Profiles Name Description default This is the default profile if no other profile name is set via the --profile= (see above). It's fairly restrictive, but should be useful for common, unprivileged system workloads. This includes write access to the logging framework, as well as IPC access to the D-Bus system. nonetwork Very similar to default, but networking is turned off for any services of the portable service image. strict A profile with very strict settings. This profile excludes IPC (D-Bus) and network access. trusted A profile with very relaxed settings. In this profile the services run with full privileges. For details on these profiles and their effects see their precise definitions, e.g. /usr/lib/systemd/portable/profile/default/service.conf and similar. 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-sysext(8), org.freedesktop.portable1(5), systemd-portabled.service(8) NOTES top 1. Portable Services Documentation https://systemd.io/PORTABLE_SERVICES 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 PORTABLECTL(1) Pages that refer to this page: systemd.directives(7), systemd.index(7), systemd-portabled.service(8), systemd-repart(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. | # portablectl\n\n> A systemd utility for managing and deploying portable service images on Linux systems.\n> More information: <https://www.freedesktop.org/software/systemd/man/portablectl.html>.\n\n- List available portable service images discovered in the portable image search paths:\n\n`portablectl list`\n\n- Attach a portable service image to the host system:\n\n`portablectl attach {{path/to/image}}`\n\n- Detach a portable service image from the host system:\n\n`portablectl detach {{path/to/image|image_name}}`\n\n- Display details and metadata about a specified portable service image:\n\n`portablectl inspect {{path/to/image}}`\n\n- Check if a portable service image is attached to the host system:\n\n`portablectl is-attached {{path/to/image|image_name}}`\n |
poweroff | poweroff(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training poweroff(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXIT STATUS | NOTES | SEE ALSO | COLOPHON POWEROFF(8) poweroff POWEROFF(8) NAME top poweroff, reboot, halt - Power off, reboot, or halt the machine SYNOPSIS top poweroff [OPTIONS...] reboot [OPTIONS...] halt [OPTIONS...] DESCRIPTION top poweroff, reboot, and halt may be used to power off, reboot, or halt the machine. All three commands take the same options. OPTIONS top The following options are understood: --help Print a short help text and exit. Added in version 253. --halt Halt the machine, regardless of which one of the three commands is invoked. Added in version 253. -p, --poweroff Power off the machine, when either halt or poweroff is invoked. This option is ignored when reboot is invoked. Added in version 253. --reboot Reboot the machine, regardless of which one of the three commands is invoked. Added in version 253. -f, --force Force immediate power-off, halt, or reboot. If specified, the command does not contact the init system. In most cases, filesystems are not properly unmounted before shutdown. For example, the command reboot -f is mostly equivalent to systemctl reboot -ff, instead of systemctl reboot -f. Added in version 253. -w, --wtmp-only Only write wtmp shutdown entry, do not actually power off, reboot, or halt. Added in version 253. -d, --no-wtmp Do not write wtmp shutdown entry. Added in version 253. -n, --no-sync Don't sync hard disks/storage media before power-off, reboot, or halt. Added in version 253. --no-wall Do not send wall message before power-off, reboot, or halt. Added in version 253. EXIT STATUS top On success, 0 is returned, a non-zero failure code otherwise. NOTES top These commands are implemented in a way that preserves basic compatibility with the original SysV commands. systemctl(1) verbs poweroff, reboot, halt provide the same functionality with some additional features. Note that on many SysV systems halt used to be synonymous to poweroff, i.e. both commands would equally result in powering the machine off. systemd is more accurate here, and halt results in halting the machine only (leaving power on), and poweroff is required to actually power it off. SEE ALSO top systemd(1), systemctl(1), shutdown(8), 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 POWEROFF(8) Pages that refer to this page: reboot(2), systemd.directives(7), systemd.index(7), fsck.minix(8), mkfs.minix(8), shutdown(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. | # poweroff\n\n> Power off the system.\n> More information: <https://www.man7.org/linux/man-pages/man8/poweroff.8.html>.\n\n- Power off the system:\n\n`poweroff`\n\n- Halt the system (same as `halt`):\n\n`poweroff --halt`\n\n- Reboot the system (same as `reboot`):\n\n`poweroff --reboot`\n\n- Shut down immediately without contacting the system manager:\n\n`poweroff --force --force`\n\n- Write the wtmp shutdown entry without shutting down the system:\n\n`poweroff --wtmp-only`\n |
pppd | pppd(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pppd(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | FREQUENTLY USED OPTIONS | OPTIONS | PPPOE OPTIONS | OPTIONS FILES | SECURITY | AUTHENTICATION | ROUTING | MULTILINK | EXAMPLES | DIAGNOSTICS | EXIT STATUS | SCRIPTS | SEE ALSO | NOTES | AUTHORS | COPYRIGHT | COLOPHON PPPD(8) System Manager's Manual PPPD(8) NAME top pppd - Point-to-Point Protocol Daemon SYNOPSIS top pppd [ options ] DESCRIPTION top PPP is the protocol used for establishing internet links over dial-up modems, DSL connections, and many other types of point- to-point links. The pppd daemon works together with the kernel PPP driver to establish and maintain a PPP link with another system (called the peer) and to negotiate Internet Protocol (IP) addresses for each end of the link. Pppd can also authenticate the peer and/or supply authentication information to the peer. PPP can be used with other network protocols besides IP, but such use is becoming increasingly rare. FREQUENTLY USED OPTIONS top ttyname Use the serial port called ttyname to communicate with the peer. If ttyname does not begin with a slash (/), the string "/dev/" is prepended to ttyname to form the name of the device to open. If no device name is given, or if the name of the terminal connected to the standard input is given, pppd will use that terminal, and will not fork to put itself in the background. A value for this option from a privileged source cannot be overridden by a non- privileged user. speed An option that is a decimal number is taken as the desired baud rate for the serial device. On systems such as Linux, 4.4BSD and NetBSD, any speed can be specified. Other systems (e.g. SunOS) only support the commonly-used baud rates. asyncmap map This option sets the Async-Control-Character-Map (ACCM) for this end of the link. The ACCM is a set of 32 bits, one for each of the ASCII control characters with values from 0 to 31, where a 1 bit indicates that the corresponding control character should not be used in PPP packets sent to this system. The map is encoded as a hexadecimal number (without a leading 0x) where the least significant bit (00000001) represents character 0 and the most significant bit (80000000) represents character 31. Pppd will ask the peer to send these characters as a 2-byte escape sequence. If multiple asyncmap options are given, the values are ORed together. If no asyncmap option is given, the default is zero, so pppd will ask the peer not to escape any control characters. To escape transmitted characters, use the escape option. auth Require the peer to authenticate itself before allowing network packets to be sent or received. This option is the default if the system has a default route. If neither this option nor the noauth option is specified, pppd will only allow the peer to use IP addresses to which the system does not already have a route. call name Read additional options from the file /etc/ppp/peers/name. This file may contain privileged options, such as noauth, even if pppd is not being run by root. The name string may not begin with / or include .. as a pathname component. The format of the options file is described below. connect script Usually there is something which needs to be done to prepare the link before the PPP protocol can be started; for instance, with a dial-up modem, commands need to be sent to the modem to dial the appropriate phone number. This option specifies an command for pppd to execute (by passing it to a shell) before attempting to start PPP negotiation. The chat (8) program is often useful here, as it provides a way to send arbitrary strings to a modem and respond to received characters. A value for this option from a privileged source cannot be overridden by a non-privileged user. crtscts Specifies that pppd should set the serial port to use hardware flow control using the RTS and CTS signals in the RS-232 interface. If neither the crtscts, the nocrtscts, the cdtrcts nor the nocdtrcts option is given, the hardware flow control setting for the serial port is left unchanged. Some serial ports (such as Macintosh serial ports) lack a true RTS output. Such serial ports use this mode to implement unidirectional flow control. The serial port will suspend transmission when requested by the modem (via CTS) but will be unable to request the modem to stop sending to the computer. This mode retains the ability to use DTR as a modem control line. defaultroute Add a default route to the system routing tables, using the peer as the gateway, when IPCP negotiation is successfully completed. This entry is removed when the PPP connection is broken. This option is privileged if the nodefaultroute option has been specified. defaultroute-metric Define the metric of the defaultroute and only add it if there is no other default route with the same metric. With the default value of -1, the route is only added if there is no default route at all. replacedefaultroute This option is a flag to the defaultroute option. If defaultroute is set and this flag is also set, pppd replaces an existing default route with the new default route. This option is privileged. disconnect script Execute the command specified by script, by passing it to a shell, after pppd has terminated the link. This command could, for example, issue commands to the modem to cause it to hang up if hardware modem control signals were not available. The disconnect script is not run if the modem has already hung up. A value for this option from a privileged source cannot be overridden by a non-privileged user. escape xx,yy,... Specifies that certain characters should be escaped on transmission (regardless of whether the peer requests them to be escaped with its async control character map). The characters to be escaped are specified as a list of hex numbers separated by commas. Note that almost any character can be specified for the escape option, unlike the asyncmap option which only allows control characters to be specified. The characters which may not be escaped are those with hex values 0x20 - 0x3f or 0x5e. file name Read options from file name (the format is described below). The file must be readable by the user who has invoked pppd. init script Execute the command specified by script, by passing it to a shell, to initialize the serial line. This script would typically use the chat(8) program to configure the modem to enable auto answer. A value for this option from a privileged source cannot be overridden by a non-privileged user. lock Specifies that pppd should create a UUCP-style lock file for the serial device to ensure exclusive access to the device. By default, pppd will not create a lock file. mru n Set the MRU [Maximum Receive Unit] value to n. Pppd will ask the peer to send packets of no more than n bytes. The value of n must be between 128 and 16384; the default is 1500. A value of 296 works well on very slow links (40 bytes for TCP/IP header + 256 bytes of data). Note that for the IPv6 protocol, the MRU must be at least 1280. mtu n Set the MTU [Maximum Transmit Unit] value to n. Unless the peer requests a smaller value via MRU negotiation, pppd will request that the kernel networking code send data packets of no more than n bytes through the PPP network interface. Note that for the IPv6 protocol, the MTU must be at least 1280. passive Enables the "passive" option in the LCP. With this option, pppd will attempt to initiate a connection; if no reply is received from the peer, pppd will then just wait passively for a valid LCP packet from the peer, instead of exiting, as it would without this option. OPTIONS top <local_IP_address>:<remote_IP_address> Set the local and/or remote interface IP addresses. Either one may be omitted. The IP addresses can be specified with a host name or in decimal dot notation (e.g. 150.234.56.78). The default local address is the (first) IP address of the system (unless the noipdefault option is given). The remote address will be obtained from the peer if not specified in any option. Thus, in simple cases, this option is not required. If a local and/or remote IP address is specified with this option, pppd will not accept a different value from the peer in the IPCP negotiation, unless the ipcp-accept-local and/or ipcp-accept-remote options are given, respectively. +ipv6 Enable the IPv6CP and IPv6 protocols. ipv6 <local_interface_identifier>,<remote_interface_identifier> Set the local and/or remote 64-bit interface identifier. Either one may be omitted. The identifier must be specified in standard ASCII notation of IPv6 addresses (e.g. ::dead:beef). If the ipv6cp-use-ipaddr option is given, the local identifier is the local IPv4 address and the remote identifier is the remote IPv4 address (see above). If the ipv6cp-use-remotenumber option is given, the remote identifier is set to the value from remotenumber option. On systems which supports a unique persistent id, such as EUI-48 derived from the Ethernet MAC address, ipv6cp-use-persistent option can be used to set local identifier. Otherwise both local and remote identifiers are randomized. active-filter filter-expression Specifies a packet filter to be applied to data packets to determine which packets are to be regarded as link activity, and therefore reset the idle timer, or cause the link to be brought up in demand-dialling mode. This option is useful in conjunction with the idle option if there are packets being sent or received regularly over the link (for example, routing information packets) which would otherwise prevent the link from ever appearing to be idle. The filter-expression syntax is as described for tcpdump(1), except that qualifiers which are inappropriate for a PPP link, such as ether and arp, are not permitted. Generally the filter expression should be enclosed in single-quotes to prevent whitespace in the expression from being interpreted by the shell. This option is currently only available under Linux, and requires that the kernel was configured to include PPP filtering support (CONFIG_PPP_FILTER). Note that it is possible to apply different constraints to incoming and outgoing packets using the inbound and outbound qualifiers. allow-ip address(es) Allow peers to use the given IP address or subnet without authenticating themselves. The parameter is parsed as for each element of the list of allowed IP addresses in the secrets files (see the AUTHENTICATION section below). allow-number number Allow peers to connect from the given telephone number. A trailing `*' character will match all numbers beginning with the leading part. bsdcomp nr,nt Request that the peer compress packets that it sends, using the BSD-Compress scheme, with a maximum code size of nr bits, and agree to compress packets sent to the peer with a maximum code size of nt bits. If nt is not specified, it defaults to the value given for nr. Values in the range 9 to 15 may be used for nr and nt; larger values give better compression but consume more kernel memory for compression dictionaries. Alternatively, a value of 0 for nr or nt disables compression in the corresponding direction. Use nobsdcomp or bsdcomp 0 to disable BSD-Compress compression entirely. ca ca-file (EAP-TLS, or PEAP) Use the file ca-file as the X.509 Certificate Authority (CA) file (in PEM format), needed for setting up an EAP-TLS connection. This option is used on the client-side in conjunction with the cert and key options. Either ca, or capath options are required for PEAP. EAP-TLS may also use the entry in eaptls-client or eaptls-server for a CA certificate associated with a particular peer. capath path (EAP-TLS, or PEAP) Specify a location that contains public CA certificates. Either ca, or capath options are required for PEAP. cdtrcts Use a non-standard hardware flow control (i.e. DTR/CTS) to control the flow of data on the serial port. If neither the crtscts, the nocrtscts, the cdtrcts nor the nocdtrcts option is given, the hardware flow control setting for the serial port is left unchanged. Some serial ports (such as Macintosh serial ports) lack a true RTS output. Such serial ports use this mode to implement true bi- directional flow control. The sacrifice is that this flow control mode does not permit using DTR as a modem control line. cert certfile (EAP-TLS) Use the file certfile as the X.509 certificate (in PEM format), needed for setting up an EAP-TLS connection. This option is used on the client-side in conjunction with the ca and key options. chap-interval n If this option is given, pppd will rechallenge the peer every n seconds. chap-max-challenge n Set the maximum number of CHAP challenge transmissions to n (default 10). chap-restart n Set the CHAP restart interval (retransmission timeout for challenges) to n seconds (default 3). chap-timeout n Set timeout for CHAP authentication by peer to n seconds (default 60). chapms-strip-domain Some Windows 9x/ME clients might be transmitting the MS domain before the username in the provided client name. This option enables stripping the domain from the client name on the server side before matching it against the secret file. child-timeout n When exiting, wait for up to n seconds for any child processes (such as the command specified with the pty command) to exit before exiting. At the end of the timeout, pppd will send a SIGTERM signal to any remaining child processes and exit. A value of 0 means no timeout, that is, pppd will wait until all child processes have exited. connect-delay n Wait for up to n milliseconds after the connect script finishes for a valid PPP packet from the peer. At the end of this time, or when a valid PPP packet is received from the peer, pppd will commence negotiation by sending its first LCP packet. The default value is 1000 (1 second). This wait period only applies if the connect or pty option is used. crl filename (EAP-TLS, or PEAP) Use the file filename as the Certificate Revocation List to check for the validity of the peer's certificate. This option is not mandatory for setting up a TLS connection. Also see the crl-dir option. crl-dir directory (EAP-TLS, or PEAP) Use the directory directory to scan for CRL files in has format ($hash.r0) to check for the validity of the peer's certificate. This option is not mandatory for setting up a TLS connection. Also see the crl option. debug Enables connection debugging facilities. If this option is given, pppd will log the contents of all control packets sent or received in a readable form. The packets are logged through syslog with facility daemon and level debug. This information can be directed to a file by setting up /etc/syslog.conf appropriately (see syslog.conf(5)). default-asyncmap Disable asyncmap negotiation, forcing all control characters to be escaped for both the transmit and the receive direction. default-mru Disable MRU [Maximum Receive Unit] negotiation. With this option, pppd will use the default MRU value of 1500 bytes for both the transmit and receive direction. defaultroute6 Add a default IPv6 route to the system routing tables, using the peer as the gateway, when IPv6CP negotiation is successfully completed. This entry is removed when the PPP connection is broken. This option is privileged if the nodefaultroute6 option has been specified. WARNING: Do not enable this option by default. IPv6 routing tables are managed by kernel (as apposite to IPv4) and IPv6 default route is configured by kernel automatically too based on ICMPv6 Router Advertisement packets. This option may conflict with kernel IPv6 route setup and should be used only for broken IPv6 networks. deflate nr,nt Request that the peer compress packets that it sends, using the Deflate scheme, with a maximum window size of 2**nr bytes, and agree to compress packets sent to the peer with a maximum window size of 2**nt bytes. If nt is not specified, it defaults to the value given for nr. Values in the range 9 to 15 may be used for nr and nt; larger values give better compression but consume more kernel memory for compression dictionaries. Alternatively, a value of 0 for nr or nt disables compression in the corresponding direction. Use nodeflate or deflate 0 to disable Deflate compression entirely. (Note: pppd requests Deflate compression in preference to BSD-Compress if the peer can do either.) demand Initiate the link only on demand, i.e. when data traffic is present. With this option, the remote IP address may be specified by the user on the command line or in an options file, or if not, pppd will use an arbitrary address in the 10.x.x.x range. Pppd will initially configure the interface and enable it for IP traffic without connecting to the peer. When traffic is available, pppd will connect to the peer and perform negotiation, authentication, etc. When this is completed, pppd will commence passing data packets (i.e., IP packets) across the link. The demand option implies the persist option. If this behaviour is not desired, use the nopersist option after the demand option. The idle and holdoff options are also useful in conjunction with the demand option. domain d Append the domain name d to the local host name for authentication purposes. For example, if gethostname() returns the name porsche, but the fully qualified domain name is porsche.Quotron.COM, you could specify domain Quotron.COM. Pppd would then use the name porsche.Quotron.COM for looking up secrets in the secrets file, and as the default name to send to the peer when authenticating itself to the peer. This option is privileged. dryrun With the dryrun option, pppd will print out all the option values which have been set and then exit, after parsing the command line and options files and checking the option values, but before initiating the link. The option values are logged at level info, and also printed to standard output unless the device on standard output is the device that pppd would be using to communicate with the peer. dump With the dump option, pppd will print out all the option values which have been set. This option is like the dryrun option except that pppd proceeds as normal rather than exiting. enable-session Enables session accounting via PAM or wtwp/wtmpx, as appropriate. When PAM is enabled, the PAM "account" and "session" module stacks determine behavior, and are enabled for all PPP authentication protocols. When PAM is disabled, wtmp/wtmpx entries are recorded regardless of whether the peer name identifies a valid user on the local system, making peers visible in the last(1) log. This feature is automatically enabled when the pppd login option is used. Session accounting is disabled by default. endpoint <epdisc> Sets the endpoint discriminator sent by the local machine to the peer during multilink negotiation to <epdisc>. The default is to use the MAC address of the first ethernet interface on the system, if any, otherwise the IPv4 address corresponding to the hostname, if any, provided it is not in the multicast or locally-assigned IP address ranges, or the localhost address. The endpoint discriminator can be the string null or of the form type:value, where type is a decimal number or one of the strings local, IP, MAC, magic, or phone. The value is an IP address in dotted-decimal notation for the IP type, or a string of bytes in hexadecimal, separated by periods or colons for the other types. For the MAC type, the value may also be the name of an ethernet or similar network interface. This option is currently only available under Linux. eap-interval n If this option is given and pppd authenticates the peer with EAP (i.e., is the server), pppd will restart EAP authentication every n seconds. For EAP SRP-SHA1, see also the srp-interval option, which enables lightweight rechallenge. eap-max-rreq n Set the maximum number of EAP Requests to which pppd will respond (as a client) without hearing EAP Success or Failure. (Default is 20.) eap-max-sreq n Set the maximum number of EAP Requests that pppd will issue (as a server) while attempting authentication. (Default is 10.) eap-restart n Set the retransmit timeout for EAP Requests when acting as a server (authenticator). (Default is 3 seconds.) eap-timeout n Set the maximum time to wait for the peer to send an EAP Request when acting as a client (authenticatee). (Default is 20 seconds.) hide-password When logging the contents of PAP packets, this option causes pppd to exclude the password string from the log. This is the default. holdoff n Specifies how many seconds to wait before re-initiating the link after it terminates. This option only has any effect if the persist or demand option is used. The holdoff period is not applied if the link was terminated because it was idle. idle n Specifies that pppd should disconnect if the link is idle for n seconds. The link is idle when no data packets (i.e. IP packets) are being sent or received. Note: it is not advisable to use this option with the persist option without the demand option. If the active-filter option is given, data packets which are rejected by the specified activity filter also count as the link being idle. ipcp-accept-local With this option, pppd will accept the peer's idea of our local IP address, even if the local IP address was specified in an option. ipcp-accept-remote With this option, pppd will accept the peer's idea of its (remote) IP address, even if the remote IP address was specified in an option. ipcp-max-configure n Set the maximum number of IPCP configure-request transmissions to n (default 10). ipcp-max-failure n Set the maximum number of IPCP configure-NAKs returned before starting to send configure-Rejects instead to n (default 10). ipcp-max-terminate n Set the maximum number of IPCP terminate-request transmissions to n (default 3). ipcp-no-address Disable negotiation of addresses via IP-Address IPCP option. ipcp-no-addresses Disable negotiation of addresses via old-style deprecated IP-Addresses IPCP option. pppd by default try to use new- style IP-Address IPCP option. If new-style is not supported by peer or is disabled by ipcp-no-address option then pppd fallbacks to old-style deprecated IP-Addresses IPCP option. When both new-style and old-style are disabled by both ipcp-no-address and ipcp-no-addresses options then negotiation of IP addresses is completely disabled. ipcp-restart n Set the IPCP restart interval (retransmission timeout) to n seconds (default 3). ipparam string Provides an extra parameter most of the notification scripts, most notably ip-up, ip-pre-up, ip-down, ipv6-up, ipv6-down, auth-up and auth-down scripts. If this option is given, the string supplied is given as the 6th parameter to those scripts. ipv6cp-accept-local With this option, pppd will accept the peer's idea of our local IPv6 interface identifier, even if the local IPv6 interface identifier was specified in an option. ipv6cp-accept-remote With this option, pppd will accept the peer's idea of its (remote) IPv6 interface identifier, even if the remote IPv6 interface identifier was specified in an option. ipv6cp-noremote Allow pppd to operate without having an IPv6 link local address for the peer. This option is only available under Linux. Normally, pppd will request the peer's IPv6 interface identifier (used for composing IPv6 link local address), and if the peer does not supply it, pppd will generate one for the peer. With this option, if the peer does not supply its IPv6 interface identifier, pppd will not ask the peer for it, and will not set the destination IPv6 link local address of the ppp interface. In this situation, the ppp interface can be used for routing by creating device routes, but the peer itself cannot be addressed directly for IPv6 traffic until the peer starts announcing ICMPv6 Router Advertisement or ICMPv6 Neighbor Advertisement packets. Note that IPv6 router must announce ICMPv6 Router Advertisement packets. ipv6cp-nosendip Don't send our local IPv6 interface identifier to peer during IPv6 interface identifier negotiation. ipv6cp-max-configure n Set the maximum number of IPv6CP configure-request transmissions to n (default 10). ipv6cp-max-failure n Set the maximum number of IPv6CP configure-NAKs returned before starting to send configure-Rejects instead to n (default 10). ipv6cp-max-terminate n Set the maximum number of IPv6CP terminate-request transmissions to n (default 3). ipv6cp-restart n Set the IPv6CP restart interval (retransmission timeout) to n seconds (default 3). kdebug n Enable debugging code in the kernel-level PPP driver. The argument values depend on the specific kernel driver, but in general a value of 1 will enable general kernel debug messages. (Note that these messages are usually only useful for debugging the kernel driver itself.) For the Linux 2.2.x kernel driver, the value is a sum of bits: 1 to enable general debug messages, 2 to request that the contents of received packets be printed, and 4 to request that the contents of transmitted packets be printed. On most systems, messages printed by the kernel are logged by syslog(1) to a file as directed in the /etc/syslog.conf configuration file. key keyfile (EAP-TLS) Use the file keyfile as the private key file (in PEM format), needed for setting up an EAP-TLS connection. This option is used on the client-side in conjunction with the ca and cert options. ktune Enables pppd to alter kernel settings as appropriate. Under Linux, pppd will enable IP forwarding (i.e. set /proc/sys/net/ipv4/ip_forward to 1) if the proxyarp option is used, and will enable the dynamic IP address option (i.e. set /proc/sys/net/ipv4/ip_dynaddr to 1) in demand mode if the local address changes. lcp-echo-adaptive If this option is used with the lcp-echo-failure option then pppd will send LCP echo-request frames only if no traffic was received from the peer since the last echo-request was sent. lcp-echo-failure n If this option is given, pppd will presume the peer to be dead if n LCP echo-requests are sent without receiving a valid LCP echo-reply. If this happens, pppd will terminate the connection. Use of this option requires a non-zero value for the lcp-echo-interval parameter. This option can be used to enable pppd to terminate after the physical connection has been broken (e.g., the modem has hung up) in situations where no hardware modem control lines are available. lcp-echo-interval n If this option is given, pppd will send an LCP echo-request frame to the peer every n seconds. Normally the peer should respond to the echo-request by sending an echo-reply. This option can be used with the lcp-echo-failure option to detect that the peer is no longer connected. lcp-max-configure n Set the maximum number of LCP configure-request transmissions to n (default 10). lcp-max-failure n Set the maximum number of LCP configure-NAKs returned before starting to send configure-Rejects instead to n (default 10). lcp-max-terminate n Set the maximum number of LCP terminate-request transmissions to n (default 3). lcp-restart n Set the LCP restart interval (retransmission timeout) to n seconds (default 3). lcp-rtt-file filename Sets the file where the round-trip time (RTT) of LCP echo- request frames will be logged. linkname name Sets the logical name of the link to name. Pppd will create a file named ppp-name.pid in /var/run (or /etc/ppp on some systems) containing its process ID. This can be useful in determining which instance of pppd is responsible for the link to a given peer system. This is a privileged option. local Don't use the modem control lines. With this option, pppd will ignore the state of the CD (Carrier Detect) signal from the modem and will not change the state of the DTR (Data Terminal Ready) signal. This is the opposite of the modem option. logfd n Send log messages to file descriptor n. Pppd will send log messages to at most one file or file descriptor (as well as sending the log messages to syslog), so this option and the logfile option are mutually exclusive. The default is for pppd to send log messages to stdout (file descriptor 1), unless the serial port is already open on stdout. logfile filename Append log messages to the file filename (as well as sending the log messages to syslog). The file is opened with the privileges of the user who invoked pppd, in append mode. login Use the system password database for authenticating the peer using PAP, and record the user in the system wtmp file. Note that the peer must have an entry in the /etc/ppp/pap-secrets file as well as the system password database to be allowed access. See also the enable-session option. master_detach If multilink is enabled and this pppd process is the multilink bundle master, and the link controlled by this pppd process terminates, this pppd process continues to run in order to maintain the bundle. If the master_detach option has been given, pppd will detach from its controlling terminal in this situation, even if the nodetach option has been given. maxconnect n Terminate the connection when it has been available for network traffic for n seconds (i.e. n seconds after the first network control protocol comes up). maxfail n Terminate after n consecutive failed connection attempts. A value of 0 means no limit. The default value is 10. max-tls-sion string (EAP-TLS, or PEAP) Configures the max allowed TLS version used during negotiation with a peer. The default value for this is 1.2. Values allowed for this option is 1.0., 1.1, 1.2, 1.3. modem Use the modem control lines. This option is the default. With this option, pppd will wait for the CD (Carrier Detect) signal from the modem to be asserted when opening the serial device (unless a connect script is specified), and it will drop the DTR (Data Terminal Ready) signal briefly when the connection is terminated and before executing the connect script. On Ultrix, this option implies hardware flow control, as for the crtscts option. This is the opposite of the local option. mp Enables the use of PPP multilink; this is an alias for the `multilink' option. This option is currently only available under Linux. mppe-stateful Allow MPPE to use stateful mode. Stateless mode is still attempted first. The default is to disallow stateful mode. mpshortseq Enables the use of short (12-bit) sequence numbers in multilink headers, as opposed to 24-bit sequence numbers. This option is only available under Linux, and only has any effect if multilink is enabled (see the multilink option). mrru n Sets the Maximum Reconstructed Receive Unit to n. The MRRU is the maximum size for a received packet on a multilink bundle, and is analogous to the MRU for the individual links. This option is currently only available under Linux, and only has any effect if multilink is enabled (see the multilink option). ms-dns <addr> If pppd is acting as a server for Microsoft Windows clients, this option allows pppd to supply one or two DNS (Domain Name Server) addresses to the clients. The first instance of this option specifies the primary DNS address; the second instance (if given) specifies the secondary DNS address. (This option was present in some older versions of pppd under the name dns-addr.) ms-wins <addr> If pppd is acting as a server for Microsoft Windows or "Samba" clients, this option allows pppd to supply one or two WINS (Windows Internet Name Services) server addresses to the clients. The first instance of this option specifies the primary WINS address; the second instance (if given) specifies the secondary WINS address. multilink Enables the use of the PPP multilink protocol. If the peer also supports multilink, then this link can become part of a bundle between the local system and the peer. If there is an existing bundle to the peer, pppd will join this link to that bundle, otherwise pppd will create a new bundle. See the MULTILINK section below. This option is currently only available under Linux. name name Set the name of the local system for authentication purposes to name. This is a privileged option. With this option, pppd will use lines in the secrets files which have name as the second field when looking for a secret to use in authenticating the peer. In addition, unless overridden with the user option, name will be used as the name to send to the peer when authenticating the local system to the peer. (Note that pppd does not append the domain name to name.) noaccomp Disable Address/Control compression in both directions (send and receive). need-peer-eap (EAP-TLS) Require the peer to verify our authentication credentials. noauth Do not require the peer to authenticate itself. This option is privileged. nobsdcomp Disables BSD-Compress compression; pppd will not request or agree to compress packets using the BSD-Compress scheme. noccp Disable CCP (Compression Control Protocol) negotiation. This option should only be required if the peer is buggy and gets confused by requests from pppd for CCP negotiation. nocrtscts Disable hardware flow control (i.e. RTS/CTS) on the serial port. If neither the crtscts nor the nocrtscts nor the cdtrcts nor the nocdtrcts option is given, the hardware flow control setting for the serial port is left unchanged. nocdtrcts This option is a synonym for nocrtscts. Either of these options will disable both forms of hardware flow control. nodefaultroute Disable the defaultroute option. The system administrator who wishes to prevent users from adding a default route with pppd can do so by placing this option in the /etc/ppp/options file. noreplacedefaultroute Disable the replacedefaultroute option. This allows to disable a replacedefaultroute option set previously in the configuration. nodefaultroute6 Disable the defaultroute6 option. The system administrator who wishes to prevent users from adding a default route with pppd can do so by placing this option in the /etc/ppp/options file. nodeflate Disables Deflate compression; pppd will not request or agree to compress packets using the Deflate scheme. nodetach Don't detach from the controlling terminal. Without this option, if a serial device other than the terminal on the standard input is specified, pppd will fork to become a background process. noendpoint Disables pppd from sending an endpoint discriminator to the peer or accepting one from the peer (see the MULTILINK section below). This option should only be required if the peer is buggy. noip Disable IPCP negotiation and IP communication. This option should only be required if the peer is buggy and gets confused by requests from pppd for IPCP negotiation. noipv6 Disable IPv6CP negotiation and IPv6 communication. This option should only be required if the peer is buggy and gets confused by requests from pppd for IPv6CP negotiation. noipdefault Disables the default behaviour when no local IP address is specified, which is to determine (if possible) the local IP address from the hostname. With this option, the peer will have to supply the local IP address during IPCP negotiation (unless it specified explicitly on the command line or in an options file). noktune Opposite of the ktune option; disables pppd from changing system settings. nolock Opposite of the lock option; specifies that pppd should not create a UUCP-style lock file for the serial device. This option is privileged. nolog Do not send log messages to a file or file descriptor. This option cancels the logfd and logfile options. nomagic Disable magic number negotiation. With this option, pppd cannot detect a looped-back line. This option should only be needed if the peer is buggy. nomp Disables the use of PPP multilink. This option is currently only available under Linux. nomppe Disables MPPE (Microsoft Point to Point Encryption). This is the default. nomppe-40 Disable 40-bit encryption with MPPE. nomppe-128 Disable 128-bit encryption with MPPE. nomppe-stateful Disable MPPE stateful mode. This is the default. nompshortseq Disables the use of short (12-bit) sequence numbers in the PPP multilink protocol, forcing the use of 24-bit sequence numbers. This option is currently only available under Linux, and only has any effect if multilink is enabled. nomultilink Disables the use of PPP multilink. This option is currently only available under Linux. nopcomp Disable protocol field compression negotiation in both the receive and the transmit direction. nopersist Exit once a connection has been made and terminated. This is the default unless the persist or demand option has been specified. nopredictor1 Do not accept or agree to Predictor-1 compression. noproxyarp Disable the proxyarp option. The system administrator who wishes to prevent users from creating proxy ARP entries with pppd can do so by placing this option in the /etc/ppp/options file. noremoteip Allow pppd to operate without having an IP address for the peer. This option is only available under Linux. Normally, pppd will request the peer's IP address, and if the peer does not supply it, pppd will use an arbitrary address in the 10.x.x.x subnet. With this option, if the peer does not supply its IP address, pppd will not ask the peer for it, and will not set the destination address of the ppp interface. In this situation, the ppp interface can be used for routing by creating device routes, but the peer itself cannot be addressed directly for IP traffic. nosendip Don't send our local IP address to peer during IP address negotiation. notty Normally, pppd requires a terminal device. With this option, pppd will allocate itself a pseudo-tty master/slave pair and use the slave as its terminal device. Pppd will create a child process to act as a `character shunt' to transfer characters between the pseudo-tty master and its standard input and output. Thus pppd will transmit characters on its standard output and receive characters on its standard input even if they are not terminal devices. This option increases the latency and CPU overhead of transferring data over the ppp interface as all of the characters sent and received must flow through the character shunt process. An explicit device name may not be given if this option is used. novj Disable Van Jacobson style TCP/IP header compression in both the transmit and the receive direction. novjccomp Disable the connection-ID compression option in Van Jacobson style TCP/IP header compression. With this option, pppd will not omit the connection-ID byte from Van Jacobson compressed TCP/IP headers, nor ask the peer to do so. papcrypt Indicates that all secrets in the /etc/ppp/pap-secrets file which are used for checking the identity of the peer are encrypted, and thus pppd should not accept a password which, before encryption, is identical to the secret from the /etc/ppp/pap-secrets file. pap-max-authreq n Set the maximum number of PAP authenticate-request transmissions to n (default 10). pap-restart n Set the PAP restart interval (retransmission timeout) to n seconds (default 3). pap-timeout n Set the maximum time that pppd will wait for the peer to authenticate itself with PAP to n seconds (0 means no limit). pass-filter filter-expression Specifies a packet filter to applied to data packets being sent or received to determine which packets should be allowed to pass. Packets which are rejected by the filter are silently discarded. This option can be used to prevent specific network daemons (such as routed) using up link bandwidth, or to provide a very basic firewall capability. The filter-expression syntax is as described for tcpdump(1), except that qualifiers which are inappropriate for a PPP link, such as ether and arp, are not permitted. Generally the filter expression should be enclosed in single-quotes to prevent whitespace in the expression from being interpreted by the shell. Note that it is possible to apply different constraints to incoming and outgoing packets using the inbound and outbound qualifiers. This option is currently only available under Linux, and requires that the kernel was configured to include PPP filtering support (CONFIG_PPP_FILTER). password password-string Specifies the password to use for authenticating to the peer. Use of this option is discouraged, as the password is likely to be visible to other users on the system (for example, by using ps(1)). persist Do not exit after a connection is terminated; instead try to reopen the connection. The maxfail option still has an effect on persistent connections. plugin filename Load the shared library object file filename as a plugin. This is a privileged option. If filename does not contain a slash (/), pppd will look in the /usr/lib/pppd/version directory for the plugin, where version is the version number of pppd (for example, 2.4.2). predictor1 Request that the peer compress frames that it sends using Predictor-1 compression, and agree to compress transmitted frames with Predictor-1 if requested. This option has no effect unless the kernel driver supports Predictor-1 compression. privgroup group-name Allows members of group group-name to use privileged options. This is a privileged option. Use of this option requires care as there is no guarantee that members of group-name cannot use pppd to become root themselves. Consider it equivalent to putting the members of group-name in the kmem or disk group. proxyarp Add an entry to this system's ARP [Address Resolution Protocol] table with the IP address of the peer and the Ethernet address of this system. This will have the effect of making the peer appear to other systems to be on the local ethernet. pty script Specifies that the command script is to be used to communicate rather than a specific terminal device. Pppd will allocate itself a pseudo-tty master/slave pair and use the slave as its terminal device. The script will be run in a child process with the pseudo-tty master as its standard input and output. An explicit device name may not be given if this option is used. (Note: if the record option is used in conjunction with the pty option, the child process will have pipes on its standard input and output.) receive-all With this option, pppd will accept all control characters from the peer, including those marked in the receive asyncmap. Without this option, pppd will discard those characters as specified in RFC1662. This option should only be needed if the peer is buggy. record filename Specifies that pppd should record all characters sent and received to a file named filename. This file is opened in append mode, using the user's user-ID and permissions. This option is implemented using a pseudo-tty and a process to transfer characters between the pseudo-tty and the real serial device, so it will increase the latency and CPU overhead of transferring data over the ppp interface. The characters are stored in a tagged format with timestamps, which can be displayed in readable form using the pppdump(8) program. remotename name Set the assumed name of the remote system for authentication purposes to name. remotenumber number Set the assumed telephone number of the remote system for authentication purposes to number. refuse-chap With this option, pppd will not agree to authenticate itself to the peer using CHAP. refuse-mschap With this option, pppd will not agree to authenticate itself to the peer using MS-CHAP. refuse-mschap-v2 With this option, pppd will not agree to authenticate itself to the peer using MS-CHAPv2. refuse-eap With this option, pppd will not agree to authenticate itself to the peer using EAP. refuse-pap With this option, pppd will not agree to authenticate itself to the peer using PAP. require-chap Require the peer to authenticate itself using CHAP [Challenge Handshake Authentication Protocol] authentication. require-mppe Require the use of MPPE (Microsoft Point to Point Encryption). This option disables all other compression types. This option enables both 40-bit and 128-bit encryption. In order for MPPE to successfully come up, you must have authenticated with either MS-CHAP or MS-CHAPv2. This option is presently only supported under Linux, and only if your kernel has been configured to include MPPE support. require-mppe-40 Require the use of MPPE, with 40-bit encryption. require-mppe-128 Require the use of MPPE, with 128-bit encryption. require-mschap Require the peer to authenticate itself using MS-CHAP [Microsoft Challenge Handshake Authentication Protocol] authentication. require-mschap-v2 Require the peer to authenticate itself using MS-CHAPv2 [Microsoft Challenge Handshake Authentication Protocol, Version 2] authentication. require-eap Require the peer to authenticate itself using EAP [Extensible Authentication Protocol] authentication. require-pap Require the peer to authenticate itself using PAP [Password Authentication Protocol] authentication. set name=value Set an environment variable for scripts that are invoked by pppd. When set by a privileged source, the variable specified by name cannot be changed by options contained in an unprivileged source. See also the unset option and the environment described in SCRIPTS. show-password When logging the contents of PAP packets, this option causes pppd to show the password string in the log message. silent With this option, pppd will not transmit LCP packets to initiate a connection until a valid LCP packet is received from the peer (as for the `passive' option with ancient versions of pppd). srp-interval n If this parameter is given and pppd uses EAP SRP-SHA1 to authenticate the peer (i.e., is the server), then pppd will use the optional lightweight SRP rechallenge mechanism at intervals of n seconds. This option is faster than eap-interval reauthentication because it uses a hash-based mechanism and does not derive a new session key. srp-pn-secret string Set the long-term pseudonym-generating secret for the server. This value is optional and if set, needs to be known at the server (authenticator) side only, and should be different for each server (or poll of identical servers). It is used along with the current date to generate a key to encrypt and decrypt the client's identity contained in the pseudonym. srp-use-pseudonym When operating as an EAP SRP-SHA1 client, attempt to use the pseudonym stored in ~/.ppp_pseudonym first as the identity, and save in this file any pseudonym offered by the peer during authentication. stop-bits n Set the number of stop bits for the serial port. Valid values are 1 or 2. The default value is 1. sync Use synchronous HDLC serial encoding instead of asynchronous. The device used by pppd with this option must have sync support. Currently supports Microgate SyncLink adapters under Linux and FreeBSD 2.2.8 and later. tls-verify-method string (EAP-TLS, or PEAP) Match the value specified for remotename to that that of the X509 certificates subject name, common name, or suffix of the common name. Respective values allowed for this option is: none, subject, name, or suffix. The default value for this option is name. tls-verify-key-usage (EAP-TLS, or PEAP) Enables examination of peer certificate's purpose, and extended key usage attributes. unit num Sets the ppp unit number (for a ppp0 or ppp1 etc interface name) for outbound connections. If the unit is already in use a dynamically allocated number will be used. ifname string Set the ppp interface name for outbound connections. If the interface name is already in use, or if the name cannot be used for any other reason, pppd will terminate. unset name Remove a variable from the environment variable for scripts that are invoked by pppd. When specified by a privileged source, the variable name cannot be set by options contained in an unprivileged source. See also the set option and the environment described in SCRIPTS. updetach With this option, pppd will detach from its controlling terminal once it has successfully established the ppp connection (to the point where the first network control protocol, usually the IP control protocol, has come up). up_sdnotify Use this option to run pppd in systemd service units of Type=notify (up_sdnotify implies nodetach). When up_sdnotify is enabled, pppd will notify systemd once it has successfully established the ppp connection (to the point where the first network control protocl, usually the IP control protocol, has come up). This option is only availble when pppd is compiled with systemd support. usehostname Enforce the use of the hostname (with domain name appended, if given) as the name of the local system for authentication purposes (overrides the name option). This option is not normally needed since the name option is privileged. usepeerdns Ask the peer for up to 2 DNS server addresses. The addresses supplied by the peer (if any) are passed to the /etc/ppp/ip-up script in the environment variables DNS1 and DNS2, and the environment variable USEPEERDNS will be set to 1. In addition, pppd will create an /etc/ppp/resolv.conf file containing one or two nameserver lines with the address(es) supplied by the peer. usepeerwins Ask the peer for up to 2 WINS server addresses. The addresses supplied by the peer (if any) are passed to the /etc/ppp/ip-up script in the environment variables WINS1 and WINS2, and the environment variable USEPEERWINS will be set to 1. Please note that some modems (like the Huawei E220) requires this option in order to avoid a race condition that results in the incorrect DNS servers being assigned. user name Sets the name used for authenticating the local system to the peer to name. vj-max-slots n Sets the number of connection slots to be used by the Van Jacobson TCP/IP header compression and decompression code to n, which must be between 2 and 16 (inclusive). welcome script Run the executable or shell command specified by script before initiating PPP negotiation, after the connect script (if any) has completed. A value for this option from a privileged source cannot be overridden by a non- privileged user. xonxoff Use software flow control (i.e. XON/XOFF) to control the flow of data on the serial port. PPPOE OPTIONS top To establish PPP link over Ethernet (PPPoE) it is needed to load pppd's plugin pppoe.so and then specify option nic-interface instead of modem options ttyname and speed. Recognized pppd's PPPoE options are: nic-interface Use the ethernet device interface to communicate with the peer. For example, establishing PPPoE link on eth0 interface is done by specifying ppp'd option nic-eth0. Prefix nic- for this option may be avoided if interface name is unambiguous and does not look like any other pppd's option. pppoe-service name Connect to specified PPPoE service name. For backward compatibility also rp_pppoe_service option name is supported. pppoe-ac name Connect to specified PPPoE access concentrator name. For backward compatibility also rp_pppoe_ac option name is supported. pppoe-sess sessid:macaddr Attach to existing PPPoE session. For backward compatibility also rp_pppoe_sess option name is supported. pppoe-verbose n Be verbose about discovered access concentrators. When set to 2 or bigger value then dump also discovery packets. For backward compatibility also rp_pppoe_verbose option name is supported. pppoe-mac macaddr Connect to specified MAC address. pppoe-host-uniq string Set the PPPoE Host-Uniq tag to the supplied hex string. By default PPPoE Host-Uniq tag is set to the pppd's process PID. For backward compatibility this option may be specified without pppoe- prefix. pppoe-padi-timeout n Initial timeout for discovery packets in seconds (default 5). pppoe-padi-attempts n Number of discovery attempts (default 3). OPTIONS FILES top Options can be taken from files as well as the command line. Pppd reads options from the files /etc/ppp/options, ~/.ppprc and /etc/ppp/options.ttyname (in that order) before processing the options on the command line. (In fact, the command-line options are scanned to find the terminal name before the options.ttyname file is read.) In forming the name of the options.ttyname file, the initial /dev/ is removed from the terminal name, and any remaining / characters are replaced with dots. An options file is parsed into a series of words, delimited by whitespace. Whitespace can be included in a word by enclosing the word in double-quotes ("). A backslash (\) quotes the following character. A hash (#) starts a comment, which continues until the end of the line. There is no restriction on using the file or call options within an options file. SECURITY top pppd provides system administrators with sufficient access control that PPP access to a server machine can be provided to legitimate users without fear of compromising the security of the server or the network it's on. This control is provided through restrictions on which IP addresses the peer may use, based on its authenticated identity (if any), and through restrictions on which options a non-privileged user may use. Several of pppd's options are privileged, in particular those which permit potentially insecure configurations; these options are only accepted in files which are under the control of the system administrator, or if pppd is being run by root. The default behaviour of pppd is to allow an unauthenticated peer to use a given IP address only if the system does not already have a route to that IP address. For example, a system with a permanent connection to the wider internet will normally have a default route, and thus all peers will have to authenticate themselves in order to set up a connection. On such a system, the auth option is the default. On the other hand, a system where the PPP link is the only connection to the internet will not normally have a default route, so the peer will be able to use almost any IP address without authenticating itself. As indicated above, some security-sensitive options are privileged, which means that they may not be used by an ordinary non-privileged user running a setuid-root pppd, either on the command line, in the user's ~/.ppprc file, or in an options file read using the file option. Privileged options may be used in /etc/ppp/options file or in an options file read using the call option. If pppd is being run by the root user, privileged options can be used without restriction. When opening the device, pppd uses either the invoking user's user ID or the root UID (that is, 0), depending on whether the device name was specified by the user or the system administrator. If the device name comes from a privileged source, that is, /etc/ppp/options or an options file read using the call option, pppd uses full root privileges when opening the device. Thus, by creating an appropriate file under /etc/ppp/peers, the system administrator can allow users to establish a ppp connection via a device which they would not normally have permission to access. Otherwise pppd uses the invoking user's real UID when opening the device. AUTHENTICATION top Authentication is the process whereby one peer convinces the other of its identity. This involves the first peer sending its name to the other, together with some kind of secret information which could only come from the genuine authorized user of that name. In such an exchange, we will call the first peer the "client" and the other the "server". The client has a name by which it identifies itself to the server, and the server also has a name by which it identifies itself to the client. Generally the genuine client shares some secret (or password) with the server, and authenticates itself by proving that it knows that secret. Very often, the names used for authentication correspond to the internet hostnames of the peers, but this is not essential. At present, pppd supports three authentication protocols: the Password Authentication Protocol (PAP), Challenge Handshake Authentication Protocol (CHAP), and Extensible Authentication Protocol (EAP). PAP involves the client sending its name and a cleartext password to the server to authenticate itself. In contrast, the server initiates the CHAP authentication exchange by sending a challenge to the client (the challenge packet includes the server's name). The client must respond with a response which includes its name plus a hash value derived from the shared secret and the challenge, in order to prove that it knows the secret. EAP supports CHAP-style authentication, and also includes the SRP-SHA1 mechanism, which is resistant to dictionary-based attacks and does not require a cleartext password on the server side. The PPP protocol, being symmetrical, allows both peers to require the other to authenticate itself. In that case, two separate and independent authentication exchanges will occur. The two exchanges could use different authentication protocols, and in principle, different names could be used in the two exchanges. The default behaviour of pppd is to agree to authenticate if requested, and to not require authentication from the peer. However, pppd will not agree to authenticate itself with a particular protocol if it has no secrets which could be used to do so. Pppd stores secrets for use in authentication in secrets files (/etc/ppp/pap-secrets for PAP, /etc/ppp/chap-secrets for CHAP, MS-CHAP, MS-CHAPv2, and EAP MD5-Challenge, and /etc/ppp/srp-secrets for EAP SRP-SHA1). All secrets files have the same format. The secrets files can contain secrets for pppd to use in authenticating itself to other systems, as well as secrets for pppd to use when authenticating other systems to itself. Each line in a secrets file contains one secret. A given secret is specific to a particular combination of client and server - it can only be used by that client to authenticate itself to that server. Thus each line in a secrets file has at least 3 fields: the name of the client, the name of the server, and the secret. These fields may be followed by a list of the IP addresses that the specified client may use when connecting to the specified server. A secrets file is parsed into words as for a options file, so the client name, server name and secrets fields must each be one word, with any embedded spaces or other special characters quoted or escaped. Note that case is significant in the client and server names and in the secret. If the secret starts with an `@', what follows is assumed to be the name of a file from which to read the secret. A "*" as the client or server name matches any name. When selecting a secret, pppd takes the best match, i.e. the match with the fewest wildcards. Any following words on the same line are taken to be a list of acceptable IP addresses for that client. If there are only 3 words on the line, or if the first word is "-", then all IP addresses are disallowed. To allow any address, use "*". A word starting with "!" indicates that the specified address is not acceptable. An address may be followed by "/" and a number n, to indicate a whole subnet, i.e. all addresses which have the same value in the most significant n bits. In this form, the address may be followed by a plus sign ("+") to indicate that one address from the subnet is authorized, based on the ppp network interface unit number in use. In this case, the host part of the address will be set to the unit number plus one. Thus a secrets file contains both secrets for use in authenticating other hosts, plus secrets which we use for authenticating ourselves to others. When pppd is authenticating the peer (checking the peer's identity), it chooses a secret with the peer's name in the first field and the name of the local system in the second field. The name of the local system defaults to the hostname, with the domain name appended if the domain option is used. This default can be overridden with the name option, except when the usehostname option is used. (For EAP SRP-SHA1, see the srp-entry(8) utility for generating proper validator entries to be used in the "secret" field.) When pppd is choosing a secret to use in authenticating itself to the peer, it first determines what name it is going to use to identify itself to the peer. This name can be specified by the user with the user option. If this option is not used, the name defaults to the name of the local system, determined as described in the previous paragraph. Then pppd looks for a secret with this name in the first field and the peer's name in the second field. Pppd will know the name of the peer if CHAP or EAP authentication is being used, because the peer will have sent it in the challenge packet. However, if PAP is being used, pppd will have to determine the peer's name from the options specified by the user. The user can specify the peer's name directly with the remotename option. Otherwise, if the remote IP address was specified by a name (rather than in numeric form), that name will be used as the peer's name. Failing that, pppd will use the null string as the peer's name. When authenticating the peer with PAP, the supplied password is first compared with the secret from the secrets file. If the password doesn't match the secret, the password is encrypted using crypt() and checked against the secret again. Thus secrets for authenticating the peer can be stored in encrypted form if desired. If the papcrypt option is given, the first (unencrypted) comparison is omitted, for better security. Furthermore, if the login option was specified, the username and password are also checked against the system password database. Thus, the system administrator can set up the pap-secrets file to allow PPP access only to certain users, and to restrict the set of IP addresses that each user can use. Typically, when using the login option, the secret in /etc/ppp/pap-secrets would be "", which will match any password supplied by the peer. This avoids the need to have the same secret in two places. Authentication must be satisfactorily completed before IPCP (or any other Network Control Protocol) can be started. If the peer is required to authenticate itself, and fails to do so, pppd will terminated the link (by closing LCP). If IPCP negotiates an unacceptable IP address for the remote host, IPCP will be closed. IP packets can only be sent or received when IPCP is open. In some cases it is desirable to allow some hosts which can't authenticate themselves to connect and use one of a restricted set of IP addresses, even when the local host generally requires authentication. If the peer refuses to authenticate itself when requested, pppd takes that as equivalent to authenticating with PAP using the empty string for the username and password. Thus, by adding a line to the pap-secrets file which specifies the empty string for the client and password, it is possible to allow restricted access to hosts which refuse to authenticate themselves. ROUTING top When IPCP negotiation is completed successfully, pppd will inform the kernel of the local and remote IP addresses for the ppp interface. This is sufficient to create a host route to the remote end of the link, which will enable the peers to exchange IP packets. Communication with other machines generally requires further modification to routing tables and/or ARP (Address Resolution Protocol) tables. In most cases the defaultroute and/or proxyarp options are sufficient for this, but in some cases further intervention is required. The /etc/ppp/ip-up script can be used for this. Sometimes it is desirable to add a default route through the remote host, as in the case of a machine whose only connection to the Internet is through the ppp interface. The defaultroute option causes pppd to create such a default route when IPCP comes up, and delete it when the link is terminated. In some cases it is desirable to use proxy ARP, for example on a server machine connected to a LAN, in order to allow other hosts to communicate with the remote host. The proxyarp option causes pppd to look for a network interface on the same subnet as the remote host (an interface supporting broadcast and ARP, which is up and not a point-to-point or loopback interface). If found, pppd creates a permanent, published ARP entry with the IP address of the remote host and the hardware address of the network interface found. When the demand option is used, the interface IP addresses have already been set at the point when IPCP comes up. If pppd has not been able to negotiate the same addresses that it used to configure the interface (for example when the peer is an ISP that uses dynamic IP address assignment), pppd has to change the interface IP addresses to the negotiated addresses. This may disrupt existing connections, and the use of demand dialling with peers that do dynamic IP address assignment is not recommended. MULTILINK top Multilink PPP provides the capability to combine two or more PPP links between a pair of machines into a single `bundle', which appears as a single virtual PPP link which has the combined bandwidth of the individual links. Currently, multilink PPP is only supported under Linux. Pppd detects that the link it is controlling is connected to the same peer as another link using the peer's endpoint discriminator and the authenticated identity of the peer (if it authenticates itself). The endpoint discriminator is a block of data which is hopefully unique for each peer. Several types of data can be used, including locally-assigned strings of bytes, IP addresses, MAC addresses, randomly strings of bytes, or E-164 phone numbers. The endpoint discriminator sent to the peer by pppd can be set using the endpoint option. In some circumstances the peer may send no endpoint discriminator or a non-unique value. The bundle option adds an extra string which is added to the peer's endpoint discriminator and authenticated identity when matching up links to be joined together in a bundle. The bundle option can also be used to allow the establishment of multiple bundles between the local system and the peer. Pppd uses a TDB database in /var/run/pppd2.tdb to match up links. Assuming that multilink is enabled and the peer is willing to negotiate multilink, then when pppd is invoked to bring up the first link to the peer, it will detect that no other link is connected to the peer and create a new bundle, that is, another ppp network interface unit. When another pppd is invoked to bring up another link to the peer, it will detect the existing bundle and join its link to it. If the first link terminates (for example, because of a hangup or a received LCP terminate-request) the bundle is not destroyed unless there are no other links remaining in the bundle. Rather than exiting, the first pppd keeps running after its link terminates, until all the links in the bundle have terminated. If the first pppd receives a SIGTERM or SIGINT signal, it will destroy the bundle and send a SIGHUP to the pppd processes for each of the links in the bundle. If the first pppd receives a SIGHUP signal, it will terminate its link but not the bundle. Note: demand mode is not currently supported with multilink. EXAMPLES top The following examples assume that the /etc/ppp/options file contains the auth option (as in the default /etc/ppp/options file in the ppp distribution). Probably the most common use of pppd is to dial out to an ISP. This can be done with a command such as pppd call isp where the /etc/ppp/peers/isp file is set up by the system administrator to contain something like this: ttyS0 19200 crtscts connect '/usr/sbin/chat -v -f /etc/ppp/chat-isp' noauth In this example, we are using chat to dial the ISP's modem and go through any logon sequence required. The /etc/ppp/chat-isp file contains the script used by chat; it could for example contain something like this: ABORT "NO CARRIER" ABORT "NO DIALTONE" ABORT "ERROR" ABORT "NO ANSWER" ABORT "BUSY" ABORT "Username/Password Incorrect" "" "at" OK "at&d0&c1" OK "atdt2468135" "name:" "^Umyuserid" "word:" "\qmypassword" "ispts" "\q^Uppp" "~-^Uppp-~" See the chat(8) man page for details of chat scripts. Pppd can also be used to provide a dial-in ppp service for users. If the users already have login accounts, the simplest way to set up the ppp service is to let the users log in to their accounts and run pppd (installed setuid-root) with a command such as pppd proxyarp To allow a user to use the PPP facilities, you need to allocate an IP address for that user's machine and create an entry in /etc/ppp/pap-secrets, /etc/ppp/chap-secrets, or /etc/ppp/srp-secrets (depending on which authentication method the PPP implementation on the user's machine supports), so that the user's machine can authenticate itself. For example, if Joe has a machine called "joespc" that is to be allowed to dial in to the machine called "server" and use the IP address joespc.my.net, you would add an entry like this to /etc/ppp/pap-secrets or /etc/ppp/chap-secrets: joespc server "joe's secret" joespc.my.net (See srp-entry(8) for a means to generate the server's entry when SRP-SHA1 is in use.) Alternatively, you can create a username called (for example) "ppp", whose login shell is pppd and whose home directory is /etc/ppp. Options to be used when pppd is run this way can be put in /etc/ppp/.ppprc. If your serial connection is any more complicated than a piece of wire, you may need to arrange for some control characters to be escaped. In particular, it is often useful to escape XON (^Q) and XOFF (^S), using asyncmap a0000. If the path includes a telnet, you probably should escape ^] as well (asyncmap 200a0000). If the path includes an rlogin, you will need to use the escape ff option on the end which is running the rlogin client, since many rlogin implementations are not transparent; they will remove the sequence [0xff, 0xff, 0x73, 0x73, followed by any 8 bytes] from the stream. DIAGNOSTICS top Messages are sent to the syslog daemon using facility LOG_DAEMON. (This can be overridden by recompiling pppd with the macro LOG_PPP defined as the desired facility.) See the syslog(8) documentation for details of where the syslog daemon will write the messages. On most systems, the syslog daemon uses the /etc/syslog.conf file to specify the destination(s) for syslog messages. You may need to edit that file to suit. The debug option causes the contents of all control packets sent or received to be logged, that is, all LCP, PAP, CHAP, EAP, or IPCP packets. This can be useful if the PPP negotiation does not succeed or if authentication fails. If debugging is enabled at compile time, the debug option also causes other debugging messages to be logged. Debugging can also be enabled or disabled by sending a SIGUSR1 signal to the pppd process. This signal acts as a toggle. EXIT STATUS top The exit status of pppd is set to indicate whether any error was detected, or the reason for the link being terminated. The values used are: 0 Pppd has detached, or otherwise the connection was successfully established and terminated at the peer's request. 1 An immediately fatal error of some kind occurred, such as an essential system call failing, or running out of virtual memory. 2 An error was detected in processing the options given, such as two mutually exclusive options being used. 3 Pppd is not setuid-root and the invoking user is not root. 4 The kernel does not support PPP, for example, the PPP kernel driver is not included or cannot be loaded. 5 Pppd terminated because it was sent a SIGINT, SIGTERM or SIGHUP signal. 6 The serial port could not be locked. 7 The serial port could not be opened. 8 The connect script failed (returned a non-zero exit status). 9 The command specified as the argument to the pty option could not be run. 10 The PPP negotiation failed, that is, it didn't reach the point where at least one network protocol (e.g. IP) was running. 11 The peer system failed (or refused) to authenticate itself. 12 The link was established successfully and terminated because it was idle. 13 The link was established successfully and terminated because the connect time limit was reached. 14 Callback was negotiated and an incoming call should arrive shortly. 15 The link was terminated because the peer is not responding to echo requests. 16 The link was terminated by the modem hanging up. 17 The PPP negotiation failed because serial loopback was detected. 18 The init script failed (returned a non-zero exit status). 19 We failed to authenticate ourselves to the peer. SCRIPTS top Pppd invokes scripts at various stages in its processing which can be used to perform site-specific ancillary processing. These scripts are usually shell scripts, but could be executable code files instead. Pppd does not wait for the scripts to finish (except for the net-init, net-pre-up and ip-pre-up scripts). The scripts are executed as root (with the real and effective user-id set to 0), so that they can do things such as update routing tables or run privileged daemons. Be careful that the contents of these scripts do not compromise your system's security. Pppd runs the scripts with standard input, output and error redirected to /dev/null, and with an environment that is empty except for some environment variables that give information about the link. The environment variables that pppd sets are: DEVICE The name of the serial tty device being used. IFNAME The name of the network interface being used. IPLOCAL The IP address for the local end of the link. This is only set when IPCP has come up. IPREMOTE The IP address for the remote end of the link. This is only set when IPCP has come up. LLLOCAL The Link-Local IPv6 address for the local end of the link. This is only set when IPV6CP has come up. LLREMOTE The Link-Local IPv6 address for the remote end of the link. This is only set when IPV6CP has come up. PEERNAME The authenticated name of the peer. This is only set if the peer authenticates itself. SPEED The baud rate of the tty device. ORIG_UID The real user-id of the user who invoked pppd. PPPLOGNAME The username of the real user-id that invoked pppd. This is always set. For the ip-down and auth-down scripts, pppd also sets the following variables giving statistics for the connection: CONNECT_TIME The number of seconds from when the PPP negotiation started until the connection was terminated. BYTES_SENT The number of bytes sent (at the level of the serial port) during the connection. BYTES_RCVD The number of bytes received (at the level of the serial port) during the connection. LINKNAME The logical name of the link, set with the linkname option. CALL_FILE The value of the call option. DNS1 If the peer supplies DNS server addresses, this variable is set to the first DNS server address supplied (whether or not the usepeerdns option was given). DNS2 If the peer supplies DNS server addresses, this variable is set to the second DNS server address supplied (whether or not the usepeerdns option was given). WINS1 If the peer supplies WINS server addresses, this variable is set to the first WINS server address supplied. WINS2 If the peer supplies WINS server addresses, this variable is set to the second WINS server address supplied. Pppd invokes the following scripts, if they exist. It is not an error if they don't exist. /etc/ppp/auth-up A program or script which is executed after the remote system successfully authenticates itself. It is executed with the parameters interface-name peer-name user-name tty-device speed ipparam Note that this script is not executed if the peer doesn't authenticate itself, for example when the noauth option is used. /etc/ppp/auth-down A program or script which is executed when the link goes down, if /etc/ppp/auth-up was previously executed. It is executed in the same manner with the same parameters as /etc/ppp/auth-up. /etc/ppp/ip-pre-up A program or script which is executed just before the ppp network interface is brought up. It is executed with the same parameters as the ip-up script (below). At this point the interface exists and has IP addresses assigned but is still down. This can be used to add firewall rules before any IP traffic can pass through the interface. Pppd will wait for this script to finish before bringing the interface up, so this script should run quickly. WARNING: Please note that on systems where a single interface carries multiple protocols (Linux) ip-pre-up is NOT actually guaranteed to execute prior to the interface moving into an up state, although IP information won't be known you should consider using net-pre-up instead, alternatively, disable other NCPs such that IPv4 is the only negotiated protocol - which will also result in a guarantee that ip-pre-up is called prior to the interface going into an UP state. /etc/ppp/ip-up A program or script which is executed when the link is available for sending and receiving IP packets (that is, IPCP has come up). It is executed with the parameters interface-name tty-device speed local-IP-address remote-IP-address ipparam /etc/ppp/ip-down A program or script which is executed when the link is no longer available for sending and receiving IP packets. This script can be used for undoing the effects of the /etc/ppp/ip-up and /etc/ppp/ip-pre-up scripts. It is invoked in the same manner and with the same parameters as the ip-up script. /etc/ppp/ipv6-up Like /etc/ppp/ip-up, except that it is executed when the link is available for sending and receiving IPv6 packets. It is executed with the parameters interface-name tty-device speed local-link-local-address remote-link-local-address ipparam /etc/ppp/ipv6-down Similar to /etc/ppp/ip-down, but it is executed when IPv6 packets can no longer be transmitted on the link. It is executed with the same parameters as the ipv6-up script. /etc/ppp/net-init This script will be executed the moment the ppp unit number is known. This script will be waited for and should not cause significant delays. This can be used to update book-keeping type systems external to ppp and provides the only guaranteed point where a script can be executed knowing the ppp unit number prior to LCP being initiated. It is executed with the parameters interface-name tty-device speed ipparam /etc/ppp/net-pre-up This script will be executed just prior to NCP negotiations initiating, and is guaranteed to be executed whilst the interface (Linux) and/or sub-interfaces (Solaris) as the case may be is/are still down. ppp will block waiting for this script to complete, and the interface may be safely renamed in this script (using for example "ip li set dev $1 name ppp-foobar". The parameters are the same as for net-init. /etc/ppp/net-down This script will be executed just prior to ppp terminating and will not be waited for. The parameters are the same as for net-init. /var/run/pppn.pid (BSD or Linux), /etc/ppp/pppn.pid (others) Process-ID for pppd process on ppp interface unit n. /var/run/ppp-name.pid (BSD or Linux), /etc/ppp/ppp-name.pid (others) Process-ID for pppd process for logical link name (see the linkname option). /var/run/pppd2.tdb Database containing information about pppd processes, interfaces and links, used for matching links to bundles in multilink operation. May be examined by external programs to obtain information about running pppd instances, the interfaces and devices they are using, IP address assignments, etc. /etc/ppp/pap-secrets Usernames, passwords and IP addresses for PAP authentication. This file should be owned by root and not readable or writable by any other user. Pppd will log a warning if this is not the case. /etc/ppp/chap-secrets Names, secrets and IP addresses for CHAP/MS-CHAP/MS-CHAPv2 authentication. As for /etc/ppp/pap-secrets, this file should be owned by root and not readable or writable by any other user. Pppd will log a warning if this is not the case. /etc/ppp/srp-secrets Names, secrets, and IP addresses for EAP authentication. As for /etc/ppp/pap-secrets, this file should be owned by root and not readable or writable by any other user. Pppd will log a warning if this is not the case. ~/.ppp_pseudonym Saved client-side SRP-SHA1 pseudonym. See the srp-use-pseudonym option for details. /etc/ppp/options System default options for pppd, read before user default options or command-line options. ~/.ppprc User default options, read before /etc/ppp/options.ttyname. /etc/ppp/options.ttyname System default options for the serial port being used, read after ~/.ppprc. In forming the ttyname part of this filename, an initial /dev/ is stripped from the port name (if present), and any slashes in the remaining part are converted to dots. /etc/ppp/peers A directory containing options files which may contain privileged options, even if pppd was invoked by a user other than root. The system administrator can create options files in this directory to permit non-privileged users to dial out without requiring the peer to authenticate, but only to certain trusted peers. SEE ALSO top chat(8), pppstats(8) RFC1144 Jacobson, V. Compressing TCP/IP headers for low-speed serial links. February 1990. RFC1321 Rivest, R. The MD5 Message-Digest Algorithm. April 1992. RFC1332 McGregor, G. PPP Internet Protocol Control Protocol (IPCP). May 1992. RFC1334 Lloyd, B.; Simpson, W.A. PPP authentication protocols. October 1992. RFC1661 Simpson, W.A. The Point-to-Point Protocol (PPP). July 1994. RFC1662 Simpson, W.A. PPP in HDLC-like Framing. July 1994. RFC1990 Sklower, K.; et al., The PPP Multilink Protocol (MP). August 1996. RFC2284 Blunk, L.; Vollbrecht, J., PPP Extensible Authentication Protocol (EAP). March 1998. RFC2472 Haskin, D. IP Version 6 over PPP December 1998. RFC2945 Wu, T., The SRP Authentication and Key Exchange System September 2000. draft-ietf-pppext-eap-srp-03.txt Carlson, J.; et al., EAP SRP-SHA1 Authentication Protocol. July 2001. NOTES top Some limited degree of control can be exercised over a running pppd process by sending it a signal from the list below. SIGINT, SIGTERM These signals cause pppd to terminate the link (by closing LCP), restore the serial device settings, and exit. If a connector or disconnector process is currently running, pppd will send the same signal to its process group, so as to terminate the connector or disconnector process. SIGHUP This signal causes pppd to terminate the link, restore the serial device settings, and close the serial device. If the persist or demand option has been specified, pppd will try to reopen the serial device and start another connection (after the holdoff period). Otherwise pppd will exit. If this signal is received during the holdoff period, it causes pppd to end the holdoff period immediately. If a connector or disconnector process is running, pppd will send the same signal to its process group. SIGUSR1 This signal toggles the state of the debug option. SIGUSR2 This signal causes pppd to renegotiate compression. This can be useful to re-enable compression after it has been disabled as a result of a fatal decompression error. (Fatal decompression errors generally indicate a bug in one or other implementation.) AUTHORS top Paul Mackerras ([email protected]), based on earlier work by Drew Perkins, Brad Clements, Karl Fox, Greg Christy, and Brad Parker. COPYRIGHT top Pppd is copyrighted and made available under conditions which provide that it may be copied and used in source or binary forms provided that the conditions listed below are met. Portions of pppd are covered by the following copyright notices: Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. Copyright (c) 1993-2004 Paul Mackerras. All rights reserved. Copyright (c) 1995 Pedro Roque Marques. All rights reserved. Copyright (c) 1995 Eric Rosenquist. All rights reserved. Copyright (c) 1999 Tommi Komulainen. All rights reserved. Copyright (C) Andrew Tridgell 1999 Copyright (c) 2000 by Sun Microsystems, Inc. All rights reserved. Copyright (c) 2001 by Sun Microsystems, Inc. All rights reserved. Copyright (c) 2002 Google, Inc. All rights reserved. The copyright notices contain the following statements. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name "Carnegie Mellon University" must not be used to endorse or promote products derived from this software without prior written permission. For permission or any legal details, please contact Office of Technology Transfer Carnegie Mellon University 5000 Forbes Avenue Pittsburgh, PA 15213-3890 (412) 268-4387, fax: (412) 268-7395 [email protected] 3b. The name(s) of the authors of this software must not be used to endorse or promote products derived from this software without prior written permission. 4. Redistributions of any form whatsoever must retain the following acknowledgements: "This product includes software developed by Computing Services at Carnegie Mellon University (http://www.cmu.edu/computing/)." "This product includes software developed by Paul Mackerras <[email protected]>". "This product includes software developed by Pedro Roque Marques <[email protected]>". "This product includes software developed by Tommi Komulainen <[email protected]>". CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. COLOPHON top This page is part of the ppp (An implementation of the Point-to- Point Protocol (PPP)) project. Information about the project can be found at https://ppp.samba.org/. If you have a bug report for this manual page, see https://github.com/paulusmack/ppp/issues. This page was obtained from the project's upstream Git repository https://github.com/paulusmack/ppp 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] PPPD(8) Pages that refer to this page: pon(1), pppd-radattr(8), pppd-radius(8), pppdump(8), pppgetpass(8), pppstats(8), slattach(8), srp-entry(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. | # pppd\n\n> Establish Point-to-Point connection to another computer.\n> It should not be invoked manually.\n> More information: <https://ppp.samba.org/pppd.html>.\n\n- Start the daemon:\n\n`pppd`\n |
pr | pr(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pr(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON PR(1) User Commands PR(1) NAME top pr - convert text files for printing SYNOPSIS top pr [OPTION]... [FILE]... DESCRIPTION top Paginate or columnate FILE(s) for printing. With no FILE, or when FILE is -, read standard input. Mandatory arguments to long options are mandatory for short options too. +FIRST_PAGE[:LAST_PAGE], --pages=FIRST_PAGE[:LAST_PAGE] begin [stop] printing with page FIRST_[LAST_]PAGE -COLUMN, --columns=COLUMN output COLUMN columns and print columns down, unless -a is used. Balance number of lines in the columns on each page -a, --across print columns across rather than down, used together with -COLUMN -c, --show-control-chars use hat notation (^G) and octal backslash notation -d, --double-space double space the output -D, --date-format=FORMAT use FORMAT for the header date -e[CHAR[WIDTH]], --expand-tabs[=CHAR[WIDTH]] expand input CHARs (TABs) to tab WIDTH (8) -F, -f, --form-feed use form feeds instead of newlines to separate pages (by a 3-line page header with -F or a 5-line header and trailer without -F) -h, --header=HEADER use a centered HEADER instead of filename in page header, -h "" prints a blank line, don't use -h"" -i[CHAR[WIDTH]], --output-tabs[=CHAR[WIDTH]] replace spaces with CHARs (TABs) to tab WIDTH (8) -J, --join-lines merge full lines, turns off -W line truncation, no column alignment, --sep-string[=STRING] sets separators -l, --length=PAGE_LENGTH set the page length to PAGE_LENGTH (66) lines (default number of lines of text 56, and with -F 63). implies -t if PAGE_LENGTH <= 10 -m, --merge print all files in parallel, one in each column, truncate lines, but join lines of full length with -J -n[SEP[DIGITS]], --number-lines[=SEP[DIGITS]] number lines, use DIGITS (5) digits, then SEP (TAB), default counting starts with 1st line of input file -N, --first-line-number=NUMBER start counting with NUMBER at 1st line of first page printed (see +FIRST_PAGE) -o, --indent=MARGIN offset each line with MARGIN (zero) spaces, do not affect -w or -W, MARGIN will be added to PAGE_WIDTH -r, --no-file-warnings omit warning when a file cannot be opened -s[CHAR], --separator[=CHAR] separate columns by a single character, default for CHAR is the <TAB> character without -w and 'no char' with -w. -s[CHAR] turns off line truncation of all 3 column options (-COLUMN|-a -COLUMN|-m) except -w is set -S[STRING], --sep-string[=STRING] separate columns by STRING, without -S: Default separator <TAB> with -J and <space> otherwise (same as -S" "), no effect on column options -t, --omit-header omit page headers and trailers; implied if PAGE_LENGTH <= 10 -T, --omit-pagination omit page headers and trailers, eliminate any pagination by form feeds set in input files -v, --show-nonprinting use octal backslash notation -w, --width=PAGE_WIDTH set page width to PAGE_WIDTH (72) characters for multiple text-column output only, -s[char] turns off (72) -W, --page-width=PAGE_WIDTH set page width to PAGE_WIDTH (72) characters always, truncate lines, except -J option is set, no interference with -S or -s --help display this help and exit --version output version information and exit AUTHOR top Written by Pete TerMaat and Roland Huebner. 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/pr> or available locally via: info '(coreutils) pr 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 PR(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. | # pr\n\n> Paginate or columnate files for printing.\n> More information: <https://www.gnu.org/software/coreutils/pr>.\n\n- Print multiple files with a default header and footer:\n\n`pr {{path/to/file1 path/to/file2 ...}}`\n\n- Print with a custom centered header:\n\n`pr -h "{{header}}" {{path/to/file1 path/to/file2 ...}}`\n\n- Print with numbered lines and a custom date format:\n\n`pr -n -D "{{format}}" {{path/to/file1 path/to/file2 ...}}`\n\n- Print all files together, one in each column, without a header or footer:\n\n`pr -m -T {{path/to/file1 path/to/file2 ...}}`\n\n- Print, beginning at page 2 up to page 5, with a given page length (including header and footer):\n\n`pr +{{2}}:{{5}} -l {{page_length}} {{path/to/file1 path/to/file2 ...}}`\n\n- Print with an offset for each line and a truncating custom page width:\n\n`pr -o {{offset}} -W {{width}} {{path/to/file1 path/to/file2 ...}}`\n |
printenv | printenv(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training printenv(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON PRINTENV(1) User Commands PRINTENV(1) NAME top printenv - print all or part of environment SYNOPSIS top printenv [OPTION]... [VARIABLE]... DESCRIPTION top Print the values of the specified environment VARIABLE(s). If no VARIABLE is specified, print name and value pairs for them all. -0, --null end each output line with NUL, not newline --help display this help and exit --version output version information and exit NOTE: your shell may have its own version of printenv, 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 David MacKenzie and 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/printenv> or available locally via: info '(coreutils) printenv 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 PRINTENV(1) Pages that refer to this page: environ(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. | # printenv\n\n> Print values of all or environment variables.\n> More information: <https://www.gnu.org/software/coreutils/printenv>.\n\n- Display key-value pairs of all environment variables:\n\n`printenv`\n\n- Display the value of a specific variable:\n\n`printenv {{HOME}}`\n\n- Display the value of a variable and end with NUL instead of newline:\n\n`printenv --null {{HOME}}`\n |
printf | printf(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training printf(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON PRINTF(1) User Commands PRINTF(1) NAME top printf - format and print data SYNOPSIS top printf FORMAT [ARGUMENT]... printf OPTION DESCRIPTION top Print ARGUMENT(s) according to FORMAT, or execute according to OPTION: --help display this help and exit --version output version information and exit FORMAT controls the output as in C printf. Interpreted sequences are: \" double quote \\ backslash \a alert (BEL) \b backspace \c produce no further output \e escape \f form feed \n new line \r carriage return \t horizontal tab \v vertical tab \NNN byte with octal value NNN (1 to 3 digits) \xHH byte with hexadecimal value HH (1 to 2 digits) \uHHHH Unicode (ISO/IEC 10646) character with hex value HHHH (4 digits) \UHHHHHHHH Unicode character with hex value HHHHHHHH (8 digits) %% a single % %b ARGUMENT as a string with '\' escapes interpreted, except that octal escapes are of the form \0 or \0NNN %q ARGUMENT is printed in a format that can be reused as shell input, escaping non-printable characters with the proposed POSIX $'' syntax. and all C format specifications ending with one of diouxXfeEgGcs, with ARGUMENTs converted to proper type first. Variable widths are handled. NOTE: your shell may have its own version of printf, 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 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 printf(3) Full documentation <https://www.gnu.org/software/coreutils/printf> or available locally via: info '(coreutils) printf 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 PRINTF(1) Pages that refer to this page: bash(1), echo(1), git-sh-i18n(1), ps(1), printf(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. | # printf\n\n> Format and print text.\n> More information: <https://www.gnu.org/software/coreutils/printf>.\n\n- Print a text message:\n\n`printf "{{%s\n}}" "{{Hello world}}"`\n\n- Print an integer in bold blue:\n\n`printf "{{\e[1;34m%.3d\e[0m\n}}" {{42}}`\n\n- Print a float number with the Unicode Euro sign:\n\n`printf "{{\u20AC %.2f\n}}" {{123.4}}`\n\n- Print a text message composed with environment variables:\n\n`printf "{{var1: %s\tvar2: %s\n}}" "{{$VAR1}}" "{{$VAR2}}"`\n\n- Store a formatted message in a variable (does not work on Zsh):\n\n`printf -v {{myvar}} {{"This is %s = %d\n" "a year" 2016}}`\n\n- Print a hexadecimal, octal and scientific number:\n\n`printf "{{hex=%x octal=%o scientific=%e}}" 0x{{FF}} 0{{377}} {{100000}}`\n |
prlimit | prlimit(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training prlimit(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | GENERAL OPTIONS | RESOURCE OPTIONS | NOTES | EXAMPLES | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY PRLIMIT(1) User Commands PRLIMIT(1) NAME top prlimit - get and set process resource limits SYNOPSIS top prlimit [options] [--resource[=limits]] [--pid PID] prlimit [options] [--resource[=limits]] command [argument...] DESCRIPTION top Given a process ID and one or more resources, prlimit tries to retrieve and/or modify the limits. When command is given, prlimit will run this command with the given arguments. The limits parameter is composed of a soft and a hard value, separated by a colon (:), in order to modify the existing values. If no limits are given, prlimit will display the current values. If one of the values is not given, then the existing one will be used. To specify the unlimited or infinity limit (RLIM_INFINITY), the -1 or 'unlimited' string can be passed. Because of the nature of limits, the soft limit must be lower or equal to the high limit (also called the ceiling). To see all available resource limits, refer to the RESOURCE OPTIONS section. soft:hard Specify both limits. soft: Specify only the soft limit. :hard Specify only the hard limit. value Specify both limits to the same value. GENERAL OPTIONS top --noheadings Do not print a header line. -o, --output list Define the output columns to use. If no output arrangement is specified, then a default set is used. Use --help to get a list of all supported columns. -p, --pid Specify the process id; if none is given, the running process will be used. --raw Use the raw output format. --verbose Verbose mode. -h, --help Display help text and exit. -V, --version Print version and exit. RESOURCE OPTIONS top -c, --core[=limits] Maximum size of a core file. -d, --data[=limits] Maximum data size. -e, --nice[=limits] Maximum nice priority allowed to raise. -f, --fsize[=limits] Maximum file size. -i, --sigpending[=limits] Maximum number of pending signals. -l, --memlock[=limits] Maximum locked-in-memory address space. -m, --rss[=limits] Maximum Resident Set Size (RSS). -n, --nofile[=limits] Maximum number of open files. -q, --msgqueue[=limits] Maximum number of bytes in POSIX message queues. -r, --rtprio[=limits] Maximum real-time priority. -s, --stack[=limits] Maximum size of the stack. -t, --cpu[=limits] CPU time, in seconds. -u, --nproc[=limits] Maximum number of processes. -v, --as[=limits] Address space limit. -x, --locks[=limits] Maximum number of file locks held. -y, --rttime[=limits] Timeout for real-time tasks. NOTES top The prlimit(2) system call is supported since Linux 2.6.36, older kernels will break this program. EXAMPLES top prlimit --pid 13134 Display limit values for all current resources. prlimit --pid 13134 --rss --nofile=1024:4095 Display the limits of the RSS, and set the soft and hard limits for the number of open files to 1024 and 4095, respectively. prlimit --pid 13134 --nproc=512: Modify only the soft limit for the number of processes. prlimit --pid $$ --nproc=unlimited Set for the current process both the soft and ceiling values for the number of processes to unlimited. prlimit --cpu=10 sort -u hugefile Set both the soft and hard CPU time limit to ten seconds and run sort(1). AUTHORS top Davidlohr Bueso <[email protected]> - In memory of Dennis M. Ritchie. SEE ALSO top ulimit(1p), prlimit(2) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The prlimit 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 PRLIMIT(1) Pages that refer to this page: getrlimit(2), cgroups(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. | # prlimit\n\n> Get or set process resource soft and hard limits.\n> Given a process ID and one or more resources, prlimit tries to retrieve and/or modify the limits.\n> More information: <https://manned.org/prlimit>.\n\n- Display limit values for all current resources for the running parent process:\n\n`prlimit`\n\n- Display limit values for all current resources of a specified process:\n\n`prlimit --pid {{pid_number}}`\n\n- Run a command with a custom number of open files limit:\n\n`prlimit --nofile={{10}} {{command}}`\n |
ps | ps(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training ps(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | SIMPLE PROCESS SELECTION | PROCESS SELECTION BY LIST | OUTPUT FORMAT CONTROL | OUTPUT MODIFIERS | THREAD DISPLAY | OTHER INFORMATION | NOTES | PROCESS FLAGS | PROCESS STATE CODES | OBSOLETE SORT KEYS | AIX FORMAT DESCRIPTORS | STANDARD FORMAT SPECIFIERS | ENVIRONMENT VARIABLES | PERSONALITY | BUGS | SEE ALSO | STANDARDS | AUTHOR | COLOPHON PS(1) User Commands PS(1) NAME top ps - report a snapshot of the current processes. SYNOPSIS top ps [options] DESCRIPTION top ps displays information about a selection of the active processes. If you want a repetitive update of the selection and the displayed information, use top instead. This version of ps accepts several kinds of options: 1 UNIX options, which may be grouped and must be preceded by a dash. 2 BSD options, which may be grouped and must not be used with a dash. 3 GNU long options, which are preceded by two dashes. Options of different types may be freely mixed, but conflicts can appear. There are some synonymous options, which are functionally identical, due to the many standards and ps implementations that this ps is compatible with. By default, ps selects all processes with the same effective user ID (euid=EUID) as the current user and associated with the same terminal as the invoker. It displays the process ID (pid=PID), the terminal associated with the process (tname=TTY), the cumulated CPU time in [DD-]hh:mm:ss format (time=TIME), and the executable name (ucmd=CMD). Output is unsorted by default. The use of BSD-style options will add process state (stat=STAT) to the default display and show the command args (args=COMMAND) instead of the executable name. You can override this with the PS_FORMAT environment variable. The use of BSD-style options will also change the process selection to include processes on other terminals (TTYs) that are owned by you; alternately, this may be described as setting the selection to be the set of all processes filtered to exclude processes owned by other users or not on a terminal. These effects are not considered when options are described as being "identical" below, so -M will be considered identical to Z and so on. Except as described below, process selection options are additive. The default selection is discarded, and then the selected processes are added to the set of processes to be displayed. A process will thus be shown if it meets any of the given selection criteria. EXAMPLES top To see every process on the system using standard syntax: ps -e ps -ef ps -eF ps -ely To see every process on the system using BSD syntax: ps ax ps axu To print a process tree: ps -ejH ps axjf To get info about threads: ps -eLf ps axms To get security info: ps -eo euser,ruser,suser,fuser,f,comm,label ps axZ ps -eM To see every process running as root (real & effective ID) in user format: ps -U root -u root u To see every process with a user-defined format: ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm ps -Ao pid,tt,user,fname,tmout,f,wchan Print only the process IDs of syslogd: ps -C syslogd -o pid= Print only the name of PID 42: ps -q 42 -o comm= SIMPLE PROCESS SELECTION top a Lift the BSD-style "only yourself" restriction, which is imposed upon the set of all processes when some BSD-style (without "-") options are used or when the ps personality setting is BSD-like. The set of processes selected in this manner is in addition to the set of processes selected by other means. An alternate description is that this option causes ps to list all processes with a terminal (tty), or to list all processes when used together with the x option. -A Select all processes. Identical to -e. -a Select all processes except both session leaders (see getsid(2)) and processes not associated with a terminal. -d Select all processes except session leaders. --deselect Select all processes except those that fulfill the specified conditions (negates the selection). Identical to -N. -e Select all processes. Identical to -A. g Really all, even session leaders. This flag is obsolete and may be discontinued in a future release. It is normally implied by the a flag, and is only useful when operating in the sunos4 personality. -N Select all processes except those that fulfill the specified conditions (negates the selection). Identical to --deselect. T Select all processes associated with this terminal. Identical to the t option without any argument. r Restrict the selection to only running processes. x Lift the BSD-style "must have a tty" restriction, which is imposed upon the set of all processes when some BSD-style (without "-") options are used or when the ps personality setting is BSD-like. The set of processes selected in this manner is in addition to the set of processes selected by other means. An alternate description is that this option causes ps to list all processes owned by you (same EUID as ps), or to list all processes when used together with the a option. PROCESS SELECTION BY LIST top These options accept a single argument in the form of a blank-separated or comma-separated list. They can be used multiple times. For example: ps -p "1 2" -p 3,4 123 Identical to --pid 123. +123 Identical to --sid 123. -123 Select by process group ID (PGID). -C cmdlist Select by command name. This selects the processes whose executable name is given in cmdlist. NOTE: The command name is not the same as the command line. Previous versions of procps and the kernel truncated this command name to 15 characters. This limitation is no longer present in both. If you depended on matching only 15 characters, you may no longer get a match. -G grplist Select by real group ID (RGID) or name. This selects the processes whose real group name or ID is in the grplist list. The real group ID identifies the group of the user who created the process, see getgid(2). -g grplist Select by session OR by effective group name. Selection by session is specified by many standards, but selection by effective group is the logical behavior that several other operating systems use. This ps will select by session when the list is completely numeric (as sessions are). Group ID numbers will work only when some group names are also specified. See the -s and --group options. --Group grplist Select by real group ID (RGID) or name. Identical to -G. --group grplist Select by effective group ID (EGID) or name. This selects the processes whose effective group name or ID is in grplist. The effective group ID describes the group whose file access permissions are used by the process (see getegid(2)). The -g option is often an alternative to --group. p pidlist Select by process ID. Identical to -p and --pid. -p pidlist Select by PID. This selects the processes whose process ID numbers appear in pidlist. Identical to p and --pid. --pid pidlist Select by process ID. Identical to -p and p. --ppid pidlist Select by parent process ID. This selects the processes with a parent process ID in pidlist. That is, it selects processes that are children of those listed in pidlist. q pidlist Select by process ID (quick mode). Identical to -q and --quick-pid. -q pidlist Select by PID (quick mode). This selects the processes whose process ID numbers appear in pidlist. With this option ps reads the necessary info only for the pids listed in the pidlist and doesn't apply additional filtering rules. The order of pids is unsorted and preserved. No additional selection options, sorting and forest type listings are allowed in this mode. Identical to q and --quick-pid. --quick-pid pidlist Select by process ID (quick mode). Identical to -q and q. -s sesslist Select by session ID. This selects the processes with a session ID specified in sesslist. --sid sesslist Select by session ID. Identical to -s. t ttylist Select by tty. Nearly identical to -t and --tty, but can also be used with an empty ttylist to indicate the terminal associated with ps. Using the T option is considered cleaner than using t with an empty ttylist. -t ttylist Select by tty. This selects the processes associated with the terminals given in ttylist. Terminals (ttys, or screens for text output) can be specified in several forms: /dev/ttyS1, ttyS1, S1. A plain "-" may be used to select processes not attached to any terminal. --tty ttylist Select by terminal. Identical to -t and t. U userlist Select by effective user ID (EUID) or name. This selects the processes whose effective user name or ID is in userlist. The effective user ID describes the user whose file access permissions are used by the process (see geteuid(2)). Identical to -u and --user. -U userlist Select by real user ID (RUID) or name. It selects the processes whose real user name or ID is in the userlist list. The real user ID identifies the user who created the process, see getuid(2). -u userlist Select by effective user ID (EUID) or name. This selects the processes whose effective user name or ID is in userlist. The effective user ID describes the user whose file access permissions are used by the process (see geteuid(2)). Identical to U and --user. --User userlist Select by real user ID (RUID) or name. Identical to -U. --user userlist Select by effective user ID (EUID) or name. Identical to -u and U. OUTPUT FORMAT CONTROL top These options are used to choose the information displayed by ps. The output may differ by personality. -c Show different scheduler information for the -l option. --context Display security context format (for SELinux). -f Do full-format listing. This option can be combined with many other UNIX-style options to add additional columns. It also causes the command arguments to be printed. When used with -L, the NLWP (number of threads) and LWP (thread ID) columns will be added. See the c option, the format keyword args, and the format keyword comm. -F Extra full format. See the -f option, which -F implies. --format format user-defined format. Identical to -o and o. j BSD job control format. -j Jobs format. l Display BSD long format. -l Long format. The -y option is often useful with this. -M Add a column of security data. Identical to Z (for SELinux). O format is preloaded o (overloaded). The BSD O option can act like -O (user-defined output format with some common fields predefined) or can be used to specify sort order. Heuristics are used to determine the behavior of this option. To ensure that the desired behavior is obtained (sorting or formatting), specify the option in some other way (e.g. with -O or --sort). When used as a formatting option, it is identical to -O, with the BSD personality. -O format Like -o, but preloaded with some default columns. Identical to -o pid,format,state,tname,time,command or -o pid,format,tname,time,cmd, see -o below. o format Specify user-defined format. Identical to -o and --format. -o format User-defined format. format is a single argument in the form of a blank-separated or comma-separated list, which offers a way to specify individual output columns. The recognized keywords are described in the STANDARD FORMAT SPECIFIERS section below. Headers may be renamed (ps -o pid,ruser=RealUser -o comm=Command) as desired. If all column headers are empty (ps -o pid= -o comm=) then the header line will not be output. Column width will increase as needed for wide headers; this may be used to widen up columns such as WCHAN (ps -o pid,wchan=WIDE- WCHAN-COLUMN -o comm). Explicit width control (ps opid, wchan:42,cmd) is offered too. The behavior of ps -o pid=X,comm=Y varies with personality; output may be one column named "X,comm=Y" or two columns named "X" and "Y". Use multiple -o options when in doubt. Use the PS_FORMAT environment variable to specify a default as desired; DefSysV and DefBSD are macros that may be used to choose the default UNIX or BSD columns. -P Add a column showing psr. s Display signal format. u Display user-oriented format. v Display virtual memory format. X Register format. -y Do not show flags; show rss in place of addr. This option can only be used with -l. Z Add a column of security data. Identical to -M (for SELinux). OUTPUT MODIFIERS top c Show the true command name. This is derived from the name of the executable file, rather than from the argv value. Command arguments and any modifications to them are thus not shown. This option effectively turns the args format keyword into the comm format keyword; it is useful with the -f format option and with the various BSD-style format options, which all normally display the command arguments. See the -f option, the format keyword args, and the format keyword comm. --cols n Set screen width. --columns n Set screen width. --cumulative Include some dead child process data (as a sum with the parent). -D format Set the date format of the lstart field to format. This format is parsed by strftime(3) and should be a maximum of 24 characters to not mis-align columns. --date-format format Identical to -D. e Show the environment after the command. f ASCII art process hierarchy (forest). --forest ASCII art process tree. h No header. (or, one header per screen in the BSD personality). The h option is problematic. Standard BSD ps uses this option to print a header on each page of output, but older Linux ps uses this option to totally disable the header. This version of ps follows the Linux usage of not printing the header unless the BSD personality has been selected, in which case it prints a header on each page of output. Regardless of the current personality, you can use the long options --headers and --no-headers to enable printing headers each page or disable headers entirely, respectively. -H Show process hierarchy (forest). --headers Repeat header lines, one per page of output. k spec Specify sorting order. Sorting syntax is [+|-]key[,[+|-]key[,...]]. Choose a multi-letter key from the STANDARD FORMAT SPECIFIERS section. The "+" is optional since default direction is increasing numerical or lexicographic order. Identical to --sort. Examples: ps jaxkuid,-ppid,+pid ps axk comm o comm,args ps kstart_time -ef --lines n Set screen height. n Numeric output for WCHAN and USER (including all types of UID and GID). --no-headers Print no header line at all. --no-heading is an alias for this option. O order Sorting order (overloaded). The BSD O option can act like -O (user-defined output format with some common fields predefined) or can be used to specify sort order. Heuristics are used to determine the behavior of this option. To ensure that the desired behavior is obtained (sorting or formatting), specify the option in some other way (e.g. with -O or --sort). For sorting, obsolete BSD O option syntax is O[+|-]k1[,[+|-]k2[,...]]. It orders the processes listing according to the multilevel sort specified by the sequence of one-letter short keys k1,k2, ... described in the OBSOLETE SORT KEYS section below. The "+" is currently optional, merely re-iterating the default direction on a key, but may help to distinguish an O sort from an O format. The "-" reverses direction only on the key it precedes. --rows n Set screen height. S Sum up some information, such as CPU usage, from dead child processes into their parent. This is useful for examining a system where a parent process repeatedly forks off short-lived children to do work. --sort spec Specify sorting order. Sorting syntax is [+|-]key[,[+|-]key[,...]]. Choose a multi-letter key from the STANDARD FORMAT SPECIFIERS section. The "+" is optional since default direction is increasing numerical or lexicographic order. Identical to k. For example: ps jax --sort=uid,-ppid,+pid --signames Show signal masks using abbreviated signal names and expands the collumn. If the column width cannot show all signals, the column will end with a plus "+". Columns with only a hyphen have no signals. w Wide output. Use this option twice for unlimited width. -w Wide output. Use this option twice for unlimited width. --width n Set screen width. THREAD DISPLAY top H Show threads as if they were processes. -L Show threads, possibly with LWP and NLWP columns. m Show threads after processes. -m Show threads after processes. -T Show threads, possibly with SPID column. OTHER INFORMATION top --help section Print a help message. The section argument can be one of simple, list, output, threads, misc, or all. The argument can be shortened to one of the underlined letters as in: s|l|o|t|m|a. --info Print debugging info. L List all format specifiers. V Print the procps-ng version. -V Print the procps-ng version. --version Print the procps-ng version. NOTES top This ps works by reading the virtual files in /proc. This ps does not need to be setuid kmem or have any privileges to run. Do not give this ps any special permissions. CPU usage is currently expressed as the percentage of time spent running during the entire lifetime of a process. This is not ideal, and it does not conform to the standards that ps otherwise conforms to. CPU usage is unlikely to add up to exactly 100%. The SIZE and RSS fields don't count some parts of a process including the page tables, kernel stack, struct thread_info, and struct task_struct. This is usually at least 20 KiB of memory that is always resident. SIZE is the virtual size of the process (code+data+stack). Processes marked <defunct> are dead processes (so-called "zombies") that remain because their parent has not destroyed them properly. These processes will be destroyed by init(8) if the parent process exits. If the length of the username is greater than the width of the display column, the username will be truncated. See the -o and -O formatting options to customize length. Commands options such as ps -aux are not recommended as it is a confusion of two different standards. According to the POSIX and UNIX standards, the above command asks to display all processes with a TTY (generally the commands users are running) plus all processes owned by a user named x. If that user doesn't exist, then ps will assume you really meant "ps aux". PROCESS FLAGS top The sum of these values is displayed in the "F" column, which is provided by the flags output specifier: 1 forked but didn't exec 4 used super-user privileges PROCESS STATE CODES top Here are the different values that the s, stat and state output specifiers (header "STAT" or "S") will display to describe the state of a process: D uninterruptible sleep (usually IO) I Idle kernel thread R running or runnable (on run queue) S interruptible sleep (waiting for an event to complete) T stopped by job control signal t stopped by debugger during the tracing W paging (not valid since the 2.6.xx kernel) X dead (should never be seen) Z defunct ("zombie") process, terminated but not reaped by its parent For BSD formats and when the stat keyword is used, additional characters may be displayed: < high-priority (not nice to other users) N low-priority (nice to other users) L has pages locked into memory (for real-time and custom IO) s is a session leader l is multi-threaded (using CLONE_THREAD, like NPTL pthreads do) + is in the foreground process group OBSOLETE SORT KEYS top These keys are used by the BSD O option (when it is used for sorting). The GNU --sort option doesn't use these keys, but the specifiers described below in the STANDARD FORMAT SPECIFIERS section. Note that the values used in sorting are the internal values ps uses and not the "cooked" values used in some of the output format fields (e.g. sorting on tty will sort into device number, not according to the terminal name displayed). Pipe ps output into the sort(1) command if you want to sort the cooked values. KEY LONG DESCRIPTION c cmd simple name of executable C pcpu cpu utilization f flags flags as in long format F field g pgrp process group ID G tpgid controlling tty process group ID j cutime cumulative user time J cstime cumulative system time k utime user time m min_flt number of minor page faults M maj_flt number of major page faults n cmin_flt cumulative minor page faults N cmaj_flt cumulative major page faults o session session ID p pid process ID P ppid parent process ID r rss resident set size R resident resident pages s size memory size in kilobytes S share amount of shared pages t tty the device number of the controlling tty T start_time time process was started U uid user ID number u user user name v vsize total VM size in KiB y priority kernel scheduling priority AIX FORMAT DESCRIPTORS top This ps supports AIX format descriptors, which work somewhat like the formatting codes of printf(1) and printf(3). The NORMAL codes are described in the next section. CODE NORMAL HEADER %C pcpu %CPU %G group GROUP %P ppid PPID %U user USER %a args COMMAND %c comm COMMAND %g rgroup RGROUP %n nice NI %p pid PID %r pgid PGID %t etime ELAPSED %u ruser RUSER %x time TIME %y tty TTY %z vsz VSZ STANDARD FORMAT SPECIFIERS top Here are the different keywords that may be used to control the output format (e.g., with option -o) or to sort the selected processes with the GNU-style --sort option. For example: ps -eo pid,user,args --sort user This version of ps tries to recognize most of the keywords used in other implementations of ps. The following user-defined format specifiers may contain spaces: args, cmd, comm, command, fname, ucmd, ucomm, lstart, bsdstart, start. Some keywords may not be available for sorting. CODE HEADER DESCRIPTION %cpu %CPU cpu utilization of the process in "##.#" format. Currently, it is the CPU time used divided by the time the process has been running (cputime/realtime ratio), expressed as a percentage. It will not add up to 100% unless you are lucky. (alias pcpu). %mem %MEM ratio of the process's resident set size to the physical memory on the machine, expressed as a percentage. (alias pmem). ag_id AGID The autogroup identifier associated with a process which operates in conjunction with the CFS scheduler to improve interactive desktop performance. ag_nice AGNI The autogroup nice value which affects scheduling of all processes in that group. args COMMAND command with all its arguments as a string. Modifications to the arguments may be shown. The output in this column may contain spaces. A process marked <defunct> is partly dead, waiting to be fully destroyed by its parent. Sometimes the process args will be unavailable; when this happens, ps will instead print the executable name in brackets. (alias cmd, command). See also the comm format keyword, the -f option, and the c option. When specified last, this column will extend to the edge of the display. If ps can not determine display width, as when output is redirected (piped) into a file or another command, the output width is undefined (it may be 80, unlimited, determined by the TERM variable, and so on). The COLUMNS environment variable or --cols option may be used to exactly determine the width in this case. The w or -w option may be also be used to adjust width. blocked BLOCKED mask of the blocked signals, see signal(7). According to the width of the field, a 32 or 64-bit mask in hexadecimal format is displayed, unless the --signames option is used. (alias sig_block, sigmask). bsdstart START time the command started. If the process was started less than 24 hours ago, the output format is " HH:MM", else it is " Mmm:SS" (where Mmm is the three letters of the month). See also lstart, start, start_time, and stime. bsdtime TIME accumulated cpu time, user + system. The display format is usually "MMM:SS", but can be shifted to the right if the process used more than 999 minutes of cpu time. c C processor utilization. Currently, this is the integer value of the percent usage over the lifetime of the process. (see %cpu). caught CAUGHT mask of the caught signals, see signal(7). According to the width of the field, a 32 or 64 bits mask in hexadecimal format is displayed, unless the --signames option is used. (alias sig_catch, sigcatch). cgname CGNAME display name of control groups to which the process belongs. cgroup CGROUP display control groups to which the process belongs. cgroupns CGROUPNSUnique inode number describing the namespace the process belongs to. See namespaces(7). class CLS scheduling class of the process. (alias policy, cls). Field's possible values are: - not reported TS SCHED_OTHER FF SCHED_FIFO RR SCHED_RR B SCHED_BATCH ISO SCHED_ISO IDL SCHED_IDLE DLN SCHED_DEADLINE ? unknown value cls CLS scheduling class of the process. (alias policy, cls). Field's possible values are: - not reported TS SCHED_OTHER FF SCHED_FIFO RR SCHED_RR B SCHED_BATCH ISO SCHED_ISO IDL SCHED_IDLE DLN SCHED_DEADLINE ? unknown value cmd CMD see args. (alias args, command). comm COMMAND command name (only the executable name). The output in this column may contain spaces. (alias ucmd, ucomm). See also the args format keyword, the -f option, and the c option. When specified last, this column will extend to the edge of the display. If ps can not determine display width, as when output is redirected (piped) into a file or another command, the output width is undefined (it may be 80, unlimited, determined by the TERM variable, and so on). The COLUMNS environment variable or --cols option may be used to exactly determine the width in this case. The w or -w option may be also be used to adjust width. command COMMAND See args. (alias args, command). cp CP per-mill (tenths of a percent) CPU usage. (see %cpu). cputime TIME cumulative CPU time, "[DD-]hh:mm:ss" format. (alias time). cputimes TIME cumulative CPU time in seconds (alias times). cuc %CUC The CPU utilization of a process, including dead children, in an extended "##.###" format. (see also %cpu, c, cp, cuu, pcpu). cuu %CUU The CPU utilization of a process in an extended "##.###" format. (see also %cpu, c, cp, cuc, pcpu). drs DRS data resident set size, the amount of private memory reserved by a process. It is also known as DATA. Such memory may not yet be mapped to rss but will always be included included in the vsz amount. egid EGID effective group ID number of the process as a decimal integer. (alias gid). egroup EGROUP effective group ID of the process. This will be the textual group ID, if it can be obtained and the field width permits, or a decimal representation otherwise. (alias group). eip EIP instruction pointer. As of kernel 4.9.xx will be zeroed out unless task is exiting or being core dumped. esp ESP stack pointer. As of kernel 4.9.xx will be zeroed out unless task is exiting or being core dumped. etime ELAPSED elapsed time since the process was started, in the form [[DD-]hh:]mm:ss. etimes ELAPSED elapsed time since the process was started, in seconds. environ ENVIRON T{ environment variables for the process. T} euid EUID effective user ID (alias uid). euser EUSER effective user name. This will be the textual user ID, if it can be obtained and the field width permits, or a decimal representation otherwise. The n option can be used to force the decimal representation. (alias uname, user). exe EXE path to the executable. Useful if path cannot be printed via cmd, comm or args format options. f F flags associated with the process, see the PROCESS FLAGS section. (alias flag, flags). fgid FGID filesystem access group ID. (alias fsgid). fgroup FGROUP filesystem access group ID. This will be the textual group ID, if it can be obtained and the field width permits, or a decimal representation otherwise. (alias fsgroup). flag F see f. (alias f, flags). flags F see f. (alias f, flag). fname COMMAND first 8 bytes of the base name of the process's executable file. The output in this column may contain spaces. fuid FUID filesystem access user ID. (alias fsuid). fuser FUSER filesystem access user ID. This will be the textual user ID, if it can be obtained and the field width permits, or a decimal representation otherwise. gid GID see egid. (alias egid). group GROUP see egroup. (alias egroup). ignored IGNORED mask of the ignored signals, see signal(7). According to the width of the field, a 32 or 64 bits mask in hexadecimal format is displayed, unless the --signames option is used. (alias sig_ignore, sigignore). ipcns IPCNS Unique inode number describing the namespace the process belongs to. See namespaces(7). label LABEL security label, most commonly used for SELinux context data. This is for the Mandatory Access Control ("MAC") found on high-security systems. lstart STARTED time the command started. This will be in the form "DDD mmm HH:MM:SS YYY" unless changed by the -D option. lsession SESSION displays the login session identifier of a process, if systemd support has been included. luid LUID displays Login ID associated with a process. lwp LWP light weight process (thread) ID of the dispatchable entity (alias spid, tid). See tid for additional information. lxc LXC 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. machine MACHINE displays the machine name for processes assigned to VM or container, if systemd support has been included. maj_flt MAJFLT The number of major page faults that have occurred with this process. min_flt MINFLT The number of minor page faults that have occurred with this process. mntns MNTNS Unique inode number describing the namespace the process belongs to. See namespaces(7). netns NETNS Unique inode number describing the namespace the process belongs to. See namespaces(7). ni NI nice value. This ranges from 19 (nicest) to -20 (not nice to others), see nice(1). (alias nice). nice NI see ni.(alias ni). nlwp NLWP number of lwps (threads) in the process. (alias thcount). numa NUMA The node associated with the most recently used processor. A -1 means that NUMA information is unavailable. nwchan WCHAN address of the kernel function where the process is sleeping (use wchan if you want the kernel function name). oom OOM Out of Memory Score. The value, ranging from 0 to +1000, used to select task(s) to kill when memory is exhausted. oomadj OOMADJ Out of Memory Adjustment Factor. The value is added to the current out of memory score which is then used to determine which task to kill when memory is exhausted. ouid OWNER displays the Unix user identifier of the owner of the session of a process, if systemd support has been included. pcpu %CPU see %cpu. (alias %cpu). pending PENDING mask of the pending signals. See signal(7). Signals pending on the process are distinct from signals pending on individual threads. Use the m option or the -m option to see both. According to the width of the field, a 32 or 64 bits mask in hexadecimal format is displayed, unless the --signames option is used. (alias sig). pgid PGID process group ID or, equivalently, the process ID of the process group leader. (alias pgrp). pgrp PGRP see pgid. (alias pgid). pid PID a number representing the process ID (alias tgid). pidns PIDNS Unique inode number describing the namespace the process belongs to. See namespaces(7). pmem %MEM see %mem. (alias %mem). policy POL scheduling class of the process. (alias class, cls). Possible values are: - not reported TS SCHED_OTHER FF SCHED_FIFO RR SCHED_RR B SCHED_BATCH ISO SCHED_ISO IDL SCHED_IDLE DLN SCHED_DEADLINE ? unknown value ppid PPID parent process ID. pri PRI priority of the process. Higher number means higher priority. psr PSR processor that process last executed on. pss PSS Proportional share size, the non-swapped physical memory, with shared memory proportionally accounted to all tasks mapping it. rbytes RBYTES Number of bytes which this process really did cause to be fetched from the storage layer. rchars RCHARS Number of bytes which this task has caused to be read from storage. rgid RGID real group ID. rgroup RGROUP real group name. This will be the textual group ID, if it can be obtained and the field width permits, or a decimal representation otherwise. rops ROPS Number of read I/O operationsthat is, system calls such as read(2) and pread(2). rss RSS resident set size, the non-swapped physical memory that a task has used (in kilobytes). (alias rssize, rsz). rssize RSS see rss. (alias rss, rsz). rsz RSZ see rss. (alias rss, rssize). rtprio RTPRIO realtime priority. ruid RUID real user ID. ruser RUSER real user ID. This will be the textual user ID, if it can be obtained and the field width permits, or a decimal representation otherwise. s S minimal state display (one character). See section PROCESS STATE CODES for the different values. See also stat if you want additional information displayed. (alias state). sched SCH scheduling policy of the process. The policies SCHED_OTHER (SCHED_NORMAL), SCHED_FIFO, SCHED_RR, SCHED_BATCH, SCHED_ISO, SCHED_IDLE and SCHED_DEADLINE are respectively displayed as 0, 1, 2, 3, 4, 5 and 6. seat SEAT displays the identifier associated with all hardware devices assigned to a specific workplace, if systemd support has been included. sess SESS session ID or, equivalently, the process ID of the session leader. (alias session, sid). sgi_p P processor that the process is currently executing on. Displays "*" if the process is not currently running or runnable. sgid SGID saved group ID. (alias svgid). sgroup SGROUP saved group name. This will be the textual group ID, if it can be obtained and the field width permits, or a decimal representation otherwise. sid SID see sess. (alias sess, session). sig PENDING see pending. (alias pending, sig_pend). sigcatch CAUGHT see caught. (alias caught, sig_catch). sigignore IGNORED see ignored. (alias ignored, sig_ignore). sigmask BLOCKED see blocked. (alias blocked, sig_block). size SIZE approximate amount of swap space that would be required if the process were to dirty all writable pages and then be swapped out. This number is very rough! slice SLICE displays the slice unit which a process belongs to, if systemd support has been included. spid SPID see lwp. (alias lwp, tid). stackp STACKP address of the bottom (start) of stack for the process. start STARTED time the command started. If the process was started less than 24 hours ago, the output format is "HH:MM:SS", else it is " Mmm dd" (where Mmm is a three-letter month name). See also bsdstart, start, start_time, and stime. start_time START starting time or date of the process. Only the year will be displayed if the process was not started the same year ps was invoked, or "MmmDD" if it was not started the same day, or "HH:MM" otherwise. See also bsdstart, start, lstart, and stime. stat STAT multi-character process state. See section PROCESS STATE CODES for the different values meaning. See also s and state if you just want the first character displayed. state S see s. (alias s). stime STIME see start_time. (alias start_time). suid SUID saved user ID. (alias svuid). supgid SUPGID group ids of supplementary groups, if any. See getgroups(2). supgrp SUPGRP group names of supplementary groups, if any. See getgroups(2). suser SUSER saved user name. This will be the textual user ID, if it can be obtained and the field width permits, or a decimal representation otherwise. (alias svuser). svgid SVGID see sgid. (alias sgid). svuid SVUID see suid. (alias suid). sz SZ size in physical pages of the core image of the process. This includes text, data, and stack space. Device mappings are currently excluded; this is subject to change. See vsz and rss. tgid TGID a number representing the thread group to which a task belongs (alias pid). It is the process ID of the thread group leader. thcount THCNT see nlwp. (alias nlwp). number of kernel threads owned by the process. tid TID the unique number representing a dispatchable entity (alias spid, tid). This value may also appear as: a process ID (pid); a process group ID (pgrp); a session ID for the session leader (sid); a thread group ID for the thread group leader (tgid); and a tty process group ID for the process group leader (tpgid). time TIME cumulative CPU time, "[DD-]HH:MM:SS" format. (alias cputime). timens TIMENS Unique inode number describing the namespace the process belongs to. See namespaces(7). times TIME cumulative CPU time in seconds (alias cputimes). tname TTY controlling tty (terminal). (alias tt, tty). tpgid TPGID ID of the foreground process group on the tty (terminal) that the process is connected to, or -1 if the process is not connected to a tty. trs TRS text resident set size, the amount of physical memory devoted to executable code. tt TT controlling tty (terminal). (alias tname, tty). tty TT controlling tty (terminal). (alias tname, tt). ucmd CMD see comm. (alias comm, ucomm). ucomm COMMAND see comm. (alias comm, ucmd). uid UID see euid. (alias euid). uname USER see euser. (alias euser, user). unit UNIT displays unit which a process belongs to, if systemd support has been included. user USER see euser. (alias euser, uname). userns USERNS Unique inode number describing the namespace the process belongs to. See namespaces(7). uss USS Unique set size, the non-swapped physical memory, which is not shared with an another task. utsns UTSNS Unique inode number describing the namespace the process belongs to. See namespaces(7). uunit UUNIT displays user unit which a process belongs to, if systemd support has been included. vsize VSZ see vsz. (alias vsz). vsz VSZ virtual memory size of the process in KiB (1024-byte units). Device mappings are currently excluded; this is subject to change. (alias vsize). wbytes WBYTES Number of bytes which this process caused to be sent to the storage layer. wcbytes WCBYTES Number of cancelled write bytes. wchan WCHAN name of the kernel function in which the process is sleeping. wchars WCHARS Number of bytes which this task has caused, or shall cause to be written to disk. wops WOPS Number of write I/O operationsthat is, system calls such as write(2) and pwrite(2). ENVIRONMENT VARIABLES top The following environment variables could affect ps: COLUMNS Override default display width. LINES Override default display height. PS_PERSONALITY Set to one of posix, old, linux, bsd, sun, digital... (see section PERSONALITY below). CMD_ENV Set to one of posix, old, linux, bsd, sun, digital... (see section PERSONALITY below). I_WANT_A_BROKEN_PS Force obsolete command line interpretation. LC_TIME Date format. LIBPROC_HIDE_KERNEL Set this to any value to hide kernel threads normally displayed with the -e option. This is equivalent to selecting --ppid 2 -p 2 --deselect instead. Also works in BSD mode. PS_COLORS Not currently supported. PS_FORMAT Default output format override. You may set this to a format string of the type used for the -o option. The DefSysV and DefBSD values are particularly useful. POSIXLY_CORRECT Don't find excuses to ignore bad "features". POSIX2 When set to "on", acts as POSIXLY_CORRECT. UNIX95 Don't find excuses to ignore bad "features". _XPG Cancel CMD_ENV=irix non-standard behavior. In general, it is a bad idea to set these variables. The one exception is CMD_ENV or PS_PERSONALITY, which could be set to Linux for normal systems. Without that setting, ps follows the useless and bad parts of the Unix98 standard. PERSONALITY top 390 like the OS/390 OpenEdition ps aix like AIX ps bsd like FreeBSD ps (totally non-standard) compaq like Digital Unix ps debian like the old Debian ps digital like Tru64 (was Digital Unix, was OSF/1) ps gnu like the old Debian ps hp like HP-UX ps hpux like HP-UX ps irix like Irix ps linux ***** recommended ***** old like the original Linux ps (totally non-standard) os390 like OS/390 Open Edition ps posix standard s390 like OS/390 Open Edition ps sco like SCO ps sgi like Irix ps solaris2 like Solaris 2+ (SunOS 5) ps sunos4 like SunOS 4 (Solaris 1) ps (totally non-standard) svr4 standard sysv standard tru64 like Tru64 (was Digital Unix, was OSF/1) ps unix standard unix95 standard unix98 standard BUGS top The fields bsdstart and start will only show the abbreviated month name in English. The fields lstart and stime will show the abbreviated month name in the configured locale but may exceed the column width due to the different lengths for abbreviated month and day names across languages. SEE ALSO top pgrep(1), pstree(1), top(1), strftime(3), proc(5). STANDARDS top This ps conforms to: 1 Version 2 of the Single Unix Specification 2 The Open Group Technical Standard Base Specifications, Issue 6 3 IEEE Std 1003.1, 2004 Edition 4 X/Open System Interfaces Extension [UP XSI] 5 ISO/IEC 9945:2003 AUTHOR top ps was originally written by Branko Lankester [email protected]. nl. Michael K. Johnson [email protected] re-wrote it significantly to use the proc filesystem, changing a few things in the process. Michael Shields [email protected] added the pid-list feature. Charles Blake [email protected] added multi-level sorting, the dirent-style library, the device name-to-number mmaped database, the approximate binary search directly on System.map, and many code and documentation cleanups. David Mossberger-Tang wrote the generic BFD support for psupdate. Albert Cahalan [email protected] rewrote ps for full Unix98 and BSD support, along with some ugly hacks for obsolete and foreign syntax. Please send bug reports to [email protected]. No subscription is required or suggested. 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-10-04 PS(1) Pages that refer to this page: free(1), fuser(1), htop(1), killall(1), pcp-ps(1), pgrep(1), pidstat(1), pmap(1), pmsleep(1), pslog(1), pstree(1), pwdx(1), slabtop(1), systemd(1), systemd-cgls(1), systemd-firstboot(1), systemd-nspawn(1), tcpdump(1), tload(1), top(1), uptime(1), w(1), proc(5), credentials(7), pid_namespaces(7), pthreads(7), sched(7), lsof(8), systemd-machined.service(8), tcpdump(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. | # ps\n\n> Information about running processes.\n> More information: <https://manned.org/ps>.\n\n- List all running processes:\n\n`ps aux`\n\n- List all running processes including the full command string:\n\n`ps auxww`\n\n- Search for a process that matches a string:\n\n`ps aux | grep {{string}}`\n\n- List all processes of the current user in extra full format:\n\n`ps --user $(id -u) -F`\n\n- List all processes of the current user as a tree:\n\n`ps --user $(id -u) f`\n\n- Get the parent PID of a process:\n\n`ps -o ppid= -p {{pid}}`\n\n- Sort processes by memory consumption:\n\n`ps --sort size`\n |
pstree | pstree(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pstree(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | FILES | BUGS | SEE ALSO | COLOPHON PSTREE(1) User Commands PSTREE(1) NAME top pstree - display a tree of processes SYNOPSIS top pstree [-a, --arguments] [-c, --compact-not] [-C, --color attr] [-g, --show-pgids] [-h, --highlight-all, -H pid, --highlight-pid pid] [-l, --long] [-n, --numeric-sort] [-N, --ns-sort ns] [-p, --show-pids] [-s, --show-parents] [-S, --ns-changes] [-t, --thread-names] [-T, --hide-threads] [-u, --uid-changes] [-Z, --security-context] [-A, --ascii, -G, --vt100, -U, --unicode] [pid, user] pstree -V, --version DESCRIPTION top pstree shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown. pstree visually merges identical branches by putting them in square brackets and prefixing them with the repetition count, e.g. init-+-getty |-getty |-getty `-getty becomes init---4*[getty] Child threads of a process are found under the parent process and are shown with the process name in curly braces, e.g. icecast2---13*[{icecast2}] If pstree is called as pstree.x11 then it will prompt the user at the end of the line to press return and will not return until that has happened. This is useful for when pstree is run in a xterminal. Certain kernel or mount parameters, such as the hidepid option for procfs, will hide information for some processes. In these situations pstree will attempt to build the tree without this information, showing process names as question marks. OPTIONS top -a Show command line arguments. If the command line of a process is swapped out, that process is shown in parentheses. -a implicitly disables compaction for processes but not threads. -A Use ASCII characters to draw the tree. -c Disable compaction of identical subtrees. By default, subtrees are compacted whenever possible. -C Color the process name by given attribute. Currently pstree only accepts the value age which colors by process age. Processes newer than 60 seconds are green, newer than an hour yellow and the remaining red. -g Show PGIDs. Process Group IDs are shown as decimal numbers in parentheses after each process name. If both PIDs and PGIDs are displayed then PIDs are shown first. -G Use VT100 line drawing characters. -h Highlight the current process and its ancestors. This is a no-op if the terminal doesn't support highlighting or if neither the current process nor any of its ancestors are in the subtree being shown. -H Like -h, but highlight the specified process instead. Unlike with -h, pstree fails when using -H if highlighting is not available. -l Display long lines. By default, lines are truncated to either the COLUMNS environment variable or the display width. If neither of these methods work, the default of 132 columns is used. -n Sort processes with the same parent by PID instead of by name. (Numeric sort.) -N Show individual trees for each namespace of the type specified. The available types are: ipc, mnt, net, pid, time, user, uts. Regular users don't have access to other users' processes information, so the output will be limited. -p Show PIDs. PIDs are shown as decimal numbers in parentheses after each process name. -p implicitly disables compaction. -s Show parent processes of the specified process. -S Show namespaces transitions. Like -N, the output is limited when running as a regular user. -t Show full names for threads when available. -T Hide threads and only show processes. -u Show uid transitions. Whenever the uid of a process differs from the uid of its parent, the new uid is shown in parentheses after the process name. -U Use UTF-8 (Unicode) line drawing characters. Under Linux 1.1-54 and above, UTF-8 mode is entered on the console with echo -e ' 33%8' and left with echo -e ' 33%@'. -V Display version information. -Z Show the current security attributes of the process. For SELinux systems this will be the security context. FILES top /proc location of the proc file system BUGS top Some character sets may be incompatible with the VT100 characters. SEE ALSO top ps(1), top(1), proc(5). COLOPHON top This page is part of the psmisc (Small utilities that use the /proc filesystem) project. Information about the project can be found at https://gitlab.com/psmisc/psmisc. If you have a bug report for this manual page, see https://gitlab.com/psmisc/psmisc/issues. This page was obtained from the project's upstream Git repository https://gitlab.com/psmisc/psmisc.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] psmisc 2021-06-21 PSTREE(1) Pages that refer to this page: ps(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. | # pstree\n\n> A convenient tool to show running processes as a tree.\n> More information: <https://manned.org/pstree>.\n\n- Display a tree of processes:\n\n`pstree`\n\n- Display a tree of processes with PIDs:\n\n`pstree -p`\n\n- Display all process trees rooted at processes owned by specified user:\n\n`pstree {{user}}`\n |
ptx | ptx(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training ptx(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON PTX(1) User Commands PTX(1) NAME top ptx - produce a permuted index of file contents SYNOPSIS top ptx [OPTION]... [INPUT]... (without -G) ptx -G [OPTION]... [INPUT [OUTPUT]] DESCRIPTION top Output a permuted index, including context, of the words in the input files. With no FILE, or when FILE is -, read standard input. Mandatory arguments to long options are mandatory for short options too. -A, --auto-reference output automatically generated references -G, --traditional behave more like System V 'ptx' -F, --flag-truncation=STRING use STRING for flagging line truncations. The default is '/' -M, --macro-name=STRING macro name to use instead of 'xx' -O, --format=roff generate output as roff directives -R, --right-side-refs put references at right, not counted in -w -S, --sentence-regexp=REGEXP for end of lines or end of sentences -T, --format=tex generate output as TeX directives -W, --word-regexp=REGEXP use REGEXP to match each keyword -b, --break-file=FILE word break characters in this FILE -f, --ignore-case fold lower case to upper case for sorting -g, --gap-size=NUMBER gap size in columns between output fields -i, --ignore-file=FILE read ignore word list from FILE -o, --only-file=FILE read only word list from this FILE -r, --references first field of each line is a reference -t, --typeset-mode - not implemented - -w, --width=NUMBER output width in columns, reference excluded --help display this help and exit --version output version information and exit AUTHOR top Written by F. Pinard. 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/ptx> or available locally via: info '(coreutils) ptx 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 PTX(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. | # ptx\n\n> Generate a permuted index of words from text files.\n> More information: <https://www.gnu.org/software/coreutils/ptx>.\n\n- Generate a permuted index where the first field of each line is an index reference:\n\n`ptx --references {{path/to/file}}`\n\n- Generate a permuted index with automatically generated index references:\n\n`ptx --auto-reference {{path/to/file}}`\n\n- Generate a permuted index with a fixed width:\n\n`ptx --width={{width_in_columns}} {{path/to/file}}`\n\n- Generate a permuted index with a list of filtered words:\n\n`ptx --only-file={{path/to/filter}} {{path/to/file}}`\n\n- Generate a permuted index with SYSV-style behaviors:\n\n`ptx --traditional {{path/to/file}}`\n |
pv | pv(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pv(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | DISPLAY SWITCHES | OUTPUT MODIFIERS | DATA TRANSFER MODIFIERS | GENERAL OPTIONS | FORMATTING | COMMON SWITCHES | EXIT STATUS | AUTHOR | KNOWN PROBLEMS | REPORTING BUGS | SEE ALSO | COPYRIGHT | COLOPHON PV(1) User Manuals PV(1) NAME top pv - monitor the progress of data through a pipe SYNOPSIS top pv [OPTION] [FILE]... pv [-h|-V] DESCRIPTION top pv shows the progress of data through a pipeline by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA. To use it, insert it in a pipeline between two processes, with the appropriate options. Its standard input will be passed through to its standard output and progress will be shown on standard error. pv will copy each supplied FILE in turn to standard output (- means standard input), or if no FILEs are specified just standard input is copied. This is the same behaviour as cat(1). A simple example to watch how quickly a file is transferred using nc(1): pv file | nc -w 1 somewhere.com 3000 A similar example, transferring a file from another process and passing the expected size to pv: cat file | pv -s 12345 | nc -w 1 somewhere.com 3000 A more complicated example using numeric output to feed into the dialog(1) program for a full-screen progress display: (tar cf - . \ | pv -n -s $(du -sb . | awk '{print $1}') \ | gzip -9 > out.tgz) 2>&1 \ | dialog --gauge 'Progress' 7 70 Taking an image of a disk, skipping errors: pv -EE /dev/your/disk/device > disk-image.img Writing an image back to a disk: pv disk-image.img > /dev/your/disk/device Zeroing a disk: pv < /dev/zero > /dev/your/disk/device Note that if the input size cannot be calculated, and the output is a block device, then the size of the block device will be used and pv will automatically stop at that size as if -S had been given. (Linux only): Watching file descriptor 3 opened by another process 1234: pv -d 1234:3 (Linux only): Watching all file descriptors used by process 1234: pv -d 1234 OPTIONS top pv takes many options, which are divided into display switches, output modifiers, and general options. DISPLAY SWITCHES top If no display switches are specified, pv behaves as if -p, -t, -e, -r, and -b had been given (i.e. everything except average rate is switched on). Otherwise, only those display types that are explicitly switched on will be shown. -p, --progress Turn the progress bar on. If any inputs are not files, or are unreadable, and no size was explicitly given (with the -s modifier), the progress bar cannot indicate how close to completion the transfer is, so it will just move left and right to indicate that data is moving. -t, --timer Turn the timer on. This will display the total elapsed time that pv has been running for. -e, --eta Turn the ETA timer on. This will attempt to guess, based on current transfer rates and the total data size, how long it will be before completion. This option will have no effect if the total data size cannot be determined. -I, --fineta Turn the ETA timer on, but display the estimated local time of arrival instead of time left. When the estimated time is more than 6 hours in the future, the date is shown as well. -r, --rate Turn the rate counter on. This will display the current rate of data transfer. -a, --average-rate Turn the average rate counter on. This will display the current average rate of data transfer (default: last 30s, see -m). -b, --bytes Turn the total byte counter on. This will display the total amount of data transferred so far. -8, --bits Display the total bits instead of the total bytes. The output suffix will be "b" instead of "B". -T, --buffer-percent Turn on the transfer buffer percentage display. This will show the percentage of the transfer buffer in use - but see the caveat under %T in the FORMATTING section below. Implies -C. -A NUM, --last-written NUM Show the last NUM bytes written - but see the caveat under %nA in the FORMATTING section below. Implies -C. -F FORMAT, --format FORMAT Ignore the options -p, -t, -e, -r, -a, -b, -T, and -A, and instead use the format string FORMAT to determine the output format. See the FORMATTING section below. -n, --numeric Numeric output. Instead of giving a visual indication of progress, pv will give an integer percentage, one per line, on standard error, suitable for piping (via convoluted redirection) into dialog(1). Note that -f is not required if -n is being used. Note that if --numeric is in use, then adding --bytes will cause the number of bytes processed so far to be output instead of a percentage; if --line-mode is also in use as well as --bytes and --numeric, then instead of bytes or a percentage, the number of lines so far is output. And finally, if --timer is added to --numeric, then each output line is prefixed with the elapsed time so far, as a decimal number of seconds. -q, --quiet No output. Useful if the -L option is being used on its own to just limit the transfer rate of a pipe. OUTPUT MODIFIERS top -W, --wait Wait until the first byte has been transferred before showing any progress information or calculating any ETAs. Useful if the program you are piping to or from requires extra information before it starts, eg piping data into gpg(1) or mcrypt(1) which require a passphrase before data can be processed. -D SEC, --delay-start SEC Wait until SEC seconds have passed before showing any progress information, for example in a script where you only want to show a progress bar if it starts taking a long time. Note that this can be a decimal such as 0.5. -s SIZE, --size SIZE Assume the total amount of data to be transferred is SIZE bytes when calculating percentages and ETAs. The same suffixes of "k", "m" etc can be used as with -L. If SIZE starts with @, the size of file whose name follows the @ will be used. Note that --size has no effect if used with -d PID to watch all file descriptors of a process, but will work with -d PID:FD. -l, --line-mode Instead of counting bytes, count lines (newline characters). The progress bar will only move when a new line is found, and the value passed to the -s option will be interpreted as a line count. If this option is used without -s, the "total size" (in this case, total line count) is calculated by reading through all input files once before transfer starts. If any inputs are pipes or non-regular files, or are unreadable, the total size will not be calculated. -0, --null Count lines as terminated with a zero byte instead of with a newline. This option implies --line-mode. -i SEC, --interval SEC Wait SEC seconds between updates. The default is to update every second. Note that this can be a decimal such as 0.1. -m SEC, --average-rate-window SEC Compute current average rate over a SEC seconds window for average rate and ETA calculations (default 30 seconds). -w WIDTH, --width WIDTH Assume the terminal is WIDTH characters wide, instead of trying to work it out (or assuming 80 if it cannot be guessed). If this option is used, the output width will not be adjusted if the width of the terminal changes while the transfer is running. -H HEIGHT, --height HEIGHT Assume the terminal is HEIGHT rows high, instead of trying to work it out (or assuming 25 if it cannot be guessed). If this option is used, the output height will not be adjusted if the height of the terminal changes while the transfer is running. -N NAME, --name NAME Prefix the output information with NAME. Useful in conjunction with -c if you have a complicated pipeline and you want to be able to tell different parts of it apart. -f, --force Force output. Normally, pv will not output any visual display if standard error is not a terminal. This option forces it to do so. -c, --cursor Use cursor positioning escape sequences instead of just using carriage returns. This is useful in conjunction with -N (name) if you are using multiple pv invocations in a single, long, pipeline. DATA TRANSFER MODIFIERS top -L RATE, --rate-limit RATE Limit the transfer to a maximum of RATE bytes per second. A suffix of "K", "M", "G", or "T" can be added to denote kibibytes (*1024), mebibytes, and so on. -B BYTES, --buffer-size BYTES Use a transfer buffer size of BYTES bytes. A suffix of "K", "M", "G", or "T" can be added to denote kibibytes (*1024), mebibytes, and so on. The default buffer size is the block size of the input file's filesystem multiplied by 32 (512KiB max), or 400KiB if the block size cannot be determined. This can be useful on platforms like MacOS which perform better in pipelines with specific buffer sizes such as 1024. Implies -C. -C, --no-splice Never use splice(2), even if it would normally be possible. The splice(2) system call is a more efficient way of transferring data from or to a pipe than regular read(2) and write(2), but means that the transfer buffer may not be used. This prevents -A and -T from working, cannot work with -X, and makes -B redundant, so using -A, -T, -X, or -B automatically switches on -C. Switching on -C results in a small loss of transfer efficiency. (This option has no effect on systems where splice(2) is unavailable). -E, --skip-errors Ignore read errors by attempting to skip past the offending sections. The corresponding parts of the output will be null bytes. At first only a few bytes will be skipped, but if there are many errors in a row then the skips will move up to chunks of 512. This is intended to be similar to dd conv=sync,noerror but has not been as thoroughly tested. Specify -E twice to only report a read error once per file, instead of reporting each byte range skipped. -Z BYTES, --error-skip-block BYTES When ignoring read errors with -E, instead of trying to adaptively skip by reading small amounts and skipping progressively larger sections until a read succeeds, move to the next file block of BYTES bytes as soon as an error occurs. There may still be some shorter skips where the block being skipped coincides with the end of the transfer buffer. This option can only be used with -E and is intended for use when reading from a block device, such as -E -Z 4K to skip in 4 kibibyte blocks. This will speed up reads from faulty media, at the expense of potentially losing more data. -S, --stop-at-size If a size was specified with -s, stop transferring data once that many bytes have been written, instead of continuing to the end of input. -Y, --sync After every write operation, synchronise the buffer caches to disk - see fdatasync(2). This has no effect when the output is a pipe. Using -Y may improve the accuracy of the progress bar when writing to a slow disk. -K, --direct-io Set the O_DIRECT flag on all inputs and outputs, if it is available. This will minimise the effect of caches, at the cost of performance. Due to memory alignment requirements, it also may cause read or write failures with an error of "Invalid argument", especially if reading and writing files across a variety of filesystems in a single pv call. Use this option with caution. -X, --discard Instead of transferring input data to standard output, discard it. This is equivalent to redirecting standard output to /dev/null, except that write(2) is never called. Implies -C. -d PID[:FD], --watchfd PID[:FD] Instead of transferring data, watch file descriptor FD of process PID, and show its progress. The pv process will exit when FD either changes to a different file, changes read/write mode, or is closed; other data transfer modifiers - and remote control - may not be used with this option. If only a PID is specified, then that process will be watched, and all regular files and block devices it opens will be shown with a progress bar. The pv process will exit when process PID exits. -R PID, --remote PID If PID is an instance of pv that is already running, -R PID will cause that instance to act as though it had been given this instance's command line instead. For example, if pv -L 123K is running with process ID 9876, then running pv -R 9876 -L 321K will cause it to start using a rate limit of 321KiB instead of 123KiB. Note that some options cannot be changed while running, such as -c, -l, -f, -D, -E, and -S. GENERAL OPTIONS top -P FILE, --pidfile FILE Save the process ID of pv in FILE. The file will be replaced if it already exists, and will be removed when pv exits. While pv is running, it will contain a single number - the process ID of pv - followed by a newline. -h, --help Print a usage message on standard output and exit successfully. -V, --version Print version information on standard output and exit successfully. FORMATTING top If the -F option is given, then the output format is determined by the given format string. Within that string, the following sequences can be used: %p Progress bar. Expands to fill the remaining space. Should only be specified once. Equivalent to -p. %t Elapsed time. Equivalent to -t. %e ETA as time remaining. Equivalent to -e. %I ETA as local time of completion. Equivalent to -I. %r Current data transfer rate. Equivalent to -r. %a Average data transfer rate. Equivalent to -a. %b Bytes transferred so far (or lines if -l was specified). Equivalent to -b. If --bits was specified, %b shows the bits transferred so far, not bytes. %T Percentage of the transfer buffer in use. Equivalent to -T. Shows "{----}" if the transfer is being done with splice(2), since splicing to or from pipes does not use the buffer. %nA Show the last n bytes written (e.g. %16A for the last 16 bytes). Shows only dots if the transfer is being done with splice(2), since splicing to or from pipes does not use the buffer. %N Name prefix given by -N. Padded to 9 characters with spaces, and suffixed with :. %% A single %. The format string equivalent of turning on all display switches is `%N %b %T %t %r %a %p %e'. COMMON SWITCHES top Some suggested common switch combinations: pv -ptebar Show a progress bar, elapsed time, estimated completion time, byte counter, average rate, and current rate. pv -betlap Show a progress bar, elapsed time, estimated completion time, line counter, and average rate, counting lines instead of bytes. pv -t Show only the elapsed time - useful as a simple timer, e.g. sleep 10m | pv -t. pv -pterb The default behaviour: progress bar, elapsed time, estimated completion time, current rate, and byte counter. On MacOS, it may be useful to specify -B 1024 in a pipeline, as this may improve performance. EXIT STATUS top An exit status of 1 indicates a problem with the -R or -P options. Any other exit status is a bitmask of the following: 2 One or more files could not be accessed, stat(2)ed, or opened. 4 An input file was the same as the output file. 8 Internal error with closing a file or moving to the next file. 16 There was an error while transferring data from one or more input files. 32 A signal was caught that caused an early exit. 64 Memory allocation failed. A zero exit status indicates no problems. AUTHOR top Written by Andrew Wood, with patches submitted by various other people. Please see the package's ACKNOWLEDGEMENTS file for a complete list of contributors. KNOWN PROBLEMS top The following problems are known to exist in pv: In some versions of bash(1) and zsh(1), the construct <(pv filename) will not output any progress to the terminal when run from an interactive shell, due to the subprocess being run in a separate process group from the one that owns the terminal. In these cases, use --force. The -c option does not work properly on Cygwin without cygserver running, if started near the bottom of the screen (IPC is needed to handle the terminal scrolling). To fix this, start cygserver before using pv -c. The -R option requires that either /run/user/<uid>/ or $HOME/ can be written to, for inter-process communication. If you find any other problems, please report them. REPORTING BUGS top Please report any bugs to [email protected]. Alternatively, use the issue tracker linked from the pv home page: <https://www.ivarch.com/programs/pv.shtml> SEE ALSO top cat(1), dialog(1), splice(2), open(2) (for O_DIRECT) COPYRIGHT top Copyright 2002-2008, 2010, 2012-2015, 2017, 2021, 2023 Andrew Wood. License GPLv3+: GNU GPL version 3 or later <https://www.gnu.org/licenses/gpl-3.0.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. COLOPHON top This page is part of the pv (Pipe Viewer) project. Information about the project can be found at http://www.ivarch.com/programs/pv.shtml. If you have a bug report for this manual page, see http://www.ivarch.com/programs/pv.shtml. This page was obtained from the tarball pv-1.8.5.tar.gz fetched from http://www.ivarch.com/programs/pv.shtml 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] Linux November 2023 PV(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. | # pv\n\n> Monitor the progress of data through a pipe.\n> More information: <https://manned.org/pv>.\n\n- Print the contents of the file and display a progress bar:\n\n`pv {{path/to/file}}`\n\n- Measure the speed and amount of data flow between pipes (`--size` is optional):\n\n`command1 | pv --size {{expected_amount_of_data_for_eta}} | command2`\n\n- Filter a file, see both progress and amount of output data:\n\n`pv -cN in {{big_text_file}} | grep {{pattern}} | pv -cN out > {{filtered_file}}`\n\n- Attach to an already running process and see its file reading progress:\n\n`pv -d {{PID}}`\n\n- Read an erroneous file, skip errors as `dd conv=sync,noerror` would:\n\n`pv -EE {{path/to/faulty_media}} > image.img`\n\n- Stop reading after reading specified amount of data, rate limit to 1K/s:\n\n`pv -L 1K --stop-at --size {{maximum_file_size_to_be_read}}`\n |
pvcreate | pvcreate(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pvcreate(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | USAGE | OPTIONS | VARIABLES | ENVIRONMENT VARIABLES | EXAMPLES | SEE ALSO | COLOPHON PVCREATE(8) System Manager's Manual PVCREATE(8) NAME top pvcreate Initialize physical volume(s) for use by LVM SYNOPSIS top pvcreate position_args [ option_args ] DESCRIPTION top pvcreate initializes a Physical Volume (PV) on a device so the device is recognized as belonging to LVM. This allows the PV to be used in a Volume Group (VG). An LVM disk label is written to the device, and LVM metadata areas are initialized. A PV can be placed on a whole device or partition. Use vgcreate(8) to create a new VG on the PV, or vgextend(8) to add the PV to an existing VG. Use pvremove(8) to remove the LVM disk label from the device. The force option will create a PV without confirmation. Repeating the force option (-ff) will forcibly create a PV, overriding checks that normally prevent it, e.g. if the PV is already in a VG. Metadata location, size, and alignment The LVM disk label begins 512 bytes from the start of the device, and is 512 bytes in size. The LVM metadata area begins at an offset (from the start of the device) equal to the page size of the machine creating the PV (often 4 KiB.) The metadata area contains a 512 byte header and a multi-KiB circular buffer that holds text copies of the VG metadata. With default settings, the first physical extent (PE), which contains LV data, is 1 MiB from the start of the device. This location is controlled by default_data_alignment in lvm.conf, which is set to 1 (MiB) by default. The pe_start will be a multiple of this many MiB. This location can be checked with: pvs -o pe_start PV The size of the LVM metadata area is the space between the the start of the metadata area and the first PE. When metadata begins at 4 KiB and the first PE is at 1024 KiB, the metadata area size is 1020 KiB. This can be checked with: pvs -o mda_size PV The mda_size cannot be increased after pvcreate, so if larger metadata is needed, it must be set during pvcreate. Two copies of the VG metadata must always fit within the metadata area, so the maximum VG metadata size is around half the mda_size. This can be checked with: vgs -o mda_free VG A larger metadata area can be set with --metadatasize. The resulting mda_size may be larger than specified due to default_data_alignment placing pe_start on a MiB boundary, and the fact that the metadata area extends to the first PE. With metadata starting at 4 KiB and default_data_alignment 1 (MiB), setting --metadatasize 2048k results in pe_start of 3 MiB and mda_size of 3068 KiB. Alternatively, --metadatasize 2044k results in pe_start at 2 MiB and mda_size of 2044 KiB. The alignment of pe_start described above may be automatically overridden based on md device properties or device i/o properties reported in sysfs. These automatic adjustments can be enabled/disabled using lvm.conf settings md_chunk_alignment and data_alignment_offset_detection. To use a different pe_start alignment, use the --dataalignment option. The --metadatasize option would also typically be used in this case because the metadata area size also determines the location of pe_start. When using these two options together, pe_start is calculated as: metadata area start (page size), plus the specified --metadatasize, rounded up to the next multiple of --dataalignment. With metadata starting at 4 KiB, --metadatasize 2048k, and --dataalignment 128k, pe_start is 2176 KiB and mda_size is 2172 KiB. The pe_start of 2176 KiB is the nearest even multiple of 128 KiB that provides at least 2048 KiB of metadata space. Always check the resulting alignment and metadata size when using these options. To shift an aligned pe_start value, use the --dataalignmentoffset option. The pe_start alignment is calculated as described above, and then the value specified with --dataalignmentoffset is added to produce the final pe_start value. USAGE top pvcreate PV ... [ -f|--force ] [ -M|--metadatatype lvm2 ] [ -u|--uuid String ] [ -Z|--zero y|n ] [ --dataalignment Size[k|UNIT] ] [ --dataalignmentoffset Size[k|UNIT] ] [ --bootloaderareasize Size[m|UNIT] ] [ --labelsector Number ] [ --[pv]metadatacopies 0|1|2 ] [ --metadatasize Size[m|UNIT] ] [ --metadataignore y|n ] [ --norestorefile ] [ --setphysicalvolumesize Size[m|UNIT] ] [ --reportformat basic|json ] [ --restorefile String ] [ 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 --bootloaderareasize Size[m|UNIT] Reserve space for the bootloader between the LVM metadata area and the first PE. The bootloader area is reserved for bootloaders to embed their own data or metadata; LVM will not use it. The bootloader area begins where the first PE would otherwise be located. The first PE is moved out by the size of the bootloader area, and then moved out further if necessary to match the data alignment. The start of the bootloader area is always aligned, see also --dataalignment and --dataalignmentoffset. The bootloader area may be larger than requested due to the alignment, but it's never less than the requested size. To see the bootloader area start and size of an existing PV use pvs -o +pv_ba_start,pv_ba_size. --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. --longhelp Display long help text. --metadataignore y|n Specifies the metadataignore property of a PV. If yes, metadata areas on the PV are ignored, and lvm will not store metadata in the metadata areas of the PV. If no, lvm will store metadata on the PV. --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. --norestorefile In conjunction with --uuid, this allows a uuid to be specified without also requiring that a backup of the metadata be provided. --profile String An alias for --commandprofile or --metadataprofile, depending on the command. --[pv]metadatacopies 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. --restorefile String In conjunction with --uuid, this reads the file (produced by vgcfgbackup), extracts the location and size of the data on the PV, and ensures that the metadata produced by the program is consistent with the contents of the file, i.e. the physical extents will be in the same place and not be overwritten by new metadata. This provides a mechanism to upgrade the metadata format or to add/remove metadata areas. Use with care. --setphysicalvolumesize Size[m|UNIT] Overrides the automatically detected size of the PV. Use with care, or prior to reducing the physical size of the device. -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 String Specify a UUID for the device. Without this option, a random UUID is generated. This option is needed before restoring a backup of LVM metadata onto a replacement device; see vgcfgrestore(8). As such, use of --restorefile is compulsory unless the --norestorefile is used. All PVs must have unique UUIDs, and LVM will prevent certain operations if multiple devices are seen with the same UUID. See vgimportclone(8) for more information. -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.) -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 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 Initialize a partition and a full device. pvcreate /dev/sdc4 /dev/sde If a device is a 4 KiB sector drive that compensates for windows partitioning (sector 7 is the lowest aligned logical block, the 4 KiB sectors start at LBA -1, and consequently sector 63 is aligned on a 4 KiB boundary) manually account for this when initializing for use by LVM. pvcreate --dataalignmentoffset 7s /dev/sdb 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) PVCREATE(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. | # pvcreate\n\n> Initialize a disk or partition for use as a physical volume.\n> See also: `lvm`.\n> More information: <https://man7.org/linux/man-pages/man8/pvcreate.8.html>.\n\n- Initialize the `/dev/sda1` volume for use by LVM:\n\n`pvcreate {{/dev/sda1}}`\n\n- Force the creation without any confirmation prompts:\n\n`pvcreate --force {{/dev/sda1}}`\n |
pvdisplay | pvdisplay(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pvdisplay(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | USAGE | OPTIONS | VARIABLES | ENVIRONMENT VARIABLES | SEE ALSO | COLOPHON PVDISPLAY(8) System Manager's Manual PVDISPLAY(8) NAME top pvdisplay Display various attributes of physical volume(s) SYNOPSIS top pvdisplay [ option_args ] [ position_args ] DESCRIPTION top pvdisplay shows the attributes of PVs, like size, physical extent size, space used for the VG descriptor area, etc. pvs(8) is a preferred alternative that shows the same information and more, using a more compact and configurable output format. USAGE top pvdisplay [ -a|--all ] [ -c|--colon ] [ -C|--columns ] [ -m|--maps ] [ -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 ] [ --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 ] [ COMMON_OPTIONS ] [ PV|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 Show information about devices that have not been initialized by LVM, i.e. they are not PVs. --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. -m|--maps Display the mapping of physical extents to LVs and logical extents. --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 Only display the size of the given PVs. -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 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]... 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) PVDISPLAY(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. | # pvdisplay\n\n> Display information about Logical Volume Manager (LVM) physical volumes.\n> See also: `lvm`.\n> More information: <https://man7.org/linux/man-pages/man8/pvdisplay.8.html>.\n\n- Display information about all physical volumes:\n\n`sudo pvdisplay`\n\n- Display information about the physical volume on drive `/dev/sdXY`:\n\n`sudo pvdisplay {{/dev/sdXY}}`\n |
pvs | pvs(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pvs(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | USAGE | OPTIONS | VARIABLES | ENVIRONMENT VARIABLES | NOTES | SEE ALSO | COLOPHON PVS(8) System Manager's Manual PVS(8) NAME top pvs Display information about physical volumes SYNOPSIS top pvs [ option_args ] [ position_args ] DESCRIPTION top pvs produces formatted output about PVs. USAGE top pvs [ -a|--all ] [ -o|--options String ] [ -S|--select String ] [ -O|--sort String ] [ --segments ] [ --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 ] [ PV|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 Show information about devices that have not been initialized by LVM, i.e. they are not PVs. --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. --segments Produces one line of output for each contiguous allocation of space on each PV, showing the start (pvseg_start) and length (pvseg_size) in units of physical extents. -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 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]... 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 pv_attr bits are: 1 (d)uplicate, (a)llocatable, (u)sed 2 e(x)ported 3 (m)issing 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) PVS(8) Pages that refer to this page: lvmreport(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. | # pvs\n\n> Display information about physical volumes.\n> See also: `lvm`.\n> More information: <https://man7.org/linux/man-pages/man8/pvs.8.html>.\n\n- Display information about physical volumes:\n\n`pvs`\n\n- Display non-physical volumes:\n\n`pvs -a`\n\n- Change default display to show more details:\n\n`pvs -v`\n\n- Display only specific fields:\n\n`pvs -o {{field_name_1}},{{field_name_2}}`\n\n- Append field to default display:\n\n`pvs -o +{{field_name}}`\n\n- Suppress heading line:\n\n`pvs --noheadings`\n\n- Use separator to separate fields:\n\n`pvs --separator {{special_character}}`\n |
pwd | pwd(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pwd(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON PWD(1) User Commands PWD(1) NAME top pwd - print name of current/working directory SYNOPSIS top pwd [OPTION]... DESCRIPTION top Print the full filename of the current working directory. -L, --logical use PWD from environment, even if it contains symlinks -P, --physical avoid all symlinks --help display this help and exit --version output version information and exit If no option is specified, -P is assumed. NOTE: your shell may have its own version of pwd, 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 getcwd(3) Full documentation <https://www.gnu.org/software/coreutils/pwd> or available locally via: info '(coreutils) pwd 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 PWD(1) Pages that refer to this page: getcwd(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. | # pwd\n\n> Print name of current/working directory.\n> More information: <https://www.gnu.org/software/coreutils/pwd>.\n\n- Print the current directory:\n\n`pwd`\n\n- Print the current directory, and resolve all symlinks (i.e. show the "physical" path):\n\n`pwd --physical`\n\n- Print the current logical directory:\n\n`pwd --logical`\n |
pwdx | pwdx(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training pwdx(1) Linux manual page NAME | SYNOPSIS | OPTIONS | SEE ALSO | STANDARDS | AUTHOR | REPORTING BUGS | COLOPHON PWDX(1) User Commands PWDX(1) NAME top pwdx - report current working directory of a process SYNOPSIS top pwdx [options] pid [...] OPTIONS top -V, --version Output version information and exit. -h, --help Output help screen and exit. SEE ALSO top ps(1), pgrep(1) STANDARDS top No standards apply, but pwdx looks an awful lot like a SunOS command. AUTHOR top Nicholas Miell [email protected] wrote pwdx in 2004. 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 2020-06-04 PWDX(1) Pages that refer to this page: pslog(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. | # pwdx\n\n> Print working directory of a process.\n> More information: <https://manned.org/pwdx>.\n\n- Print current working directory of a process:\n\n`pwdx {{process_id}}`\n |
qsub | qsub(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training qsub(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 QSUB(1P) POSIX Programmer's Manual QSUB(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 qsub submit a script SYNOPSIS top qsub [-a date_time] [-A account_string] [-c interval] [-C directive_prefix] [-e path_name] [-h] [-j join_list] [-k keep_list] [-m mail_options] [-M mail_list] [-N name] [-o path_name] [-p priority] [-q destination] [-r y|n] [-S path_name_list] [-u user_list] [-v variable_list] [-V] [-z] [script] DESCRIPTION top To submit a script is to create a batch job that executes the script. A script is submitted by a request to a batch server. The qsub utility is a user-accessible batch client that submits a script. Upon successful completion, the qsub utility shall have created a batch job that will execute the submitted script. The qsub utility shall submit a script by sending a Queue Job Request to a batch server. The qsub utility shall place the value of the following environment variables in the Variable_List attribute of the batch job: HOME, LANG, LOGNAME, PATH, MAIL, SHELL, and TZ. The name of the environment variable shall be the current name prefixed with the string PBS_O_. Note: If the current value of the HOME variable in the environment space of the qsub utility is /aa/bb/cc, then qsub shall place PBS_O_HOME=/aa/bb/cc in the Variable_List attribute of the batch job. In addition to the variables described above, the qsub utility shall add the following variables with the indicated values to the variable list: PBS_O_WORKDIR The absolute path of the current working directory of the qsub utility process. PBS_O_HOST The name of the host on which the qsub utility is running. OPTIONS top The qsub utility shall conform to the Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines. The following options shall be supported by the implementation: -a date_time Define the time at which a batch job becomes eligible for execution. The qsub utility shall accept an option-argument that conforms to the syntax of the time operand of the touch utility. Table 4-19: Environment Variable Values (Utilities) Variable Name Value at qsub Time PBS_O_HOME HOME PBS_O_HOST Client host name PBS_O_LANG LANG PBS_O_LOGNAME LOGNAME PBS_O_PATH PATH PBS_O_MAIL MAIL PBS_O_SHELL SHELL PBS_O_TZ TZ PBS_O_WORKDIR Current working directory Note: The server that initiates execution of the batch job will add other variables to the batch job's environment; see Section 3.2.2.1, Batch Job Execution. The qsub utility shall set the Execution_Time attribute of the batch job to the number of seconds since the Epoch that is equivalent to the local time expressed by the value of the date_time option-argument. The Epoch is defined in the Base Definitions volume of POSIX.12017, Section 3.150, Epoch. If the -a option is not presented to the qsub utility, the utility shall set the Execution_Time attribute of the batch job to a time (number of seconds since the Epoch) that is earlier than the time at which the utility exits. -A account_string Define the account to which the resource consumption of the batch job should be charged. The syntax of the account_string option-argument is unspecified. The qsub utility shall set the Account_Name attribute of the batch job to the value of the account_string option-argument. If the -A option is not presented to the qsub utility, the utility shall omit the Account_Name attribute from the attributes of the batch job. -c interval Define whether the batch job should be checkpointed, and if so, how often. The qsub utility shall accept a value for the interval option-argument that is one of the following: n No checkpointing shall be performed on the batch job (NO_CHECKPOINT). s Checkpointing shall be performed only when the batch server is shut down (CHECKPOINT_AT_SHUTDOWN). c Automatic periodic checkpointing shall be performed at the Minimum_Cpu_Interval attribute of the batch queue, in units of CPU minutes (CHECKPOINT_AT_MIN_CPU_INTERVAL). c=minutes Automatic periodic checkpointing shall be performed every minutes of CPU time, or every Minimum_Cpu_Interval minutes, whichever is greater. The minutes argument shall conform to the syntax for unsigned integers and shall be greater than zero. The qsub utility shall set the Checkpoint attribute of the batch job to the value of the interval option- argument. If the -c option is not presented to the qsub utility, the utility shall set the Checkpoint attribute of the batch job to the single character 'u' (CHECKPOINT_UNSPECIFIED). -C directive_prefix Define the prefix that declares a directive to the qsub utility within the script. The directive_prefix is not a batch job attribute; it affects the behavior of the qsub utility. If the -C option is presented to the qsub utility, and the value of the directive_prefix option-argument is the null string, the utility shall not scan the script file for directives. If the -C option is not presented to the qsub utility, then the value of the PBS_DPREFIX environment variable is used. If the environment variable is not defined, then #PBS encoded in the portable character set is the default. -e path_name Define the path to be used for the standard error stream of the batch job. The qsub utility shall accept a path_name option- argument which can be preceded by a host name element of the form hostname:. If the path_name option-argument constitutes an absolute pathname, the qsub utility shall set the Error_Path attribute of the batch job to the value of the path_name option-argument. If the path_name option-argument constitutes a relative pathname and no host name element is specified, the qsub utility shall set the Error_Path attribute of the batch job to the value of the absolute pathname derived by expanding the path_name option-argument relative to the current directory of the process executing qsub. If the path_name option-argument constitutes a relative pathname and a host name element is specified, the qsub utility shall set the Error_Path attribute of the batch job to the value of the path_name option-argument without expansion. The host name element shall be included. If the path_name option-argument does not include a host name element, the qsub utility shall prefix the pathname with hostname:, where hostname is the name of the host upon which the qsub utility is being executed. If the -e option is not presented to the qsub utility, the utility shall set the Error_Path attribute of the batch job to the host name and path of the current directory of the submitting process and the default filename. The default filename for standard error has the following format: job_name.esequence_number -h Specify that a USER hold is applied to the batch job. The qsub utility shall set the value of the Hold_Types attribute of the batch job to the value USER. If the -h option is not presented to the qsub utility, the utility shall set the Hold_Types attribute of the batch job to the value NO_HOLD. -j join_list Define which streams of the batch job are to be merged. The qsub -j option shall accept a value for the join_list option-argument that is a string of alphanumeric characters in the portable character set (see the Base Definitions volume of POSIX.12017, Section 6.1, Portable Character Set). The qsub utility shall accept a join_list option- argument that consists of one or more of the characters 'e' and 'o', or the single character 'n'. All of the other batch job output streams specified will be merged into the output stream represented by the character listed first in the join_list option- argument. For each unique character in the join_list option- argument, the qsub utility shall add a value to the Join_Path attribute of the batch job as follows, each representing a different batch job stream to join: e The standard error of the batch job (JOIN_STD_ERROR). o The standard output of the batch job (JOIN_STD_OUTPUT). An existing Join_Path attribute can be cleared by the following join type: n NO_JOIN If 'n' is specified, then no files are joined. The qsub utility shall consider it an error if any join type other than 'n' is combined with join type 'n'. Strictly conforming applications shall not repeat any of the characters 'e', 'o', or 'n' within the join_list option-argument. The qsub utility shall permit the repetition of characters, but shall not assign additional meaning to the repeated characters. An implementation may define other join types. The conformance document for an implementation shall describe any additional batch job streams, how they are specified, their internal behavior, and how they affect the behavior of the utility. If the -j option is not presented to the qsub utility, the utility shall set the value of the Join_Path attribute of the batch job to NO_JOIN. -k keep_list Define which output of the batch job to retain on the execution host. The qsub -k option shall accept a value for the keep_list option-argument that is a string of alphanumeric characters in the portable character set (see the Base Definitions volume of POSIX.12017, Section 6.1, Portable Character Set). The qsub utility shall accept a keep_list option- argument that consists of one or more of the characters 'e' and 'o', or the single character 'n'. For each unique character in the keep_list option- argument, the qsub utility shall add a value to the Keep_Files attribute of the batch job as follows, each representing a different batch job stream to keep: e The standard error of the batch job (KEEP_STD_ERROR). o The standard output of the batch job (KEEP_STD_OUTPUT). If both 'e' and 'o' are specified, then both files are retained. An existing Keep_Files attribute can be cleared by the following keep type: n NO_KEEP If 'n' is specified, then no files are retained. The qsub utility shall consider it an error if any keep type other than 'n' is combined with keep type 'n'. Strictly conforming applications shall not repeat any of the characters 'e', 'o', or 'n' within the keep_list option-argument. The qsub utility shall permit the repetition of characters, but shall not assign additional meaning to the repeated characters. An implementation may define other keep types. The conformance document for an implementation shall describe any additional keep types, how they are specified, their internal behavior, and how they affect the behavior of the utility. If the -k option is not presented to the qsub utility, the utility shall set the Keep_Files attribute of the batch job to the value NO_KEEP. -m mail_options Define the points in the execution of the batch job at which the batch server that manages the batch job shall send mail about a change in the state of the batch job. The qsub -m option shall accept a value for the mail_options option-argument that is a string of alphanumeric characters in the portable character set (see the Base Definitions volume of POSIX.12017, Section 6.1, Portable Character Set). The qsub utility shall accept a value for the mail_options option-argument that is a string of one or more of the characters 'e', 'b', and 'a', or the single character 'n'. For each unique character in the mail_options option- argument, the qsub utility shall add a value to the Mail_Users attribute of the batch job as follows, each representing a different time during the life of a batch job at which to send mail: e MAIL_AT_EXIT b MAIL_AT_BEGINNING a MAIL_AT_ABORT If any of these characters are duplicated in the mail_options option-argument, the duplicates shall be ignored. An existing Mail_Points attribute can be cleared by the following mail type: n NO_MAIL If 'n' is specified, then mail is not sent. The qsub utility shall consider it an error if any mail type other than 'n' is combined with mail type 'n'. Strictly conforming applications shall not repeat any of the characters 'e', 'b', 'a', or 'n' within the mail_options option-argument. The qsub utility shall permit the repetition of characters, but shall not assign additional meaning to the repeated characters. An implementation may define other mail types. The conformance document for an implementation shall describe any additional mail types, how they are specified, their internal behavior, and how they affect the behavior of the utility. If the -m option is not presented to the qsub utility, the utility shall set the Mail_Points attribute to the value MAIL_AT_ABORT. -M mail_list Define the list of users to which a batch server that executes the batch job shall send mail, if the server sends mail about the batch job. The syntax of the mail_list option-argument is unspecified. If the implementation of the qsub utility uses a name service to locate users, the utility should accept the syntax used by the name service. If the implementation of the qsub utility does not use a name service to locate users, the implementation should accept the following syntax for user names: mail_address[,,mail_address,, ...] The interpretation of mail_address is implementation- defined. The qsub utility shall set the Mail_Users attribute of the batch job to the value of the mail_list option- argument. If the -M option is not presented to the qsub utility, the utility shall place only the user name and host name for the current process in the Mail_Users attribute of the batch job. -N name Define the name of the batch job. The qsub -N option shall accept a value for the name option-argument that is a string of up to 15 alphanumeric characters in the portable character set (see the Base Definitions volume of POSIX.12017, Section 6.1, Portable Character Set) where the first character is alphabetic. The qsub utility shall set the value of the Job_Name attribute of the batch job to the value of the name option-argument. If the -N option is not presented to the qsub utility, the utility shall set the Job_Name attribute of the batch job to the name of the script argument from which the directory specification if any, has been removed. If the -N option is not presented to the qsub utility, and the script is read from standard input, the utility shall set the Job_Name attribute of the batch job to the value STDIN. -o path_name Define the path for the standard output of the batch job. The qsub utility shall accept a path_name option- argument that conforms to the syntax of the path_name element defined in the System Interfaces volume of POSIX.12017, which can be preceded by a host name element of the form hostname:. If the path_name option-argument constitutes an absolute pathname, the qsub utility shall set the Output_Path attribute of the batch job to the value of the path_name option-argument without expansion. If the path_name option-argument constitutes a relative pathname and no host name element is specified, the qsub utility shall set the Output_Path attribute of the batch job to the pathname derived by expanding the value of the path_name option-argument relative to the current directory of the process executing the qsub. If the path_name option-argument constitutes a relative pathname and a host name element is specified, the qsub utility shall set the Output_Path attribute of the batch job to the value of the path_name option-argument without expansion. If the path_name option-argument does not specify a host name element, the qsub utility shall prefix the pathname with hostname:, where hostname is the name of the host upon which the qsub utility is executing. If the -o option is not presented to the qsub utility, the utility shall set the Output_Path attribute of the batch job to the host name and path of the current directory of the submitting process and the default filename. The default filename for standard output has the following format: job_name.osequence_number -p priority Define the priority the batch job should have relative to other batch jobs owned by the batch server. The qsub utility shall set the Priority attribute of the batch job to the value of the priority option- argument. If the -p option is not presented to the qsub utility, the value of the Priority attribute is implementation- defined. The qsub utility shall accept a value for the priority option-argument that conforms to the syntax for signed decimal integers, and which is not less than -1024 and not greater than 1023. -q destination Define the destination of the batch job. The destination is not a batch job attribute; it determines the batch server, and possibly the batch queue, to which the qsub utility batch queues the batch job. The qsub utility shall submit the script to the batch server named by the destination option-argument or the server that owns the batch queue named in the destination option-argument. The qsub utility shall accept an option-argument for the -q option that conforms to the syntax for a destination (see Section 3.3.2, Destination). If the -q option is not presented to the qsub utility, the qsub utility shall submit the batch job to the default destination. The mechanism for determining the default destination is implementation-defined. -r y|n Define whether the batch job is rerunnable. If the value of the option-argument is y, the qsub utility shall set the Rerunable attribute of the batch job to TRUE. If the value of the option-argument is n, the qsub utility shall set the Rerunable attribute of the batch job to FALSE. If the -r option is not presented to the qsub utility, the utility shall set the Rerunable attribute of the batch job to TRUE. -S path_name_list Define the pathname to the shell under which the batch job is to execute. The qsub utility shall accept a path_name_list option- argument that conforms to the following syntax: pathname[@host][,,pathname[@host],, ...] The qsub utility shall allow only one pathname for a given host name. The qsub utility shall allow only one pathname that is missing a corresponding host name. The qsub utility shall add a value to the Shell_Path_List attribute of the batch job for each entry in the path_name_list option-argument. If the -S option is not presented to the qsub utility, the utility shall set the Shell_Path_List attribute of the batch job to the null string. The conformance document for an implementation shall describe the mechanism used to set the default shell and determine the current value of the default shell. An implementation shall provide a means for the installation to set the default shell to the login shell of the user under which the batch job is to execute. See Section 3.3.3, Multiple Keyword-Value Pairs for a means of removing keyword=value (and value@keyword) pairs and other general rules for list- oriented batch job attributes. -u user_list Define the user name under which the batch job is to execute. The qsub utility shall accept a user_list option- argument that conforms to the following syntax: username[@host][,,username[@host],, ...] The qsub utility shall accept only one user name that is missing a corresponding host name. The qsub utility shall accept only one user name per named host. The qsub utility shall add a value to the User_List attribute of the batch job for each entry in the user_list option-argument. If the -u option is not presented to the qsub utility, the utility shall set the User_List attribute of the batch job to the user name from which the utility is executing. See Section 3.3.3, Multiple Keyword-Value Pairs for a means of removing keyword=value (and value@keyword) pairs and other general rules for list- oriented batch job attributes. -v variable_list Add to the list of variables that are exported to the session leader of the batch job. A variable_list is a set of strings of either the form <variable> or <variable=value>, delimited by <comma> characters. If the -v option is presented to the qsub utility, the utility shall also add, to the environment Variable_List attribute of the batch job, every variable named in the environment variable_list option- argument and, optionally, values of specified variables. If a value is not provided on the command line, the qsub utility shall set the value of each variable in the environment Variable_List attribute of the batch job to the value of the corresponding environment variable for the process in which the utility is executing; see Table 4-19, Environment Variable Values (Utilities). A conforming application shall not repeat a variable in the environment variable_list option-argument. The qsub utility shall not repeat a variable in the environment Variable_List attribute of the batch job. See Section 3.3.3, Multiple Keyword-Value Pairs for a means of removing keyword=value (and value@keyword) pairs and other general rules for list-oriented batch job attributes. -V Specify that all of the environment variables of the process are exported to the context of the batch job. The qsub utility shall place every environment variable in the process in which the utility is executing in the list and shall set the value of each variable in the attribute to the value of that variable in the process. -z Specify that the utility does not write the batch job_identifier of the created batch job to standard output. If the -z option is presented to the qsub utility, the utility shall not write the batch job_identifier of the created batch job to standard output. If the -z option is not presented to the qsub utility, the utility shall write the identifier of the created batch job to standard output. OPERANDS top The qsub utility shall accept a script operand that indicates the path to the script of the batch job. If the script operand is not presented to the qsub utility, or if the operand is the single-character string '-', the utility shall read the script from standard input. If the script represents a partial path, the qsub utility shall expand the path relative to the current directory of the process executing the utility. STDIN top The qsub utility reads the script of the batch job from standard input if the script operand is omitted or is the single character '-'. INPUT FILES top In addition to binding the file indicated by the script operand to the batch job, the qsub utility reads the script file and acts on directives in the script. ENVIRONMENT VARIABLES top The following environment variables shall affect the execution of qsub: 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 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. LOGNAME Determine the login name of the user. PBS_DPREFIX Determine the default prefix for directives within the script. SHELL Determine the pathname of the preferred command language interpreter of the user. TZ Determine the timezone used to interpret the date-time option-argument. If TZ is unset or null, an unspecified default timezone shall be used. ASYNCHRONOUS EVENTS top Once created, a batch job exists until it exits, aborts, or is deleted. After a batch job is created by the qsub utility, batch servers might route, execute, modify, or delete the batch job. STDOUT top The qsub utility writes the batch job_identifier assigned to the batch job to standard output, unless the -z option is specified. STDERR top The standard error shall be used only for diagnostic messages. OUTPUT FILES top None. EXTENDED DESCRIPTION top Script Preservation The qsub utility shall make the script available to the server executing the batch job in such a way that the server executes the script as it exists at the time of submission. The qsub utility can send a copy of the script to the server with the Queue Job Request or store a temporary copy of the script in a location specified to the server. Option Specification A script can contain directives to the qsub utility. The qsub utility shall scan the lines of the script for directives, skipping blank lines, until the first line that begins with a string other than the directive string; if directives occur on subsequent lines, the utility shall ignore those directives. Lines are separated by a <newline>. If the first line of the script begins with "#!" or a <colon> (':'), then it is skipped. The qsub utility shall process a line in the script as a directive if and only if the string of characters from the first non-white-space character on the line until the first <space> or <tab> on the line match the directive prefix. If a line in the script contains a directive and the final characters of the line are <backslash> and <newline>, then the next line shall be interpreted as a continuation of that directive. The qsub utility shall process the options and option-arguments contained on the directive prefix line using the same syntax as if the options were input on the qsub utility. The qsub utility shall continue to process a directive prefix line until after a <newline> is encountered. An implementation may ignore lines which, according to the syntax of the shell that will interpret the script, are comments. An implementation shall describe in the conformance document the format of any shell comments that it will recognize. If an option is present in both a directive and the arguments to the qsub utility, the utility shall ignore the option and the corresponding option-argument, if any, in the directive. If an option that is present in the directive is not present in the arguments to the qsub utility, the utility shall process the option and the option-argument, if any. In order of preference, the qsub utility shall select the directive prefix from one of the following sources: * If the -C option is presented to the utility, the value of the directive_prefix option-argument * If the environment variable PBS_DPREFIX is defined, the value of that variable * The four-character string "#PBS" encoded in the portable character set If the -C option is present in the script file it shall be ignored. 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 The qsub utility allows users to create a batch job that will process the script specified as the operand of the utility. The options of the qsub utility allow users to control many aspects of the queuing and execution of a batch job. The -a option allows users to designate the time after which the batch job will become eligible to run. By specifying an execution time, users can take advantage of resources at off-peak hours, synchronize jobs with chronologically predictable events, and perhaps take advantage of off-peak pricing of computing time. For these reasons and others, a timing option is existing practice on the part of almost every batch system, including NQS. The -A option allows users to specify the account that will be charged for the batch job. Support for account is not mandatory for conforming batch servers. The -C option allows users to prescribe the prefix for directives within the script file. The default prefix "#PBS" may be inappropriate if the script will be interpreted with an alternate shell, as specified by the -S option. The -c option allows users to establish the checkpointing interval for their jobs. A checkpointing system, which is not defined by this volume of POSIX.12017, allows recovery of a batch job at the most recent checkpoint in the event of a crash. Checkpointing is typically used for jobs that consume expensive computing time or must meet a critical schedule. Users should be allowed to make the tradeoff between the overhead of checkpointing and the risk to the timely completion of the batch job; therefore, this volume of POSIX.12017 provides the checkpointing interval option. Support for checkpointing is optional for batch servers. The -e option allows users to redirect the standard error streams of their jobs to a non-default path. For example, if the submitted script generally produces a great deal of useless error output, a user might redirect the standard error output to the null device. Or, if the file system holding the default location (the home directory of the user) has too little free space, the user might redirect the standard error stream to a file in another file system. The -h option allows users to create a batch job that is held until explicitly released. The ability to create a held job is useful when some external event must complete before the batch job can execute. For example, the user might submit a held job and release it when the system load has dropped. The -j option allows users to merge the standard error of a batch job into its standard output stream, which has the advantage of showing the sequential relationship between output and error messages. The -m option allows users to designate those points in the execution of a batch job at which mail will be sent to the submitting user, or to the account(s) indicated by the -M option. By requesting mail notification at points of interest in the life of a job, the submitting user, or other designated users, can track the progress of a batch job. The -N option allows users to associate a name with the batch job. The job name in no way affects the processing of the batch job, but rather serves as a mnemonic handle for users. For example, the batch job name can help the user distinguish between multiple jobs listed by the qstat utility. The -o option allows users to redirect the standard output stream. A user might, for example, wish to redirect to the null device the standard output stream of a job that produces copious yet superfluous output. The -P option allows users to designate the relative priority of a batch job for selection from a queue. The -q option allows users to specify an initial queue for the batch job. If the user specifies a routing queue, the batch server routes the batch job to another queue for execution or further routing. If the user specifies a non-routing queue, the batch server of the queue eventually executes the batch job. The -r option allows users to control whether the submitted job will be rerun if the controlling batch node fails during execution of the batch job. The -r option likewise allows users to indicate whether or not the batch job is eligible to be rerun by the qrerun utility. Some jobs cannot be correctly rerun because of changes they make in the state of databases or other aspects of their environment. This volume of POSIX.12017 specifies that the default, if the -r option is not presented to the utility, will be that the batch job cannot be rerun, since the result of rerunning a non-rerunnable job might be catastrophic. The -S option allows users to specify the program (usually a shell) that will be invoked to process the script of the batch job. This option has been modified to allow a list of shell names and locations associated with different hosts. The -u option is useful when the submitting user is authorized to use more than one account on a given host, in which case the -u option allows the user to select from among those accounts. The option-argument is a list of user-host pairs, so that the submitting user can provide different user identifiers for different nodes in the event the batch job is routed. The -u option provides a lot of flexibility to accommodate sites with complex account structures. Users that have the same user identifier on all the hosts they are authorized to use will not need to use the -u option. The -V option allows users to export all their current environment variables, as of the time the batch job is submitted, to the context of the processes of the batch job. The -v option allows users to export specific environment variables from their current process to the processes of the batch job. The -z option allows users to suppress the writing of the batch job identifier to standard output. The -z option is an existing NQS practice that has been standardized. Historically, the qsub utility has served the batch job- submission function in the NQS system, the existing practice on which it is based. Some changes and additions have been made to the qsub utility in this volume of POSIX.12017, vis-a-vis NQS, as a result of the growing pool of experience with distributed batch systems. The set of features of the qsub utility as defined in this volume of POSIX.12017 appears to incorporate all the common existing practice on potentially conforming platforms. FUTURE DIRECTIONS top The qsub utility may be removed in a future version. SEE ALSO top Chapter 3, Batch Environment Services, qrerun(1p), qstat(1p), touch(1p) The Base Definitions volume of POSIX.12017, Section 3.150, Epoch, Section 6.1, Portable Character Set, 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 QSUB(1P) Pages that refer to this page: qalter(1p), qselect(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. | # qsub\n\n> Submits a script to the queue management system TORQUE.\n> More information: <https://manned.org/qsub.1>.\n\n- Submit a script with default settings (depends on TORQUE settings):\n\n`qsub {{script.sh}}`\n\n- Submit a script with a specified wallclock runtime limit of 1 hour, 2 minutes and 3 seconds:\n\n`qsub -l walltime={{1}}:{{2}}:{{3}} {{script.sh}}`\n\n- Submit a script that is executed on 2 nodes using 4 cores per node:\n\n`qsub -l nodes={{2}}:ppn={{4}} {{script.sh}}`\n\n- Submit a script to a specific queue. Note that different queues can have different maximum and minimum runtime limits:\n\n`qsub -q {{queue_name}} {{script.sh}}`\n |
quilt | quilt(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training quilt(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXIT STATUS | ENVIRONMENT | FILES | AUTHORS | EXAMPLES | SEE ALSO | COLOPHON quilt(1) General Commands Manual quilt(1) NAME top quilt - manage a series of patches SYNOPSIS top quilt [--quiltrc file] [--trace] command [options] quilt [command] -h quilt --version DESCRIPTION top Quilt is a tool to manage large sets of patches by keeping track of the changes each patch makes. Patches can be applied, unapplied, refreshed, and so forth. The key philosophical concept is that your primary working material is patches. With quilt, all work occurs within a single directory tree. Commands can be invoked from anywhere within the source tree. Like CVS, Subversion, or Git, quilt takes commands of the form quilt command. A command can be truncated (abbreviated) as long as the specified part of the command is unambiguous. If command is ambiguously short, quilt lists all commands matching that prefix and exits. All commands print a brief contextual help message and exit if given the -h option. Quilt manages a stack of patches. Patches are applied incrementally on top of the base tree plus all preceding patches. They can be pushed onto the stack (quilt push), and popped off the stack (quilt pop). Commands are available for querying the contents of the stack (quilt applied, quilt previous, quilt top) and the patches that are not applied at a particular moment (quilt next, quilt unapplied). By default, most commands apply to the topmost patch on the stack. Patch files are located in the patches subdirectory of the source tree (see Example of working tree, under FILES, below). The QUILT_PATCHES environment variable overrides this default location. When not found in the current directory, that subdirectory is searched recursively in the parent directories (this is similar to the way Git searches for its configuration files). The patches directory may contain subdirectories. It may also be a symbolic link instead of a directory. Quilt creates and maintains a file called series, which defines the order in which patches are applied. The QUILT_SERIES environment variable overrides this default name. You can query the contents of the series file at any time with quilt series. In this file, each patch file name is on a separate line. Patch files are identified by path names that are relative to the patches directory; patches may be in subdirectories below this directory. Lines in the series file that start with a hash character (#) are ignored. Patch options, such as the strip level or whether the patch is reversed, can be added after each patch file name. Options are introduced by a space, separated by spaces, and follow the syntax of the patch(1) options (e.g., -p2). Quilt records patch options automatically when a command supporting them is used. Without options, strip level 1 is assumed. You can also add a comment after each patch file name and options, introduced by a space followed by a hash character. When quilt adds, removes, or renames patches, it automatically updates the series file. Users of quilt can modify series files while some patches are applied, as long as the applied patches remain in their original order. Unless there are means by which a series file can be generated automatically, you should provide it along with any set of quilt-managed patches you distribute. Different series files can be used to assemble patches in different ways, corresponding (for example) to different development branches. Before a patch is applied, copies of all files the patch modifies are saved to the .pc/patch-name directory, where patch-name is the name of the patch (for example, fix-buffer-overflow.patch). The patch is added to the list of currently applied patches (.pc/applied-patches). Later, when a patch is regenerated (quilt refresh), the backup copies in .pc/patch-name are compared with the current versions of the files in the source tree using GNU diff(1). A similar process occurs when starting a new patch (quilt new); the new patch file name is added to the series file. A file to be changed by the patch is backed up and opened for editing (quilt edit). After editing, inspect the impact of your changes (quilt diff); the changes stay local to your working tree until you call quilt refresh to write them to the patch file. Documentation related to a patch can be put at the beginning of its patch file (quilt header). Quilt is careful to preserve all text that precedes the actual patch when doing a refresh. (This is limited to patches in unified format; see the GNU Diffutils manual.) The series file is looked up in the .pc directory, in the root of the source tree, and in the patches directory. The first series file that is found is used. This may also be a symbolic link, or a file with multiple hard links. Usually, only one series file is used for a set of patches, making the patches subdirectory a convenient location. The .pc directory cannot be relocated, but it can be a symbolic link. Its subdirectories must not be renamed or restructured. While patches are applied to the source tree, this directory is essential for many operations, including popping patches off the stack and refreshing them. Files in the .pc directory are automatically removed when they are no longer needed, so there is no need to clean up manually. Quilt commands reference add [-P patch] {file} ... Add one or more files to the topmost or named patch. Files must be added to the patch before being modified. Files that are modified by patches already applied on top of the specified patch cannot be added. -P patch Patch to add files to. annotate [-P patch] {file} Print an annotated listing of the specified file showing which patches modify which lines. Only applied patches are included. -P patch Stop checking for changes at the specified rather than the topmost patch. applied [patch] Print a list of applied patches, or all patches up to and including the specified patch in the file series. delete [-r] [--backup] [patch|-n] Remove the specified or topmost patch from the series file. If the patch is applied, quilt will attempt to remove it first. (Only the topmost patch can be removed right now.) -n Delete the next patch after topmost, rather than the specified or topmost patch. -r Remove the deleted patch file from the patches directory as well. --backup Rename the patch file to patch~ rather than deleting it. Ignored if not used with `-r'. diff [-p n|-p ab] [-u|-U num|-c|-C num] [--combine patch|-z] [-R] [-P patch] [--snapshot] [--diff=utility] [--no-timestamps] [--no- index] [--sort] [--color[=always|auto|never]] [file ...] Produces a diff of the specified file(s) in the topmost or specified patch. If no files are specified, all files that are modified are included. -p n Create a -p n style patch (-p0 or -p1 are supported). -p ab Create a -p1 style patch, but use a/file and b/file as the original and new filenames instead of the default dir.orig/file and dir/file names. -u, -U num, -c, -C num Create a unified diff (-u, -U) with num lines of context. Create a context diff (-c, -C) with num lines of context. The number of context lines defaults to 3. --no-timestamps Do not include file timestamps in patch headers. --no-index Do not output Index: lines. -z Write to standard output the changes that have been made relative to the topmost or specified patch. -R Create a reverse diff. -P patch Create a diff for the specified patch. (Defaults to the topmost patch.) --combine patch Create a combined diff for all patches between this patch and the patch specified with -P. A patch name of `-' is equivalent to specifying the first applied patch. --snapshot Diff against snapshot (see `quilt snapshot -h'). --diff=utility Use the specified utility for generating the diff. The utility is invoked with the original and new file name as arguments. --color[=always|auto|never] Use syntax coloring (auto activates it only if the output is a tty). --sort Sort files by their name instead of preserving the original order. edit file ... Edit the specified file(s) in $EDITOR after adding it (them) to the topmost patch. files [-v] [-a] [-l] [--combine patch] [patch] Print the list of files that the topmost or specified patch changes. -a List all files in all applied patches. -l Add patch name to output. -v Verbose, more user friendly output. --combine patch Create a listing for all patches between this patch and the topmost or specified patch. A patch name of `-' is equivalent to specifying the first applied patch. fold [-R] [-q] [-f] [-p strip-level] Integrate the patch read from standard input into the topmost patch: After making sure that all files modified are part of the topmost patch, the patch is applied with the specified strip level (which defaults to 1). -R Apply patch in reverse. -q Quiet operation. -f Force apply, even if the patch has rejects. Unless in quiet mode, apply the patch interactively: the patch utility may ask questions. -p strip-level The number of pathname components to strip from file names when applying patchfile. fork [new_name] Fork the topmost patch. Forking a patch means creating a verbatim copy of it under a new name, and use that new name instead of the original one in the current series. This is useful when a patch has to be modified, but the original version of it should be preserved, e.g. because it is used in another series, or for the history. A typical sequence of commands would be: fork, edit, refresh. If new_name is missing, the name of the forked patch will be the current patch name, followed by `-2'. If the patch name already ends in a dash-and-number, the number is further incremented (e.g., patch.diff, patch-2.diff, patch-3.diff). graph [--all] [--reduce] [--lines[=num]] [--edge-labels=files] [-T ps] [patch] Generate a dot(1) directed graph showing the dependencies between applied patches. A patch depends on another patch if both touch the same file or, with the --lines option, if their modifications overlap. Unless otherwise specified, the graph includes all patches that the topmost patch depends on. When a patch name is specified, instead of the topmost patch, create a graph for the specified patch. The graph will include all other patches that this patch depends on, as well as all patches that depend on this patch. --all Generate a graph including all applied patches and their dependencies. (Unapplied patches are not included.) --reduce Eliminate transitive edges from the graph. --lines[=num] Compute dependencies by looking at the lines the patches modify. Unless a different num is specified, two lines of context are included. --edge-labels=files Label graph edges with the file names that the adjacent patches modify. -T ps Directly produce a PostScript output file. grep [-h|options] {pattern} Grep through the source files, recursively, skipping patches and quilt meta-information. If no filename argument is given, the whole source tree is searched. Please see the grep(1) manual page for options. -h Print this help. The grep -h option can be passed after a double-dash (--). Search expressions that start with a dash can be passed after a second double-dash (-- --). header [-a|-r|-e] [--backup] [--strip-diffstat] [--strip- trailing-whitespace] [patch] Print or change the header of the topmost or specified patch. -a, -r, -e Append to (-a) or replace (-r) the exiting patch header, or edit (-e) the header in $EDITOR. If none of these options is given, print the patch header. --strip-diffstat Strip diffstat output from the header. --strip-trailing-whitespace Strip trailing whitespace at the end of lines of the header. --backup Create a backup copy of the old version of a patch as patch~. import [-p num] [-R] [-P patch] [-f] [-d {o|a|n}] patchfile ... Import external patches. The patches will be inserted following the current top patch, and must be pushed after import to apply them. -p num Number of directory levels to strip when applying (default=1) -R Apply patch in reverse. -P patch Patch filename to use inside quilt. This option can only be used when importing a single patch. -f Overwrite/update existing patches. -d {o|a|n} When overwriting in existing patch, keep the old (o), all (a), or new (n) patch header. If both patches include headers, this option must be specified. This option is only effective when -f is used. mail {--mbox file|--send} [-m text] [-M file] [--prefix prefix] [--sender ...] [--from ...] [--to ...] [--cc ...] [--bcc ...] [--subject ...] [--reply-to message] [--charset ...] [--signature file] [first_patch [last_patch]] Create mail messages from a specified range of patches, or all patches in the series file, and either store them in a mailbox file, or send them immediately. The editor is opened with a template for the introduction. Please see /usr/local/share/doc/quilt/README.MAIL for details. When specifying a range of patches, a first patch name of `-' denotes the first, and a last patch name of `-' denotes the last patch in the series. -m text Text to use as the text in the introduction. When this option is used, the editor will not be invoked, and the patches will be processed immediately. -M file Like the -m option, but read the introduction from file. --prefix prefix Use an alternate prefix in the bracketed part of the subjects generated. Defaults to `patch'. --mbox file Store all messages in the specified file in mbox format. The mbox can later be sent using formail, for example. --send Send the messages directly. --sender The envelope sender address to use. The address must be of the form `[email protected]'. No display name is allowed. --from, --subject The values for the From and Subject headers to use. If no --from option is given, the value of the --sender option is used. --to, --cc, --bcc Append a recipient to the To, Cc, or Bcc header. --charset Specify a particular message encoding on systems which don't use UTF-8 or ISO-8859-15. This character encoding must match the one used in the patches. --signature file Append the specified signature to messages (defaults to ~/.signature if found; use `-' for no signature). --reply-to message Add the appropriate headers to reply to the specified message. new [-p n|-p ab] {patchname} Create a new patch with the specified file name, and insert it after the topmost patch. The name can be prefixed with a sub-directory name, allowing for grouping related patches together. -p n Create a -p n style patch (-p0 or -p1 are supported). -p ab Create a -p1 style patch, but use a/file and b/file as the original and new filenames instead of the default dir.orig/file and dir/file names. Quilt can be used in sub-directories of a source tree. It determines the root of a source tree by searching for a directory above the current working directory. Create a directory in the intended root directory if quilt chooses a top-level directory that is too high up in the directory tree. next [patch] Print the name of the next patch after the specified or topmost patch in the series file. patches [-v] [--color[=always|auto|never]] {file} [files...] Print the list of patches that modify any of the specified files. (Uses a heuristic to determine which files are modified by unapplied patches. Note that this heuristic is much slower than scanning applied patches.) -v Verbose, more user friendly output. --color[=always|auto|never] Use syntax coloring (auto activates it only if the output is a tty). pop [-afRqv] [--refresh] [num|patch] Remove patch(es) from the stack of applied patches. Without options, the topmost patch is removed. When a number is specified, remove the specified number of patches. When a patch name is specified, remove patches until the specified patch end up on top of the stack. Patch names may include the patches/ prefix, which means that filename completion can be used. -a Remove all applied patches. -f Force remove. The state before the patch(es) were applied will be restored from backup files. -R Always verify if the patch removes cleanly; don't rely on timestamp checks. -q Quiet operation. -v Verbose operation. --refresh Automatically refresh every patch before it gets unapplied. previous [patch] Print the name of the previous patch before the specified or topmost patch in the series file. push [-afqvm] [--fuzz=N] [--merge[=merge|diff3]] [--leave- rejects] [--color[=always|auto|never]] [--refresh] [num|patch] Apply patch(es) from the series file. Without options, the next patch in the series file is applied. When a number is specified, apply the specified number of patches. When a patch name is specified, apply all patches up to and including the specified patch. Patch names may include the patches/ prefix, which means that filename completion can be used. -a Apply all patches in the series file. -q Quiet operation. -f Force apply, even if the patch has rejects. -v Verbose operation. --fuzz=N Set the maximum fuzz factor (default: 2). -m, --merge[=merge|diff3] Merge the patch file into the original files (see patch(1)). --leave-rejects Leave around the reject files patch produced, even if the patch is not actually applied. --color[=always|auto|never] Use syntax coloring (auto activates it only if the output is a tty). --refresh Automatically refresh every patch after it was successfully applied. refresh [-p n|-p ab] [-u|-U num|-c|-C num] [-z[new_name]] [-f] [--no-timestamps] [--no-index] [--diffstat] [--sort] [--backup] [--strip-trailing-whitespace] [patch] Refreshes the specified patch, or the topmost patch by default. Documentation that comes before the actual patch in the patch file is retained. It is possible to refresh patches that are not on top. If any patches on top of the patch to refresh modify the same files, the script aborts by default. Patches can still be refreshed with -f. In that case this script will print a warning for each shadowed file, changes by more recent patches will be ignored, and only changes in files that have not been modified by any more recent patches will end up in the specified patch. -p n Create a -p n style patch (-p0 or -p1 supported). -p ab Create a -p1 style patch, but use a/file and b/file as the original and new filenames instead of the default dir.orig/file and dir/file names. -u, -U num, -c, -C num Create a unified diff (-u, -U) with num lines of context. Create a context diff (-c, -C) with num lines of context. The number of context lines defaults to 3. -z[new_name] Create a new patch containing the changes instead of refreshing the topmost patch. If no new name is specified, `-2' is added to the original patch name, etc. (See the fork command.) --no-timestamps Do not include file timestamps in patch headers. --no-index Do not output Index: lines. --diffstat Add a diffstat section to the patch header, or replace the existing diffstat section. -f Enforce refreshing of a patch that is not on top. --backup Create a backup copy of the old version of a patch as patch~. --sort Sort files by their name instead of preserving the original order. --strip-trailing-whitespace Strip trailing whitespace at the end of lines. remove [-P patch] {file} ... Remove one or more files from the topmost or named patch. Files that are modified by patches on top of the specified patch cannot be removed. -P patch Remove named files from the named patch. rename [-P patch] new_name Rename the topmost or named patch. -P patch Patch to rename. revert [-P patch] {file} ... Revert uncommitted changes to the topmost or named patch for the specified file(s): after the revert, 'quilt diff -z' will show no differences for those files. Changes to files that are modified by patches on top of the specified patch cannot be reverted. -P patch Revert changes in the named patch. series [--color[=always|auto|never]] [-v] Print the names of all patches in the series file. --color[=always|auto|never] Use syntax coloring (auto activates it only if the output is a tty). -v Verbose, more user friendly output. setup [-d path-prefix] [-v] [--sourcedir dir] [--fuzz=N] [--slow|--fast] {specfile|seriesfile} Initializes a source tree from an rpm spec file or a quilt series file. -d Optional path prefix for the resulting source tree. --sourcedir Directory that contains the package sources. Defaults to `.'. -v Verbose debug output. --fuzz=N Set the maximum fuzz factor (needs rpm 4.6 or later). --slow Use the original, slow method to process the spec file. In this mode, rpmbuild generates a working tree in a temporary directory while all its actions are recorded, and then everything is replayed from scratch in the target directory. --fast Use the new, faster method to process the spec file. In this mode, rpmbuild is told to generate a working tree directly in the target directory. This is the default (since quilt version 0.67). The setup command is only guaranteed to work properly on spec files where applying all the patches is the last thing done in the %prep section. This is a design limitation due to the fact that quilt can only operate on patches. If other commands in the %prep section modify the patched files, this must happen first, otherwise you won't be able to push the patch series. snapshot [-d] Take a snapshot of the current working state. After taking the snapshot, the tree can be modified in the usual ways, including pushing and popping patches. A diff against the tree at the moment of the snapshot can be generated with `quilt diff --snapshot'. -d Only remove current snapshot. top Print the name of the topmost patch on the current stack of applied patches. unapplied [patch] Print a list of patches that are not applied, or all patches that follow the specified patch in the series file. upgrade Upgrade the meta-data in a working tree from an old version of quilt to the current version. This command is only needed when the quilt meta-data format has changed, and the working tree still contains old-format meta-data. In that case, quilt will request to run `quilt upgrade'. OPTIONS top These options are common to all quilt commands. -h Print a usage message (for the given command, if one is specified, otherwise for quilt itself) and exit. --quiltrc file Use file as the configuration file instead of ~/.quiltrc (or /etc/quilt.quiltrc if ~/.quiltrc does not exist). The special value - causes quilt not to read any configuration file. --trace Run the command in the shell's trace mode (-x) for debugging of internal operations. --version Print the version number and exit. EXIT STATUS top The exit status is 0 if the requested operation completed successfully, or 1 in case of error. An exit status of 2 indicates that quilt did not do anything to complete the command. This happens in particular when asking quilt to push when the whole stack is already pushed, or to pop when the whole stack is already popped. This behavior is intended to ease scripting with quilt. ENVIRONMENT top Quilt recognizes the following variables: EDITOR Specify the program to run to edit files; for instance, with quilt edit or quilt header -e. LESS Specify the arguments used to invoke the less(1) pager. Defaults to -FRSX. FILES top Example of working tree project-1.2.3/ patches/ series (list of patches to apply) patch1.diff (one particular patch) patch2.diff ... .pc/ .quilt_patches (content of QUILT_PATCHES) .quilt_series (content of QUILT_SERIES) patch1.diff/ (copy of patched files) ... patch2.diff/ ... ... ... The patches directory is precious as it contains all your patches as well as the order in which they should be applied. The .pc directory contains metadata about the current state of your patch series. Changing its content is not advised. This directory can usually be regenerated from the initial files and the content of the patches directory (provided that all patches were regenerated before the removal). Configuration file Upon startup, quilt evaluates the file specified with the --quiltrc option; if that option is not given, the file .quiltrc in the user's home directory is used, and if that does not exist, /etc/quilt.quiltrc is read. This file is a bash(1) script. EDITOR and LESS can be overridden here if desired; see ENVIRONMENT, above. Define a variable of the form QUILT_COMMAND_ARGS to specify default options to be passed to any quilt command (in uppercase). For example, QUILT_DIFF_ARGS="--color=auto" causes the output of quilt diff to be syntax-colored when writing to a terminal. QUILT_DIFF_OPTS Additional options that quilt shall pass to GNU diff when generating patches. A useful setting for C source code is -p, which causes GNU diff to show in the resulting patch which function a change is in. QUILT_PATCH_OPTS Additional options that quilt shall pass to GNU patch when applying patches. For example, recent versions of GNU patch support the --reject-format=unified option for generating reject files in unified diff style (older patch versions used --unified-reject-files for that). You may also want to add the -E option if you have issues with quilt not deleting empty files when you think it should. The documentation of GNU patch says that normally this option is unnecessary, but when patch is in POSIX mode or if the patch format doesn't distinguish empty files from deleted files, patch deletes empty files only if the -E option is given. Beware that when passing -E to patch, quilt will no longer be able to deal with empty files, which is why using -E is no longer the default. QUILT_DIFFSTAT_OPTS indicates additional options that quilt shall pass to diffstat(1) when generating patch statistics. For example, -f0 can be used for an alternative output format. Recent versions of diffstat also support alternative rounding methods (-r1, -r2). QUILT_PC The location of backup files and any other data relating to the current state of the working directory from quilt's perspective. Defaults to .pc. QUILT_PATCHES The location of patch files, defaulting to patches. QUILT_SERIES The name of the series file, defaulting to series. Unless an absolute path is used, the search algorithm described above applies. QUILT_PATCHES_PREFIX Boolean flag; if set to anything, quilt will prefix any patch name it prints with its directory (QUILT_PATCHES). QUILT_NO_DIFF_INDEX Boolean flag; if set to anything, no Index: line is prepended to patches generated by quilt. This is shorthand for adding --no-index to both QUILT_DIFF_ARGS and QUILT_REFRESH_ARGS. QUILT_NO_DIFF_TIMESTAMPS Boolean flag; if set to anything, no timestamps are included in headers when generating patches. This is shorthand for adding --no-timestamps to both QUILT_DIFF_ARGS and QUILT_REFRESH_ARGS. QUILT_PAGER The pager quilt shall use for commands which produce paginated output. If unset, the value of GIT_PAGER or, failing that, PAGER is used. If none of these variables is set, less -R is used. An empty value indicates that no pager should be used. QUILT_COLORS A sequence of definitions that directs quilt which ANSI escape sequences to associate with an output context, overriding the defaults. The most common use is to set colors (thus the name of this variable), but other attributes exist, such as bold or reverse. To override one or more settings, set QUILT_COLORS to a colon-separated list of elements, each of the form format- name=digit-sequence[;...]. Each digit-sequence should be a SGR (Select Graphic Rendition) value supported by your terminal. The standardized SGR values were specified by ANSI and incorporated into ISO-6429 and ECMA-48 (8.3.117). The colors have standard names but their values were not defined within a color space; their precise appearance will vary and may be customizable in your terminal (emulator). Recognized format-names, along with the quilt commands that use them, their use contexts, and default values, follow. format-name command context default diff_add diff added lines 36 (cyan) diff_cctx diff asterisk sequences 33 (yellow) diff_ctx diff text after hunk 35 (magenta) diff_hdr diff index line 32 (green) diff_hunk diff hunk header 33 (yellow) diff_mod diff modified lines 35 (magenta) diff_rem diff removed lines 35 (magenta) patch_fail push failure message 31 (red) patch_fuzz push fuzz information 35 (magenta) patch_offs push offset information 33 (yellow) series_app series applied patch names 32 (green) series_top series top patch name 33 (yellow) series_una series unapplied patch names 0 (none) All format-names used by the series command are also used by the patches command. The special format-name clear is used to turn off special graphic renditions and return to the terminal defaults. Changing its definition should not be necessary for any terminal that claims to support ANSI escape sequences. If your terminal is corrupted despite your best efforts, try the command tput sgr0 to restore the default graphic rendition. As an example, one can put the following in ~/.quiltrc (or /etc/quilt.quiltrc): QUILT_DIFF_ARGS="--color" # Render diff file headers in bold blue over yellow. # Render diff hunk headers in "negative image" yellow. # Render failed patches with a red background. QUILT_COLORS="diff_hdr=1;34;43:diff_hunk=7;33:patch_fail=41" AUTHORS top Quilt started as a series of scripts written by Andrew Morton (patch-scripts). Based on Andrew's ideas, Andreas Grnbacher completely rewrote the scripts, with the help of several other contributors (see the file AUTHORS in the distribution). This man page was written by Martin Quinson, based on information found in the PDF documentation, and in the help message of each command. EXAMPLES top Please refer to the PDF documentation for a full example of use (under SEE ALSO below). SEE ALSO top How to Survive with Many Patches, or: Introduction to Quilt is installed at /usr/local/share/doc/quilt/quilt.pdf. Note that some distributors compress this file. zxpdf(1) can be used to display compressed PDF files. The GNU Diffutils manual, Comparing and Merging Files https://www.gnu.org/software/diffutils/manual/, documents diff and patch in detail. Control Functions for Coded Character Sets (ECMA-48) https://www.ecma-international.org/publications/standards/Ecma-048.htm specifies the ANSI escape sequences used by QUILT_COLORS; section 8.3.117 will be of the most interest. See console_codes(4) for a more convenient, if less canonical, resource. diff(1), diffstat(1), guards(1), patch(1) COLOPHON top This page is part of the quilt (tool to manage series of patches) project. Information about the project can be found at http://savannah.nongnu.org/projects/quilt. If you have a bug report for this manual page, see http://savannah.nongnu.org/bugs/?group=quilt. This page was obtained from the project's upstream Git repository git://git.savannah.nongnu.org/quilt.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-08-10.) 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] quilt Dec 17, 2013 quilt(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. | # quilt\n\n> Manage a series of patches.\n> More information: <https://savannah.nongnu.org/projects/quilt>.\n\n- Import an existing patch from a file:\n\n`quilt import {{path/to/filename.patch}}`\n\n- Create a new patch:\n\n`quilt new {{filename.patch}}`\n\n- Add a file to the current patch:\n\n`quilt add {{path/to/file}}`\n\n- After editing the file, refresh the current patch with the changes:\n\n`quilt refresh`\n\n- Apply all the patches in the series file:\n\n`quilt push -a`\n\n- Remove all applied patches:\n\n`quilt pop -a`\n |
quota | quota(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training quota(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | DIAGNOSTICS | FILES | SEE ALSO | COLOPHON QUOTA(1) General Commands Manual QUOTA(1) NAME top quota - display disk usage and limits SYNOPSIS top quota [ -F format-name ] [ -guqvswi ] [ -l | [ -QAm ]] quota [ -F format-name ] [ -qvswi ] [ -l | [ -QAm ]] -u user... quota [ -F format-name ] [ -qvswi ] [ -l | [ -QAm ]] -g group... quota [ -F format-name ] [ -qvswi ] [ -l | [ -QAm ]] -P project... quota [ -F format-name ] [ -qvswugQm ] -f filesystem... DESCRIPTION top quota displays users' disk usage and limits. By default only the user quotas are printed. By default space usage and limits are shown in kbytes (and are named blocks for historical reasons). quota reports the quotas of all the filesystems listed in /etc/mtab. For filesystems that are NFS-mounted a call to the rpc.rquotad on the server machine is performed to get the information. OPTIONS top -F, --format=format-name Show quota for specified format (ie. don't perform format autodetection). Possible format names are: vfsold Original quota format with 16-bit UIDs / GIDs, vfsv0 Quota format with 32-bit UIDs / GIDs, 64-bit space usage, 32-bit inode usage and limits, vfsv1 Quota format with 64-bit quota limits and usage, rpc (quota over NFS), xfs (quota on XFS filesystem) -g, --group Print group quotas for the group of which the user is a member. The optional group argument(s) restricts the display to the specified group(s). -u, --user flag is equivalent to the default. -P, --project Print project quotas for the specified project. -v, --verbose will display quotas on filesystems where no storage is allocated. -s, --human-readable[=units] option will make quota(1) try to choose units for showing limits, used space and used inodes. Units can be also specified explicitely by an optional argument in format [ kgt ],[ kgt ] where the first character specifies space units and the second character specifies inode units. --always-resolve Always try to translate user / group name to uid / gid even if the name is composed of digits only. -p, --raw-grace When user is in grace period, report time in seconds since epoch when his grace time runs out (or has run out). Field is '0' when no grace time is in effect. This is especially useful when parsing output by a script. -i, --no-autofs ignore mountpoints mounted by automounter -l, --local-only report quotas only on local filesystems (ie. ignore NFS mounted filesystems). -A, --all-nfs report quotas for all NFS filesystems even if they report to be on the same device. -f, --filesystem-list report quotas only for filesystems specified on command line. --filesystem=path report quotas only for filesystem path. This option can be specified multiple types and quota will be reported for each specified filesystem. Unlike command line option -f remaining command like arguments are still treated as user / group / project names to report. -m, --no-mixed-pathnames Currently, pathnames of NFSv4 mountpoints are sent without leading slash in the path. rpc.rquotad uses this to recognize NFSv4 mounts and properly prepend pseudoroot of NFS filesystem to the path. If you specify this option, quota will always send paths with a leading slash. This can be useful for legacy reasons but be aware that quota over RPC will stop working if you are using new rpc.rquotad. -q, --quiet Print a more terse message, containing only information on filesystems where usage is over quota. -Q, --quiet-refuse Do not print error message if connection to rpc.rquotad is refused (usually this happens when rpc.rquotad is not running on the server). -w, --no-wrap Do not wrap the line if the device name is too long. This can be useful when parsing the output of quota(1) by a script. --show-mntpoint Show also mount point as a filesystem identification. --hide-device Do not show device name in a filesystem identification. Specifying both -g and -u displays both the user quotas and the group quotas (for the user). Only the super-user may use the -u flag and the optional user argument to view the limits of other users. Also viewing of project quota usage and limits is limited to super-user only. Non-super-users can use the -g flag and optional group argument to view only the limits of groups of which they are members. The -q flag takes precedence over the -v flag. DIAGNOSTICS top If quota exits with a non-zero status, one or more filesystems are over quota. FILES top aquota.user or aquota.group quota file at the filesystem root (version 2 quota, non- XFS filesystems) quota.user or quota.group quota file at the filesystem root (version 1 quota, non- XFS filesystems) /etc/mtab default filesystems SEE ALSO top quotactl(2), fstab(5), edquota(8), quotacheck(8), quotaon(8), quota_nld(8), repquota(8), warnquota(8), setquota(8) COLOPHON top This page is part of the quota (Linux Diskquota Tools) project. Information about the project can be found at [unknown -- if you know, please contact [email protected]] 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/utils/quota/quota-tools.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2022-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] QUOTA(1) Pages that refer to this page: quota(1), quotasync(1), quotactl(2), rquota(3), convertquota(8), edquota(8), quotacheck(8), quota_nld(8), quotastats(8), repquota(8), rpc.rquotad(8), setquota(8), warnquota(8), xqmstats(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. | # quota\n\n> Display users' disk space usage and allocated limits.\n> More information: <https://manned.org/quota>.\n\n- Show disk quotas in human-readable units for the current user:\n\n`quota -s`\n\n- Verbose output (also display quotas on filesystems where no storage is allocated):\n\n`quota -v`\n\n- Quiet output (only display quotas on filesystems where usage is over quota):\n\n`quota -q`\n\n- Print quotas for the groups of which the current user is a member:\n\n`quota -g`\n\n- Show disk quotas for another user:\n\n`sudo quota -u {{username}}`\n |
quotacheck | quotacheck(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training quotacheck(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | NOTE | SEE ALSO | FILES | AUTHOR | COLOPHON quotacheck(8) System Manager's Manual quotacheck(8) NAME top quotacheck - scan a filesystem for disk usage, create, check and repair quota files SYNOPSIS top quotacheck [ -gubcfinvdMmR ] [ -F quota-format ] -a | filesystem DESCRIPTION top quotacheck examines each filesystem, builds a table of current disk usage, and compares this table against that recorded in the disk quota file for the filesystem (this step is omitted if option -c is specified). If any inconsistencies are detected, both the quota file and the current system copy of the incorrect quotas are updated (the latter only occurs if an active filesystem is checked which is not advised). By default, only user quotas are checked. quotacheck expects each filesystem to be checked to have quota files named [a]quota.user and [a]quota.group located at the root of the associated filesystem. If a file is not present, quotacheck will create it. If the quota file is corrupted, quotacheck tries to save as much data as possible. Rescuing data may need user intervention. With no additional options quotacheck will simply exit in such a situation. When in interactive mode (option -i) , the user is asked for advice. Advice can also be provided from command line (see option -n) , which is useful when quotacheck is run automatically (ie. from script) and failure is unacceptable. quotacheck should be run each time the system boots and mounts non-valid filesystems. This is most likely to happen after a system crash. It is strongly recommended to run quotacheck with quotas turned off for the filesystem. Otherwise, possible damage or loss to data in the quota files can result. It is also unwise to run quotacheck on a live filesystem as actual usage may change during the scan. To prevent this, quotacheck tries to remount the filesystem read-only before starting the scan. After the scan is done it remounts the filesystem read-write. You can disable this with option -m. You can also make quotacheck ignore the failure to remount the filesystem read-only with option -M. OPTIONS top -b, --backup Forces quotacheck to make backups of the quota file before writing the new data. -v, --verbose quotacheck reports its operation as it progresses. Normally it operates silently. If the option is specified twice, also the current directory is printed (note that printing can slow down the scan measurably). -d, --debug Enable debugging mode. It will result in a lot of information which can be used in debugging the program. The output is very verbose and the scan will be slow. -u, --user Only user quotas listed in /etc/mtab or on the filesystems specified are to be checked. This is the default action. -g, --group Only group quotas listed in /etc/mtab or on the filesystems specified are to be checked. -c, --create-files Don't read existing quota files. Just perform a new scan and save it to disk. quotacheck also skips scanning of old quota files when they are not found. -f, --force Forces checking and writing of new quota files on filesystems with quotas enabled. This is not recommended as the created quota files may be out of sync. -M, --try-remount This flag forces checking of filesystem in read-write mode if a remount fails. Do this only when you are sure no process will write to a filesystem while scanning. -m, --no-remount Don't try to remount filesystem read-only. See comment with option -M. -i, --interactive Interactive mode. By default quotacheck exits when it finds an error. In interactive mode user is asked for input instead. See option -n. -n, --use-first-dquot If the quota files become corrupted, it is possible for duplicate entries for a single user or group ID to exist. Normally in this case, quotacheck exits or asks user for input. When this option is set, the first entry found is always used (this option works in interactive mode too). -F, --format=format-name Check and fix quota files of specified format (ie. don't perform format auto-detection). This is recommended as detection might not work well on corrupted quota files. Possible format names are: vfsold Original quota format with 16-bit UIDs / GIDs, vfsv0 Quota format with 32-bit UIDs / GIDs, 64-bit space usage, 32-bit inode usage and limits, vfsv1 Quota format with 64-bit quota limits and usage, rpc (quota over NFS), xfs (quota on XFS filesystem) -a, --all Check all mounted non-NFS filesystems in /etc/mtab -R, --exclude-root When used together with the -a option, all filesystems except for the root filesystem are checked for quotas. NOTE top quotacheck should only be run by super-user. Non-privileged users are presumably not allowed to read all the directories on the given filesystem. SEE ALSO top quota(1), quotactl(2), fstab(5), quotaon(8), repquota(8), convertquota(8), setquota(8), edquota(8), fsck(8), efsck(8), e2fsck(8), xfsck(8) FILES top aquota.user or aquota.group located at filesystem root with quotas (version 2 quota, non-XFS filesystems) quota.user or quota.group located at filesystem root with quotas (version 1 quota, non-XFS filesystems) /etc/mtab names and locations of mounted filesystems AUTHOR top Jan Kara <[email protected]> Based on old quotacheck by: Edvard Tuinder <[email protected]> Marco van Wieringen <[email protected]> COLOPHON top This page is part of the quota (Linux Diskquota Tools) project. Information about the project can be found at [unknown -- if you know, please contact [email protected]] 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/utils/quota/quota-tools.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2022-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] Fri Jul 20 2001 quotacheck(8) Pages that refer to this page: quota(1), quotasync(1), quotactl(2), convertquota(8), edquota(8), repquota(8), setquota(8), systemd-quotacheck.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. | # quotacheck\n\n> Scan a filesystem for disk usage; create, check and repair quota files.\n> It is best to run quota check with quotas turned off to prevent damage or loss to quota files.\n> More information: <https://manned.org/quotacheck>.\n\n- Check quotas on all mounted non-NFS filesystems:\n\n`sudo quotacheck --all`\n\n- Force check even if quotas are enabled (this can cause damage or loss to quota files):\n\n`sudo quotacheck --force {{mountpoint}}`\n\n- Check quotas on a given filesystem in debug mode:\n\n`sudo quotacheck --debug {{mountpoint}}`\n\n- Check quotas on a given filesystem, displaying the progress:\n\n`sudo quotacheck --verbose {{mountpoint}}`\n\n- Check user quotas:\n\n`sudo quotacheck --user {{user}} {{mountpoint}}`\n\n- Check group quotas:\n\n`sudo quotacheck --group {{group}} {{mountpoint}}`\n |
read | read(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training read(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 READ(1P) POSIX Programmer's Manual READ(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 read read from standard input into shell variables SYNOPSIS top read [-r] var... DESCRIPTION top The read utility shall read a single logical line from standard input into one or more shell variables. By default, unless the -r option is specified, <backslash> shall act as an escape character. An unescaped <backslash> shall preserve the literal value of the following character, with the exception of a <newline>. If a <newline> follows the <backslash>, the read utility shall interpret this as line continuation. The <backslash> and <newline> shall be removed before splitting the input into fields. All other unescaped <backslash> characters shall be removed after splitting the input into fields. If standard input is a terminal device and the invoking shell is interactive, read shall prompt for a continuation line when it reads an input line ending with a <backslash> <newline>, unless the -r option is specified. The terminating <newline> (if any) shall be removed from the input and the results shall be split into fields as in the shell for the results of parameter expansion (see Section 2.6.5, Field Splitting); the first field shall be assigned to the first variable var, the second field to the second variable var, and so on. If there are fewer fields than there are var operands, the remaining vars shall be set to empty strings. If there are fewer vars than fields, the last var shall be set to a value comprising the following elements: * The field that corresponds to the last var in the normal assignment sequence described above * The delimiter(s) that follow the field corresponding to the last var * The remaining fields and their delimiters, with trailing IFS white space ignored The setting of variables specified by the var operands shall affect the current shell execution environment; see Section 2.12, Shell Execution Environment. If it is called in a subshell or separate utility execution environment, such as one of the following: (read foo) nohup read ... find . -exec read ... \; it shall not affect the shell variables in the caller's environment. OPTIONS top The read utility shall conform to the Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines. The following option is supported: -r Do not treat a <backslash> character in any special way. Consider each <backslash> to be part of the input line. OPERANDS top The following operand shall be supported: var The name of an existing or nonexisting shell variable. STDIN top The standard input shall be a text file. INPUT FILES top None. ENVIRONMENT VARIABLES top The following environment variables shall affect the execution of read: IFS Determine the internal field separators used to delimit fields; see Section 2.5.3, Shell Variables. 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. PS2 Provide the prompt string that an interactive shell shall write to standard error when a line ending with a <backslash> <newline> is read and the -r option was not specified. ASYNCHRONOUS EVENTS top Default. STDOUT top Not used. STDERR top The standard error shall be used for diagnostic messages and prompts for continued input. OUTPUT FILES top None. EXTENDED DESCRIPTION top None. EXIT STATUS top The following exit values shall be returned: 0 Successful completion. >0 End-of-file was detected or an error occurred. CONSEQUENCES OF ERRORS top Default. The following sections are informative. APPLICATION USAGE top The -r option is included to enable read to subsume the purpose of the line utility, which is not included in POSIX.12008. EXAMPLES top The following command: while read -r xx yy do printf "%s %s\n$yy$xx" done < input_file prints a file with the first field of each line moved to the end of the line. RATIONALE top The read utility historically has been a shell built-in. It was separated off into its own utility to take advantage of the richer description of functionality introduced by this volume of POSIX.12017. Since read 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: (read foo) nohup read ... find . -exec read ... \; it does not affect the shell variables in the environment of the caller. Although the standard input is required to be a text file, and therefore will always end with a <newline> (unless it is an empty file), the processing of continuation lines when the -r option is not used can result in the input not ending with a <newline>. This occurs if the last line of the input file ends with a <backslash> <newline>. It is for this reason that ``if any'' is used in ``The terminating <newline> (if any) shall be removed from the input'' in the description. It is not a relaxation of the requirement for standard input to be a text file. FUTURE DIRECTIONS top None. SEE ALSO top Chapter 2, Shell Command Language 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 READ(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. | # read\n\n> Shell builtin for retrieving data from `stdin`.\n> More information: <https://manned.org/read.1p>.\n\n- Store data that you type from the keyboard:\n\n`read {{variable}}`\n\n- Store each of the next lines you enter as values of an array:\n\n`read -a {{array}}`\n\n- Specify the number of maximum characters to be read:\n\n`read -n {{character_count}} {{variable}}`\n\n- Use a specific character as a delimiter instead of a new line:\n\n`read -d {{new_delimiter}} {{variable}}`\n\n- Do not let backslash (\\) act as an escape character:\n\n`read -r {{variable}}`\n\n- Display a prompt before the input:\n\n`read -p "{{Enter your input here: }}" {{variable}}`\n\n- Do not echo typed characters (silent mode):\n\n`read -s {{variable}}`\n\n- Read `stdin` and perform an action on every line:\n\n`while read line; do echo "$line"; done`\n |
readelf | readelf(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training readelf(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | SEE ALSO | COPYRIGHT | COLOPHON READELF(1) GNU Development Tools READELF(1) NAME top readelf - display information about ELF files SYNOPSIS top readelf [-a|--all] [-h|--file-header] [-l|--program-headers|--segments] [-S|--section-headers|--sections] [-g|--section-groups] [-t|--section-details] [-e|--headers] [-s|--syms|--symbols] [--dyn-syms|--lto-syms] [--sym-base=[0|8|10|16]] [--demangle=style|--no-demangle] [--quiet] [--recurse-limit|--no-recurse-limit] [-U method|--unicode=method] [-n|--notes] [-r|--relocs] [-u|--unwind] [-d|--dynamic] [-V|--version-info] [-A|--arch-specific] [-D|--use-dynamic] [-L|--lint|--enable-checks] [-x <number or name>|--hex-dump=<number or name>] [-p <number or name>|--string-dump=<number or name>] [-R <number or name>|--relocated-dump=<number or name>] [-z|--decompress] [-c|--archive-index] [-w[lLiaprmfFsoORtUuTgAck]| --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links]] [-wK|--debug-dump=follow-links] [-wN|--debug-dump=no-follow-links] [-wD|--debug-dump=use-debuginfod] [-wE|--debug-dump=do-not-use-debuginfod] [-P|--process-links] [--dwarf-depth=n] [--dwarf-start=n] [--ctf=section] [--ctf-parent=section] [--ctf-symbols=section] [--ctf-strings=section] [--sframe=section] [-I|--histogram] [-v|--version] [-W|--wide] [-T|--silent-truncation] [-H|--help] elffile... DESCRIPTION top readelf displays information about one or more ELF format object files. The options control what particular information to display. elffile... are the object files to be examined. 32-bit and 64-bit ELF files are supported, as are archives containing ELF files. This program performs a similar function to objdump but it goes into more detail and it exists independently of the BFD library, so if there is a bug in BFD then readelf will not be affected. OPTIONS top The long and short forms of options, shown here as alternatives, are equivalent. At least one option besides -v or -H must be given. -a --all Equivalent to specifying --file-header, --program-headers, --sections, --symbols, --relocs, --dynamic, --notes, --version-info, --arch-specific, --unwind, --section-groups and --histogram. Note - this option does not enable --use-dynamic itself, so if that option is not present on the command line then dynamic symbols and dynamic relocs will not be displayed. -h --file-header Displays the information contained in the ELF header at the start of the file. -l --program-headers --segments Displays the information contained in the file's segment headers, if it has any. --quiet Suppress "no symbols" diagnostic. -S --sections --section-headers Displays the information contained in the file's section headers, if it has any. -g --section-groups Displays the information contained in the file's section groups, if it has any. -t --section-details Displays the detailed section information. Implies -S. -s --symbols --syms Displays the entries in symbol table section of the file, if it has one. If a symbol has version information associated with it then this is displayed as well. The version string is displayed as a suffix to the symbol name, preceded by an @ character. For example foo@VER_1. If the version is the default version to be used when resolving unversioned references to the symbol then it is displayed as a suffix preceded by two @ characters. For example foo@@VER_2. --dyn-syms Displays the entries in dynamic symbol table section of the file, if it has one. The output format is the same as the format used by the --syms option. --lto-syms Displays the contents of any LTO symbol tables in the file. --sym-base=[0|8|10|16] Forces the size field of the symbol table to use the given base. Any unrecognized options will be treated as 0. --sym-base=0 represents the default and legacy behaviour. This will output sizes as decimal for numbers less than 100000. For sizes 100000 and greater hexadecimal notation will be used with a 0x prefix. --sym-base=8 will give the symbol sizes in octal. --sym-base=10 will always give the symbol sizes in decimal. --sym-base=16 will always give the symbol sizes in hexadecimal with a 0x prefix. -C --demangle[=style] Decode (demangle) low-level symbol names into user-level names. This makes C++ function names readable. Different compilers have different mangling styles. The optional demangling style argument can be used to choose an appropriate demangling style for your compiler. --no-demangle Do not demangle low-level symbol names. This is the default. --recurse-limit --no-recurse-limit --recursion-limit --no-recursion-limit Enables or disables a limit on the amount of recursion performed whilst demangling strings. Since the name mangling formats allow for an infinite level of recursion it is possible to create strings whose decoding will exhaust the amount of stack space available on the host machine, triggering a memory fault. The limit tries to prevent this from happening by restricting recursion to 2048 levels of nesting. The default is for this limit to be enabled, but disabling it may be necessary in order to demangle truly complicated names. Note however that if the recursion limit is disabled then stack exhaustion is possible and any bug reports about such an event will be rejected. -U [d|i|l|e|x|h] --unicode=[default|invalid|locale|escape|hex|highlight] Controls the display of non-ASCII characters in identifier names. The default (--unicode=locale or --unicode=default) is to treat them as multibyte characters and display them in the current locale. All other versions of this option treat the bytes as UTF-8 encoded values and attempt to interpret them. If they cannot be interpreted or if the --unicode=invalid option is used then they are displayed as a sequence of hex bytes, encloses in curly parethesis characters. Using the --unicode=escape option will display the characters as as unicode escape sequences (\uxxxx). Using the --unicode=hex will display the characters as hex byte sequences enclosed between angle brackets. Using the --unicode=highlight will display the characters as unicode escape sequences but it will also highlighted them in red, assuming that colouring is supported by the output device. The colouring is intended to draw attention to the presence of unicode sequences when they might not be expected. -e --headers Display all the headers in the file. Equivalent to -h -l -S. -n --notes Displays the contents of the NOTE segments and/or sections, if any. -r --relocs Displays the contents of the file's relocation section, if it has one. -u --unwind Displays the contents of the file's unwind section, if it has one. Only the unwind sections for IA64 ELF files, as well as ARM unwind tables (".ARM.exidx" / ".ARM.extab") are currently supported. If support is not yet implemented for your architecture you could try dumping the contents of the .eh_frames section using the --debug-dump=frames or --debug-dump=frames-interp options. -d --dynamic Displays the contents of the file's dynamic section, if it has one. -V --version-info Displays the contents of the version sections in the file, it they exist. -A --arch-specific Displays architecture-specific information in the file, if there is any. -D --use-dynamic When displaying symbols, this option makes readelf use the symbol hash tables in the file's dynamic section, rather than the symbol table sections. When displaying relocations, this option makes readelf display the dynamic relocations rather than the static relocations. -L --lint --enable-checks Displays warning messages about possible problems with the file(s) being examined. If used on its own then all of the contents of the file(s) will be examined. If used with one of the dumping options then the warning messages will only be produced for the things being displayed. -x <number or name> --hex-dump=<number or name> Displays the contents of the indicated section as a hexadecimal bytes. A number identifies a particular section by index in the section table; any other string identifies all sections with that name in the object file. -R <number or name> --relocated-dump=<number or name> Displays the contents of the indicated section as a hexadecimal bytes. A number identifies a particular section by index in the section table; any other string identifies all sections with that name in the object file. The contents of the section will be relocated before they are displayed. -p <number or name> --string-dump=<number or name> Displays the contents of the indicated section as printable strings. A number identifies a particular section by index in the section table; any other string identifies all sections with that name in the object file. -z --decompress Requests that the section(s) being dumped by x, R or p options are decompressed before being displayed. If the section(s) are not compressed then they are displayed as is. -c --archive-index Displays the file symbol index information contained in the header part of binary archives. Performs the same function as the t command to ar, but without using the BFD library. -w[lLiaprmfFsOoRtUuTgAckK] --debug-dump[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links,=follow-links] Displays the contents of the DWARF debug sections in the file, if any are present. Compressed debug sections are automatically decompressed (temporarily) before they are displayed. If one or more of the optional letters or words follows the switch then only those type(s) of data will be dumped. The letters and words refer to the following information: "a" "=abbrev" Displays the contents of the .debug_abbrev section. "A" "=addr" Displays the contents of the .debug_addr section. "c" "=cu_index" Displays the contents of the .debug_cu_index and/or .debug_tu_index sections. "f" "=frames" Display the raw contents of a .debug_frame section. "F" "=frames-interp" Display the interpreted contents of a .debug_frame section. "g" "=gdb_index" Displays the contents of the .gdb_index and/or .debug_names sections. "i" "=info" Displays the contents of the .debug_info section. Note: the output from this option can also be restricted by the use of the --dwarf-depth and --dwarf-start options. "k" "=links" Displays the contents of the .gnu_debuglink, .gnu_debugaltlink and .debug_sup sections, if any of them are present. Also displays any links to separate dwarf object files (dwo), if they are specified by the DW_AT_GNU_dwo_name or DW_AT_dwo_name attributes in the .debug_info section. "K" "=follow-links" Display the contents of any selected debug sections that are found in linked, separate debug info file(s). This can result in multiple versions of the same debug section being displayed if it exists in more than one file. In addition, when displaying DWARF attributes, if a form is found that references the separate debug info file, then the referenced contents will also be displayed. Note - in some distributions this option is enabled by default. It can be disabled via the N debug option. The default can be chosen when configuring the binutils via the --enable-follow-debug-links=yes or --enable-follow-debug-links=no options. If these are not used then the default is to enable the following of debug links. Note - if support for the debuginfod protocol was enabled when the binutils were built then this option will also include an attempt to contact any debuginfod servers mentioned in the DEBUGINFOD_URLS environment variable. This could take some time to resolve. This behaviour can be disabled via the =do-not-use-debuginfod debug option. "N" "=no-follow-links" Disables the following of links to separate debug info files. "D" "=use-debuginfod" Enables contacting debuginfod servers if there is a need to follow debug links. This is the default behaviour. "E" "=do-not-use-debuginfod" Disables contacting debuginfod servers when there is a need to follow debug links. "l" "=rawline" Displays the contents of the .debug_line section in a raw format. "L" "=decodedline" Displays the interpreted contents of the .debug_line section. "m" "=macro" Displays the contents of the .debug_macro and/or .debug_macinfo sections. "o" "=loc" Displays the contents of the .debug_loc and/or .debug_loclists sections. "O" "=str-offsets" Displays the contents of the .debug_str_offsets section. "p" "=pubnames" Displays the contents of the .debug_pubnames and/or .debug_gnu_pubnames sections. "r" "=aranges" Displays the contents of the .debug_aranges section. "R" "=Ranges" Displays the contents of the .debug_ranges and/or .debug_rnglists sections. "s" "=str" Displays the contents of the .debug_str, .debug_line_str and/or .debug_str_offsets sections. "t" "=pubtype" Displays the contents of the .debug_pubtypes and/or .debug_gnu_pubtypes sections. "T" "=trace_aranges" Displays the contents of the .trace_aranges section. "u" "=trace_abbrev" Displays the contents of the .trace_abbrev section. "U" "=trace_info" Displays the contents of the .trace_info section. Note: displaying the contents of .debug_static_funcs, .debug_static_vars and debug_weaknames sections is not currently supported. --dwarf-depth=n Limit the dump of the ".debug_info" section to n children. This is only useful with --debug-dump=info. The default is to print all DIEs; the special value 0 for n will also have this effect. With a non-zero value for n, DIEs at or deeper than n levels will not be printed. The range for n is zero-based. --dwarf-start=n Print only DIEs beginning with the DIE numbered n. This is only useful with --debug-dump=info. If specified, this option will suppress printing of any header information and all DIEs before the DIE numbered n. Only siblings and children of the specified DIE will be printed. This can be used in conjunction with --dwarf-depth. -P --process-links Display the contents of non-debug sections found in separate debuginfo files that are linked to the main file. This option automatically implies the -wK option, and only sections requested by other command line options will be displayed. --ctf[=section] Display the contents of the specified CTF section. CTF sections themselves contain many subsections, all of which are displayed in order. By default, display the name of the section named .ctf, which is the name emitted by ld. --ctf-parent=member If the CTF section contains ambiguously-defined types, it will consist of an archive of many CTF dictionaries, all inheriting from one dictionary containing unambiguous types. This member is by default named .ctf, like the section containing it, but it is possible to change this name using the "ctf_link_set_memb_name_changer" function at link time. When looking at CTF archives that have been created by a linker that uses the name changer to rename the parent archive member, --ctf-parent can be used to specify the name used for the parent. --ctf-symbols=section --ctf-strings=section Specify the name of another section from which the CTF file can inherit strings and symbols. By default, the ".symtab" and its linked string table are used. If either of --ctf-symbols or --ctf-strings is specified, the other must be specified as well. -I --histogram Display a histogram of bucket list lengths when displaying the contents of the symbol tables. -v --version Display the version number of readelf. -W --wide Don't break output lines to fit into 80 columns. By default readelf breaks section header and segment listing lines for 64-bit ELF files, so that they fit into 80 columns. This option causes readelf to print each section header resp. each segment one a single line, which is far more readable on terminals wider than 80 columns. -T --silent-truncation Normally when readelf is displaying a symbol name, and it has to truncate the name to fit into an 80 column display, it will add a suffix of "[...]" to the name. This command line option disables this behaviour, allowing 5 more characters of the name to be displayed and restoring the old behaviour of readelf (prior to release 2.35). -H --help Display the command-line options understood by readelf. @file Read command-line options from file. The options read are inserted in place of the original @file option. If file does not exist, or cannot be read, then the option will be treated literally, and not removed. Options in file are separated by whitespace. A whitespace character may be included in an option by surrounding the entire option in either single or double quotes. Any character (including a backslash) may be included by prefixing the character to be included with a backslash. The file may itself contain additional @file options; any such options will be processed recursively. SEE ALSO top objdump(1), and the Info entries for binutils. COPYRIGHT top Copyright (c) 1991-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 binutils (a collection of tools for working with executable binaries) project. Information about the project can be found at http://www.gnu.org/software/binutils/. If you have a bug report for this manual page, see http://sourceware.org/bugzilla/enter_bug.cgi?product=binutils. This page was obtained from the tarball binutils-2.41.tar.gz fetched from https://ftp.gnu.org/gnu/binutils/ 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] binutils-2.41 2023-12-22 READELF(1) Pages that refer to this page: elfedit(1), ld(1), objdump(1), size(1), strings(1), dl_iterate_phdr(3), end(3), elf(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. | # readelf\n\n> Displays information about ELF files.\n> More information: <http://man7.org/linux/man-pages/man1/readelf.1.html>.\n\n- Display all information about the ELF file:\n\n`readelf -all {{path/to/binary}}`\n\n- Display all the headers present in the ELF file:\n\n`readelf --headers {{path/to/binary}}`\n\n- Display the entries in symbol table section of the ELF file, if it has one:\n\n`readelf --symbols {{path/to/binary}}`\n\n- Display the information contained in the ELF header at the start of the file:\n\n`readelf --file-header {{path/to/binary}}`\n |
readlink | readlink(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training readlink(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON READLINK(1) User Commands READLINK(1) NAME top readlink - print resolved symbolic links or canonical file names SYNOPSIS top readlink [OPTION]... FILE... DESCRIPTION top Note realpath(1) is the preferred command to use for canonicalization functionality. Print value of a symbolic link or canonical file name -f, --canonicalize canonicalize by following every symlink in every component of the given name recursively; all but the last component must exist -e, --canonicalize-existing canonicalize by following every symlink in every component of the given name recursively, all components must exist -m, --canonicalize-missing canonicalize by following every symlink in every component of the given name recursively, without requirements on components existence -n, --no-newline do not output the trailing delimiter -q, --quiet -s, --silent suppress most error messages (on by default) -v, --verbose report error messages -z, --zero end each output line with NUL, not newline --help display this help and exit --version output version information and exit AUTHOR top Written by Dmitry V. Levin. 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 readlink(2), realpath(1), realpath(3) Full documentation <https://www.gnu.org/software/coreutils/readlink> or available locally via: info '(coreutils) readlink 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 READLINK(1) Pages that refer to this page: basename(1), dirname(1), dpkg-realpath(1), realpath(1), unshare(1), mount(2), readlink(2), unshare(2), namespaces(7), mount(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. | # readlink\n\n> Follow symlinks and get symlink information.\n> More information: <https://www.gnu.org/software/coreutils/readlink>.\n\n- Get the actual file to which the symlink points:\n\n`readlink {{path/to/file}}`\n\n- Get the absolute path to a file:\n\n`readlink -f {{path/to/file}}`\n |
readonly | readonly(1p) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training readonly(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 READONLY(1P) POSIX Programmer's Manual READONLY(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 readonly set the readonly attribute for variables SYNOPSIS top readonly name[=word]... readonly -p DESCRIPTION top The variables whose names are specified shall be given the readonly attribute. The values of variables with the readonly attribute cannot be changed by subsequent assignment, nor can those variables be unset by the unset utility. If the name of a variable is followed by =word, then the value of that variable shall be set to word. The readonly special built-in shall support the Base Definitions volume of POSIX.12017, Section 12.2, Utility Syntax Guidelines. When -p is specified, readonly writes to the standard output the names and values of all read-only variables, in the following format: "readonly %s=%s\n", <name>, <value> if name is set, and "readonly %s\n", <name> if name is unset. 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 value and readonly attribute- setting results in a shell execution environment in which: 1. Variables with values at the time they were output do not have the readonly attribute set. 2. Variables that were unset at the time they were output do not have a value at the time at which the saved output is reinput to the shell. When no arguments are given, the results are unspecified. 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 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 0 All name operands were successfully marked readonly. >0 At least one name could not be marked readonly, or the -p option was specified and an error occurred. CONSEQUENCES OF ERRORS top Default. The following sections are informative. APPLICATION USAGE top None. EXAMPLES top readonly HOME PWD RATIONALE top Some historical shells preserve the readonly attribute across separate invocations. This volume of POSIX.12017 allows this behavior, but does not require it. The -p option allows portable access to the values that can be saved and then later restored using, for example, a dot script. Also see the RATIONALE for export(1p) for a description of the no-argument and -p output cases and a related example. Read-only functions were considered, but they were omitted as not being historical practice or particularly useful. Furthermore, functions must not be read-only across invocations to preclude ``spoofing'' (spoofing is the term for the practice of creating a program that acts like a well-known utility with the intent of subverting the real intent of the user) of administrative or security-relevant (or security-conscious) shell scripts. 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 READONLY(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. | # readonly\n\n> Set read-only shell variables.\n> More information: <https://manned.org/readonly.1posix>.\n\n- Set a read-only variable:\n\n`readonly {{variable_name}}={{value}}`\n\n- Mark a variable as read-only:\n\n`readonly {{existing_variable}}`\n\n- [p]rint the names and values of all read-only variables to `stdout`:\n\n`readonly -p`\n |
realpath | realpath(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training realpath(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON REALPATH(1) User Commands REALPATH(1) NAME top realpath - print the resolved path SYNOPSIS top realpath [OPTION]... FILE... DESCRIPTION top Print the resolved absolute file name; all but the last component must exist -e, --canonicalize-existing all components of the path must exist -m, --canonicalize-missing no path components need exist or be a directory -L, --logical resolve '..' components before symlinks -P, --physical resolve symlinks as encountered (default) -q, --quiet suppress most error messages --relative-to=DIR print the resolved path relative to DIR --relative-base=DIR print absolute paths unless paths below DIR -s, --strip, --no-symlinks don't expand symlinks -z, --zero end each output line with NUL, not newline --help display this help and exit --version output version information and exit 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 readlink(1), readlink(2), realpath(3) Full documentation <https://www.gnu.org/software/coreutils/realpath> or available locally via: info '(coreutils) realpath 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 REALPATH(1) Pages that refer to this page: dpkg-realpath(1), readlink(1), mount(2), realpath(3), mount(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. | # realpath\n\n> Display the resolved absolute path for a file or directory.\n> More information: <https://www.gnu.org/software/coreutils/realpath>.\n\n- Display the absolute path for a file or directory:\n\n`realpath {{path/to/file_or_directory}}`\n\n- Require all path components to exist:\n\n`realpath --canonicalize-existing {{path/to/file_or_directory}}`\n\n- Resolve ".." components before symlinks:\n\n`realpath --logical {{path/to/file_or_directory}}`\n\n- Disable symlink expansion:\n\n`realpath --no-symlinks {{path/to/file_or_directory}}`\n\n- Suppress error messages:\n\n`realpath --quiet {{path/to/file_or_directory}}`\n |
reboot | poweroff(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training poweroff(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXIT STATUS | NOTES | SEE ALSO | COLOPHON POWEROFF(8) poweroff POWEROFF(8) NAME top poweroff, reboot, halt - Power off, reboot, or halt the machine SYNOPSIS top poweroff [OPTIONS...] reboot [OPTIONS...] halt [OPTIONS...] DESCRIPTION top poweroff, reboot, and halt may be used to power off, reboot, or halt the machine. All three commands take the same options. OPTIONS top The following options are understood: --help Print a short help text and exit. Added in version 253. --halt Halt the machine, regardless of which one of the three commands is invoked. Added in version 253. -p, --poweroff Power off the machine, when either halt or poweroff is invoked. This option is ignored when reboot is invoked. Added in version 253. --reboot Reboot the machine, regardless of which one of the three commands is invoked. Added in version 253. -f, --force Force immediate power-off, halt, or reboot. If specified, the command does not contact the init system. In most cases, filesystems are not properly unmounted before shutdown. For example, the command reboot -f is mostly equivalent to systemctl reboot -ff, instead of systemctl reboot -f. Added in version 253. -w, --wtmp-only Only write wtmp shutdown entry, do not actually power off, reboot, or halt. Added in version 253. -d, --no-wtmp Do not write wtmp shutdown entry. Added in version 253. -n, --no-sync Don't sync hard disks/storage media before power-off, reboot, or halt. Added in version 253. --no-wall Do not send wall message before power-off, reboot, or halt. Added in version 253. EXIT STATUS top On success, 0 is returned, a non-zero failure code otherwise. NOTES top These commands are implemented in a way that preserves basic compatibility with the original SysV commands. systemctl(1) verbs poweroff, reboot, halt provide the same functionality with some additional features. Note that on many SysV systems halt used to be synonymous to poweroff, i.e. both commands would equally result in powering the machine off. systemd is more accurate here, and halt results in halting the machine only (leaving power on), and poweroff is required to actually power it off. SEE ALSO top systemd(1), systemctl(1), shutdown(8), 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 POWEROFF(8) Pages that refer to this page: reboot(2), systemd.directives(7), systemd.index(7), fsck.minix(8), mkfs.minix(8), shutdown(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. | # reboot\n\n> Reboot the system.\n> More information: <https://manned.org/reboot.8>.\n\n- Reboot the system:\n\n`reboot`\n\n- Power off the system (same as `poweroff`):\n\n`reboot --poweroff`\n\n- Halt (terminates all processes and shuts down the CPU) the system (same as `halt`):\n\n`reboot --halt`\n\n- Reboot immediately without contacting the system manager:\n\n`reboot --force`\n\n- Write the wtmp shutdown entry without rebooting the system:\n\n`reboot --wtmp-only`\n |
rename | rename(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training rename(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | WARNING | EDGE CASES | INTERACTIVE MODE | EXIT STATUS | EXAMPLES | SEE ALSO | REPORTING BUGS | AVAILABILITY RENAME(1) User Commands RENAME(1) NAME top rename - rename files SYNOPSIS top rename [options] expression replacement file... DESCRIPTION top rename will rename the specified files by replacing the first occurrence of expression in their name by replacement. OPTIONS top -s, --symlink Do not rename a symlink but change where it points. -v, --verbose Show which files were renamed, if any. -n, --no-act Do not make any changes; add --verbose to see what would be made. -a, --all Replace all occurrences of expression rather than only the first one. -l, --last Replace the last occurrence of expression rather than the first one. -o, --no-overwrite Do not overwrite existing files. When --symlink is active, do not overwrite symlinks pointing to existing targets. -i, --interactive Ask before overwriting existing files. -h, --help Display help text and exit. -V, --version Print version and exit. WARNING top The renaming has no safeguards by default or without any one of the options --no-overwrite, --interactive or --no-act. If the user has permission to rewrite file names, the command will perform the action without any questions. For example, the result can be quite drastic when the command is run as root in the /lib directory. Always make a backup before running the command, unless you truly know what you are doing. EDGE CASES top If the expression is empty, then by default replacement will be added to the start of the filename. With --all, replacement will be inserted in between every two characters of the filename, as well as at the start and end. Normally, only the final path component of a filename is updated. (Or with --symlink, only the final path component of the link.) But if either expression or replacement contains a /, the full path is updated. This can cause a file to be moved between folders. Creating folders, and moving files between filesystems, is not supported. INTERACTIVE MODE top As most standard utilities rename can be used with a terminal device (tty in short) in canonical mode, where the line is buffered by the tty and you press ENTER to validate the user input. If you put your tty in cbreak mode however, rename requires only a single key press to answer the prompt. To set cbreak mode, run for example: sh -c 'stty -icanon min 1; "$0" "$@"; stty icanon' rename -i from to files EXIT STATUS top 0 all requested rename operations were successful 1 all rename operations failed 2 some rename operations failed 4 nothing was renamed 64 unanticipated error occurred EXAMPLES top Given the files foo1, ..., foo9, foo10, ..., foo278, the commands rename foo foo00 foo? rename foo foo0 foo?? will turn them into foo001, ..., foo009, foo010, ..., foo278. And rename .htm .html *.htm will fix the extension of your html files. Provide an empty string for shortening: rename '_with_long_name' '' file_with_long_name.* will remove the substring in the filenames. SEE ALSO top mv(1) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The rename 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 RENAME(1) Pages that refer to this page: rename(2), strverscmp(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. | # rename\n\n> Rename multiple files.\n> Note: this page refers to the command from the `util-linux` package.\n> For the Perl version, see `file-rename` or `perl-rename`.\n> Warning: This command has no safeguards and will overwrite files without prompting.\n> More information: <https://manned.org/rename>.\n\n- Rename files using simple substitutions (substitute 'foo' with 'bar' wherever found):\n\n`rename {{foo}} {{bar}} {{*}}`\n\n- Dry-run - display which renames would occur without performing them:\n\n`rename -vn {{foo}} {{bar}} {{*}}`\n\n- Do not overwrite existing files:\n\n`rename -o {{foo}} {{bar}} {{*}}`\n\n- Change file extensions:\n\n`rename {{.ext}} {{.bak}} {{*.ext}}`\n\n- Prepend "foo" to all filenames in the current directory:\n\n`rename {{''}} {{'foo'}} {{*}}`\n\n- Rename a group of increasingly numbered files zero-padding the numbers up to 3 digits:\n\n`rename {{foo}} {{foo00}} {{foo?}} && rename {{foo}} {{foo0}} {{foo??}}`\n |
renice | renice(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training renice(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | FILES | NOTES | HISTORY | EXAMPLES | SEE ALSO | REPORTING BUGS | AVAILABILITY RENICE(1) User Commands RENICE(1) NAME top renice - alter priority of running processes SYNOPSIS top renice [--priority|--relative] priority [-g|-p|-u] identifier... DESCRIPTION top renice alters the scheduling priority of one or more running processes. The first argument is the priority value to be used. The other arguments are interpreted as process IDs (by default), process group IDs, user IDs, or user names. renice'ing a process group causes all processes in the process group to have their scheduling priority altered. renice'ing a user causes all processes owned by the user to have their scheduling priority altered. If no -n, --priority or --relative option is used, then the priority is set as absolute. OPTIONS top -n priority Specify the absolute or relative (depending on environment variable POSIXLY_CORRECT) scheduling priority to be used for the process, process group, or user. Use of the option -n is optional, but when used, it must be the first argument. See NOTES for more information. --priority priority Specify an absolute scheduling priority. Priority is set to the given value. This is the default, when no option is specified. --relative priority Specify a relative scheduling priority. Same as the standard POSIX -n option. Priority gets incremented/decremented by the given value. -g, --pgrp Interpret the succeeding arguments as process group IDs. -p, --pid Interpret the succeeding arguments as process IDs (the default). -u, --user Interpret the succeeding arguments as usernames or UIDs. -h, --help Display help text and exit. -V, --version Print version and exit. FILES top /etc/passwd to map user names to user IDs NOTES top Users other than the superuser may only alter the priority of processes they own. Furthermore, an unprivileged user can only increase the "nice value" (i.e., choose a lower priority) and such changes are irreversible unless (since Linux 2.6.12) the user has a suitable "nice" resource limit (see ulimit(1p) and getrlimit(2)). The superuser may alter the priority of any process and set the priority to any value in the range -20 to 19. Useful priorities are: 19 (the affected processes will run only when nothing else in the system wants to), 0 (the "base" scheduling priority), anything negative (to make things go very fast). For historical reasons in this implementation, the -n option did not follow the POSIX specification. Therefore, instead of setting a relative priority, it sets an absolute priority by default. As this may not be desirable, this behavior can be controlled by setting the environment variable POSIXLY_CORRECT to be fully POSIX compliant. See the -n option for details. See --relative and --priority for options that do not change behavior depending on environment variables. HISTORY top The renice command appeared in 4.0BSD. EXAMPLES top The following command would change the priority of the processes with PIDs 987 and 32, plus all processes owned by the users daemon and root: renice +1 987 -u daemon root -p 32 SEE ALSO top nice(1), chrt(1), getpriority(2), setpriority(2), credentials(7), sched(7) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The renice 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 RENICE(1) Pages that refer to this page: chrt(1), kill(1@@procps-ng), nice(1), skill(1), taskset(1), uclampset(1), getpriority(2), nice(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. | # renice\n\n> Alter the scheduling priority/niceness of running processes.\n> Niceness values range from -20 (most favorable to the process) to 19 (least favorable to the process).\n> See also: `nice`.\n> More information: <https://manned.org/renice>.\n\n- Set the absolute priority of a running [p]rocess:\n\n`renice {{+3}} -p {{pid}}`\n\n- Increase/decrease the priority of all processes owned by a [u]ser:\n\n`renice --relative {{-4}} -u {{uid|user}}`\n\n- Set the priority of all processes that belong to a process [g]roup:\n\n`renice --absolute {{5}} -g {{process_group}}`\n |
repquota | repquota(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training repquota(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | FILES | SEE ALSO | COLOPHON REPQUOTA(8) System Manager's Manual REPQUOTA(8) NAME top repquota - summarize quotas for a filesystem SYNOPSIS top /usr/sbin/repquota [ -vspiugP ] [ -c | -C ] [ -t | -n ] [ -F format-name ] filesystem... /usr/sbin/repquota [ -avtpsiugP ] [ -c | -C ] [ -t | -n ] [ -F format-name ] DESCRIPTION top repquota prints a summary of the disc usage and quotas for the specified file systems. For each user the current number of files and amount of space (in kilobytes) is printed, along with any quota limits set with edquota(8) or setquota(8). In the second column repquota prints two characters marking which limits are exceeded. If user is over his space softlimit or reaches his space hardlimit in case softlimit is unset, the first character is '+'. Otherwise the character printed is '-'. The second character denotes the state of inode usage analogously. repquota has to translate ids of all users/groups/projects to names (unless option -n was specified) so it may take a while to print all the information. To make translating as fast as possible repquota tries to detect (by reading /etc/nsswitch.conf) whether entries are stored in standard plain text file or in a database and either translates chunks of 1024 names or each name individually. You can override this autodetection by -c or -C options. OPTIONS top -a, --all Report on all filesystems indicated in /etc/mtab to be read-write with quotas. -v, --verbose Report all quotas, even if there is no usage. Be also more verbose about quotafile information. -c, --cache Cache entries to report and translate uids/gids to names in big chunks by scanning all users (default). This is good (fast) behaviour when using /etc/passwd file. -C, --no-cache Translate individual entries. This is faster when you have users stored in database. -t, --truncate-names Truncate user/group names longer than 9 characters. This results in nicer output when there are such names. -n, --no-names Don't resolve UIDs/GIDs to names. This can speedup printing a lot. -s, --human-readable[=units] Try to report used space, number of used inodes and limits in more appropriate units than the default ones. Units can be also specified explicitely by an optional argument in format [ kgt ],[ kgt ] where the first character specifies space units and the second character specifies inode units. -p, --raw-grace When user is in grace period, report time in seconds since epoch when his grace time runs out (or has run out). Field is '0' when no grace time is in effect. This is especially useful when parsing output by a script. -i, --no-autofs Ignore mountpoints mounted by automounter. -F, --format=format-name Report quota for specified format (ie. don't perform format autodetection). Possible format names are: vfsold Original quota format with 16-bit UIDs / GIDs, vfsv0 Quota format with 32-bit UIDs / GIDs, 64-bit space usage, 32-bit inode usage and limits, vfsv1 Quota format with 64-bit quota limits and usage, xfs (quota on XFS filesystem) -g, --group Report quotas for groups. -P, --project Report quotas for projects. -u, --user Report quotas for users. This is the default. -O, --output=format-name Output quota report in the specified format. Possible format names are: default The default format, optimized for console viewing csv Comma-separated values, a text file with the columns delimited by commas xml Output is XML encoded, useful for processing with XSLT Only the super-user may view quotas which are not their own. FILES top aquota.user or aquota.group quota file at the filesystem root (version 2 quota, non- XFS filesystems) quota.user or quota.group quota file at the filesystem root (version 1 quota, non- XFS filesystems) /etc/mtab default filesystems /etc/passwd default set of users /etc/group default set of groups SEE ALSO top quota(1), quotactl(2), edquota(8), quotacheck(8), quotaon(8), quota_nld(8), setquota(8), warnquota(8) COLOPHON top This page is part of the quota (Linux Diskquota Tools) project. Information about the project can be found at [unknown -- if you know, please contact [email protected]] 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/utils/quota/quota-tools.git on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2022-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] 4th Berkeley Distribution REPQUOTA(8) Pages that refer to this page: quota(1), quotasync(1), convertquota(8), edquota(8), quotacheck(8), quotaon(8), setquota(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. | # repquota\n\n> Display a summary of existing file quotas for a filesystem.\n> More information: <https://manned.org/repquota>.\n\n- Report stats for all quotas in use:\n\n`sudo repquota -all`\n\n- Report quota stats for all users, even those who aren't using any of their quota:\n\n`sudo repquota -v {{filesystem}}`\n\n- Report on quotas for users only:\n\n`repquota --user {{filesystem}}`\n\n- Report on quotas for groups only:\n\n`sudo repquota --group {{filesystem}}`\n\n- Report on used quota and limits in a human-readable format:\n\n`sudo repquota --human-readable {{filesystem}}`\n\n- Report on all quotas for users and groups in a human-readable format:\n\n`sudo repquota -augs`\n |
reset | 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. | # reset\n\n> Reinitializes the current terminal. Clears the entire terminal screen.\n> More information: <https://manned.org/reset>.\n\n- Reinitialize the current terminal:\n\n`reset`\n\n- Display the terminal type instead:\n\n`reset -q`\n |
resize2fs | resize2fs(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training resize2fs(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | KNOWN BUGS | AUTHOR | COPYRIGHT | SEE ALSO | COLOPHON RESIZE2FS(8) System Manager's Manual RESIZE2FS(8) NAME top resize2fs - ext2/ext3/ext4 file system resizer SYNOPSIS top resize2fs [ -fFpPMbs ] [ -d debug-flags ] [ -S RAID-stride ] [ -z undo_file ] device [ size ] DESCRIPTION top The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on device. If the file system is mounted, it can be used to expand the size of the mounted file system, assuming the kernel and the file system supports on-line resizing. (Modern Linux 2.6 kernels will support on-line resize for file systems mounted using ext3 and ext4; ext3 file systems will require the use of file systems with the resize_inode feature enabled.) The size parameter specifies the requested new size of the file system. If no units are specified, the units of the size parameter shall be the file system blocksize of the file system. Optionally, the size parameter may be suffixed by one of the following units designators: 'K', 'M', 'G', 'T' (either upper- case or lower-case) or 's' for power-of-two kilobytes, megabytes, gigabytes, terabytes or 512 byte sectors respectively. The size of the file system may never be larger than the size of the partition. If size parameter is not specified, it will default to the size of the partition. The resize2fs program does not manipulate the size of partitions. If you wish to enlarge a file system, you must make sure you can expand the size of the underlying partition first. This can be done using fdisk(8) by deleting the partition and recreating it with a larger size or using lvextend(8), if you're using the logical volume manager lvm(8). When recreating the partition, make sure you create it with the same starting disk cylinder as before! Otherwise, the resize operation will certainly not work, and you may lose your entire file system. After running fdisk(8), run resize2fs to resize the ext2 file system to use all of the space in the newly enlarged partition. If you wish to shrink an ext2 partition, first use resize2fs to shrink the size of file system. Then you may use fdisk(8) to shrink the size of the partition. When shrinking the size of the partition, make sure you do not make it smaller than the new size of the ext2 file system! The -b and -s options enable and disable the 64bit feature, respectively. The resize2fs program will, of course, take care of resizing the block group descriptors and moving other data blocks out of the way, as needed. It is not possible to resize the file system concurrent with changing the 64bit status. OPTIONS top -b Turns on the 64bit feature, resizes the group descriptors as necessary, and moves other metadata out of the way. -d debug-flags Turns on various resize2fs debugging features, if they have been compiled into the binary. debug-flags should be computed by adding the numbers of the desired features from the following list: 2 - Debug block relocations 4 - Debug inode relocations 8 - Debug moving the inode table 16 - Print timing information 32 - Debug minimum file system size (-M) calculation -f Forces resize2fs to proceed with the file system resize operation, overriding some safety checks which resize2fs normally enforces. -F Flush the file system device's buffer caches before beginning. Only really useful for doing resize2fs time trials. -M Shrink the file system to minimize its size as much as possible, given the files stored in the file system. -p Print out percentage completion bars for each resize2fs phase during an offline (non-trivial) resize operation, so that the user can keep track of what the program is doing. (For very fast resize operations, no progress bars may be displayed.) -P Print an estimate of the number of file system blocks in the file system if it is shrunk using resize2fs's -M option and then exit. -s Turns off the 64bit feature and frees blocks that are no longer in use. -S RAID-stride The resize2fs program will heuristically determine the RAID stride that was specified when the file system was created. This option allows the user to explicitly specify a RAID stride setting to be used by resize2fs instead. -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 resize2fs-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. KNOWN BUGS top The minimum size of the file system as estimated by resize2fs may be incorrect, especially for file systems with 1k and 2k blocksizes. AUTHOR top resize2fs was written by Theodore Ts'o <[email protected]>. COPYRIGHT top Resize2fs is Copyright 1998 by Theodore Ts'o and PowerQuest, Inc. All rights reserved. As of April, 2000 Resize2fs may be redistributed under the terms of the GPL. SEE ALSO top fdisk(8), e2fsck(8), mke2fs(8), lvm(8), lvextend(8) 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 RESIZE2FS(8) Pages that refer to this page: ext4(5), fsadm(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. | # resize2fs\n\n> Resize an ext2, ext3 or ext4 filesystem.\n> Does not resize the underlying partition. The filesystem may have to be unmounted first, read the man page for more details.\n> More information: <https://manned.org/resize2fs>.\n\n- Automatically resize a filesystem:\n\n`resize2fs {{/dev/sdXN}}`\n\n- Resize the filesystem to a size of 40G, displaying a progress bar:\n\n`resize2fs -p {{/dev/sdXN}} {{40G}}`\n\n- Shrink the filesystem to its minimum possible size:\n\n`resize2fs -M {{/dev/sdXN}}`\n |
resolvconf | resolvectl(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training resolvectl(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COMMANDS | OPTIONS | COMPATIBILITY WITH RESOLVCONF(8) | EXAMPLES | SEE ALSO | NOTES | COLOPHON RESOLVECTL(1) resolvectl RESOLVECTL(1) NAME top resolvectl, resolvconf - Resolve domain names, IPV4 and IPv6 addresses, DNS resource records, and services; introspect and reconfigure the DNS resolver SYNOPSIS top resolvectl [OPTIONS...] {COMMAND} [NAME...] DESCRIPTION top resolvectl may be used to resolve domain names, IPv4 and IPv6 addresses, DNS resource records and services with the systemd-resolved.service(8) resolver service. By default, the specified list of parameters will be resolved as hostnames, retrieving their IPv4 and IPv6 addresses. If the parameters specified are formatted as IPv4 or IPv6 addresses the reverse operation is done, and a hostname is retrieved for the specified addresses. The program's output contains information about the protocol used for the look-up and on which network interface the data was discovered. It also contains information on whether the information could be authenticated. All data for which local DNSSEC validation succeeds is considered authenticated. Moreover all data originating from local, trusted sources is also reported authenticated, including resolution of the local host name, the "localhost" hostname or all data from /etc/hosts. COMMANDS top query HOSTNAME|ADDRESS... Resolve domain names, as well as IPv4 and IPv6 addresses. When used in conjunction with --type= or --class= (see below), resolves low-level DNS resource records. If a single-label domain name is specified it is searched for according to the configured search domains unless --search=no or --type=/--class= are specified, both of which turn this logic off. If an international domain name is specified, it is automatically translated according to IDNA rules when resolved via classic DNS but not for look-ups via MulticastDNS or LLMNR. If --type=/--class= is used IDNA translation is turned off and domain names are processed as specified. Added in version 239. service [[NAME] TYPE] DOMAIN Resolve RFC 6763 DNS-SD[1] and RFC 2782 SRV[2] services, depending on the specified list of parameters. If three parameters are passed the first is assumed to be the DNS-SD service name, the second the SRV service type, and the third the domain to search in. In this case a full DNS-SD style SRV and TXT lookup is executed. If only two parameters are specified, the first is assumed to be the SRV service type, and the second the domain to look in. In this case no TXT resource record is requested. Finally, if only one parameter is specified, it is assumed to be a domain name, that is already prefixed with an SRV type, and an SRV lookup is done (no TXT). Added in version 239. openpgp EMAIL@DOMAIN... Query PGP keys stored as OPENPGPKEY resource records, see RFC 7929[3]. Specified e-mail addresses are converted to the corresponding DNS domain name, and any OPENPGPKEY keys are printed. Added in version 239. tlsa [FAMILY] DOMAIN[:PORT]... Query TLS public keys stored as TLSA resource records, see RFC 6698[4]. A query will be performed for each of the specified names prefixed with the port and family ("_port._family.domain"). The port number may be specified after a colon (":"), otherwise 443 will be used by default. The family may be specified as the first argument, otherwise tcp will be used. Added in version 239. status [LINK...] Shows the global and per-link DNS settings currently in effect. If no command is specified, this is the implied default. Added in version 239. statistics Shows general resolver statistics, including information whether DNSSEC is enabled and available, as well as resolution and validation statistics. Added in version 239. reset-statistics Resets the statistics counters shown in statistics to zero. This operation requires root privileges. Added in version 239. flush-caches Flushes all DNS resource record caches the service maintains locally. This is mostly equivalent to sending the SIGUSR2 to the systemd-resolved service. Added in version 239. reset-server-features Flushes all feature level information the resolver learnt about specific servers, and ensures that the server feature probing logic is started from the beginning with the next look-up request. This is mostly equivalent to sending the SIGRTMIN+1 to the systemd-resolved service. Added in version 239. dns [LINK [SERVER...]], domain [LINK [DOMAIN...]], default-route [LINK [BOOL...]], llmnr [LINK [MODE]], mdns [LINK [MODE]], dnssec [LINK [MODE]], dnsovertls [LINK [MODE]], nta [LINK [DOMAIN...]] Get/set per-interface DNS configuration. These commands may be used to configure various DNS settings for network interfaces. These commands may be used to inform systemd-resolved or systemd-networkd about per-interface DNS configuration determined through external means. The dns command expects IPv4 or IPv6 address specifications of DNS servers to use. Each address can optionally take a port number separated with ":", a network interface name or index separated with "%", and a Server Name Indication (SNI) separated with "#". When IPv6 address is specified with a port number, then the address must be in the square brackets. That is, the acceptable full formats are "111.222.333.444:9953%ifname#example.com" for IPv4 and "[1111:2222::3333]:9953%ifname#example.com" for IPv6. The domain command expects valid DNS domains, possibly prefixed with "~", and configures a per-interface search or route-only domain. The default-route command expects a boolean parameter, and configures whether the link may be used as default route for DNS lookups, i.e. if it is suitable for lookups on domains no other link explicitly is configured for. The llmnr, mdns, dnssec and dnsovertls commands may be used to configure the per-interface LLMNR, MulticastDNS, DNSSEC and DNSOverTLS settings. Finally, nta command may be used to configure additional per-interface DNSSEC NTA domains. Commands dns, domain and nta can take a single empty string argument to clear their respective value lists. For details about these settings, their possible values and their effect, see the corresponding settings in systemd.network(5). Added in version 239. revert LINK Revert the per-interface DNS configuration. If the DNS configuration is reverted all per-interface DNS setting are reset to their defaults, undoing all effects of dns, domain, default-route, llmnr, mdns, dnssec, dnsovertls, nta. Note that when a network interface disappears all configuration is lost automatically, an explicit reverting is not necessary in that case. Added in version 239. monitor Show a continuous stream of local client resolution queries and their responses. Whenever a local query is completed the query's DNS resource lookup key and resource records are shown. Note that this displays queries issued locally only, and does not immediately relate to DNS requests submitted to configured DNS servers or the LLMNR or MulticastDNS zones, as lookups may be answered from the local cache, or might result in multiple DNS transactions (for example to validate DNSSEC information). If CNAME/CNAME redirection chains are followed, a separate query will be displayed for each element of the chain. Use --json= to enable JSON output. Added in version 252. show-cache Show current cache content, per scope. Use --json= to enable JSON output. Added in version 254. show-server-state Show detailed server state information, per DNS Server. Use --json= to enable JSON output. Added in version 255. log-level [LEVEL] If no argument is given, print the current log level of the manager. If an optional argument LEVEL is provided, then the command changes the current log level of the manager to LEVEL (accepts the same values as --log-level= described in systemd(1)). Added in version 244. OPTIONS top -4, -6 By default, when resolving a hostname, both IPv4 and IPv6 addresses are acquired. By specifying -4 only IPv4 addresses are requested, by specifying -6 only IPv6 addresses are requested. Added in version 239. -i INTERFACE, --interface=INTERFACE Specifies the network interface to execute the query on. This may either be specified as numeric interface index or as network interface string (e.g. "en0"). Note that this option has no effect if system-wide DNS configuration (as configured in /etc/resolv.conf or /etc/systemd/resolved.conf) in place of per-link configuration is used. Added in version 239. -p PROTOCOL, --protocol=PROTOCOL Specifies the network protocol for the query. May be one of "dns" (i.e. classic unicast DNS), "llmnr" (Link-Local Multicast Name Resolution[5]), "llmnr-ipv4", "llmnr-ipv6" (LLMNR via the indicated underlying IP protocols), "mdns" (Multicast DNS[6]), "mdns-ipv4", "mdns-ipv6" (MDNS via the indicated underlying IP protocols). By default the lookup is done via all protocols suitable for the lookup. If used, limits the set of protocols that may be used. Use this option multiple times to enable resolving via multiple protocols at the same time. The setting "llmnr" is identical to specifying this switch once with "llmnr-ipv4" and once via "llmnr-ipv6". Note that this option does not force the service to resolve the operation with the specified protocol, as that might require a suitable network interface and configuration. The special value "help" may be used to list known values. Added in version 239. -t TYPE, --type=TYPE, -c CLASS, --class=CLASS When used in conjunction with the query command, specifies the DNS resource record type (e.g. A, AAAA, MX, ...) and class (e.g. IN, ANY, ...) to look up. If these options are used a DNS resource record set matching the specified class and type is requested. The class defaults to IN if only a type is specified. The special value "help" may be used to list known values. Without these options resolvectl query provides high-level domain name to address and address to domain name resolution. With these options it provides low-level DNS resource record resolution. The search domain logic is automatically turned off when these options are used, i.e. specified domain names need to be fully qualified domain names. Moreover, IDNA internal domain name translation is turned off as well, i.e. international domain names should be specified in "xn--..." notation, unless look-up in MulticastDNS/LLMNR is desired, in which case UTF-8 characters should be used. Added in version 239. --service-address=BOOL Takes a boolean parameter. If true (the default), when doing a service lookup with --service the hostnames contained in the SRV resource records are resolved as well. Added in version 239. --service-txt=BOOL Takes a boolean parameter. If true (the default), when doing a DNS-SD service lookup with --service the TXT service metadata record is resolved as well. Added in version 239. --cname=BOOL Takes a boolean parameter. If true (the default), DNS CNAME or DNAME redirections are followed. Otherwise, if a CNAME or DNAME record is encountered while resolving, an error is returned. Added in version 239. --validate=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), DNSSEC validation is applied as usual under the condition that it is enabled for the network and for systemd-resolved.service as a whole. If false, DNSSEC validation is disabled for the specific query, regardless of whether it is enabled for the network or in the service. Note that setting this option to true does not force DNSSEC validation on systems/networks where DNSSEC is turned off. This option is only suitable to turn off such validation where otherwise enabled, not enable validation where otherwise disabled. Added in version 248. --synthesize=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), select domains are resolved on the local system, among them "localhost", "_gateway", "_outbound", "_localdnsstub" and "_localdnsproxy" or entries from /etc/hosts. If false these domains are not resolved locally, and either fail (in case of "localhost", "_gateway" or "_outbound" and suchlike) or go to the network via regular DNS/mDNS/LLMNR lookups (in case of /etc/hosts entries). Added in version 248. --cache=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups use the local DNS resource record cache. If false, lookups are routed to the network instead, regardless if already available in the local cache. Added in version 248. --zone=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups are answered from locally registered LLMNR or mDNS resource records, if defined. If false, locally registered LLMNR/mDNS records are not considered for the lookup request. Added in version 248. --trust-anchor=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups for DS and DNSKEY are answered from the local DNSSEC trust anchors if possible. If false, the local trust store is not considered for the lookup request. Added in version 248. --network=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups are answered via DNS, LLMNR or mDNS network requests if they cannot be synthesized locally, or be answered from the local cache, zone or trust anchors (see above). If false, the request is not answered from the network and will thus fail if none of the indicated sources can answer them. Added in version 248. --search=BOOL Takes a boolean parameter. If true (the default), any specified single-label hostnames will be searched in the domains configured in the search domain list, if it is non-empty. Otherwise, the search domain logic is disabled. Note that this option has no effect if --type= is used (see above), in which case the search domain logic is unconditionally turned off. Added in version 239. --raw[=payload|packet] Dump the answer as binary data. If there is no argument or if the argument is "payload", the payload of the packet is exported. If the argument is "packet", the whole packet is dumped in wire format, prefixed by length specified as a little-endian 64-bit number. This format allows multiple packets to be dumped and unambiguously parsed. Added in version 239. --legend=BOOL Takes a boolean parameter. If true (the default), column headers and meta information about the query response are shown. Otherwise, this output is suppressed. Added in version 239. --stale-data=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups are answered with stale data (expired resource records) if possible. If false, the stale data is not considered for the lookup request. Added in version 254. --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). -j Short for --json=auto Added in version 252. --no-pager Do not pipe output into a pager. -h, --help Print a short help text and exit. --version Print a short version string and exit. COMPATIBILITY WITH RESOLVCONF(8) top resolvectl is a multi-call binary. When invoked as "resolvconf" (generally achieved by means of a symbolic link of this name to the resolvectl binary) it is run in a limited resolvconf(8) compatibility mode. It accepts mostly the same arguments and pushes all data into systemd-resolved.service(8), similar to how dns and domain commands operate. Note that systemd-resolved.service is the only supported backend, which is different from other implementations of this command. /etc/resolv.conf will only be updated with servers added with this command when /etc/resolv.conf is a symlink to /run/systemd/resolve/resolv.conf, and not a static file. See the discussion of /etc/resolv.conf handling in systemd-resolved.service(8). Not all operations supported by other implementations are supported natively. Specifically: -a Registers per-interface DNS configuration data with systemd-resolved. Expects a network interface name as only command line argument. Reads resolv.conf(5)-compatible DNS configuration data from its standard input. Relevant fields are "nameserver" and "domain"/"search". This command is mostly identical to invoking resolvectl with a combination of dns and domain commands. Added in version 239. -d Unregisters per-interface DNS configuration data with systemd-resolved. This command is mostly identical to invoking resolvectl revert. Added in version 239. -f When specified -a and -d will not complain about missing network interfaces and will silently execute no operation in that case. Added in version 239. -x This switch for "exclusive" operation is supported only partially. It is mapped to an additional configured search domain of "~." i.e. ensures that DNS traffic is preferably routed to the DNS servers on this interface, unless there are other, more specific domains configured on other interfaces. Added in version 239. -m, -p These switches are not supported and are silently ignored. Added in version 239. -u, -I, -i, -l, -R, -r, -v, -V, --enable-updates, --disable-updates, --are-updates-enabled These switches are not supported and the command will fail if used. Added in version 239. See resolvconf(8) for details on those command line options. EXAMPLES top Example 1. Retrieve the addresses of the "www.0pointer.net" domain (A and AAAA resource records) $ resolvectl query www.0pointer.net www.0pointer.net: 2a01:238:43ed:c300:10c3:bcf3:3266:da74 85.214.157.71 -- Information acquired via protocol DNS in 611.6ms. -- Data is authenticated: no Example 2. Retrieve the domain of the "85.214.157.71" IP address (PTR resource record) $ resolvectl query 85.214.157.71 85.214.157.71: gardel.0pointer.net -- Information acquired via protocol DNS in 1.2997s. -- Data is authenticated: no Example 3. Retrieve the MX record of the "yahoo.com" domain $ resolvectl --legend=no -t MX query yahoo.com yahoo.com. IN MX 1 mta7.am0.yahoodns.net yahoo.com. IN MX 1 mta6.am0.yahoodns.net yahoo.com. IN MX 1 mta5.am0.yahoodns.net Example 4. Resolve an SRV service $ resolvectl service _xmpp-server._tcp gmail.com _xmpp-server._tcp/gmail.com: alt1.xmpp-server.l.google.com:5269 [priority=20, weight=0] 173.194.210.125 alt4.xmpp-server.l.google.com:5269 [priority=20, weight=0] 173.194.65.125 ... Example 5. Retrieve a PGP key (OPENPGP resource record) $ resolvectl openpgp [email protected] d08ee310438ca124a6149ea5cc21b6313b390dce485576eff96f8722._openpgpkey.fedoraproject.org. IN OPENPGPKEY mQINBFBHPMsBEACeInGYJCb+7TurKfb6wGyTottCDtiSJB310i37/6ZYoeIay/5soJjlMyf MFQ9T2XNT/0LM6gTa0MpC1st9LnzYTMsT6tzRly1D1UbVI6xw0g0vE5y2Cjk3xUwAynCsSs ... Example 6. Retrieve a TLS key (TLSA resource record) $ resolvectl tlsa tcp fedoraproject.org:443 _443._tcp.fedoraproject.org IN TLSA 0 0 1 19400be5b7a31fb733917700789d2f0a2471c0c9d506c0e504c06c16d7cb17c0 -- Cert. usage: CA constraint -- Selector: Full Certificate -- Matching type: SHA-256 "tcp" and ":443" are optional and could be skipped. SEE ALSO top systemd(1), systemd-resolved.service(8), systemd.dnssd(5), systemd-networkd.service(8), resolvconf(8) NOTES top 1. RFC 6763 DNS-SD https://tools.ietf.org/html/rfc6763 2. RFC 2782 SRV https://tools.ietf.org/html/rfc2782 3. RFC 7929 https://tools.ietf.org/html/rfc7929 4. RFC 6698 https://tools.ietf.org/html/rfc6698 5. Link-Local Multicast Name Resolution https://tools.ietf.org/html/rfc4795 6. Multicast DNS https://www.ietf.org/rfc/rfc6762.txt 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 RESOLVECTL(1) Pages that refer to this page: systemd.dnssd(5), systemd.link(5), systemd.directives(7), systemd.index(7), systemd-resolved.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. | # resolvconf\n\n> Manage nameserver information.\n> Acts as an intermediary between programs that supply nameserver information and applications that use this information.\n> This page documents Debian's implementation of `resolvconf`.\n> More information: <https://manned.org/resolvconf.8>.\n\n- Add or override the IFACE.PROG record and run the update scripts if updating is enabled:\n\n`resolvconf -a {{IFACE.PROG}}`\n\n- Delete the IFACE.PROG record and run the update scripts if updating is enabled:\n\n`resolvconf -d {{IFACR.PROG}}`\n\n- Just run the update scripts if updating is enabled:\n\n`resolvconf -u`\n\n- Set the flag indicating whether `resolvconf` should run update scripts when invoked with `-a`, `-d` or `-u`:\n\n`resolvconf --enable-updates`\n\n- Clear the flag indicating whether to run updates:\n\n`resolvconf --disable-updates`\n\n- Check whether updates are enabled:\n\n`resolvconf --updates-are-enabled`\n |
resolvectl | resolvectl(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training resolvectl(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COMMANDS | OPTIONS | COMPATIBILITY WITH RESOLVCONF(8) | EXAMPLES | SEE ALSO | NOTES | COLOPHON RESOLVECTL(1) resolvectl RESOLVECTL(1) NAME top resolvectl, resolvconf - Resolve domain names, IPV4 and IPv6 addresses, DNS resource records, and services; introspect and reconfigure the DNS resolver SYNOPSIS top resolvectl [OPTIONS...] {COMMAND} [NAME...] DESCRIPTION top resolvectl may be used to resolve domain names, IPv4 and IPv6 addresses, DNS resource records and services with the systemd-resolved.service(8) resolver service. By default, the specified list of parameters will be resolved as hostnames, retrieving their IPv4 and IPv6 addresses. If the parameters specified are formatted as IPv4 or IPv6 addresses the reverse operation is done, and a hostname is retrieved for the specified addresses. The program's output contains information about the protocol used for the look-up and on which network interface the data was discovered. It also contains information on whether the information could be authenticated. All data for which local DNSSEC validation succeeds is considered authenticated. Moreover all data originating from local, trusted sources is also reported authenticated, including resolution of the local host name, the "localhost" hostname or all data from /etc/hosts. COMMANDS top query HOSTNAME|ADDRESS... Resolve domain names, as well as IPv4 and IPv6 addresses. When used in conjunction with --type= or --class= (see below), resolves low-level DNS resource records. If a single-label domain name is specified it is searched for according to the configured search domains unless --search=no or --type=/--class= are specified, both of which turn this logic off. If an international domain name is specified, it is automatically translated according to IDNA rules when resolved via classic DNS but not for look-ups via MulticastDNS or LLMNR. If --type=/--class= is used IDNA translation is turned off and domain names are processed as specified. Added in version 239. service [[NAME] TYPE] DOMAIN Resolve RFC 6763 DNS-SD[1] and RFC 2782 SRV[2] services, depending on the specified list of parameters. If three parameters are passed the first is assumed to be the DNS-SD service name, the second the SRV service type, and the third the domain to search in. In this case a full DNS-SD style SRV and TXT lookup is executed. If only two parameters are specified, the first is assumed to be the SRV service type, and the second the domain to look in. In this case no TXT resource record is requested. Finally, if only one parameter is specified, it is assumed to be a domain name, that is already prefixed with an SRV type, and an SRV lookup is done (no TXT). Added in version 239. openpgp EMAIL@DOMAIN... Query PGP keys stored as OPENPGPKEY resource records, see RFC 7929[3]. Specified e-mail addresses are converted to the corresponding DNS domain name, and any OPENPGPKEY keys are printed. Added in version 239. tlsa [FAMILY] DOMAIN[:PORT]... Query TLS public keys stored as TLSA resource records, see RFC 6698[4]. A query will be performed for each of the specified names prefixed with the port and family ("_port._family.domain"). The port number may be specified after a colon (":"), otherwise 443 will be used by default. The family may be specified as the first argument, otherwise tcp will be used. Added in version 239. status [LINK...] Shows the global and per-link DNS settings currently in effect. If no command is specified, this is the implied default. Added in version 239. statistics Shows general resolver statistics, including information whether DNSSEC is enabled and available, as well as resolution and validation statistics. Added in version 239. reset-statistics Resets the statistics counters shown in statistics to zero. This operation requires root privileges. Added in version 239. flush-caches Flushes all DNS resource record caches the service maintains locally. This is mostly equivalent to sending the SIGUSR2 to the systemd-resolved service. Added in version 239. reset-server-features Flushes all feature level information the resolver learnt about specific servers, and ensures that the server feature probing logic is started from the beginning with the next look-up request. This is mostly equivalent to sending the SIGRTMIN+1 to the systemd-resolved service. Added in version 239. dns [LINK [SERVER...]], domain [LINK [DOMAIN...]], default-route [LINK [BOOL...]], llmnr [LINK [MODE]], mdns [LINK [MODE]], dnssec [LINK [MODE]], dnsovertls [LINK [MODE]], nta [LINK [DOMAIN...]] Get/set per-interface DNS configuration. These commands may be used to configure various DNS settings for network interfaces. These commands may be used to inform systemd-resolved or systemd-networkd about per-interface DNS configuration determined through external means. The dns command expects IPv4 or IPv6 address specifications of DNS servers to use. Each address can optionally take a port number separated with ":", a network interface name or index separated with "%", and a Server Name Indication (SNI) separated with "#". When IPv6 address is specified with a port number, then the address must be in the square brackets. That is, the acceptable full formats are "111.222.333.444:9953%ifname#example.com" for IPv4 and "[1111:2222::3333]:9953%ifname#example.com" for IPv6. The domain command expects valid DNS domains, possibly prefixed with "~", and configures a per-interface search or route-only domain. The default-route command expects a boolean parameter, and configures whether the link may be used as default route for DNS lookups, i.e. if it is suitable for lookups on domains no other link explicitly is configured for. The llmnr, mdns, dnssec and dnsovertls commands may be used to configure the per-interface LLMNR, MulticastDNS, DNSSEC and DNSOverTLS settings. Finally, nta command may be used to configure additional per-interface DNSSEC NTA domains. Commands dns, domain and nta can take a single empty string argument to clear their respective value lists. For details about these settings, their possible values and their effect, see the corresponding settings in systemd.network(5). Added in version 239. revert LINK Revert the per-interface DNS configuration. If the DNS configuration is reverted all per-interface DNS setting are reset to their defaults, undoing all effects of dns, domain, default-route, llmnr, mdns, dnssec, dnsovertls, nta. Note that when a network interface disappears all configuration is lost automatically, an explicit reverting is not necessary in that case. Added in version 239. monitor Show a continuous stream of local client resolution queries and their responses. Whenever a local query is completed the query's DNS resource lookup key and resource records are shown. Note that this displays queries issued locally only, and does not immediately relate to DNS requests submitted to configured DNS servers or the LLMNR or MulticastDNS zones, as lookups may be answered from the local cache, or might result in multiple DNS transactions (for example to validate DNSSEC information). If CNAME/CNAME redirection chains are followed, a separate query will be displayed for each element of the chain. Use --json= to enable JSON output. Added in version 252. show-cache Show current cache content, per scope. Use --json= to enable JSON output. Added in version 254. show-server-state Show detailed server state information, per DNS Server. Use --json= to enable JSON output. Added in version 255. log-level [LEVEL] If no argument is given, print the current log level of the manager. If an optional argument LEVEL is provided, then the command changes the current log level of the manager to LEVEL (accepts the same values as --log-level= described in systemd(1)). Added in version 244. OPTIONS top -4, -6 By default, when resolving a hostname, both IPv4 and IPv6 addresses are acquired. By specifying -4 only IPv4 addresses are requested, by specifying -6 only IPv6 addresses are requested. Added in version 239. -i INTERFACE, --interface=INTERFACE Specifies the network interface to execute the query on. This may either be specified as numeric interface index or as network interface string (e.g. "en0"). Note that this option has no effect if system-wide DNS configuration (as configured in /etc/resolv.conf or /etc/systemd/resolved.conf) in place of per-link configuration is used. Added in version 239. -p PROTOCOL, --protocol=PROTOCOL Specifies the network protocol for the query. May be one of "dns" (i.e. classic unicast DNS), "llmnr" (Link-Local Multicast Name Resolution[5]), "llmnr-ipv4", "llmnr-ipv6" (LLMNR via the indicated underlying IP protocols), "mdns" (Multicast DNS[6]), "mdns-ipv4", "mdns-ipv6" (MDNS via the indicated underlying IP protocols). By default the lookup is done via all protocols suitable for the lookup. If used, limits the set of protocols that may be used. Use this option multiple times to enable resolving via multiple protocols at the same time. The setting "llmnr" is identical to specifying this switch once with "llmnr-ipv4" and once via "llmnr-ipv6". Note that this option does not force the service to resolve the operation with the specified protocol, as that might require a suitable network interface and configuration. The special value "help" may be used to list known values. Added in version 239. -t TYPE, --type=TYPE, -c CLASS, --class=CLASS When used in conjunction with the query command, specifies the DNS resource record type (e.g. A, AAAA, MX, ...) and class (e.g. IN, ANY, ...) to look up. If these options are used a DNS resource record set matching the specified class and type is requested. The class defaults to IN if only a type is specified. The special value "help" may be used to list known values. Without these options resolvectl query provides high-level domain name to address and address to domain name resolution. With these options it provides low-level DNS resource record resolution. The search domain logic is automatically turned off when these options are used, i.e. specified domain names need to be fully qualified domain names. Moreover, IDNA internal domain name translation is turned off as well, i.e. international domain names should be specified in "xn--..." notation, unless look-up in MulticastDNS/LLMNR is desired, in which case UTF-8 characters should be used. Added in version 239. --service-address=BOOL Takes a boolean parameter. If true (the default), when doing a service lookup with --service the hostnames contained in the SRV resource records are resolved as well. Added in version 239. --service-txt=BOOL Takes a boolean parameter. If true (the default), when doing a DNS-SD service lookup with --service the TXT service metadata record is resolved as well. Added in version 239. --cname=BOOL Takes a boolean parameter. If true (the default), DNS CNAME or DNAME redirections are followed. Otherwise, if a CNAME or DNAME record is encountered while resolving, an error is returned. Added in version 239. --validate=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), DNSSEC validation is applied as usual under the condition that it is enabled for the network and for systemd-resolved.service as a whole. If false, DNSSEC validation is disabled for the specific query, regardless of whether it is enabled for the network or in the service. Note that setting this option to true does not force DNSSEC validation on systems/networks where DNSSEC is turned off. This option is only suitable to turn off such validation where otherwise enabled, not enable validation where otherwise disabled. Added in version 248. --synthesize=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), select domains are resolved on the local system, among them "localhost", "_gateway", "_outbound", "_localdnsstub" and "_localdnsproxy" or entries from /etc/hosts. If false these domains are not resolved locally, and either fail (in case of "localhost", "_gateway" or "_outbound" and suchlike) or go to the network via regular DNS/mDNS/LLMNR lookups (in case of /etc/hosts entries). Added in version 248. --cache=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups use the local DNS resource record cache. If false, lookups are routed to the network instead, regardless if already available in the local cache. Added in version 248. --zone=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups are answered from locally registered LLMNR or mDNS resource records, if defined. If false, locally registered LLMNR/mDNS records are not considered for the lookup request. Added in version 248. --trust-anchor=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups for DS and DNSKEY are answered from the local DNSSEC trust anchors if possible. If false, the local trust store is not considered for the lookup request. Added in version 248. --network=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups are answered via DNS, LLMNR or mDNS network requests if they cannot be synthesized locally, or be answered from the local cache, zone or trust anchors (see above). If false, the request is not answered from the network and will thus fail if none of the indicated sources can answer them. Added in version 248. --search=BOOL Takes a boolean parameter. If true (the default), any specified single-label hostnames will be searched in the domains configured in the search domain list, if it is non-empty. Otherwise, the search domain logic is disabled. Note that this option has no effect if --type= is used (see above), in which case the search domain logic is unconditionally turned off. Added in version 239. --raw[=payload|packet] Dump the answer as binary data. If there is no argument or if the argument is "payload", the payload of the packet is exported. If the argument is "packet", the whole packet is dumped in wire format, prefixed by length specified as a little-endian 64-bit number. This format allows multiple packets to be dumped and unambiguously parsed. Added in version 239. --legend=BOOL Takes a boolean parameter. If true (the default), column headers and meta information about the query response are shown. Otherwise, this output is suppressed. Added in version 239. --stale-data=BOOL Takes a boolean parameter; used in conjunction with query. If true (the default), lookups are answered with stale data (expired resource records) if possible. If false, the stale data is not considered for the lookup request. Added in version 254. --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). -j Short for --json=auto Added in version 252. --no-pager Do not pipe output into a pager. -h, --help Print a short help text and exit. --version Print a short version string and exit. COMPATIBILITY WITH RESOLVCONF(8) top resolvectl is a multi-call binary. When invoked as "resolvconf" (generally achieved by means of a symbolic link of this name to the resolvectl binary) it is run in a limited resolvconf(8) compatibility mode. It accepts mostly the same arguments and pushes all data into systemd-resolved.service(8), similar to how dns and domain commands operate. Note that systemd-resolved.service is the only supported backend, which is different from other implementations of this command. /etc/resolv.conf will only be updated with servers added with this command when /etc/resolv.conf is a symlink to /run/systemd/resolve/resolv.conf, and not a static file. See the discussion of /etc/resolv.conf handling in systemd-resolved.service(8). Not all operations supported by other implementations are supported natively. Specifically: -a Registers per-interface DNS configuration data with systemd-resolved. Expects a network interface name as only command line argument. Reads resolv.conf(5)-compatible DNS configuration data from its standard input. Relevant fields are "nameserver" and "domain"/"search". This command is mostly identical to invoking resolvectl with a combination of dns and domain commands. Added in version 239. -d Unregisters per-interface DNS configuration data with systemd-resolved. This command is mostly identical to invoking resolvectl revert. Added in version 239. -f When specified -a and -d will not complain about missing network interfaces and will silently execute no operation in that case. Added in version 239. -x This switch for "exclusive" operation is supported only partially. It is mapped to an additional configured search domain of "~." i.e. ensures that DNS traffic is preferably routed to the DNS servers on this interface, unless there are other, more specific domains configured on other interfaces. Added in version 239. -m, -p These switches are not supported and are silently ignored. Added in version 239. -u, -I, -i, -l, -R, -r, -v, -V, --enable-updates, --disable-updates, --are-updates-enabled These switches are not supported and the command will fail if used. Added in version 239. See resolvconf(8) for details on those command line options. EXAMPLES top Example 1. Retrieve the addresses of the "www.0pointer.net" domain (A and AAAA resource records) $ resolvectl query www.0pointer.net www.0pointer.net: 2a01:238:43ed:c300:10c3:bcf3:3266:da74 85.214.157.71 -- Information acquired via protocol DNS in 611.6ms. -- Data is authenticated: no Example 2. Retrieve the domain of the "85.214.157.71" IP address (PTR resource record) $ resolvectl query 85.214.157.71 85.214.157.71: gardel.0pointer.net -- Information acquired via protocol DNS in 1.2997s. -- Data is authenticated: no Example 3. Retrieve the MX record of the "yahoo.com" domain $ resolvectl --legend=no -t MX query yahoo.com yahoo.com. IN MX 1 mta7.am0.yahoodns.net yahoo.com. IN MX 1 mta6.am0.yahoodns.net yahoo.com. IN MX 1 mta5.am0.yahoodns.net Example 4. Resolve an SRV service $ resolvectl service _xmpp-server._tcp gmail.com _xmpp-server._tcp/gmail.com: alt1.xmpp-server.l.google.com:5269 [priority=20, weight=0] 173.194.210.125 alt4.xmpp-server.l.google.com:5269 [priority=20, weight=0] 173.194.65.125 ... Example 5. Retrieve a PGP key (OPENPGP resource record) $ resolvectl openpgp [email protected] d08ee310438ca124a6149ea5cc21b6313b390dce485576eff96f8722._openpgpkey.fedoraproject.org. IN OPENPGPKEY mQINBFBHPMsBEACeInGYJCb+7TurKfb6wGyTottCDtiSJB310i37/6ZYoeIay/5soJjlMyf MFQ9T2XNT/0LM6gTa0MpC1st9LnzYTMsT6tzRly1D1UbVI6xw0g0vE5y2Cjk3xUwAynCsSs ... Example 6. Retrieve a TLS key (TLSA resource record) $ resolvectl tlsa tcp fedoraproject.org:443 _443._tcp.fedoraproject.org IN TLSA 0 0 1 19400be5b7a31fb733917700789d2f0a2471c0c9d506c0e504c06c16d7cb17c0 -- Cert. usage: CA constraint -- Selector: Full Certificate -- Matching type: SHA-256 "tcp" and ":443" are optional and could be skipped. SEE ALSO top systemd(1), systemd-resolved.service(8), systemd.dnssd(5), systemd-networkd.service(8), resolvconf(8) NOTES top 1. RFC 6763 DNS-SD https://tools.ietf.org/html/rfc6763 2. RFC 2782 SRV https://tools.ietf.org/html/rfc2782 3. RFC 7929 https://tools.ietf.org/html/rfc7929 4. RFC 6698 https://tools.ietf.org/html/rfc6698 5. Link-Local Multicast Name Resolution https://tools.ietf.org/html/rfc4795 6. Multicast DNS https://www.ietf.org/rfc/rfc6762.txt 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 RESOLVECTL(1) Pages that refer to this page: systemd.dnssd(5), systemd.link(5), systemd.directives(7), systemd.index(7), systemd-resolved.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. | # resolvectl\n\n> Resolve domain names, IPv4 and IPv6 addresses, DNS resource records, and services.\n> Introspect and reconfigure the DNS resolver.\n> More information: <https://www.freedesktop.org/software/systemd/man/resolvectl.html>.\n\n- Show DNS settings:\n\n`resolvectl status`\n\n- Resolve the IPv4 and IPv6 addresses for one or more domains:\n\n`resolvectl query {{domain1 domain2 ...}}`\n\n- Retrieve the domain of a specified IP address:\n\n`resolvectl query {{ip_address}}`\n\n- Flush all local DNS caches:\n\n`resolvectl flush-caches`\n\n- Display DNS statistics (transactions, cache, and DNSSEC verdicts):\n\n`resolvectl statistics`\n\n- Retrieve an MX record of a domain:\n\n`resolvectl --legend={{no}} --type={{MX}} query {{domain}}`\n\n- Resolve an SRV record, for example _xmpp-server._tcp gmail.com:\n\n`resolvectl service _{{service}}._{{protocol}} {{name}}`\n\n- Retrieve a TLS key:\n\n`resolvectl tlsa tcp {{domain}}:443`\n |
resolveip | resolveip(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training resolveip(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | COPYRIGHT | SEE ALSO | AUTHOR | COLOPHON RESOLVEIP(1) MariaDB Database System RESOLVEIP(1) NAME top resolveip - resolve host name to IP address or vice versa SYNOPSIS top resolveip [options] {host_name|ip-addr} ... DESCRIPTION top The resolveip utility resolves host names to IP addresses and vice versa. Invoke resolveip like this: shell> resolveip [options] {host_name|ip-addr} ... resolveip supports the following options. --help, --info, -?, -I Display a help message and exit. --silent, -s Silent mode. Produce less output. --version, -V Display version information and exit. COPYRIGHT top Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2020 MariaDB Foundation This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see http://www.gnu.org/licenses/. SEE ALSO top For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/ AUTHOR top MariaDB Foundation (http://www.mariadb.org/). COLOPHON top This page is part of the MariaDB (MariaDB database server) project. Information about the project can be found at http://mariadb.org/. If you have a bug report for this manual page, see https://mariadb.com/kb/en/mariadb/reporting-bugs/. This page was obtained from the project's upstream Git repository https://github.com/MariaDB/server on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-05-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] MariaDB 10.8 15 May 2020 RESOLVEIP(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. | # resolveip\n\n> Resolve hostnames to their IP addresses and vice versa.\n> More information: <https://mariadb.com/kb/en/resolveip/>.\n\n- Resolve a hostname to an IP address:\n\n`resolveip {{example.org}}`\n\n- Resolve an IP address to a hostname:\n\n`resolveip {{1.1.1.1}}`\n\n- Silent mode. Produces less output:\n\n`resolveip --silent {{example.org}}`\n |
restorecon | restorecon(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training restorecon(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | ARGUMENTS | NOTES | AUTHOR | SEE ALSO | COLOPHON restorecon(8) SELinux User Command restorecon(8) NAME top restorecon - restore file(s) default SELinux security contexts. SYNOPSIS top restorecon [-r|-R] [-m] [-n] [-p] [-v] [-i] [-F] [-W] [-I|-D] [-x] [-e directory] pathname ... restorecon [-f infilename] [-e directory] [-r|-R] [-m] [-n] [-p] [-v] [-i] [-F] [-W] [-I|-D] [-x] [-T nthreads] DESCRIPTION top This manual page describes the restorecon program. This program is primarily used to set the security context (extended attributes) on one or more files. It can also be run at any other time to correct inconsistent labels, to add support for newly-installed policy or, by using the -n option, to passively check whether the file contexts are all set as specified by the active policy (default behavior). If a file object does not have a context, restorecon will write the default context to the file object's extended attributes. If a file object has a context, restorecon will only modify the type portion of the security context. The -F option will force a replacement of the entire context. If a file is labeled with customizable SELinux type (for list of customizable types see /etc/selinux/{SELINUXTYPE}/contexts/customizable_types), restorecon won't reset the label unless the -F option is used. It is the same executable as setfiles but operates in a slightly different manner depending on its argv[0]. OPTIONS top -e directory exclude a directory (repeat the option to exclude more than one directory, Requires full path). -f infilename infilename contains a list of files to be processed. Use - for stdin. -F Force reset of context to match file_context for customizable files, and the default file context, changing the user, role, range portion as well as the type. -h, -? display usage information and exit. -i ignore files that do not exist. -I ignore digest to force checking of labels even if the stored SHA1 digest matches the specfiles SHA1 digest. The digest will then be updated provided there are no errors. See the NOTES section for further details. -D Set or update any directory SHA1 digests. Use this option to enable usage of the security.sehash extended attribute. -m do not read /proc/mounts to obtain a list of non-seclabel mounts to be excluded from relabeling checks. Setting this option is useful where there is a non-seclabel fs mounted with a seclabel fs mounted on a directory below this. -n don't change any file labels (passive check). To display the files whose labels would be changed, add -v. -o outfilename Deprecated - This option is no longer supported. -p show progress by printing the number of files in 1k blocks unless relabeling the entire OS, that will then show the approximate percentage complete. Note that the -p and -v options are mutually exclusive. -R, -r change files and directories file labels recursively (descend directories). -v show changes in file labels. Multiple -v options increase the verbosity. Note that the -v and -p options are mutually exclusive. -W display warnings about entries that had no matching files by outputting the selabel_stats(3) results. -0 the separator for the input items is assumed to be the null character (instead of the white space). The quotes and the backslash characters are also treated as normal characters that can form valid input. This option finally also 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 -print0 option of GNU find produces input suitable for this mode. -x prevent restorecon from crossing file system boundaries. -T nthreads use up to nthreads threads. Specify 0 to create as many threads as there are available CPU cores; 1 to use only a single thread (default); or any positive number to use the given number of threads (if possible). ARGUMENTS top pathname ... The pathname for the file(s) to be relabeled. NOTES top 1. restorecon by default does not operate recursively on directories. Paths leading up the final component of the file(s) are canonicalized using realpath(3) before labeling. 2. If the pathname specifies the root directory and the -vR or -vr options are set and the audit system is running, then an audit event is automatically logged stating that a "mass relabel" took place using the message label FS_RELABEL. 3. To improve performance when relabeling file systems recursively (i.e. the -R or -r option is set), the -D option to restorecon will cause it to store a SHA1 digest of the default specfiles set in an extended attribute named security.sehash on each directory specified in pathname ... once the relabeling has been completed successfully. These digests will be checked should restorecon -D be rerun with the same pathname parameters. See selinux_restorecon(3) for further details. The -I option will ignore the SHA1 digest from each directory specified in pathname ... and provided the -n option is NOT set and recursive mode is set, files will be relabeled as required with the digests then being updated provided there are no errors. AUTHOR top This man page was written by Dan Walsh <[email protected]>. Some of the content of this man page was taken from the setfiles man page written by Russell Coker <[email protected]>. The program was written by Dan Walsh <[email protected]>. SEE ALSO top setfiles(8), fixfiles(8), load_policy(8), checkpolicy(8), customizable_types(5) COLOPHON top This page is part of the selinux (Security-Enhanced Linux user- space libraries and tools) project. Information about the project can be found at https://github.com/SELinuxProject/selinux/wiki. If you have a bug report for this manual page, see https://github.com/SELinuxProject/selinux/wiki/Contributing. This page was obtained from the project's upstream Git repository https://github.com/SELinuxProject/selinux on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-05-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] 10 June 2016 restorecon(8) Pages that refer to this page: selinux_restorecon_xattr(3), fixfiles(8), restorecond(8), restorecon_xattr(8), selinux(8), semanage-fcontext(8), setfiles(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. | # restorecon\n\n> Restore SELinux security context on files/directories according to persistent rules.\n> See also: `semanage-fcontext`.\n> More information: <https://manned.org/restorecon>.\n\n- View the current security context of a file or directory:\n\n`ls -dlZ {{path/to/file_or_directory}}`\n\n- Restore the security context of a file or directory:\n\n`restorecon {{path/to/file_or_directory}}`\n\n- Restore the security context of a directory recursively, and show all changed labels:\n\n`restorecon -R -v {{path/to/directory}}`\n\n- Restore the security context of a directory recursively, using all available threads, and show progress:\n\n`restorecon -R -T {{0}} -p {{path/to/directory}}`\n\n- Preview the label changes that would happen without applying them:\n\n`restorecon -R -n -v {{path/to/directory}}`\n |
rev | rev(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training rev(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | SEE ALSO | REPORTING BUGS | AVAILABILITY REV(1) User Commands REV(1) NAME top rev - reverse lines characterwise SYNOPSIS top rev [option] [file...] DESCRIPTION top The rev utility copies the specified files to standard output, reversing the order of characters in every line. If no files are specified, standard input is read. This utility is a line-oriented tool and it uses in-memory allocated buffer for a whole wide-char line. If the input file is huge and without line breaks then allocating the memory for the file may be unsuccessful. OPTIONS top -h, --help Display help text and exit. -V, --version Print version and exit. -0, --zero Zero termination. Use the byte '\0' as line separator. SEE ALSO top tac(1) REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The rev 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 REV(1) Pages that refer to this page: tac(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. | # rev\n\n> Reverse a line of text.\n> More information: <https://manned.org/rev>.\n\n- Reverse the text string "hello":\n\n`echo "hello" | rev`\n\n- Reverse an entire file and print to `stdout`:\n\n`rev {{path/to/file}}`\n |
rfkill | rfkill(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training rfkill(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | COMMANDS | EXAMPLE | AUTHORS | SEE ALSO | REPORTING BUGS | AVAILABILITY RFKILL(8) System Administration RFKILL(8) NAME top rfkill - tool for enabling and disabling wireless devices SYNOPSIS top rfkill [options] [command] [ID|type ...] DESCRIPTION top rfkill lists, enabling and disabling wireless devices. The command "list" output format is deprecated and maintained for backward compatibility only. The new output format is the default when no command is specified or when the option --output is used. 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 the --output option together with a columns list in environments where a stable output is required. 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 available columns. --output-all Output all available columns. -r, --raw Use the raw output format. -h, --help Display help text and exit. -V, --version Print version and exit. COMMANDS top help Display help text and exit. event Listen for rfkill events and display them on stdout. list [id|type ...] List the current state of all available devices. The command output format is deprecated, see the DESCRIPTION section. It is a good idea to check with list command id or type scope is appropriate before setting block or unblock. Special all type string will match everything. Use of multiple ID or type arguments is supported. Possible types are all, {wlan | wifi}, bluetooth, {uwb | ultrawideband}, wimax, wwan, gps, fm, nfc. block id|type [...] Disable the corresponding device. unblock id|type [...] Enable the corresponding device. If the device is hard-blocked, for example via a hardware switch, it will remain unavailable though it is now soft-unblocked. toggle id|type [...] Enable or disable the corresponding device. EXAMPLE top rfkill --output ID,TYPE rfkill block all rfkill unblock wlan rfkill block bluetooth uwb wimax wwan gps fm nfc AUTHORS top rfkill was originally written by Johannes Berg <[email protected]> and Marcel Holtmann <[email protected]>. The code has been later modified by Sami Kerola <[email protected]> and Karel Zak <[email protected]> for the util-linux project. This manual page was written by Darren Salt <[email protected]> for the Debian project (and may be used by others). SEE ALSO top powertop(8), systemd-rfkill(8), Linux kernel documentation <https://docs.kernel.org/driver-api/rfkill.html> REPORTING BUGS top For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues. AVAILABILITY top The rfkill 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 RFKILL(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. | # rfkill\n\n> Enable and disable wireless devices.\n> More information: <https://manned.org/rfkill>.\n\n- List devices:\n\n`rfkill`\n\n- Filter by columns:\n\n`rfkill -o {{ID,TYPE,DEVICE}}`\n\n- Block devices by type (e.g. bluetooth, wlan):\n\n`rfkill block {{bluetooth}}`\n\n- Unblock devices by type (e.g. bluetooth, wlan):\n\n`rfkill unblock {{wlan}}`\n\n- Output in JSON format:\n\n`rfkill -J`\n |
rm | rm(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training rm(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON RM(1) User Commands RM(1) NAME top rm - remove files or directories SYNOPSIS top rm [OPTION]... [FILE]... DESCRIPTION top This manual page documents the GNU version of rm. rm removes each specified file. By default, it does not remove directories. If the -I or --interactive=once option is given, and there are more than three files or the -r, -R, or --recursive are given, then rm prompts the user for whether to proceed with the entire operation. If the response is not affirmative, the entire command is aborted. Otherwise, if a file is unwritable, standard input is a terminal, and the -f or --force option is not given, or the -i or --interactive=always option is given, rm prompts the user for whether to remove the file. If the response is not affirmative, the file is skipped. OPTIONS top Remove (unlink) the FILE(s). -f, --force ignore nonexistent files and arguments, never prompt -i prompt before every removal -I prompt once before removing more than three files, or when removing recursively; less intrusive than -i, while still giving protection against most mistakes --interactive[=WHEN] prompt according to WHEN: never, once (-I), or always (-i); without WHEN, prompt always --one-file-system when removing a hierarchy recursively, skip any directory that is on a file system different from that of the corresponding command line argument --no-preserve-root do not treat '/' specially --preserve-root[=all] do not remove '/' (default); with 'all', reject any command line argument on a separate device from its parent -r, -R, --recursive remove directories and their contents recursively -d, --dir remove empty directories -v, --verbose explain what is being done --help display this help and exit --version output version information and exit By default, rm does not remove directories. Use the --recursive (-r or -R) option to remove each listed directory, too, along with all of its contents. To remove a file whose name starts with a '-', for example '-foo', use one of these commands: rm -- -foo rm ./-foo Note that if you use rm to remove a file, it might be possible to recover some of its contents, given sufficient expertise and/or time. For greater assurance that the contents are truly unrecoverable, consider using shred(1). AUTHOR top Written by Paul Rubin, David MacKenzie, Richard M. Stallman, and 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 unlink(1), unlink(2), chattr(1), shred(1) Full documentation <https://www.gnu.org/software/coreutils/rm> or available locally via: info '(coreutils) rm 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 RM(1) Pages that refer to this page: rmdir(2), unlink(2), remove(3), mq_overview(7), symlink(7), debugfs(8), 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. | # rm\n\n> Remove files or directories.\n> See also: `rmdir`.\n> More information: <https://www.gnu.org/software/coreutils/rm>.\n\n- Remove specific files:\n\n`rm {{path/to/file1 path/to/file2 ...}}`\n\n- Remove specific files ignoring nonexistent ones:\n\n`rm --force {{path/to/file1 path/to/file2 ...}}`\n\n- Remove specific files interactively prompting before each removal:\n\n`rm --interactive {{path/to/file1 path/to/file2 ...}}`\n\n- Remove specific files printing info about each removal:\n\n`rm --verbose {{path/to/file1 path/to/file2 ...}}`\n\n- Remove specific files and directories recursively:\n\n`rm --recursive {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`\n |
rmdir | rmdir(1) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training rmdir(1) Linux manual page NAME | SYNOPSIS | DESCRIPTION | AUTHOR | REPORTING BUGS | COPYRIGHT | SEE ALSO | COLOPHON RMDIR(1) User Commands RMDIR(1) NAME top rmdir - remove empty directories SYNOPSIS top rmdir [OPTION]... DIRECTORY... DESCRIPTION top Remove the DIRECTORY(ies), if they are empty. --ignore-fail-on-non-empty ignore each failure to remove a non-empty directory -p, --parents remove DIRECTORY and its ancestors; e.g., 'rmdir -p a/b' is similar to 'rmdir a/b a' -v, --verbose output a diagnostic for every directory processed --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 rmdir(2) Full documentation <https://www.gnu.org/software/coreutils/rmdir> or available locally via: info '(coreutils) rmdir 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 RMDIR(1) Pages that refer to this page: rmdir(2), cpuset(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. | # rmdir\n\n> Remove directories without files.\n> See also: `rm`.\n> More information: <https://www.gnu.org/software/coreutils/rmdir>.\n\n- Remove specific directories:\n\n`rmdir {{path/to/directory1 path/to/directory2 ...}}`\n\n- Remove specific nested directories recursively:\n\n`rmdir --parents {{path/to/directory1 path/to/directory2 ...}}`\n |
rmmod | rmmod(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training rmmod(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | COPYRIGHT | SEE ALSO | AUTHORS | COLOPHON RMMOD(8) rmmod RMMOD(8) NAME top rmmod - Simple program to remove a module from the Linux Kernel SYNOPSIS top rmmod [-f] [-s] [-v] [modulename] DESCRIPTION top rmmod is a trivial program to remove a module (when module unloading support is provided) from the kernel. Most users will want to use modprobe(8) with the -r option instead since it removes unused dependent modules as well. OPTIONS top -v, --verbose Print messages about what the program is doing. Usually rmmod prints messages only if something goes wrong. -f, --force This option can be extremely dangerous: it has no effect unless CONFIG_MODULE_FORCE_UNLOAD was set when the kernel was compiled. With this option, you can remove modules which are being used, or which are not designed to be removed, or have been marked as unsafe (see lsmod(8)). -s, --syslog Send errors to syslog instead of standard error. -V --version Show version of program and exit. COPYRIGHT top This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. Maintained by Jon Masters and others. SEE ALSO top modprobe(8), insmod(8), lsmod(8), modinfo(8) depmod(8) AUTHORS top Jon Masters <[email protected]> Developer Lucas De Marchi <[email protected]> Developer COLOPHON top This page is part of the kmod (userspace tools for managing kernel modules) project. Information about the project can be found at [unknown -- if you know, please contact man- [email protected]] 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/kernel/kmod/kmod.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] kmod 12/22/2023 RMMOD(8) Pages that refer to this page: delete_module(2), insmod(8), kmod(8), modprobe(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. | # rmmod\n\n> Remove modules from the Linux kernel.\n> More information: <https://manned.org/rmmod>.\n\n- Remove a module from the kernel:\n\n`sudo rmmod {{module_name}}`\n\n- Remove a module from the kernel and display verbose information:\n\n`sudo rmmod --verbose {{module_name}}`\n\n- Remove a module from the kernel and send errors to syslog instead of `stderr`:\n\n`sudo rmmod --syslog {{module_name}}`\n\n- Display help:\n\n`rmmod --help`\n\n- Display version:\n\n`rmmod --version`\n |
route | route(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training route(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLES | OUTPUT | FILES | SEE ALSO | HISTORY | AUTHOR | COLOPHON ROUTE(8) Linux System Administrator's Manual ROUTE(8) NAME top route - show / manipulate the IP routing table SYNOPSIS top route [-CFvnNee] [-A family |-4|-6] route [-v] [-A family |-4|-6] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss M] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If] route [-v] [-A family |-4|-6] del [-net|-host] target [gw Gw] [netmask Nm] [metric M] [[dev] If] route [-V] [--version] [-h] [--help] DESCRIPTION top Route manipulates the kernel's IP routing tables. Its primary use is to set up static routes to specific hosts or networks via an interface after it has been configured with the ifconfig(8) program. When the add or del options are used, route modifies the routing tables. Without these options, route displays the current contents of the routing tables. OPTIONS top -A family use the specified address family (eg `inet'). Use route --help for a full list. You can use -6 as an alias for --inet6 and -4 as an alias for -A inet -F operate on the kernel's FIB (Forwarding Information Base) routing table. This is the default. -C operate on the kernel's routing cache. -v select verbose operation. -n show numerical addresses instead of trying to determine symbolic host names. This is useful if you are trying to determine why the route to your nameserver has vanished. -e use netstat(8)-format for displaying the routing table. -ee will generate a very long line with all parameters from the routing table. del delete a route. add add a new route. target the destination network or host. You can provide an addresses or symbolic network or host name. Optionally you can use /prefixlen notation instead of using the netmask option. -net the target is a network. -host the target is a host. netmask NM when adding a network route, the netmask to be used. gw GW route packets via a gateway. NOTE: The specified gateway must be reachable first. This usually means that you have to set up a static route to the gateway beforehand. If you specify the address of one of your local interfaces, it will be used to decide about the interface to which the packets should be routed to. This is a BSDism compatibility hack. metric M set the metric field in the routing table (used by routing daemons) to M. If this option is not specified the metric for inet6 (IPv6) address family defaults to '1', for inet (IPv4) it defaults to '0'. You should always specify an explicit metric value to not rely on those defaults - they also differ from iproute2. mss M sets MTU (Maximum Transmission Unit) of the route to M bytes. Note that the current implementation of the route command does not allow the option to set the Maximum Segment Size (MSS). window W set the TCP window size for connections over this route to W bytes. This is typically only used on AX.25 networks and with drivers unable to handle back to back frames. irtt I set the initial round trip time (irtt) for TCP connections over this route to I milliseconds (1-12000). This is typically only used on AX.25 networks. If omitted the RFC 1122 default of 300ms is used. reject install a blocking route, which will force a route lookup to fail. This is for example used to mask out networks before using the default route. This is NOT for firewalling. mod, dyn, reinstate install a dynamic or modified route. These flags are for diagnostic purposes, and are generally only set by routing daemons. dev If force the route to be associated with the specified device, as the kernel will otherwise try to determine the device on its own (by checking already existing routes and device specifications, and where the route is added to). In most normal networks you won't need this. If dev If is the last option on the command line, the word dev may be omitted, as it's the default. Otherwise the order of the route modifiers (metric netmask gw dev) doesn't matter. EXAMPLES top route add -net 127.0.0.0 netmask 255.0.0.0 metric 1024 dev lo adds the normal loopback entry, using netmask 255.0.0.0 and associated with the "lo" device (assuming this device was previously set up correctly with ifconfig(8)). route add -net 192.56.76.0 netmask 255.255.255.0 metric 1024 dev eth0 adds a route to the local network 192.56.76.x via "eth0". The word "dev" can be omitted here. route del default deletes the current default route, which is labeled "default" or 0.0.0.0 in the destination field of the current routing table. route del -net 192.56.76.0 netmask 255.255.255.0 deletes the route. Since the Linux routing kernel uses classless addressing, you pretty much always have to specify the netmask that is same as as seen in 'route -n' listing. route add default gw mango adds a default route (which will be used if no other route matches). All packets using this route will be gatewayed through the address of a node named "mango". The device which will actually be used for that route depends on how we can reach "mango" - "mango" must be on directly reachable route. route add mango sl0 Adds the route to the host named "mango" via the SLIP interface (assuming that "mango" is the SLIP host). route add -net 192.57.66.0 netmask 255.255.255.0 gw mango This command adds the net "192.57.66.x" to be gatewayed through the former route to the SLIP interface. route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0 This is an obscure one documented so people know how to do it. This sets all of the class D (multicast) IP routes to go via "eth0". This is the correct normal configuration line with a multicasting kernel. route add -net 10.0.0.0 netmask 255.0.0.0 metric 1024 reject This installs a rejecting route for the private network "10.x.x.x." route -6 add 2001:0002::/48 metric 1 dev eth0 This adds a IPv6 route with the specified metric to be directly reachable via eth0. OUTPUT top The output of the kernel routing table is organized in the following columns Destination The destination network or destination host. Gateway The gateway address or '*' if none set. Genmask The netmask for the destination net; '255.255.255.255' for a host destination and '0.0.0.0' for the default route. Flags Possible flags include U (route is up) H (target is a host) G (use gateway) R (reinstate route for dynamic routing) D (dynamically installed by daemon or redirect) M (modified from routing daemon or redirect) A (installed by addrconf) C (cache entry) ! (reject route) Metric The 'distance' to the target (usually counted in hops). Ref Number of references to this route. (Not used in the Linux kernel.) Use Count of lookups for the route. Depending on the use of -F and -C this will be either route cache misses (-F) or hits (-C). Iface Interface to which packets for this route will be sent. MSS Default maximum segment size for TCP connections over this route. Window Default window size for TCP connections over this route. irtt Initial RTT (Round Trip Time). The kernel uses this to guess about the best TCP protocol parameters without waiting on (possibly slow) answers. HH (cached only) The number of ARP entries and cached routes that refer to the hardware header cache for the cached route. This will be -1 if a hardware address is not needed for the interface of the cached route (e.g. lo). Arp (cached only) Whether or not the hardware address for the cached route is up to date. FILES top /proc/net/ipv6_route /proc/net/route /proc/net/rt_cache SEE ALSO top ethers(5), arp(8), rarp(8), route(8), ifconfig(8), netstat(8) HISTORY top Route for Linux was originally written by Fred N. van Kempen, <[email protected]> and then modified by Johannes Stille and Linus Torvalds for pl15. Alan Cox added the mss and window options for Linux 1.1.22. irtt support and merged with netstat from Bernd Eckenfels. AUTHOR top Currently maintained by Phil Blundell <[email protected]> and Bernd Eckenfels <[email protected]>. COLOPHON top This page is part of the net-tools (networking utilities) project. Information about the project can be found at http://net-tools.sourceforge.net/. If you have a bug report for this manual page, see http://net-tools.sourceforge.net/. This page was obtained from the project's upstream Git repository git://git.code.sf.net/p/net-tools/code on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2023-06-29.) 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] net-tools 2014-02-17 ROUTE(8) Pages that refer to this page: networks(5), proc(5), arp(8), ifconfig(8), netstat(8), rarp(8), route(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. | # route\n\n> Use route cmd to set the route table.\n> More information: <https://manned.org/route>.\n\n- Display the information of route table:\n\n`route -n`\n\n- Add route rule:\n\n`sudo route add -net {{ip_address}} netmask {{netmask_address}} gw {{gw_address}}`\n\n- Delete route rule:\n\n`sudo route del -net {{ip_address}} netmask {{netmask_address}} dev {{gw_address}}`\n |
rpcinfo | rpcinfo(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training rpcinfo(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | OPTIONS | EXAMPLES | SEE ALSO | COLOPHON NAME top rpcinfo report RPC information SYNOPSIS top rpcinfo [-m | -s] [host] rpcinfo -p [host] rpcinfo -T transport host prognum [versnum] rpcinfo -l [-T transport] host prognum versnum rpcinfo [-n portnum] -u host prognum [versnum] rpcinfo [-n portnum] [-t] host prognum [versnum] rpcinfo -a serv_address -T transport prognum [versnum] rpcinfo -b [-T transport] prognum versnum rpcinfo -d [-T transport] prognum versnum DESCRIPTION top makes an RPC call to an RPC server and reports what it finds. In the first synopsis, lists all the registered RPC services with rpcbind on host. If host is not specified, the local host is the default. If -s is used, the information is displayed in a concise format. In the second synopsis, lists all the RPC services registered with rpcbind, version 2. Also note that the format of the information is different in the first and the second synopsis. This is because the second synopsis is an older protocol used to collect the information displayed (version 2 of the rpcbind protocol). The third synopsis makes an RPC call to procedure 0 of prognum and versnum on the specified host and reports whether a response was received. transport is the transport which has to be used for contacting the given service. The remote address of the service is obtained by making a call to the remote rpcbind. The prognum argument is a number that represents an RPC program number. If a versnum is specified, attempts to call that version of the specified prognum. Otherwise, attempts to find all the registered version numbers for the specified prognum by calling version 0, which is presumed not to exist; if it does exist, attempts to obtain this information by calling an extremely high version number instead, and attempts to call each registered version. Note: the version number is required for -b and -d options. OPTIONS top -T transport Specify the transport on which the service is required. If this option is not specified, uses the transport specified in the NETPATH environment variable, or if that is unset or null, the transport in the netconfig(5) database is used. This is a generic option, and can be used in conjunction with other options as shown in the SYNOPSIS. -a serv_address Use serv_address as the (universal) address for the service on transport to ping procedure 0 of the specified prognum and report whether a response was received. The -T option is required with the -a option. If versnum is not specified, tries to ping all available version numbers for that program number. This option avoids calls to remote rpcbind to find the address of the service. The serv_address is specified in universal address format of the given transport. -b Make an RPC broadcast to procedure 0 of the specified prognum and versnum and report all hosts that respond. If transport is specified, it broadcasts its request only on the specified transport. If broadcasting is not supported by any transport, an error message is printed. Use of broadcasting should be limited because of the potential for adverse effect on other systems. -d Delete registration for the RPC service of the specified prognum and versnum. If transport is specified, unregister the service on only that transport, otherwise unregister the service on all the transports on which it was registered. Only the owner of a service can delete a registration, except the super-user who can delete any service. -l Display a list of entries with a given prognum and versnum on the specified host. Entries are returned for all transports in the same protocol family as that used to contact the remote rpcbind. -m Display a table of statistics of rpcbind operations on the given host. The table shows statistics for each version of rpcbind (versions 2, 3 and 4), giving the number of times each procedure was requested and successfully serviced, the number and type of remote call requests that were made, and information about RPC address lookups that were handled. This is useful for monitoring RPC activities on host. -n portnum Use portnum as the port number for the -t and -u options instead of the port number given by rpcbind. Use of this option avoids a call to the remote rpcbind to find out the address of the service. This option is made obsolete by the -a option. -p Probe rpcbind on host using version 2 of the rpcbind protocol, and display a list of all registered RPC programs. If host is not specified, it defaults to the local host. Note: Version 2 of the rpcbind protocol was previously known as the portmapper protocol. -s Display a concise list of all registered RPC programs on host. If host is not specified, it defaults to the local host. -t Make an RPC call to procedure 0 of prognum on the specified host using TCP, and report whether a response was received. This option is made obsolete by the -T option as shown in the third synopsis. -u Make an RPC call to procedure 0 of prognum on the specified host using UDP, and report whether a response was received. This option is made obsolete by the -T option as shown in the third synopsis. EXAMPLES top To show all of the RPC services registered on the local machine use: example% rpcinfo To show all of the RPC services registered with rpcbind on the machine named klaxon use: example% rpcinfo klaxon The information displayed by the above commands can be quite lengthy. Use the -s option to display a more concise list: example$ rpcinfo -s klaxon program version(s) netid(s) service owner 100000 2,3,4 local,tcp,udp,tcp6,udp6 rpcbind super-user 100008 1 udp,tcp,udp6,tcp6 walld super-user 100002 2,1 udp,udp6 rusersd super-user 100001 2,3,4 udp,udp6 rstatd super-user 100012 1 udp,tcp sprayd super-user 100007 3 udp,tcp ypbind super-user To show whether the RPC service with program number prognum and version versnum is registered on the machine named klaxon for the transport TCP use: example% rpcinfo -T tcp klaxon prognum versnum To show all RPC services registered with version 2 of the rpcbind protocol on the local machine use: example% rpcinfo -p To delete the registration for version 1 of the walld (program number 100008 ) service for all transports use: example# rpcinfo -d 100008 1 or example# rpcinfo -d walld 1 SEE ALSO top rpc(3), netconfig(5), rpc(5), rpcbind(8) COLOPHON top This page is part of the rpcbind (convert RPC numbers to universal addresses) project. Information about the project can be found at http://sourceforge.net/projects/rpcbind/. If you have a bug report for this manual page, see http://sourceforge.net/p/rpcbind/bugs/?source=navbar. This page was obtained from the project's upstream Git repository git://linux-nfs.org/~steved/rpcbind on 2023-12-22. (At that time, the date of the most recent commit that was found in the repository was 2022-07-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] Pages that refer to this page: getrpcent(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. | # rpcinfo\n\n> Makes an RPC call to an RPC server and reports what it finds.\n> More information: <https://manned.org/rpcinfo>.\n\n- Show full table of all RPC services registered on localhost:\n\n`rpcinfo`\n\n- Show concise table of all RPC services registered on localhost:\n\n`rpcinfo -s {{localhost}}`\n\n- Display table of statistics of rpcbind operations on localhost:\n\n`rpcinfo -m`\n\n- Display list of entries of given service name (mountd) and version number (2) on a remote nfs share:\n\n`rpcinfo -l {{remote_nfs_server_ip}} {{mountd}} {{2}}`\n\n- Delete the registration for version 1 of the mountd service for all transports:\n\n`rpcinfo -d {{mountd}} {{1}}`\n |
rpm | rpm(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training rpm(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | LEGACY ISSUES | FILES | SEE ALSO | AUTHORS | COLOPHON RPM(8) RPM(8) NAME top rpm - RPM Package Manager SYNOPSIS top QUERYING AND VERIFYING PACKAGES: rpm {-q|--query} [select-options] [query-options] rpm --querytags rpm {-V|--verify} [select-options] [verify-options] INSTALLING, UPGRADING, AND REMOVING PACKAGES: rpm {-i|--install} [install-options] PACKAGE_FILE ... rpm {-U|--upgrade} [install-options] PACKAGE_FILE ... rpm {-F|--freshen} [install-options] PACKAGE_FILE ... rpm {--reinstall} [install-options] PACKAGE_FILE ... rpm {-e|--erase} [--allmatches] [--justdb] [--nodb] [--nodeps] [--noscripts] [--notriggers] [--test] PACKAGE_NAME ... MISCELLANEOUS: rpm --showrc rpm --restore [select-options] select-options [PACKAGE_NAME] [-a,--all [SELECTOR]] [-f,--file FILE] [--path PATH] [-g,--group GROUP] [-p,--package PACKAGE_FILE] [--hdrid SHA1] [--pkgid MD5] [--tid TID] [--querybynumber HDRNUM] [--triggeredby PACKAGE_NAME] [--whatprovides CAPABILITY] [--whatrequires CAPABILITY] [--whatrecommends CAPABILITY] [--whatsuggests CAPABILITY] [--whatsupplements CAPABILITY] [--whatenhances CAPABILITY] [--whatobsoletes CAPABILITY] [--whatconflicts CAPABILITY] query-options General: [--changelog] [--changes] [--dupes] [-i,--info] [--last] [--qf,--queryformat QUERYFMT] [--xml] Dependencies: [--conflicts] [--enhances] [--obsoletes] [--provides] [--recommends] [-R,--requires] [--suggests] [--supplements] Files: [-c,--configfiles] [-d,--docfiles] [--dump] [--fileclass] [--filecolor] [--fileprovide][--filerequire] [--filecaps] [--filesbypkg] [-l,--list] [-s,--state] [--noartifact] [--noghost] [--noconfig] Scripts and triggers: [--filetriggers] [--scripts] [--triggers,--triggerscripts] verify-options [--nodeps] [--nofiles] [--noscripts] [--nodigest] [--nosignature] [--nolinkto] [--nofiledigest] [--nosize] [--nouser] [--nogroup] [--nomtime] [--nomode] [--nordev] [--nocaps] install-options [--allfiles] [--badreloc] [--excludepath OLDPATH] [--excludedocs] [--force] [-h,--hash] [--ignoresize] [--ignorearch] [--ignoreos] [--includedocs] [--justdb] [nodb] [--nodeps] [--nodigest] [--noplugins] [--nocaps] [--noorder] [--noverify] [--nosignature] [--noscripts] [--notriggers] [--oldpackage] [--percent] [--prefix NEWPATH] [--relocate OLDPATH=NEWPATH] [--replacefiles] [--replacepkgs] [--test] DESCRIPTION top rpm is a powerful Package Manager, which can be used to build, install, query, verify, update, and erase individual software packages. A package consists of an archive of files and meta- data used to install and erase the archive files. The meta-data includes helper scripts, file attributes, and descriptive information about the package. Packages come in two varieties: binary packages, used to encapsulate software to be installed, and source packages, containing the source code and recipe necessary to produce binary packages. One of the following basic modes must be selected: Query, Verify, Install/Upgrade/Freshen/Reinstall, Uninstall, Set Owners/Groups, Show Querytags, and Show Configuration. GENERAL OPTIONS These options can be used in all the different modes. -?, --help Print a longer usage message than normal. --version Print a single line containing the version number of rpm being used. --quiet Print as little as possible - normally only error messages will be displayed. -v, --verbose Print verbose information - normally routine progress messages will be displayed. -vv Print lots of ugly debugging information. --rcfile FILELIST Replace the list of configuration files to be read. Each of the files in the colon separated FILELIST is read sequentially by rpm for configuration information. Only the first file in the list must exist, and tildes will be expanded to the value of $HOME. The default FILELIST is /usr/lib/rpm/rpmrc:/usr/lib/rpm/redhat/rpmrc:/etc/rpmrc:~/.rpmrc. --load FILE Load an individual macro file. --macros FILELIST Replace the list of macro files to be loaded. Each of the files in the colon separated FILELIST is read sequentially by rpm for macro definitions. Only the first file in the list must exist, and tildes will be expanded to the value of $HOME. The default FILELIST is /usr/lib/rpm/macros:/usr/lib/rpm/macros.d/macros.*:/usr/lib/rpm/platform/%{_target}/macros:/usr/lib/rpm/fileattrs/*.attr:/usr/lib/rpm/redhat/macros:/etc/rpm/macros.*:/etc/rpm/macros:/etc/rpm/%{_target}/macros:~/.rpmmacros --pipe CMD Pipes the output of rpm to the command CMD. --dbpath DIRECTORY Use the database in DIRECTORY rather than the default path /var/lib/rpm --root DIRECTORY Use the file system tree rooted at DIRECTORY for all operations. Note that this means the database within DIRECTORY will be used for dependency checks and any scriptlet(s) (e.g. %post if installing, or %prep if building, a package) will be run after a chroot(2) to DIRECTORY. Note that rpm assumes the environment inside the root is set up by the caller, such as any mounts needed for the operation inside the root directory. -D, --define='MACRO EXPR' Defines MACRO with value EXPR. --undefine='MACRO' Undefines MACRO. -E, --eval='EXPR' Prints macro expansion of EXPR. More - less often needed - options can be found on the rpm- misc(8) man page. INSTALL AND UPGRADE OPTIONS In these options, PACKAGE_FILE can be either rpm binary file or ASCII package manifest (see PACKAGE SELECTION OPTIONS), and may be specified as an ftp or http URL, in which case the package will be downloaded before being installed. See FTP/HTTP OPTIONS for information on rpm's ftp and http client support. The general form of an rpm install command is rpm {-i|--install} [install-options] PACKAGE_FILE ... This installs a new package. The general form of an rpm upgrade command is rpm {-U|--upgrade} [install-options] PACKAGE_FILE ... This upgrades or installs the package currently installed to a newer version. This is the same as install, except all other version(s) of the package are removed after the new package is installed. rpm {-F|--freshen} [install-options] PACKAGE_FILE ... This will upgrade packages, but only ones for which an earlier version is installed. The general form of an rpm reinstall command is rpm {--reinstall} [install-options] PACKAGE_FILE ... This reinstalls a previously installed package. --allfiles Installs or upgrades all the missingok files in the package, regardless if they exist. --badreloc Used with --relocate, permit relocations on all file paths, not just those OLDPATH's included in the binary package relocation hint(s). --excludepath OLDPATH Don't install files whose name begins with OLDPATH. --excludeartifacts Don't install any files which are marked as artifacts, such as build-id links. --excludedocs Don't install any files which are marked as documentation (which includes man pages and texinfo documents). --force Same as using --replacepkgs, --replacefiles, and --oldpackage. -h, --hash Print 50 hash marks as the package archive is unpacked. Use with -v|--verbose for a nicer display. --ignoresize Don't check mount file systems for sufficient disk space before installing this package. --ignorearch Allow installation or upgrading even if the architectures of the binary package and host don't match. --ignoreos Allow installation or upgrading even if the operating systems of the binary package and host don't match. --includedocs Install documentation files. This is the default behavior. --justdb Update only the database, not the filesystem. --nodb Update only the filesystem, not the database. --nodigest Don't verify package or header digests when reading. --nomanifest Don't process non-package files as manifests. --nosignature Don't verify package or header signatures when reading. --nodeps Don't do a dependency check before installing or upgrading a package. --nocaps Don't set file capabilities. --noorder Don't reorder the packages for an install. The list of packages would normally be reordered to satisfy dependencies. --noverify Don't perform verify package files prior to installation. --noplugins Do not load and execute plugins. --noscripts, --nopre, --nopost, --nopreun, --nopostun, --nopretrans, --noposttrans, --nopreuntrans, --nopostuntrans Don't execute the scriptlet of the same name. The --noscripts option is equivalent to --nopre --nopost --nopreun --nopostun --nopretrans --noposttrans --nopreuntrans --nopostuntrans and turns off the execution of the corresponding %pre, %post, %preun, %postun %pretrans, %posttrans, %preuntrans and %postuntrans scriptlet(s). --notriggers, --notriggerin, --notriggerun, --notriggerprein, --notriggerpostun Don't execute any trigger scriptlet of the named type. The --notriggers option is equivalent to --notriggerprein --notriggerin --notriggerun --notriggerpostun and turns off execution of the corresponding %triggerprein, %triggerin, %triggerun, and %triggerpostun scriptlet(s). --nosysusers Dont create sysusers from packages --oldpackage Allow an upgrade to replace a newer package with an older one. --percent Print percentages as files are unpacked from the package archive. This is intended to make rpm easy to run from other tools. --prefix NEWPATH For relocatable binary packages, translate all file paths that start with the installation prefix in the package relocation hint(s) to NEWPATH. --relocate OLDPATH=NEWPATH For relocatable binary packages, translate all file paths that start with OLDPATH in the package relocation hint(s) to NEWPATH. This option can be used repeatedly if several OLDPATH's in the package are to be relocated. --replacefiles Install the packages even if they replace files from other, already installed, packages. --replacepkgs Install the packages even if some of them are already installed on this system. --test Do not install the package, simply check for and report potential conflicts. ERASE OPTIONS The general form of an rpm erase command is rpm {-e|--erase} [--allmatches] [--justdb] [--nodeps] [--noscripts] [--notriggers] [--test] PACKAGE_NAME ... The following options may also be used: --allmatches Remove all versions of the package which match PACKAGE_NAME. Normally an error is issued if PACKAGE_NAME matches multiple packages. --justdb Update only the database, not the filesystem. --nodeps Don't check dependencies before uninstalling the packages. --noscripts, --nopreun, --nopostun Don't execute the scriptlet of the same name. The --noscripts option during package erase is equivalent to --nopreun --nopostun and turns off the execution of the corresponding %preun, and %postun scriptlet(s). --notriggers, --notriggerun, --notriggerpostun Don't execute any trigger scriptlet of the named type. The --notriggers option is equivalent to --notriggerun --notriggerpostun and turns off execution of the corresponding %triggerun, and %triggerpostun scriptlet(s). --test Don't really uninstall anything, just go through the motions. Useful in conjunction with the -vv option for debugging. QUERY OPTIONS The general form of an rpm query command is rpm {-q|--query} [select-options] [query-options] You may specify the format that package information should be printed in. To do this, you use the --qf|--queryformat QUERYFMT option, followed by the QUERYFMT format string. Query formats are modified versions of the standard printf(3) formatting. The format is made up of static strings (which may include standard C character escapes for newlines, tabs, and other special characters (not including \0)) and printf(3) type formatters. As rpm already knows the type to print, the type specifier must be omitted however, and replaced by the name of the header tag to be printed, enclosed by {} characters. Tag names are case insensitive, and the leading RPMTAG_ portion of the tag name may be omitted as well. Alternate output formats may be requested by following the tag with :typetag. Currently, the following types are supported: :armor Wrap a public key in ASCII armor. :arraysize Display number of elements in array tags. :base64 Encode binary data using base64. :date Use strftime(3) "%c" format. :day Use strftime(3) "%a %b %d %Y" format. :depflags Format dependency comparison operator. :deptype Format dependency type. :expand Perform macro expansion. :fflags Format file flags. :fstate Format file state. :fstatus Format file verify status. :hex Format in hexadecimal. :octal Format in octal. :humaniec Human readable number (in IEC 80000). The suffix K = 1024, M = 1048576, ... :humansi Human readable number (in SI). The suffix K = 1000, M = 1000000, ... :perms Format file permissions. :pgpsig Display signature fingerprint and time. :shescape Escape single quotes for use in a script. :string Display string format. (default) :tagname Display tag name. :tagnum Display tag number. :triggertype Display trigger suffix. :vflags File verification flags. :xml Wrap data in simple xml markup. For example, to print only the names of the packages queried, you could use %{NAME} as the format string. To print the packages name and distribution information in two columns, you could use %-30{NAME}%{DISTRIBUTION}. rpm will print a list of all of the tags it knows about when it is invoked with the --querytags argument. There are three subsets of options for querying: package selection, file selection and information selection. PACKAGE SELECTION OPTIONS: PACKAGE_NAME Query installed package named PACKAGE_NAME. To specify the package more precisely the package name may be followed by the version or version and release both separated by a dash or an architecture name separated by a dot. See the output of rpm -qa or rpm -qp PACKAGE_FILE as an example. -a, --all [SELECTOR] Query all installed packages. An optional SELECTOR in the form of tag=pattern can be provided to narrow the selection, for example name="b*" to query packages whose name starts with "b". --dupes List duplicated packages. -f, --file FILE Query package owning installed FILE. --filecaps List file names with POSIX1.e capabilities. --fileclass List file names with their classes (libmagic classification). --filecolor List file names with their colors (0 for noarch, 1 for 32bit, 2 for 64 bit). --fileprovide List file names with their provides. --filerequire List file names with their requires. -g, --group GROUP Query packages with the group of GROUP. --hdrid SHA1 Query package that contains a given header identifier, i.e. the SHA1 digest of the immutable header region. -p, --package PACKAGE_FILE Query an (uninstalled) package PACKAGE_FILE. The PACKAGE_FILE may be specified as an ftp or http style URL, in which case the package header will be downloaded and queried. See FTP/HTTP OPTIONS for information on rpm's ftp and http client support. The PACKAGE_FILE argument(s), if not a binary package, will be interpreted as an ASCII package manifest unless --nomanifest option is used. In manifests, comments are permitted, starting with a '#', and each line of a package manifest file may include white space separated glob expressions, including URL's, that will be expanded to paths that are substituted in place of the package manifest as additional PACKAGE_FILE arguments to the query. --path PATH Query package(s) owning PATH, whether the file is installed or not. Multiple packages may own a PATH, but the file is only owned by the package installed last. --pkgid MD5 Query package that contains a given package identifier, i.e. the MD5 digest of the combined header and payload contents. --querybynumber HDRNUM Query the HDRNUMth database entry directly; this is useful only for debugging. --specfile SPECFILE Parse and query SPECFILE as if it were a package. Although not all the information (e.g. file lists) is available, this type of query permits rpm to be used to extract information from spec files without having to write a specfile parser. --tid TID Query package(s) that have a given TID transaction identifier. A unix time stamp is currently used as a transaction identifier. All package(s) installed or erased within a single transaction have a common identifier. --triggeredby PACKAGE_NAME Query packages that are triggered by package(s) PACKAGE_NAME. --whatobsoletes CAPABILITY Query all packages that obsolete CAPABILITY for proper functioning. --whatprovides CAPABILITY Query all packages that provide the CAPABILITY capability. --whatrequires CAPABILITY Query all packages that require CAPABILITY for proper functioning. --whatconflicts CAPABILITY Query all packages that conflict with CAPABILITY. --whatrecommends CAPABILITY Query all packages that recommend CAPABILITY. --whatsuggests CAPABILITY Query all packages that suggest CAPABILITY. --whatsupplements CAPABILITY Query all packages that supplement CAPABILITY. --whatenhances CAPABILITY Query all packages that enhance CAPABILITY. PACKAGE QUERY OPTIONS: --changelog Display change information for the package. --changes Display change information for the package with full time stamps. --conflicts List capabilities this package conflicts with. --dump Dump file information as follows (implies -l): path size mtime digest mode owner group isconfig isdoc rdev symlink --enhances List capabilities enhanced by package(s) --filesbypkg List all the files in each selected package. --filetriggers List filetrigger scriptlets from package(s). -i, --info Display package information, including name, version, and description. This uses the --queryformat if one was specified. --last Orders the package listing by install time such that the latest packages are at the top. -l, --list List files in package. --obsoletes List packages this package obsoletes. --provides List capabilities this package provides. --recommends List capabilities recommended by package(s) -R, --requires List capabilities on which this package depends. --suggests List capabilities suggested by package(s) --supplements List capabilities supplemented by package(s) --scripts List the package specific scriptlet(s) that are used as part of the installation and uninstallation processes. -s, --state Display the states of files in the package (implies -l). The state of each file is one of normal, not installed, or replaced. --triggers, --triggerscripts Display the trigger scripts, if any, which are contained in the package. --xml Format package headers as XML. FILE SELECTION OPTIONS: -A, --artifactfiles Only include artifact files (implies -l). -c, --configfiles Only include configuration files (implies -l). -d, --docfiles Only include documentation files (implies -l). -L, --licensefiles Only include license files (implies -l). --noartifact Exclude artifact files. --noconfig Exclude config files. --noghost Exclude ghost files. VERIFY OPTIONS The general form of an rpm verify command is rpm {-V|--verify} [select-options] [verify-options] Verifying a package compares information about the installed files in the package with information about the files taken from the package metadata stored in the rpm database. Among other things, verifying compares the size, digest, permissions, type, owner and group of each file. Any discrepancies are displayed. Files that were not installed from the package, for example, documentation files excluded on installation using the "--excludedocs" option, will be silently ignored. The package and file selection options are the same as for package querying (including package manifest files as arguments). Other options unique to verify mode are: --nodeps Don't verify dependencies of packages. --nodigest Don't verify package or header digests when reading. --nofiles Don't verify any attributes of package files. --noscripts Don't execute the %verifyscript scriptlet (if any). --nosignature Don't verify package or header signatures when reading. --nolinkto --nofiledigest (formerly --nomd5) --nosize --nomtime --nomode --nordev Don't verify the corresponding file attribute. --nouser --nogroup Don't verify file user/group ownership. Note that only local passwd(5) and group(5) databases are consulted. --nocaps Don't verify file capabilities. The format of the output is a string of 9 characters, a possible attribute marker: c %config configuration file. d %doc documentation file. g %ghost file (i.e. the file contents are not included in the package payload). l %license license file. r %readme readme file. from the package header, followed by the file name. Each of the 9 characters denotes the result of a comparison of attribute(s) of the file to the value of those attribute(s) recorded in the database. A single "." (period) means the test passed, while a single "?" (question mark) indicates the test could not be performed (e.g. file permissions prevent reading). Otherwise, the (mnemonically emBoldened) character denotes failure of the corresponding --verify test: S file Size differs M Mode differs (includes permissions and file type) 5 digest (formerly MD5 sum) differs D Device major/minor number mismatch L readLink(2) path mismatch U User ownership differs G Group ownership differs T mTime differs P caPabilities differ MISCELLANEOUS COMMANDS rpm --showrc shows the values rpm will use for all of the options are currently set in rpmrc and macros configuration file(s). rpm --setperms | --setugids | --setcaps PACKAGE_NAME obsolete aliases for --restore rpm --restore [select-options] The option restores file metadata such as timestamp, owner, group, permissions and capabilities of files in packages. FTP/HTTP OPTIONS rpm can act as an FTP and/or HTTP client so that packages can be queried or installed from the internet. Package files for install, upgrade, and query operations may be specified as an ftp or http style URL: http://HOST[:PORT]/path/to/package.rpm ftp://[USER:PASSWORD]@HOST[:PORT]/path/to/package.rpm If both the user and password are omitted, anonymous ftp is used. rpm allows the following options to be used with ftp URLs: rpm allows the following options to be used with http and ftp URLs: --httpproxy HOST The host HOST will be used as a proxy server for all http and ftp transfers. This option may also be specified by configuring the macro %_httpproxy. --httpport PORT The TCP PORT number to use for the http connection on the proxy http server instead of the default port. This option may also be specified by configuring the macro %_httpport. LEGACY ISSUES top Executing rpmbuild The build modes of rpm are now resident in the /usr/bin/rpmbuild executable. Install the package containing rpmbuild (usually rpm-build) and see rpmbuild(8) for documentation of all the rpm build modes. FILES top rpmrc Configuration /usr/lib/rpm/rpmrc /usr/lib/rpm/<vendor>/rpmrc /etc/rpmrc ~/.rpmrc Macro Configuration /usr/lib/rpm/macros /usr/lib/rpm/<vendor>/macros /etc/rpm/macros ~/.rpmmacros Database /var/lib/rpm/Basenames /var/lib/rpm/Conflictname /var/lib/rpm/Dirnames /var/lib/rpm/Group /var/lib/rpm/Installtid /var/lib/rpm/Name /var/lib/rpm/Obsoletename /var/lib/rpm/Packages /var/lib/rpm/Providename /var/lib/rpm/Requirename /var/lib/rpm/Sha1header /var/lib/rpm/Sigmd5 /var/lib/rpm/Triggername Temporary /var/tmp/rpm* SEE ALSO top rpm-misc(8), popt(3), rpm2cpio(8), rpmbuild(8), rpmdb(8), rpmkeys(8), rpmsign(8), rpmspec(8) rpm --help - as rpm supports customizing the options via popt aliases it's impossible to guarantee that what's described in the manual matches what's available. http://www.rpm.org/ <URL:http://www.rpm.org/> AUTHORS top Marc Ewing <[email protected]> Jeff Johnson <[email protected]> Erik Troan <[email protected]> COLOPHON top This page is part of the rpm (RPM Package Manager) project. Information about the project can be found at https://github.com/rpm-software-management/rpm. 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/rpm.git 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] 09 June 2002 RPM(8) Pages that refer to this page: yum-versionlock(1), daemon(7), rpm2archive(8), rpm2cpio(8), rpmbuild(8), rpmdb(8), rpmdeps(8), rpmkeys(8), rpmlua(8), rpm-plugin-ima(8), rpm-plugin-prioreset(8), rpm-plugins(8), rpm-plugin-selinux(8), rpm-plugin-syslog(8), rpm-plugin-systemd-inhibit(8), rpmsign(8), rpmspec(8), yumdb(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. | # rpm\n\n> RPM Package Manager.\n> For equivalent commands in other package managers, see <https://wiki.archlinux.org/title/Pacman/Rosetta>.\n> More information: <https://rpm.org/>.\n\n- Show version of httpd package:\n\n`rpm --query {{httpd}}`\n\n- List versions of all matching packages:\n\n`rpm --query --all '{{mariadb*}}'`\n\n- Forcibly install a package regardless of currently installed versions:\n\n`rpm --upgrade {{path/to/package.rpm}} --force`\n\n- Identify owner of a file and show version of the package:\n\n`rpm --query --file {{/etc/postfix/main.cf}}`\n\n- List package-owned files:\n\n`rpm --query --list {{kernel}}`\n\n- Show scriptlets from an RPM file:\n\n`rpm --query --package --scripts {{package.rpm}}`\n\n- Show changed, missing and/or incorrectly installed files of matching packages:\n\n`rpm --verify --all '{{php-*}}'`\n\n- Display the changelog of a specific package:\n\n`rpm --query --changelog {{package}}`\n |
rpm2cpio | rpm2cpio(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training rpm2cpio(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | SEE ALSO | AUTHOR | COLOPHON rpm2cpio(8) rpm2cpio(8) NAME top rpm2cpio - Extract cpio archive from RPM Package Manager (RPM) package. SYNOPSIS top rpm2cpio [filename] DESCRIPTION top rpm2cpio converts the .rpm file specified as a single argument to a cpio archive on standard out. If a '-' argument is given, an rpm stream is read from standard in. Note: the CPIO format cannot host individual files over 4GB in size, and so this tool is considered obsolete. Use rpm2archive instead. rpm2cpio glint-1.0-1.i386.rpm | cpio -dium cat glint-1.0-1.i386.rpm | rpm2cpio - | cpio -tv SEE ALSO top rpm(8) rpm2archive(8) AUTHOR top Erik Troan <[email protected]> COLOPHON top This page is part of the rpm (RPM Package Manager) project. Information about the project can be found at https://github.com/rpm-software-management/rpm. 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/rpm.git 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] 11 January 2001 rpm2cpio(8) Pages that refer to this page: rpm2archive(8), rpm(8), rpmbuild(8), rpmdb(8), rpmkeys(8), rpmsign(8), rpmspec(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. | # rpm2cpio\n\n> Convert an RPM package to a `cpio` archive.\n> More information: <http://ftp.rpm.org/max-rpm/s1-rpm-miscellania-rpm2cpio.html>.\n\n- Convert an RPM package to a `cpio` archive and save it as `file.cpio` in the current directory:\n\n`rpm2cpio {{path/to/file.rpm}}`\n |
rpmbuild | rpmbuild(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training rpmbuild(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | FILES | SEE ALSO | AUTHORS | COLOPHON RPMBUILD(8) RPMBUILD(8) NAME top rpmbuild - Build RPM Package(s) SYNOPSIS top BUILDING PACKAGES: rpmbuild {-ba|-bb|-bp|-bf|-bc|-bi|-bl|-bs|-br|-bd} [rpmbuild- options] SPECFILE ... rpmbuild {-ra|-rb|-rp|-rf|-rc|-ri|-rl|-rs|-rr|-rd} [rpmbuild- options] SOURCEPACKAGE ... rpmbuild {-ta|-tb|-tp|-tf|-tc|-ti|-tl|-ts|-tr|-td} [rpmbuild- options] TARBALL ... rpmbuild {--rebuild|--recompile} SOURCEPKG ... MISCELLANEOUS: rpmbuild --showrc rpmbuild-options [--buildroot DIRECTORY] [--clean] [--nobuild] [--rmsource] [--rmspec] [--short-circuit] [--build-in-place] [--noprep] [--noclean] [--nocheck] [--rpmfcdebug] [--target PLATFORM] [--with OPTION] [--without OPTION] DESCRIPTION top rpmbuild is used to build both binary and source software packages. A package consists of an archive of files and meta- data used to install and erase the archive files. The meta-data includes helper scripts, file attributes, and descriptive information about the package. Packages come in two varieties: binary packages, used to encapsulate software to be installed, and source packages, containing the source code and recipe necessary to produce binary packages. One of the following basic modes must be selected: Build Package, Build Package from Tarball, Recompile Package, Show Configuration. GENERAL OPTIONS These options can be used in all the different modes. -?, --help Print a longer usage message then normal. --version Print a single line containing the version number of rpm being used. --quiet Print as little as possible - normally only error messages will be displayed. -v Print verbose information - normally routine progress messages will be displayed. -vv Print lots of ugly debugging information. --rpmfcdebug Enables to debug dependencies generation. --rcfile FILELIST Each of the files in the colon separated FILELIST is read sequentially by rpm for configuration information. Only the first file in the list must exist, and tildes will be expanded to the value of $HOME. The default FILELIST is /usr/lib/rpm/rpmrc:/usr/lib/rpm/<vendor>/rpmrc:/etc/rpmrc:~/.rpmrc. --pipe CMD Pipes the output of rpm to the command CMD. --dbpath DIRECTORY Use the database in DIRECTORY rather than the default path /var/lib/rpm --root DIRECTORY Use the file system tree rooted at DIRECTORY for all operations. Note that this means the database within DIRECTORY will be used for dependency checks and any scriptlet(s) (e.g. %post if installing, or %prep if building, a package) will be run after a chroot(2) to DIRECTORY. -D, --define='MACRO EXPR' Defines MACRO with value EXPR. --scm=SCM Select the SCM to use with %autosetup, if one is not set in the spec file. Note that not all values for SCM, e.g., patch (the default) and gendiff, git, or quilt work interchangeably with all other patches and options stated in the %autosetup line, especially option -pN. BUILD OPTIONS The general form of an rpm build command is rpmbuild {-bSTAGE|-rSTAGE|-tSTAGE} [rpmbuild-options] FILE ... The argument used is -b if a spec file is being used to build the package, -r if a source package is to be rebuilt and -t if rpmbuild should look inside of a (possibly compressed) tar file for the spec file to use. Packages are built in a number of stages. The first six correspond to the following sections in a spec file: %prep, %generate_buildrequires, %build, %install, %check and %clean. Finally, binary and source packages are created in an assembly stage. The STAGE character specifies the stage to finish with (after doing all the stages preceding it), and is one of: -ba Perform a full build - executes up to and including the assembly stage. In most cases, this is the option to choose. -bb Build just the binary packages - executes up to and including the assembly stage, but without creating the source package. On success, the build directory is removed (as in --clean). -bp Unpack the sources and apply any patches - executes the %prep stage only. -bf Configure the sources - executes up to and including the %conf stage. This generally involves the equivalent of a "./configure". -bc Compile the sources - executes up to and including the %build stage. This generally involves the equivalent of a "make". -bi Install the binaries into the build root - executes up to and including the %check stage. This generally involves the equivalent of a "make install" and "make check". -bl Do a "list check" - the %files section from the spec file is macro expanded, and checks are made to verify that each file exists. -bs Build just the source package - skips straight to the assembly stage, without executing any of the preceding stages or creating binary packages. -br Build just the source package, but also parse and include dynamic build dependencies - executes up to and including the %generate_buildrequires stage and then skips straight to the assembly stage, without creating binary packages. This command can be used to fully resolve dynamic build dependencies. See the DYNAMIC BUILD DEPENDENCIES section for details. -bd Check dynamic build dependencies and build the .buildreqs.nosrc.rpm package if any are missing. Dont build anything else. The following options may also be used: --buildroot DIRECTORY When building a package, override the BuildRoot tag with directory DIRECTORY. --clean Remove the build tree after the packages are made. --nobuild Do not execute any build stages. Useful for testing out spec files. --noprep Do not execute %prep build stage even if present in spec. --noclean Do not execute %clean build stage even if present in spec. --nocheck Do not execute %check build stage even if present in spec. --nodebuginfo Do not generate debuginfo packages. --nodeps Do not verify build dependencies. --rmsource Remove the sources after the build (may also be used standalone, e.g. "rpmbuild --rmsource foo.spec"). --rmspec Remove the spec file after the build (may also be used standalone, eg. "rpmbuild --rmspec foo.spec"). --short-circuit Skip straight to specified stage (i.e., skip all stages leading up to the specified stage). Only valid with -bc, -bi, and -bb. Useful for local testing only. Packages built this way will be marked with an unsatisfiable dependency to prevent their accidental use. --build-in-place Build from locally checked out sources. Sets _builddir to current working directory. Skips handling of -n and untar in the %setup and the deletion of the buildSubdir. --target PLATFORM When building the package, interpret PLATFORM as arch- vendor-os and set the macros %_target, %_target_cpu, and %_target_os accordingly. --with OPTION Enable configure OPTION for build. --without OPTION Disable configure OPTION for build. REBUILD AND RECOMPILE OPTIONS There are two other ways to invoke building with rpm: rpmbuild --rebuild|--recompile SOURCEPKG ... When invoked this way, rpmbuild installs the named source package, and does a prep, compile and install. In addition, --rebuild builds a new binary package. When the build has completed, the build directory is removed (as in --clean) and the the sources and spec file for the package are removed. These options are now superseded by the -r* options which allow much more fine control over what stages of the build to run. DYNAMIC BUILD DEPENDENCIES When the %generate_buildrequires stage runs and some of the newly generated BuildRequires are not satisfied, rpmbuild creates an intermediate source package ending in buildreqs.nosrc.rpm, which has the new BuildRequires, and exits with code 11. This package can then be used in place of the original source package to resolve and install the missing build dependencies in the usual way, such as with dnf-builddep(8). Multiple layers of dynamic build dependencies may exist in a spec file; the presence of specific BuildRequires on the system may yield new BuildRequires next time a build is performed with the same source package. The easiest way to ensure that all dynamic build dependencies are satisfied is to run the -br command, install the new dependencies of the buildreqs.nosrc.rpm package and repeat the whole procedure until rpmbuild no longer exits with code 11. If the -br command is coupled with --nodeps, exit code 11 is always returned and a buildreqs.nosrc.rpm package is always created. SHOWRC The command rpmbuild --showrc shows the values rpmbuild will use for all of the options are currently set in rpmrc and macros configuration file(s). FILES top rpmrc Configuration /usr/lib/rpm/rpmrc /usr/lib/rpm/<vendor>/rpmrc /etc/rpmrc ~/.rpmrc Macro Configuration /usr/lib/rpm/macros /usr/lib/rpm/<vendor>/macros /etc/rpm/macros ~/.rpmmacros Temporary /var/tmp/rpm* SEE ALSO top gendiff(1), popt(3), rpm(8), rpm2cpio(8), rpmkeys(8), rpmspec(8), rpmsign(8) rpmbuild --help - as rpm supports customizing the options via popt aliases it's impossible to guarantee that what's described in the manual matches what's available. http://www.rpm.org/ <URL:http://www.rpm.org/> AUTHORS top Marc Ewing <[email protected]> Jeff Johnson <[email protected]> Erik Troan <[email protected]> COLOPHON top This page is part of the rpm (RPM Package Manager) project. Information about the project can be found at https://github.com/rpm-software-management/rpm. 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/rpm.git 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] 09 June 2002 RPMBUILD(8) Pages that refer to this page: rpm(8), rpmdb(8), rpmdeps(8), rpmkeys(8), rpmsign(8), rpmspec(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. | # rpmbuild\n\n> RPM Package Build tool.\n> More information: <https://docs.fedoraproject.org/en-US/quick-docs/creating-rpm-packages/>.\n\n- Build binary and source packages:\n\n`rpmbuild -ba {{path/to/spec_file}}`\n\n- Build a binary package without source package:\n\n`rpmbuild -bb {{path/to/spec_file}}`\n\n- Specify additional variables when building a package:\n\n`rpmbuild -bb {{path/to/spec_file}} --define "{{variable1}} {{value1}}" --define "{{variable2}} {{value2}}"`\n |
rpmspec | rpmspec(8) - Linux manual page man7.org > Linux > man-pages Linux/UNIX system programming training rpmspec(8) Linux manual page NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | SEE ALSO | AUTHORS | COLOPHON RPMSPEC(8) RPMSPEC(8) NAME top rpmspec - RPM Spec Tool SYNOPSIS top QUERYING SPEC FILES: rpmspec {-q|--query} [select-options] [query-options] SPEC_FILE ... PARSING SPEC FILES TO STDOUT: rpmspec {-P|--parse} SPEC_FILE ... INVOKING MACRO SHELL: rpmspec {shell} [SPEC_FILE ...] DESCRIPTION top rpmspec is a tool for querying a spec file. More specifically for querying hypothetical packages which would be created from the given spec file. So querying a spec file with rpmspec is similar to querying a package built from that spec file. But is is not identical. With rpmspec you can't query all fields which you can query from a built package. E. g. you can't query BUILDTIME with rpmspec for obvious reasons. You also cannot query other fields automatically generated during a build of a package like auto generated dependencies. select-options [--rpms] [--srpm] query-options [--qf,--queryformat QUERYFMT] [--target TARGET_PLATFORM] QUERY OPTIONS The general form of an rpm spec query command is rpm {-q|--query} [select-options] [query-options] You may specify the format that the information should be printed in. To do this, you use the --qf|--queryformat QUERYFMT option, followed by the QUERYFMT format string. See rpm(8) for details. SELECT OPTIONS --rpms Operate on the all binary package headers generated from spec. --builtrpms Operate only on the binary package headers of packages which would be built from spec. That means ignoring package headers of packages that won't be built from spec i. e. ignoring package headers of packages without file section. --srpm Operate on the source package header(s) generated from spec. EXAMPLES top Get list of binary packages which would be generated from the rpm spec file: $ rpmspec -q rpm.spec rpm-4.11.3-3.fc20.x86_64 rpm-libs-4.11.3-3.fc20.x86_64 rpm-build-libs-4.11.3-3.fc20.x86_64 ... Get summary infos for single binary packages generated from the rpm spec file: $ rpmspec -q --qf "%{name}: %{summary}\n" rpm.spec rpm: The RPM package management system rpm-libs: Libraries for manipulating RPM packages rpm-build-libs: Libraries for building and signing RPM packages ... Get the source package which would be generated from the rpm spec file: $ rpmspec -q --srpm rpm.spec rpm-4.11.3-3.fc20.x86_64 Parse the rpm spec file to stdout: $ rpmspec -P rpm.spec Summary: The RPM package management system Name: rpm Version: 4.14.0 ... Run interactive macro shell for debugging macros: $ rpmspec --shell > %define foo bar > %foo bar > %(date) Tue Apr 13 03:55:37 PM EEST 2021 > %getncpus 8 Run interactive macros shell in spec context: $ rpmspec --shell popt.spec %name popt %version 1.18 SEE ALSO top popt(3), rpm(8), rpmdb(8), rpmkeys(8), rpmsign(8), rpm2cpio(8), rpmbuild(8) rpmspec --help - as rpm supports customizing the options via popt aliases it's impossible to guarantee that what's described in the manual matches what's available. http://www.rpm.org/ <URL:http://www.rpm.org/> AUTHORS top Marc Ewing <[email protected]> Jeff Johnson <[email protected]> Erik Troan <[email protected]> Panu Matilainen <[email protected]> COLOPHON top This page is part of the rpm (RPM Package Manager) project. Information about the project can be found at https://github.com/rpm-software-management/rpm. 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/rpm.git 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] 29 October 2010 RPMSPEC(8) Pages that refer to this page: rpm(8), rpmbuild(8), rpmdb(8), rpmkeys(8), rpmsign(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. | # rpmspec\n\n> Query a RPM spec file.\n> More information: <https://manned.org/rpmspec>.\n\n- List binary packages which would be generated from a RPM spec file:\n\n`rpmspec --query {{path/to/rpm.spec}}`\n\n- List all options for `--queryformat`:\n\n`rpmspec --querytags`\n\n- Get summary information for single binary packages generated from a RPM spec file:\n\n`rpmspec --query --queryformat "{{%{name}: %{summary}\n}}" {{path/to/rpm.spec}}`\n\n- Get the source package which would be generated from a RPM spec file:\n\n`rpmspec --query --srpm {{path/to/rpm.spec}}`\n\n- Parse a RPM spec file to `stdout`:\n\n`rpmspec --parse {{path/to/rpm.spec}}`\n |