Asciidoc: Import misc-utils man pages

This commit is contained in:
Mario Blättermann 2021-03-19 17:12:57 +01:00
parent a48b5068a7
commit 6c64d12d13
20 changed files with 2470 additions and 0 deletions

172
misc-utils/blkid.8.adoc Normal file
View File

@ -0,0 +1,172 @@
// Copyright 2000 Andreas Dilger (adilger@turbolinux.com)
// This file may be copied under the terms of the GNU Public License.
= blkid(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: blkid
== NAME
blkid - locate/print block device attributes
== SYNOPSIS
*blkid* *--label* _label_ | *--uuid* _uuid_
*blkid* [*--no-encoding* *--garbage-collect* *--list-one* *--cache-file* _file_] [*--output* _format_][*--match-tag* _tag_] [*--match-token* _NAME=value_] [_device_...]
*blkid* *--probe* [*--offset* _offset_] [*--output* _format_] [*--size* _size_] [*--match-tag* _tag_] [*--match-types* _list_] [*--usages* _list_] [*--no-part-details*] _device_...
*blkid* *--info* [*--output format*] [*--match-tag* _tag_] _device_...
== DESCRIPTION
The *blkid* program is the command-line interface to working with the *libblkid*(3) library. It can determine the type of content (e.g., filesystem or swap) that a block device holds, and also the attributes (tokens, NAME=value pairs) from the content metadata (e.g., LABEL or UUID fields).
*It is recommended to use* *lsblk*(8) *command to get information about block devices, or lsblk --fs to get an overview of filesystems, or* *findmnt*(8) *to search in already mounted filesystems.*
____
*lsblk*(8) provides more information, better control on output formatting, easy to use in scripts and it does not require root permissions to get actual information. *blkid* reads information directly from devices and for non-root users it returns cached unverified information. *blkid* is mostly designed for system services and to test *libblkid*(3) functionality.
____
When _device_ is specified, tokens from only this device are displayed. It is possible to specify multiple _device_ arguments on the command line. If none is given, all partitions or unpartitioned devices which appear in _/proc/partitions_ are shown, if they are recognized.
*blkid* has two main forms of operation: either searching for a device with a specific NAME=value pair, or displaying NAME=value pairs for one or more specified devices.
For security reasons *blkid* silently ignores all devices where the probing result is ambivalent (multiple colliding filesystems are detected). The low-level probing mode (*-p*) provides more information and extra exit status in this case. It's recommended to use *wipefs*(8) to get a detailed overview and to erase obsolete stuff (magic strings) from the device.
== OPTIONS
The _size_ and _offset_ arguments may be followed by the multiplicative suffixes like KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB"), or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
*-c*, *--cache-file* _cachefile_::
Read from _cachefile_ instead of reading from the default cache file (see the CONFIGURATION FILE section for more details). If you want to start with a clean cache (i.e., don't report devices previously scanned but not necessarily available at this time), specify _/dev/null_.
*-d*, *--no-encoding*::
Don't encode non-printing characters. The non-printing characters are encoded by ^ and M- notation by default. Note that the *--output udev* output format uses a different encoding which cannot be disabled.
*-D*, *--no-part-details*::
Don't print information (PART_ENTRY_* tags) from partition table in low-level probing mode.
*-g*, *--garbage-collect*::
Perform a garbage collection pass on the blkid cache to remove devices which no longer exist.
*-h*, *--help*::
Display a usage message and exit.
*-i*, *--info*::
Display information about I/O Limits (aka I/O topology). The 'export' output format is automatically enabled. This option can be used together with the *--probe* option.
*-k*, *--list-filesystems*::
List all known filesystems and RAIDs and exit.
*-l*, *--list-one*::
Look up only one device that matches the search parameter specified with the *--match-token* option. If there are multiple devices that match the specified search parameter, then the device with the highest priority is returned, and/or the first device found at a given priority (but see below note about udev). Device types in order of decreasing priority are: Device Mapper, EVMS, LVM, MD, and finally regular block devices. If this option is not specified, *blkid* will print all of the devices that match the search parameter. +
This option forces *blkid* to use udev when used for LABEL or UUID tokens in *--match-token*. The goal is to provide output consistent with other utils (like *mount*(8), etc.) on systems where the same tag is used for multiple devices.
*-L*, *--label* _label_::
Look up the device that uses this filesystem _label_; this is equal to **--list-one --output device --match-token LABEL=**__label__. This lookup method is able to reliably use /dev/disk/by-label udev symlinks (dependent on a setting in _/etc/blkid.conf_). Avoid using the symlinks directly; it is not reliable to use the symlinks without verification. The *--label* option works on systems with and without udev. +
Unfortunately, the original *blkid*(8) from e2fsprogs uses the *-L* option as a synonym for *-o list*. For better portability, use **-l -o device -t LABEL=**__label__ and *-o list* in your scripts rather than the *-L* option.
*-n*, *--match-types* _list_::
Restrict the probing functions to the specified (comma-separated) _list_ of superblock types (names). The list items may be prefixed with "no" to specify the types which should be ignored. For example: +
*blkid --probe --match-types vfat,ext3,ext4 /dev/sda1* +
probes for vfat, ext3 and ext4 filesystems, and +
*blkid --probe --match-types nominix /dev/sda1* +
probes for all supported formats except minix filesystems. This option is only useful together with *--probe*.
*-o*, *--output* _format_::
Use the specified output format. Note that the order of variables and devices is not fixed. See also option *-s*. The _format_ parameter may be: +
*full*;;
print all tags (the default)
*value*;;
print the value of the tags
*list*;;
print the devices in a user-friendly format; this output format is unsupported for low-level probing (*--probe* or *--info*). +
This output format is *DEPRECATED* in favour of the *lsblk*(8) command.
*device*;;
print the device name only; this output format is always enabled for the *--label* and *--uuid* options
*udev*;;
print key="value" pairs for easy import into the udev environment; the keys are prefixed by ID_FS_ or ID_PART_ prefixes. The value may be modified to be safe for udev environment; allowed is plain ASCII, hex-escaping and valid UTF-8, everything else (including whitespaces) is replaced with '+++_+++'. The keys with __ENC_ postfix use hex-escaping for unsafe chars. +
The udev output returns the ID_FS_AMBIVALENT tag if more superblocks are detected, and ID_PART_ENTRY_* tags are always returned for all partitions including empty partitions. +
This output format is *DEPRECATED*.
*export*;;
print key=value pairs for easy import into the environment; this output format is automatically enabled when I/O Limits (*--info* option) are requested. +
The non-printing characters are encoded by ^ and M- notation and all potentially unsafe characters are escaped.
*-O*, *--offset* _offset_::
Probe at the given _offset_ (only useful with *--probe*). This option can be used together with the *--info* option.
*-p*, *--probe*::
Switch to low-level superblock probing mode (bypassing the cache). +
Note that low-level probing also returns information about partition table type (PTTYPE tag) and partitions (PART_ENTRY_* tags). The tag names produced by low-level probing are based on names used internally by libblkid and it may be different than when executed without *--probe* (for example PART_ENTRY_UUID= vs PARTUUID=). See also *--no-part-details*.
*-s*, *--match-tag* _tag_::
For each (specified) device, show only the tags that match _tag_. It is possible to specify multiple *--match-tag* options. If no tag is specified, then all tokens are shown for all (specified) devices. In order to just refresh the cache without showing any tokens, use *--match-tag none* with no other options.
*-S*, *--size* _size_::
Override the size of device/file (only useful with *--probe*).
*-t*, *--match-token* _NAME=value_::
Search for block devices with tokens named _NAME_ that have the value _value_, and display any devices which are found. Common values for _NAME_ include *TYPE*, *LABEL*, and *UUID*. If there are no devices specified on the command line, all block devices will be searched; otherwise only the specified devices are searched.
*-u*, *--usages* _list_::
Restrict the probing functions to the specified (comma-separated) _list_ of "usage" types. Supported usage types are: filesystem, raid, crypto and other. The list items may be prefixed with "no" to specify the usage types which should be ignored. For example: +
*blkid --probe --usages filesystem,other /dev/sda1* +
probes for all filesystem and other (e.g., swap) formats, and +
*blkid --probe --usages noraid /dev/sda1* +
probes for all supported formats except RAIDs. This option is only useful together with *--probe*.
*-U*, *--uuid* _uuid_::
Look up the device that uses this filesystem _uuid_. For more details see the *--label* option.
*-V*, *--version*::
Display version number and exit.
== EXIT STATUS
If the specified device or device addressed by specified token (option *--match-token*) was found and it's possible to gather any information about the device, an exit status 0 is returned. Note the option *--match-tag* filters output tags, but it does not affect exit status.
If the specified token was not found, or no (specified) devices could be identified, or it is impossible to gather any information about the device identifiers or device content an exit status of 2 is returned.
For usage or other errors, an exit status of 4 is returned.
If an ambivalent probing result was detected by low-level probing mode (*-p*), an exit status of 8 is returned.
== CONFIGURATION FILE
The standard location of the _/etc/blkid.conf_ config file can be overridden by the environment variable BLKID_CONF. The following options control the libblkid library:
_SEND_UEVENT=<yes|not>_::
Sends uevent when _/dev/disk/by-{label,uuid,partuuid,partlabel}/_ symlink does not match with LABEL, UUID, PARTUUID or PARTLABEL on the device. Default is "yes".
_CACHE_FILE=<path>_::
Overrides the standard location of the cache file. This setting can be overridden by the environment variable *BLKID_FILE*. Default is _/run/blkid/blkid.tab_, or _/etc/blkid.tab_ on systems without a _/run_ directory.
_EVALUATE=<methods>_::
Defines LABEL and UUID evaluation method(s). Currently, the libblkid library supports the "udev" and "scan" methods. More than one method may be specified in a comma-separated list. Default is "udev,scan". The "udev" method uses udev _/dev/disk/by-*_ symlinks and the "scan" method scans all block devices from the _/proc/partitions_ file.
== ENVIRONMENT
Setting _LIBBLKID_DEBUG=all_ enables debug output.
== AUTHORS
*blkid* was written by Andreas Dilger for libblkid and improved by Theodore Ts'o and Karel Zak.
== SEE ALSO
*libblkid*(3),
*findfs*(8),
*lsblk*(8),
*wipefs*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

170
misc-utils/cal.1.adoc Normal file
View File

@ -0,0 +1,170 @@
////
Copyright (c) 1989, 1990, 1993
The Regents of the University of California. All rights reserved.
This code is derived from software contributed to Berkeley by
Kim Letkeman.
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. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the University of
California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
@(#)cal.1 8.1 (Berkeley) 6/6/93
////
= cal(1)
:doctype: manpage
:man manual: User Commands
:man source: util-linux {release-version}
:page-layout: base
:command: cal
== NAME
cal - display a calendar
== SYNOPSIS
*cal* [options] [[[_day_] _month_] _year_]
*cal* [options] [_timestamp_|_monthname_]
== DESCRIPTION
*cal* displays a simple calendar. If no arguments are specified, the current month is displayed.
The _month_ may be specified as a number (1-12), as a month name or as an abbreviated month name according to the current locales.
Two different calendar systems are used, Gregorian and Julian. These are nearly identical systems with Gregorian making a small adjustment to the frequency of leap years; this facilitates improved synchronization with solar events like the equinoxes. The Gregorian calendar reform was introduced in 1582, but its adoption continued up to 1923. By default *cal* uses the adoption date of 3 Sept 1752. From that date forward the Gregorian calendar is displayed; previous dates use the Julian calendar system. 11 days were removed at the time of adoption to bring the calendar in sync with solar events. So Sept 1752 has a mix of Julian and Gregorian dates by which the 2nd is followed by the 14th (the 3rd through the 13th are absent).
Optionally, either the proleptic Gregorian calendar or the Julian calendar may be used exclusively. See *--reform* below.
== OPTIONS
*-1*, *--one*::
Display single month output. (This is the default.)
*-3*, *--three*::
Display three months spanning the date.
*-n , --months* _number_::
Display _number_ of months, starting from the month containing the date.
*-S, --span*::
Display months spanning the date.
*-s*, *--sunday*::
Display Sunday as the first day of the week.
*-m*, *--monday*::
Display Monday as the first day of the week.
*-v*, *--vertical*::
Display using a vertical layout (aka *ncal*(1) mode).
*--iso*::
Display the proleptic Gregorian calendar exclusively. This option does not affect week numbers and the first day of the week. See *--reform* below.
*-j*, *--julian*::
Use day-of-year numbering for all calendars. These are also called ordinal days. Ordinal days range from 1 to 366. This option does not switch from the Gregorian to the Julian calendar system, that is controlled by the *--reform* option. +
Sometimes Gregorian calendars using ordinal dates are referred to as Julian calendars. This can be confusing due to the many date related conventions that use Julian in their name: (ordinal) julian date, julian (calendar) date, (astronomical) julian date, (modified) julian date, and more. This option is named julian, because ordinal days are identified as julian by the POSIX standard. However, be aware that *cal* also uses the Julian calendar system. See *DESCRIPTION* above.
*--reform* _val_::
This option sets the adoption date of the Gregorian calendar reform. Calendar dates previous to reform use the Julian calendar system. Calendar dates after reform use the Gregorian calendar system. The argument _val_ can be: +
* _1752_ - sets 3 September 1752 as the reform date (default). This is when the Gregorian calendar reform was adopted by the British Empire.
* _gregorian_ - display Gregorian calendars exclusively. This special placeholder sets the reform date below the smallest year that *cal* can use; meaning all calendar output uses the Gregorian calendar system. This is called the proleptic Gregorian calendar, because dates prior to the calendar system's creation use extrapolated values.
* _iso_ - alias of _gregorian_. The ISO 8601 standard for the representation of dates and times in information interchange requires using the proleptic Gregorian calendar.
* _julian_ - display Julian calendars exclusively. This special placeholder sets the reform date above the largest year that *cal* can use; meaning all calendar output uses the Julian calendar system.
See *­DESCRIPTION* above.
*-y*, *--year*::
Display a calendar for the whole year.
*-Y, --twelve*::
Display a calendar for the next twelve months.
*-w*, *--week*[=_number_]::
Display week numbers in the calendar (US or ISO-8601). See NOTES section for more details.
*--color*[=_when_]::
Colorize the output. The optional argument _when_ can be *auto*, *never* or *always*. If the _when_ argument is omitted, it defaults to *auto*. The colors can be disabled; for the current built-in default see the *--help* output. See also the *COLORS* section.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== PARAMETERS
*Single digits-only parameter (e.g., 'cal 2020')*::
Specifies the _year_ to be displayed; note the year must be fully specified: *cal 89* will not display a calendar for 1989.
*Single string parameter (e.g., 'cal tomorrow' or 'cal August')*::
Specifies _timestamp_ or a _month name_ (or abbreviated name) according to the current locales. +
The special placeholders are accepted when parsing timestamp, "now" may be used to refer to the current time, "today", "yesterday", "tomorrow" refer to of the current day, the day before or the next day, respectively. +
The relative date specifications are also accepted, in this case "+" is evaluated to the current time plus the specified time span. Correspondingly, a time span that is prefixed with "-" is evaluated to the current time minus the specified time span, for example '+2days'. Instead of prefixing the time span with "+" or "-", it may also be suffixed with a space and the word "left" or "ago" (for example '1 week ago').
*Two parameters (e.g., 'cal 11 2020')*::
Denote the _month_ (1 - 12) and _year_.
*Three parameters (e.g., 'cal 25 11 2020')*::
Denote the _day_ (1-31), _month and year_, and the day will be highlighted if the calendar is displayed on a terminal. If no parameters are specified, the current month's calendar is displayed.
== NOTES
A year starts on January 1. The first day of the week is determined by the locale or the *--sunday* and *--monday* options.
The week numbering depends on the choice of the first day of the week. If it is Sunday then the customary North American numbering is used, where 1 January is in week number 1. If it is Monday (*-m*) then the ISO 8601 standard week numbering is used, where the first Thursday is in week number 1.
== COLORS
Implicit coloring can be disabled as follows:
____
*touch /etc/terminal-colors.d/cal.disable*
____
See *terminal-colors.d*(5) for more details about colorization configuration.
== HISTORY
A *cal* command appeared in Version 6 AT&T UNIX.
== BUGS
The default *cal* output uses 3 September 1752 as the Gregorian calendar reform date. The historical reform dates for the other locales, including its introduction in October 1582, are not implemented.
Alternative calendars, such as the Umm al-Qura, the Solar Hijri, the Ge'ez, or the lunisolar Hindu, are not supported.
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

66
misc-utils/fincore.1.adoc Normal file
View File

@ -0,0 +1,66 @@
////
Copyright 2017 Red Hat, Inc.
This file may be copied under the terms of the GNU Public License.
////
= fincore(1)
:doctype: manpage
:man manual: User Commands
:man source: util-linux {release-version}
:page-layout: base
:command: fincore
== NAME
fincore - count pages of file contents in core
== SYNOPSIS
*fincore* [options] _file_...
== DESCRIPTION
*fincore* counts pages of file contents being resident in memory (in core), and reports the numbers. If an error occurs during counting, then an error message is printed to the stderr and *fincore* continues processing the rest of files listed in a command line.
The default output is subject to change. So whenever possible, you should avoid using default outputs in your scripts. Always explicitly define expected columns by using *--output* _columns-list_ in environments where a stable output is required.
== OPTIONS
*-n*, *--noheadings*::
Do not print a header line in status output.
*-b*, *--bytes*::
Print the SIZE column in bytes rather than in a human-readable format.
*-o*, *--output* _list_::
Define output columns. See the *--help* output to get a list of the currently supported columns. The default list of columns may be extended if _list_ is specified in the format _+list_.
*-r*, *--raw*::
Produce output in raw format. All potentially unsafe characters are hex-escaped (BSOLx<code>).
*-J*, *--json*::
Use JSON output format.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== AUTHORS
mailto:yamato@redhat.com[Masatake YAMATO]
== SEE ALSO
*mincore*(2),
*getpagesize*(2),
*getconf*(1p)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

78
misc-utils/findfs.8.adoc Normal file
View File

@ -0,0 +1,78 @@
// Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved.
// This file may be copied under the terms of the GNU Public License.
= findfs(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: findfs
== NAME
findfs - find a filesystem by label or UUID
== SYNOPSIS
*findfs* *NAME*=_value_
== DESCRIPTION
*findfs* will search the block devices in the system looking for a filesystem or partition with specified tag. The currently supported tags are:
*LABEL=<label>*::
Specifies filesystem label.
*UUID=<uuid>*::
Specifies filesystem UUID.
*PARTUUID=<uuid>*::
Specifies partition UUID. This partition identifier is supported for example for GUID Partition Table (GPT) partition tables.
*PARTLABEL=<label>*::
Specifies partition label (name). The partition labels are supported for example for GUID Partition Table (GPT) or MAC partition tables.
If the filesystem or partition is found, the device name will be printed on stdout.
The complete overview about filesystems and partitions you can get for example by
____
*lsblk --fs*
*partx --show <disk>*
*blkid*
____
== EXIT STATUS
____
*0*::
success
*1*::
label or uuid cannot be found
*2*::
usage error, wrong number of arguments or unknown option
____
== ENVIRONMENT
LIBBLKID_DEBUG=all::
enables libblkid debug output.
== AUTHORS
*findfs* was originally written by mailto:tytso@mit.edu[Theodore Ts'o] and re-written for the util-linux package by mailto:kzak@redhat.com[Karel Zak]
== SEE ALSO
*blkid*(8),
*lsblk*(8),
*partx*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

217
misc-utils/findmnt.8.adoc Normal file
View File

@ -0,0 +1,217 @@
= findmnt(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: findmnt
== NAME
findmnt - find a filesystem
== SYNOPSIS
*findmnt* [options]
*findmnt* [options] _device_|_mountpoint_
*findmnt* [options] [*--source*] _device_ [*--target*|*--mountpoint*] _mountpoint_
== DESCRIPTION
*findmnt* will list all mounted filesystems or search for a filesystem. The *­findmnt* command is able to search in _/etc/fstab_, _/etc/mtab_ or _/proc/self/mountinfo_. If _device_ or _mountpoint_ is not given, all filesystems are shown.
The device may be specified by device name, major:minor numbers, filesystem label or UUID, or partition label or UUID. Note that *­findmnt* follows *mount*(8) behavior where a device name may be interpreted as a mountpoint (and vice versa) if the *--target*, *--mountpoint* or *--source* options are not specified.
The command prints all mounted filesystems in the tree-like format by default.
== OPTIONS
*-A*, *--all*::
Disable all built-in filters and print all filesystems.
*-a*, *--ascii*::
Use ascii characters for tree formatting.
*-b*, *--bytes*::
Print the SIZE, USED and AVAIL columns in bytes rather than in a human-readable format.
*-C*, *--nocanonicalize*::
Do not canonicalize paths at all. This option affects the comparing of paths and the evaluation of tags (LABEL, UUID, etc.).
*-c*, *--canonicalize*::
Canonicalize all printed paths.
*-D*, *--df*::
Imitate the output of df1. This option is equivalent to *-o SOURCE,FSTYPE,SIZE,USED,AVAIL,USE%,TARGET* but excludes all pseudo filesystems. Use *--all* to print all filesystems.
*-d*, *--direction* __word__****::
The search direction, either *forward* or *backward*.
*-e*, *--evaluate*::
Convert all tags (LABEL, UUID, PARTUUID or PARTLABEL) to the corresponding device names.
*-F*, *--tab-file* _path_::
Search in an alternative file. If used with *--fstab*, *--mtab* or *--kernel*, then it overrides the default paths. If specified more than once, then tree-like output is disabled (see the *--list* option).
*-f*, *--first-only*::
Print the first matching filesystem only.
*-h*, *--help*::
Display help text and exit.
*-i*, *--invert*::
Invert the sense of matching.
*-J*, *--json*::
Use JSON output format.
*-k*, *--kernel*::
Search in _/proc/self/mountinfo_. The output is in the tree-like format. This is the default. The output contains only mount options maintained by kernel (see also *--mtab)*.
*-l*, *--list*::
Use the list output format. This output format is automatically enabled if the output is restricted by the *-t*, *-O*, *-S* or *-T* option and the option *--submounts* is not used or if more that one source file (the option *-F*) is specified.
*-M*, *--mountpoint* _path_::
Explicitly define the mountpoint file or directory. See also *--target*.
*-m*, *--mtab*::
Search in _/etc/mtab_. The output is in the list format by default (see *--tree*). The output may include user space mount options.
*-N*, *--task* _tid_::
Use alternative namespace _/proc/<tid>/mountinfo_ rather than the default _/proc/self/mountinfo_. If the option is specified more than once, then tree-like output is disabled (see the *--list* option). See also the *unshare*(1) command.
*-n*, *--noheadings*::
Do not print a header line.
*-O*, *--options* _list_::
Limit the set of printed filesystems. More than one option may be specified in a comma-separated list. The *-t* and *-O* options are cumulative in effect. It is different from *-t* in that each option is matched exactly; a leading _no_ at the beginning does not have global meaning. The "no" can used for individual items in the list. The "no" prefix interpretation can be disabled by "+" prefix.
*-o*, *--output* _list_::
Define output columns. See the *--help* output to get a list of the currently supported columns. The *TARGET* column contains tree formatting if the *--list* or *--raw* options are not specified. +
The default list of columns may be extended if _list_ is specified in the format _+list_ (e.g., *findmnt -o +PROPAGATION*).
*--output-all*::
Output almost all available columns. The columns that require *--poll* are not included.
*-P*, *--pairs*::
Produce output in the form of key="value" pairs. All potentially unsafe value characters are hex-escaped (\x<code>). The key (variable name) will be modified to contain only characters allowed for a shell variable identifiers, for example, FS_OPTIONS and USE_PCT instead of FS-OPTIONS and USE%.
*-p*, *--poll*[_=list_]::
Monitor changes in the _/proc/self/mountinfo_ file. Supported actions are: mount, umount, remount and move. More than one action may be specified in a comma-separated list. All actions are monitored by default. +
The time for which *--poll* will block can be restricted with the *--timeout* or *--first-only* options. +
The standard columns always use the new version of the information from the mountinfo file, except the umount action which is based on the original information cached by findmnt8. The poll mode allows using extra columns: +
*ACTION*;;
mount, umount, move or remount action name; this column is enabled by default
*OLD-TARGET*;;
available for umount and move actions
*OLD-OPTIONS*;;
available for umount and remount actions
*--pseudo*::
Print only pseudo filesystems.
*-R*, *--submounts*::
Print recursively all submounts for the selected filesystems. The restrictions defined by options *-t*, *-O*, *-S*, *-T* and *­--direction* are not applied to submounts. All submounts are always printed in tree-like order. The option enables the tree-like output format by default. This option has no effect for *--mtab* or *--fstab*.
*-r*, *--raw*::
Use raw output format. All potentially unsafe characters are hex-escaped (\x<code>).
*--real*::
Print only real filesystems.
*-S*, *--source* _spec_::
Explicitly define the mount source. Supported specifications are _device_, __maj__**:**_min_, **LABEL=**__label__, **UUID=**__uuid__, **PARTLABEL=**__label__ and **PARTUUID=**__uuid__.
*-s*, *--fstab*::
Search in _/etc/fstab_. The output is in the list format (see *--list*).
*-T*, *--target* _path_::
Define the mount target. If _path_ is not a mountpoint file or directory, then *findmnt* checks the _path_ elements in reverse order to get the mountpoint (this feature is supported only when searching in kernel files and unsupported for *--fstab*). It's recommended to use the option *--mountpoint* when checks of _path_ elements are unwanted and _path_ is a strictly specified mountpoint.
*-t*, *--types* _list_::
Limit the set of printed filesystems. More than one type may be specified in a comma-separated list. The list of filesystem types can be prefixed with *no* to specify the filesystem types on which no action should be taken. For more details see *mount*(8).
*--tree*::
Enable tree-like output if possible. The options is silently ignored for tables where is missing child-parent relation (e.g., fstab).
*-U*, *--uniq*::
Ignore filesystems with duplicate mount targets, thus effectively skipping over-mounted mount points.
*-u*, *--notruncate*::
Do not truncate text in columns. The default is to not truncate the *TARGET*, *SOURCE*, *UUID*, *LABEL*, *PARTUUID*, *PARTLABEL* columns. This option disables text truncation also in all other columns.
*-v*, *--nofsroot*::
Do not print a [/dir] in the SOURCE column for bind mounts or btrfs subvolumes.
*-w*, *--timeout* _milliseconds_::
Specify an upper limit on the time for which *--poll* will block, in milliseconds.
*-x*, *--verify*::
Check mount table content. The default is to verify _/etc/fstab_ parsability and usability. It's possible to use this option also with *--tab-file*. It's possible to specify source (device) or target (mountpoint) to filter mount table. The option *--verbose* forces findmnt to print more details.
*--verbose*::
Force findmnt to print more information (*--verify* only for now).
*--vfs-all*::
When used with *VFS-OPTIONS* column, print all VFS (fs-independent) flags. This option is designed for auditing purposes to list also default VFS kernel mount options which are normally not listed.
== ENVIRONMENT
LIBMOUNT_FSTAB=<path>::
overrides the default location of the fstab file
LIBMOUNT_MTAB=<path>::
overrides the default location of the mtab file
LIBMOUNT_DEBUG=all::
enables libmount debug output
LIBSMARTCOLS_DEBUG=all::
enables libsmartcols debug output
LIBSMARTCOLS_DEBUG_PADDING=on::
use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.
== EXAMPLES
*findmnt --fstab -t nfs*::
Prints all NFS filesystems defined in _/etc/fstab_.
*findmnt --fstab /mnt/foo*::
Prints all `/etc/fstab` filesystems where the mountpoint directory is _/mnt/foo_. It also prints bind mounts where _/mnt/foo_ is a source.
*findmnt --fstab --target /mnt/foo*::
Prints all _/etc/fstab_ filesystems where the mountpoint directory is _/mnt/foo_.
*findmnt --fstab --evaluate*::
Prints all _/etc/fstab_ filesystems and converts LABEL= and UUID= tags to the real device names.
*findmnt -n --raw --evaluate --output=target LABEL=/boot*::
Prints only the mountpoint where the filesystem with label "/boot" is mounted.
*findmnt --poll --mountpoint /mnt/foo*::
Monitors mount, unmount, remount and move on _/mnt/foo_.
*findmnt --poll=umount --first-only --mountpoint /mnt/foo*::
Waits for _/mnt/foo_ unmount.
*findmnt --poll=remount -t ext3 -O ro*::
Monitors remounts to read-only mode on all ext3 filesystems.
== AUTHORS
mailto:kzak@redhat.com>[Karel Zak]
== SEE ALSO
*fstab*(5),
*mount*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

156
misc-utils/getopt.1.adoc Normal file
View File

@ -0,0 +1,156 @@
= getopt(1)
:doctype: manpage
:man manual: User Commands
:man source: util-linux {release-version}
:page-layout: base
:command: getopt
== NAME
getopt - parse command options (enhanced)
== SYNOPSIS
*getopt* _optstring_ _parameters_
*getopt* [options] [*--*] _optstring_ _parameters_
*getopt* [options] *-o*|*--options* _optstring_ [options] [*--*] _parameters_
== DESCRIPTION
*getopt* is used to break up (_parse_) options in command lines for easy parsing by shell procedures, and to check for valid options. It uses the GNU *getopt*(3) routines to do this.
The parameters *getopt* is called with can be divided into two parts: options which modify the way *getopt* will do the parsing (the _options_ and the _optstring_ in the *SYNOPSIS*), and the parameters which are to be parsed (_parameters_ in the *SYNOPSIS*). The second part will start at the first non-option parameter that is not an option argument, or after the first occurrence of '*--*'. If no '*-o*' or '*--options*' option is found in the first part, the first parameter of the second part is used as the short options string.
If the environment variable *GETOPT_COMPATIBLE* is set, or if the first _parameter_ is not an option (does not start with a '*-*', the first format in the *SYNOPSIS*), *getopt* will generate output that is compatible with that of other versions of *getopt*(1). It will still do parameter shuffling and recognize optional arguments (see section *COMPATIBILITY* for more information).
Traditional implementations of *getopt*(1) are unable to cope with whitespace and other (shell-specific) special characters in arguments and non-option parameters. To solve this problem, this implementation can generate quoted output which must once again be interpreted by the shell (usually by using the *eval* command). This has the effect of preserving those characters, but you must call *getopt* in a way that is no longer compatible with other versions (the second or third format in the *SYNOPSIS*). To determine whether this enhanced version of *getopt*(1) is installed, a special test option (*-T*) can be used.
== OPTIONS
*-a*, *--alternative*::
Allow long options to start with a single '*-*'.
*-h*, *--help*::
Display help text and exit. No other output is generated.
*-l*, *--longoptions* _longopts_::
The long (multi-character) options to be recognized. More than one option name may be specified at once, by separating the names with commas. This option may be given more than once, the _longopts_ are cumulative. Each long option name in _longopts_ may be followed by one colon to indicate it has a required argument, and by two colons to indicate it has an optional argument.
*-n*, *--name* _progname_::
The name that will be used by the *getopt*(3) routines when it reports errors. Note that errors of *getopt*(1) are still reported as coming from getopt.
*-o*, *--options* _shortopts_::
The short (one-character) options to be recognized. If this option is not found, the first parameter of *getopt* that does not start with a '*-*' (and is not an option argument) is used as the short options string. Each short option character in _shortopts_ may be followed by one colon to indicate it has a required argument, and by two colons to indicate it has an optional argument. The first character of shortopts may be '*+*' or '*-*' to influence the way options are parsed and output is generated (see section *SCANNING MODES* for details).
*-q*, *--quiet*::
Disable error reporting by *getopt*(3).
*-Q*, *--quiet-output*::
Do not generate normal output. Errors are still reported by *getopt*(3), unless you also use *-q*.
*-s*, *--shell* _shell_::
Set quoting conventions to those of _shell_. If the *-s* option is not given, the BASH conventions are used. Valid arguments are currently '*sh*' '*bash*', '*csh*', and '*tcsh*'.
*-T*, *--test*::
Test if your *getopt*(1) is this enhanced version or an old version. This generates no output, and sets the error status to 4. Other implementations of getopt1, and this version if the environment variable *GETOPT_COMPATIBLE* is set, will return '*--*' and error status 0.
*-u*, *--unquoted*::
Do not quote the output. Note that whitespace and special (shell-dependent) characters can cause havoc in this mode (like they do with other getopt1 implementations).
*-V*, *--version*::
Display version information and exit. No other output is generated.
== PARSING
This section specifies the format of the second part of the parameters of *getopt* (the _parameters_ in the *SYNOPSIS*). The next section (*OUTPUT*) describes the output that is generated. These parameters were typically the parameters a shell function was called with. Care must be taken that each parameter the shell function was called with corresponds to exactly one parameter in the parameter list of *getopt* (see the *EXAMPLES*). All parsing is done by the GNU *getopt*(3) routines.
The parameters are parsed from left to right. Each parameter is classified as a short option, a long option, an argument to an option, or a non-option parameter.
A simple short option is a '*-*' followed by a short option character. If the option has a required argument, it may be written directly after the option character or as the next parameter (i.e., separated by whitespace on the command line). If the option has an optional argument, it must be written directly after the option character if present.
It is possible to specify several short options after one '*-*', as long as all (except possibly the last) do not have required or optional arguments.
A long option normally begins with '*--*' followed by the long option name. If the option has a required argument, it may be written directly after the long option name, separated by '*=*', or as the next argument (i.e., separated by whitespace on the command line). If the option has an optional argument, it must be written directly after the long option name, separated by '*=*', if present (if you add the '*=*' but nothing behind it, it is interpreted as if no argument was present; this is a slight bug, see the *BUGS*). Long options may be abbreviated, as long as the abbreviation is not ambiguous.
Each parameter not starting with a '*-*', and not a required argument of a previous option, is a non-option parameter. Each parameter after a '*--*' parameter is always interpreted as a non-option parameter. If the environment variable *POSIXLY_CORRECT* is set, or if the short option string started with a '*+*', all remaining parameters are interpreted as non-option parameters as soon as the first non-option parameter is found.
== OUTPUT
Output is generated for each element described in the previous section. Output is done in the same order as the elements are specified in the input, except for non-option parameters. Output can be done in _compatible_ (_unquoted_) mode, or in such way that whitespace and other special characters within arguments and non-option parameters are preserved (see *QUOTING*). When the output is processed in the shell script, it will seem to be composed of distinct elements that can be processed one by one (by using the shift command in most shell languages). This is imperfect in unquoted mode, as elements can be split at unexpected places if they contain whitespace or special characters.
If there are problems parsing the parameters, for example because a required argument is not found or an option is not recognized, an error will be reported on stderr, there will be no output for the offending element, and a non-zero error status is returned.
For a short option, a single '*-*' and the option character are generated as one parameter. If the option has an argument, the next parameter will be the argument. If the option takes an optional argument, but none was found, the next parameter will be generated but be empty in quoting mode, but no second parameter will be generated in unquoted (compatible) mode. Note that many other *getopt*(1) implementations do not support optional arguments.
If several short options were specified after a single '*-*', each will be present in the output as a separate parameter.
For a long option, '*--*' and the full option name are generated as one parameter. This is done regardless whether the option was abbreviated or specified with a single '*-*' in the input. Arguments are handled as with short options.
Normally, no non-option parameters output is generated until all options and their arguments have been generated. Then '*--*' is generated as a single parameter, and after it the non-option parameters in the order they were found, each as a separate parameter. Only if the first character of the short options string was a '*-*', non-option parameter output is generated at the place they are found in the input (this is not supported if the first format of the *SYNOPSIS* is used; in that case all preceding occurrences of '*-*' and '*+*' are ignored).
== QUOTING
In compatibility mode, whitespace or 'special' characters in arguments or non-option parameters are not handled correctly. As the output is fed to the shell script, the script does not know how it is supposed to break the output into separate parameters. To circumvent this problem, this implementation offers quoting. The idea is that output is generated with quotes around each parameter. When this output is once again fed to the shell (usually by a shell *eval* command), it is split correctly into separate parameters.
Quoting is not enabled if the environment variable *GETOPT_COMPATIBLE* is set, if the first form of the *SYNOPSIS* is used, or if the option '*-u*' is found.
Different shells use different quoting conventions. You can use the '*-s*' option to select the shell you are using. The following shells are currently supported: '*sh*', '*bash*', '*csh*' and '*tcsh*'. Actually, only two 'flavors' are distinguished: sh-like quoting conventions and csh-like quoting conventions. Chances are that if you use another shell script language, one of these flavors can still be used.
== SCANNING MODES
The first character of the short options string may be a '*-*' or a '*+*' to indicate a special scanning mode. If the first calling form in the *SYNOPSIS* is used they are ignored; the environment variable *POSIXLY_CORRECT* is still examined, though.
If the first character is '*+*', or if the environment variable *POSIXLY_CORRECT* is set, parsing stops as soon as the first non-option parameter (i.e., a parameter that does not start with a '*-*') is found that is not an option argument. The remaining parameters are all interpreted as non-option parameters.
If the first character is a '*-*', non-option parameters are outputted at the place where they are found; in normal operation, they are all collected at the end of output after a '*--*' parameter has been generated. Note that this '*--*' parameter is still generated, but it will always be the last parameter in this mode.
== COMPATIBILITY
This version of *getopt*(1) is written to be as compatible as possible to other versions. Usually you can just replace them with this version without any modifications, and with some advantages.
If the first character of the first parameter of getopt is not a '*-*', *getopt* goes into compatibility mode. It will interpret its first parameter as the string of short options, and all other arguments will be parsed. It will still do parameter shuffling (i.e., all non-option parameters are output at the end), unless the environment variable *POSIXLY_CORRECT* is set, in which case, *getopt* will prepend a '*+*' before short options automatically.
The environment variable *GETOPT_COMPATIBLE* forces *getopt* into compatibility mode. Setting both this environment variable and *POSIXLY_CORRECT* offers 100% compatibility for 'difficult' programs. Usually, though, neither is needed.
In compatibility mode, leading '*-*' and '*+*' characters in the short options string are ignored.
== RETURN CODES
*getopt* returns error code *0* for successful parsing, *1* if *getopt*(3) returns errors, *2* if it does not understand its own parameters, *3* if an internal error occurs like out-of-memory, and *4* if it is called with *-T*.
== EXAMPLES
// TRANSLATORS: Don't translate _{docdir}_.
Example scripts for (ba)sh and (t)csh are provided with the *getopt*(1) distribution, and are installed in _{docdir}_ directory.
== ENVIRONMENT
*POSIXLY_CORRECT*::
This environment variable is examined by the *getopt*(3) routines. If it is set, parsing stops as soon as a parameter is found that is not an option or an option argument. All remaining parameters are also interpreted as non-option parameters, regardless whether they start with a '*-*'.
*GETOPT_COMPATIBLE*::
Forces *getopt* to use the first calling format as specified in the *SYNOPSIS*.
== BUGS
*getopt*(3) can parse long options with optional arguments that are given an empty optional argument (but cannot do this for short options). This *getopt*(1) treats optional arguments that are empty as if they were not present.
The syntax if you do not want any short option variables at all is not very intuitive (you have to set them explicitly to the empty string).
== AUTHOR
mailto:frodo@frodo.looijaard.name[Frodo Looijaard]
== SEE ALSO
*bash*(1),
*tcsh*(1),
*getopt*(3)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

View File

@ -0,0 +1,93 @@
////
SPDX-License-Identifier: MIT
Copyright (C) 2008 - 2012 Julian Andres Klode. See hardlink.c for license.
Copyright (C) 2021 Karel Zak <kzak@redhat.com>
////
= hardlink(1)
:doctype: manpage
:man manual: User Commands
:man source: util-linux {release-version}
:page-layout: base
:command: hardlink
== NAME
hardlink - link multiple copies of a file
== SYNOPSIS
*hardlink* [options] [_directory_|_file_]...
== DESCRIPTION
*hardlink* is a tool which replaces copies of a file with hardlinks, therefore saving space.
== OPTIONS
*-h*, *--help*::
print quick usage details to the screen.
*-v*, *--verbose*::
More verbose output. If specified once, every hardlinked file is displayed, if specified twice, it also shows every comparison.
*-q*, *--quiet*::
Quiet mode, don't print anything.
*-n*, *--dry-run*::
Do not act, just print what would happen
*-f*, *--respect-name*::
Only try to link files with the same (basename). It's strongly recommended to use long options rather than *-f* which is interpreted in a different way by others hardlink implementations.
*-p*, *--ignore-mode*::
Link/compare files even if their mode is different. This may be a bit unpredictable.
*-o*, *--ignore-owner*::
Link/compare files even if their owner (user and group) is different. It is not predictable.
*-t*, *--ignore-time*::
Link/compare files even if their time of modification is different. You almost always want this.
*-X*, *--respect-xattrs*::
Only try to link files with the same extended attributes.
*-m*, *--maximize*::
Among equal files, keep the file with the highest link count.
*-M*, *--minimize*::
Among equal files, keep the file with the lowest link count.
*-O*, *--keep-oldest*::
Among equal files, keep the oldest file (least recent modification time). By default, the newest file is kept. If *--maximize* or *--minimize* is specified, the link count has a higher precedence than the time of modification.
*-x*, *--exclude* _regex_::
A regular expression which excludes files from being compared and linked.
*-i*, *--include* _regex_::
A regular expression to include files. If the option *--exclude* has been given, this option re-includes files which would otherwise be excluded. If the option is used without *--exclude*, only files matched by the pattern are included.
*-s*, *--minimum-size* _size_::
The minimum size to consider. By default this is 1, so empty files will not be linked. The _size_ argument may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB").
== ARGUMENTS
*hardlink* takes one or more directories which will be searched for files to be linked.
== BUGS
The original *hardlink* implementation uses the option *-f* to force hardlinks creation between filesystem. This very rarely usable feature is no more supported by the current hardlink.
*hardlink* assumes that the trees it operates on do not change during operation. If a tree does change, the result is undefined and potentially dangerous. For example, if a regular file is replaced by a device, hardlink may start reading from the device. If a component of a path is replaced by a symbolic link or file permissions change, security may be compromised. Do not run hardlink on a changing tree or on a tree controlled by another user.
== AUTHOR
There are multiple *hardlink* implementations. The very first implementation is from Jakub Jelinek for Fedora distribution, this implementation has been used in util-linux between versions v2.34 to v2.36. The current implementations is based on Debian version from Julian Andres Klode.
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

119
misc-utils/kill.1.adoc Normal file
View File

@ -0,0 +1,119 @@
////
Copyright 1994 Salvatore Valente (svalente@mit.edu)
Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
May be distributed under the GNU General Public License
////
= kill(1)
:doctype: manpage
:man manual: User Commands
:man source: util-linux {release-version}
:page-layout: base
:command: kill
== NAME
kill - terminate a process
== SYNOPSIS
*kill* [-signal|*-s* _signal_|*-p*] [*-q* _value_] [*-a*] [*--timeout* _milliseconds_ _signal_] [*--*] _pid_|_name_...
*kill* *-l* [_number_] | *-L*
== DESCRIPTION
The command *kill* sends the specified _signal_ to the specified processes or process groups.
If no signal is specified, the TERM signal is sent. The default action for this signal is to terminate the process. This signal should be used in preference to the KILL signal (number 9), since a process may install a handler for the TERM signal in order to perform clean-up steps before terminating in an orderly fashion. If a process does not terminate after a TERM signal has been sent, then the KILL signal may be used; be aware that the latter signal cannot be caught, and so does not give the target process the opportunity to perform any clean-up before terminating.
Most modern shells have a builtin *kill* command, with a usage rather similar to that of the command described here. The *--all*, *--pid*, and *--queue* options, and the possibility to specify processes by command name, are local extensions.
If _signal_ is 0, then no actual signal is sent, but error checking is still performed.
== ARGUMENTS
The list of processes to be signaled can be a mixture of names and PIDs.
_pid_::
Each _pid_ can be expressed in one of the following ways: +
_n_;;
where _n_ is larger than 0. The process with PID _n_ is signaled.
*0*;;
All processes in the current process group are signaled.
*-1*;;
All processes with a PID larger than 1 are signaled.
**-**__n__;;
where _n_ is larger than 1. All processes in process group _n_ are signaled. When an argument of the form '-n' is given, and it is meant to denote a process group, either a signal must be specified first, or the argument must be preceded by a '--' option, otherwise it will be taken as the signal to send.
_name_::
All processes invoked using this _name_ will be signaled.
== OPTIONS
*-s*, *--signal* _signal_::
The signal to send. It may be given as a name or a number.
*-l*, *--list* [_number_]::
Print a list of signal names, or convert the given signal number to a name. The signals can be found in `/usr/include/linux/signal.h`.
*-L*, *--table*::
Similar to *-l*, but it will print signal names and their corresponding numbers.
*-a*, *--all*::
Do not restrict the command-name-to-PID conversion to processes with the same UID as the present process.
*-p*, *--pid*::
Only print the process ID (PID) of the named processes, do not send any signals.
*--verbose*::
Print PID(s) that will be signaled with *kill* along with the signal.
*-q*, *--queue* _value_::
Send the signal using *sigqueue*(3) rather than *kill*(2). The _value_ argument is an integer that is sent along 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_sigval_ field of the `siginfo_t` structure.
*--timeout* _milliseconds signal_::
Send a signal defined in the usual way to a process, followed by an additional signal after a specified delay. The *--timeout* option causes *kill* to wait for a period defined in _milliseconds_ before sending a follow-up _signal_ to the process. This feature is implemented using the Linux kernel PID file descriptor feature in order to guarantee that the follow-up signal is sent to the same process or not sent if the process no longer exists. +
Note that the operating system may re-use PIDs and implementing an equivalent feature in a shell using *kill* and *sleep* would be subject to races whereby the follow-up signal might be sent to a different process that used a recycled PID. +
The *--timeout* option can be specified multiple times: the signals are sent sequentially with the specified timeouts. The *--timeout* option can be combined with the *--queue* option. +
As an example, the following command sends the signals QUIT, TERM and KILL in sequence and waits for 1000 milliseconds between sending the signals: +
....
kill --verbose --timeout 1000 TERM --timeout 1000 KILL \
--signal QUIT 12345
....
== EXIT STATUS
*kill* has the following exit status values:
____
*0*::
success
*1*::
failure
*64*::
partial success (when more than one process specified)
____
== NOTES
Although it is possible to specify the TID (thread ID, see *gettid*(2)) of one of the threads in a multithreaded process as the argument of *kill*, the signal is nevertheless directed to the process (i.e., the entire thread group). In other words, it is not possible to send a signal to an explicitly selected thread in a multithreaded process. The signal will be delivered to an arbitrarily selected thread in the target process that is not blocking the signal. For more details, see *signal*(7) and the description of *CLONE_THREAD* in *clone*(2).
Various shells provide a builtin *kill* command that is preferred in relation to the *kill*(1) executable described by this manual. The easiest way to ensure one is executing the command described in this page is to use the full path when calling the command, for example: */bin/kill --version*
== AUTHORS
mailto:svalente@mit.edu[Salvatore Valente] +
mailto:kzak@redhat.com[Karel Zak] +
The original version was taken from BSD 4.4.
== SEE ALSO
*bash*(1),
*tcsh*(1),
*sigaction*(2),
*kill*(2),
*sigqueue*(3),
*signal*(7)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

239
misc-utils/logger.1.adoc Normal file
View File

@ -0,0 +1,239 @@
////
Copyright (c) 1983, 1990, 1993
The Regents of the University of California. All rights reserved.
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. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the University of
California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
@(#)logger.1 8.1 (Berkeley) 6/6/93
////
= logger(1)
:doctype: manpage
:man manual: User Commands
:man source: util-linux {release-version}
:page-layout: base
:command: logger
== NAME
logger - enter messages into the system log
== SYNOPSIS
*logger* [options] _message_
== DESCRIPTION
*logger* makes entries in the system log.
When the optional _message_ argument is present, it is written to the log. If it is not present, and the *-f* option is not given either, then standard input is logged.
== OPTIONS
*-d*, *--udp*::
Use datagrams (UDP) only. By default the connection is tried to the syslog port defined in _/etc/services_, which is often 514. +
See also *--server* and *--socket* to specify where to connect.
*-e*, *--skip-empty*::
Ignore empty lines when processing files. An empty line is defined to be a line without any characters. Thus a line consisting only of whitespace is NOT considered empty. Note that when the *--prio-prefix* option is specified, the priority is not part of the line. Thus an empty line in this mode is a line that does not have any characters after the priority prefix (e.g., *<13>*).
*-f*, *--file* _file_::
Log the contents of the specified _file_. This option cannot be combined with a command-line message.
*-i*::
Log the PID of the logger process with each line.
*--id*[**=**__id__]::
Log the PID of the logger process with each line. When the optional argument _id_ is specified, then it is used instead of the logger command's PID. The use of *--id=$$* (PPID) is recommended in scripts that send several messages. +
Note that the system logging infrastructure (for example *systemd* when listening on _/dev/log_) may follow local socket credentials to overwrite the PID specified in the message. *logger*(1) is able to set those socket credentials to the given _id_, but only if you have root permissions and a process with the specified PID exists, otherwise the socket credentials are not modified and the problem is silently ignored.
*--journald*[**=**__file__]::
Write a systemd journal entry. The entry is read from the given _file_, when specified, otherwise from standard input. Each line must begin with a field that is accepted by journald; see *systemd.journal-fields*(7) for details. The use of a MESSAGE_ID field is generally a good idea, as it makes finding entries easy. Examples: +
____
logger --journald <<end
MESSAGE_ID=67feb6ffbaf24c5cbec13c008dd72309
MESSAGE=The dogs bark, but the caravan goes on.
DOGS=bark
CARAVAN=goes on
end
logger --journald=entry.txt
____
Notice that *--journald* will ignore values of other options, such as priority. If priority is needed it must be within input, and use PRIORITY field. The simple execution of *journalctl*(1) will display MESSAGE field. Use *journalctl --output json-pretty* to see rest of the fields. +
To include newlines in MESSAGE, specify MESSAGE several times. This is handled as a special case, other fields will be stored as an array in the journal if they appear multiple times.
*--msgid* _msgid_::
Sets the RFC5424 MSGID field. Note that the space character is not permitted inside of _msgid_. This option is only used if *--rfc5424* is specified as well; otherwise, it is silently ignored.
*-n*, *--server* _server_::
Write to the specified remote syslog _server_ instead of to the system log socket. Unless *--udp* or *--tcp* is specified, *logger* will first try to use UDP, but if this fails a TCP connection is attempted.
*--no-act*::
Causes everything to be done except for writing the log message to the system log, and removing the connection or the journal. This option can be used together with *--stderr* for testing purposes.
*--octet-count*::
Use the link:https://tools.ietf.org/html/rfc6587[RFC 6587] octet counting framing method for sending messages. When this option is not used, the default is no framing on UDP, and RFC6587 non-transparent framing (also known as octet stuffing) on TCP.
*-P*, *--port* _port_::
Use the specified _port_. When this option is not specified, the port defaults to syslog for udp and to syslog-conn for tcp connections.
*-p*, *--priority* _priority_::
Enter the message into the log with the specified _priority_. The priority may be specified numerically or as a _facility_._level_ pair. For example, *-p local3.info* logs the message as informational in the local3 facility. The default is *user.notice*.
*--prio-prefix*::
Look for a syslog prefix on every line read from standard input. This prefix is a decimal number within angle brackets that encodes both the facility and the level. The number is constructed by multiplying the facility by 8 and then adding the level. For example, *local0.info*, meaning facility=16 and level=6, becomes *<134>*. +
If the prefix contains no facility, the facility defaults to what is specified by the *-p* option. Similarly, if no prefix is provided, the line is logged using the _priority_ given with *-p*. +
This option doesn't affect a command-line message.
*--rfc3164*::
Use the link:https://tools.ietf.org/html/rfc3164[RFC 3164] BSD syslog protocol to submit messages to a remote server.
*--rfc5424*[**=**__without__]::
Use the link:https://tools.ietf.org/html/rfc5424[RFC 5424] syslog protocol to submit messages to a remote server. The optional _without_ argument can be a comma-separated list of the following values: *notq*, *notime*, *nohost*. +
The *notq* value suppresses the time-quality structured data from the submitted message. The time-quality information shows whether the local clock was synchronized plus the maximum number of microseconds the timestamp might be off. The time quality is also automatically suppressed when *--sd-id timeQuality* is specified. +
The *notime* value (which implies *notq*) suppresses the complete sender timestamp that is in ISO-8601 format, including microseconds and timezone. +
The *nohost* value suppresses *gethostname*(2) information from the message header. +
The RFC 5424 protocol has been the default for *logger* since version 2.26.
*-s*, *--stderr*::
Output the message to standard error as well as to the system log.
*--sd-id* _name_[**@**__digits__]::
Specifies a structured data element ID for an RFC 5424 message header. The option has to be used before *--sd-param* to introduce a new element. The number of structured data elements is unlimited. The ID (_name_ plus possibly **@**__digits__) is case-sensitive and uniquely identifies the type and purpose of the element. The same ID must not exist more than once in a message. The **@**__digits__ part is required for user-defined non-standardized IDs. +
*logger* currently generates the *timeQuality* standardized element only. RFC 5424 also describes the elements *origin* (with parameters ip, enterpriseId, software and swVersion) and *meta* (with parameters sequenceId, sysUpTime and language). These element IDs may be specified without the **@**__digits__ suffix.
*--sd-param* _name_=_value_::
Specifies a structured data element parameter, a name and value pair. The option has to be used after *--sd-id* and may be specified more than once for the same element. Note that the quotation marks around _value_ are required and must be escaped on the command line. +
....
logger --rfc5424 --sd-id zoo@123 \
--sd-param tiger="hungry" \
--sd-param zebra="running" \
--sd-id manager@123
--sd-param onMeeting="yes"
"this is message"
....
produces: +
*<13>1 2015-10-01T14:07:59.168662+02:00 ws kzak - - [timeQuality tzKnown="1" isSynced="1" syncAccuracy="218616"][zoo@123 tiger="hungry" zebra="running"][manager@123 onMeeting="yes"] this is message*
*-S*, *--size* _size_::
Sets the maximum permitted message size to _size_. The default is 1KiB characters, which is the limit traditionally used and specified in RFC 3164. With RFC 5424, this limit has become flexible. A good assumption is that RFC 5424 receivers can at least process 4KiB messages. +
Most receivers accept messages larger than 1KiB over any type of syslog protocol. As such, the *--size* option affects logger in all cases (not only when *--rfc5424* was used). +
Note: the message-size limit limits the overall message size, including the syslog header. Header sizes vary depending on the selected options and the hostname length. As a rule of thumb, headers are usually not longer than 50 to 80 characters. When selecting a maximum message size, it is important to ensure that the receiver supports the max size as well, otherwise messages may become truncated. Again, as a rule of thumb two to four KiB message size should generally be OK, whereas anything larger should be verified to work.
*--socket-errors*[**=**__mode__]::
Print errors about Unix socket connections. The _mode_ can be a value of *off*, *on*, or *auto*. When the mode is auto logger will detect if the init process is systemd, and if so assumption is made _/dev/log_ can be used early at boot. Other init systems lack of _/dev/log_ will not cause errors that is identical with messaging using *openlog*(3) system call. The *logger*(1) before version 2.26 used openlog, and hence was unable to detected loss of messages sent to Unix sockets. +
The default mode is *auto*. When errors are not enabled lost messages are not communicated and will result to successful exit status of *logger*(1) invocation.
*-T*, *--tcp*::
Use stream (TCP) only. By default the connection is tried to the _syslog-conn_ port defined in _/etc/services_, which is often _601_. +
See also *--server* and *--socket* to specify where to connect.
*-t*, *--tag* _tag_::
Mark every line to be logged with the specified _tag_. The default tag is the name of the user logged in on the terminal (or a user name based on effective user ID).
*-u*, *--socket* _socket_::
Write to the specified _socket_ instead of to the system log socket.
*--*::
End the argument list. This allows the _message_ to start with a hyphen (-).
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== EXIT STATUS
The *logger* utility exits 0 on success, and >0 if an error occurs.
== FACILITIES AND LEVELS
Valid facility names are:
*auth* +
*authpriv* for security information of a sensitive nature +
*cron* +
*daemon* +
*ftp* +
*kern* cannot be generated from userspace process, automatically converted to *user* +
*lpr* +
*mail* +
*news* +
*syslog* +
*user* +
*uucp* +
*local0* +
to +
*local7* +
*security* deprecated synonym for *auth*
Valid level names are:
*emerg* +
*alert* +
*crit* +
*err* +
*warning* +
*notice* +
*info* +
*debug* +
*panic* deprecated synonym for *emerg* +
*error* deprecated synonym for *err* +
*warn* deprecated synonym for *warning* +
For the priority order and intended purposes of these facilities and levels, see *syslog*(3).
== CONFORMING TO
The *logger* command is expected to be IEEE Std 1003.2 ("POSIX.2") compatible.
== EXAMPLES
*logger System rebooted* *logger -p local0.notice -t HOSTIDM -f /dev/idmc* *logger -n loghost.example.com System rebooted*
== AUTHORS
The *logger* command was originally written by University of California in 1983-1993 and later rewritten by mailto:kzak@redhat.com[Karel Zak], mailto:rgerhards@adiscon.com[Rainer Gerhards], and mailto:kerolasa@iki.fi[Sami Kerola].
== SEE ALSO
*journalctl*(1),
*syslog*(3),
*systemd.journal-fields*(7)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

114
misc-utils/look.1.adoc Normal file
View File

@ -0,0 +1,114 @@
////
Copyright (c) 1990, 1993
The Regents of the University of California. All rights reserved.
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. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the University of
California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
@(#)look.1 8.1 (Berkeley) 6/14/93
////
= look(1)
:doctype: manpage
:man manual: User Commands
:man source: util-linux {release-version}
:page-layout: base
:command: look
== NAME
look - display lines beginning with a given string
== SYNOPSIS
*look* [options] _string_ [_file_]
== DESCRIPTION
The *look* utility displays any lines in _file_ which contain _string_. As *look* performs a binary search, the lines in _file_ must be sorted (where *sort*(1) was given the same options *-d* and/or *-f* that *look* is invoked with).
If _file_ is not specified, the file _/usr/share/dict/words_ is used, only alphanumeric characters are compared and the case of alphabetic characters is ignored.
== OPTIONS
*-a*, *--alternative*::
Use the alternative dictionary file.
*-d*, *--alphanum*::
Use normal dictionary character set and order, i.e., only blanks and alphanumeric characters are compared. This is on by default if no file is specified. +
Note that blanks have been added to dictionary character set for compatibility with *sort -d* command since version 2.28.
*-f*, *--ignore-case*::
Ignore the case of alphabetic characters. This is on by default if no file is specified.
*-t*, *--terminate* _character_::
Specify a string termination character, i.e., only the characters in _string_ up to and including the first occurrence of _character_ are compared.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
The *look* utility exits 0 if one or more lines were found and displayed, 1 if no lines were found, and >1 if an error occurred.
== ENVIRONMENT
*WORDLIST*::
Path to a dictionary file. The environment variable has greater priority than the dictionary path defined in FILES segment.
== FILES
_/usr/share/dict/words_::
the dictionary
_/usr/share/dict/web2_::
the alternative dictionary
== HISTORY
The *look* utility appeared in Version 7 AT&T Unix.
== EXAMPLES
....
sort -d /etc/passwd -o /tmp/look.dict
look -t: root:foobar /tmp/look.dict
....
== SEE ALSO
*grep*(1),
*sort*(1)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

174
misc-utils/lsblk.8.adoc Normal file
View File

@ -0,0 +1,174 @@
= lsblk(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: lsblk
== NAME
lsblk - list block devices
== SYNOPSIS
*lsblk* [options] [_device_...]
== DESCRIPTION
*lsblk* lists information about all available or the specified block devices. The *lsblk* command reads the *sysfs* filesystem and *udev db* to gather information. If the udev db is not available or *lsblk* is compiled without udev support, then it tries to read LABELs, UUIDs and filesystem types from the block device. In this case root permissions are necessary.
The command prints all block devices (except RAM disks) in a tree-like format by default. Use *lsblk --help* to get a list of all available columns.
The default output, as well as the default output from options like *--fs* and *--topology*, is subject to change. So whenever possible, you should avoid using default outputs in your scripts. Always explicitly define expected columns by using *--output* _columns-list_ and *--list* in environments where a stable output is required.
Note that *lsblk* might be executed in time when *udev* does not have all information about recently added or modified devices yet. In this case it is recommended to use *udevadm settle* before *lsblk* to synchronize with udev.
The relationship between block devices and filesystems is not always one-to-one. The filesystem may use more block devices, or the same filesystem may be accessible by more paths. This is the reason why *lsblk* provides MOUNTPOINT and MOUNTPOINTS (pl.) columns. The column MOUNTPOINT displays only one mount point (usually the last mounted instance of the filesystem), and the column MOUNTPOINTS displays by multi-line cell all mount points associated with the device.
== OPTIONS
*-a*, *--all*::
Also list empty devices and RAM disk devices.
*-b*, *--bytes*::
Print the SIZE column in bytes rather than in a human-readable format.
*-D*, *--discard*::
Print information about the discarding capabilities (TRIM, UNMAP) for each device.
*-d*, *--nodeps*::
Do not print holder devices or slaves. For example, *lsblk --nodeps /dev/sda* prints information about the sda device only.
*-E*, *--dedup* _column_::
Use _column_ as a de-duplication key to de-duplicate output tree. If the key is not available for the device, or the device is a partition and parental whole-disk device provides the same key than the device is always printed. +
The usual use case is to de-duplicate output on system multi-path devices, for example by *-E WWN*.
-e*, *--exclude* _list_::
Exclude the devices specified by the comma-separated _list_ of major device numbers. Note that RAM disks (major=1) are excluded by default if *--all* is not specified. The filter is applied to the top-level devices only. This may be confusing for *--list* output format where hierarchy of the devices is not obvious.
*-f*, *--fs*::
Output info about filesystems. This option is equivalent to *-o NAME,FSTYPE,FSVER,LABEL,UUID,FSAVAIL,FSUSE%,MOUNTPOINTS*. The authoritative information about filesystems and raids is provided by the *blkid*(8) command.
*-h*, *--help*::
Display help text and exit.
*-I*, *--include* _list_::
Include devices specified by the comma-separated _list_ of major device numbers. The filter is applied to the top-level devices only. This may be confusing for *--list* output format where hierarchy of the devices is not obvious.
*-i*, *--ascii*::
Use ASCII characters for tree formatting.
*-J*, *--json*::
Use JSON output format. It's strongly recommended to use *--output* and also *--tree* if necessary.
*-l*, *--list*::
Produce output in the form of a list. The output does not provide information about relationships between devices and since version 2.34 every device is printed only once if *--pairs* or *--raw* not specified (the parsable outputs are maintained in backwardly compatible way).
*-M*, *--merge*::
Group parents of sub-trees to provide more readable output for RAIDs and Multi-path devices. The tree-like output is required.
*-m*, *--perms*::
Output info about device owner, group and mode. This option is equivalent to *-o NAME,SIZE,OWNER,GROUP,MODE*.
*-n*, *--noheadings*::
Do not print a header line.
*-o*, *--output* _list_::
Specify which output columns to print. Use *--help* to get a list of all supported columns. The columns may affect tree-like output. The default is to use tree for the column 'NAME' (see also *--tree*). +
The default list of columns may be extended if _list_ is specified in the format _+list_ (e.g., *lsblk -o +UUID*).
*-O*, *--output-all*::
Output all available columns.
*-P*, *--pairs*::
Produce output in the form of key="value" pairs. The output lines are still ordered by dependencies. All potentially unsafe value characters are hex-escaped (\x<code>). The key (variable name) will be modified to contain only characters allowed for a shell variable identifiers, for example, MIN_IO and FSUSE_PCT instead of MIN-IO and FSUSE%.
*-p*, *--paths*::
Print full device paths.
*-r*, *--raw*::
Produce output in raw format. The output lines are still ordered by dependencies. All potentially unsafe characters are hex-escaped (\x<code>) in the NAME, KNAME, LABEL, PARTLABEL and MOUNTPOINT columns.
*-S*, *--scsi*::
Output info about SCSI devices only. All partitions, slaves and holder devices are ignored.
*-s*, *--inverse*::
Print dependencies in inverse order. If the *--list* output is requested then the lines are still ordered by dependencies.
*-T*, *--tree*[**=**__column__]::
Force tree-like output format. If _column_ is specified, then a tree is printed in the column. The default is NAME column.
*-t*, *--topology*::
Output info about block-device topology. This option is equivalent to +
*-o NAME,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,RQ-SIZE,RA,WSAME*.
*-V*, *--version*::
Display version information and exit.
*-w*, *--width* _number_::
Specifies output width as a number of characters. The default is the number of the terminal columns, and if not executed on a terminal, then output width is not restricted at all by default. This option also forces *lsblk* to assume that terminal control characters and unsafe characters are not allowed. The expected use-case is for example when lsblk used by *watch*(1) command.
*-x*, *--sort* _column_::
Sort output lines by _column_. This option enables *--list* output format by default. It is possible to use the option *--tree* to force tree-like output and than the tree branches are sorted by the _column_.
*-z*, *--zoned*::
Print the zone model for each device.
*--sysroot* _directory_::
Gather data for a Linux instance other than the instance from which the *lsblk* command is issued. The specified directory is the system root of the Linux instance to be inspected. The real device nodes in the target directory can be replaced by text files with udev attributes.
== EXIT STATUS
0::
success
1::
failure
32::
none of specified devices found
64::
some specified devices found, some not found
== ENVIRONMENT
LSBLK_DEBUG=all::
enables *lsblk* debug output.
LIBBLKID_DEBUG=all::
enables *libblkid* debug output.
LIBMOUNT_DEBUG=all::
enables *libmount* debug output.
LIBSMARTCOLS_DEBUG=all::
enables *libsmartcols* debug output.
LIBSMARTCOLS_DEBUG_PADDING=on::
use visible padding characters. Requires enabled LIBSMARTCOLS_DEBUG.
== NOTES
For partitions, some information (e.g., queue attributes) is inherited from the parent device.
The *lsblk* command needs to be able to look up each block device by major:minor numbers, which is done by using _/sys/dev/block_. This sysfs block directory appeared in kernel 2.6.27 (October 2008). In case of problems with a new enough kernel, check that CONFIG_SYSFS was enabled at the time of the kernel build.
== AUTHORS
mailto:mbroz@redhat.com[Milan Broz] +
mailto:kzak@redhat.com[Karel Zak]
== SEE ALSO
*ls*(1),
*blkid*(8),
*findmnt*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

111
misc-utils/lslocks.8.adoc Normal file
View File

@ -0,0 +1,111 @@
////
Man page for the lslocks command.
Copyright 2012 Davidlohr Bueso <dave@gnu.org>
May be distributed under the GNU General Public License
////
////
Copyright 1994 Salvatore Valente (svalente@mit.edu)
Copyright 1992 Rickard E. Faith (faith@cs.unc.edu)
May be distributed under the GNU General Public License
////
= lslocks(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: lslocks
== NAME
lslocks - list local system locks
== SYNOPSIS
*lslocks* [options]
== DESCRIPTION
*lslocks* lists information about all the currently held file locks in a Linux system.
Note that lslocks also lists OFD (Open File Description) locks, these locks are not associated with any process (PID is -1). OFD locks are associated with the open file description on which they are acquired. This lock type is available since Linux 3.15, see fcntl2 for more details.
== OPTIONS
*-b*, *--bytes*::
Print the SIZE column in bytes rather than in a human-readable format.
*-i*, *--noinaccessible*::
Ignore lock files which are inaccessible for the current user.
*-J*, *--json*::
Use JSON output format.
*-n*, *--noheadings*::
Do not print a header line.
*-o*, *--output* _list_::
Specify which output columns to print. Use *--help* to get a list of all supported columns. +
The default list of columns may be extended if _list_ is specified in the format _+list_ (e.g., *lslocks -o +BLOCKER*).
*--output-all*::
Output all available columns.
*-p*, *--pid* _pid_::
Display only the locks held by the process with this _pid_.
*-r*, *--raw*::
Use the raw output format.
*-u*, *--notruncate*::
Do not truncate text in columns.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== OUTPUT
COMMAND::
The command name of the process holding the lock.
PID::
The process ID of the process which holds the lock or -1 for OFDLCK.
TYPE::
The type of lock; can be FLOCK (created with flock2), POSIX (created with fcntl2 and lockf3) or OFDLCK (created with fcntl(2).
SIZE::
Size of the locked file.
MODE::
The lock's access permissions (read, write). If the process is blocked and waiting for the lock, then the mode is postfixed with an '*' (asterisk).
M::
Whether the lock is mandatory; 0 means no (meaning the lock is only advisory), 1 means yes. (See fcntl2.)
START::
Relative byte offset of the lock.
END::
Ending offset of the lock.
PATH::
Full path of the lock. If none is found, or there are no permissions to read the path, it will fall back to the device's mountpoint and "..." is appended to the path. The path might be truncated; use *--notruncate* to get the full path.
BLOCKER::
The PID of the process which blocks the lock.
== NOTES
The lslocks command is meant to replace the *lslk*(8) command, originally written by mailto:abe@purdue.edu[Victor A. Abell] and unmaintained since 2001.
== AUTHORS
mailto:dave@gnu.org[Davidlohr Bueso]
== SEE ALSO
*flock*(1),
*fcntl*(2),
*lockf*(3)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

68
misc-utils/mcookie.1.adoc Normal file
View File

@ -0,0 +1,68 @@
// mcookie.1 --
// Public Domain 1995 Rickard E. Faith (faith@cs.unc.edu)
= mcookie(1)
:doctype: manpage
:man manual: User Commands
:man source: util-linux {release-version}
:page-layout: base
:command: mcookie
== NAME
mcookie - generate magic cookies for xauth
== SYNOPSIS
*mcookie* [options]
== DESCRIPTION
*mcookie* generates a 128-bit random hexadecimal number for use with the X authority system. Typical usage:
____
*xauth add :0 . `mcookie`*
____
The "random" number generated is actually the MD5 message digest of random information coming from one of the sources *getrandom*(2) system call, _/dev/urandom_, _/dev/random_, or the _libc pseudo-random functions_, in this preference order. See also the option *--file*.
== OPTIONS
*-f*, *--file* _file_::
Use this _file_ as an additional source of randomness (for example _/dev/urandom_). When _file_ is '-', characters are read from standard input.
*-m*, *--max-size* _number_::
Read from _file_ only this _number_ of bytes. This option is meant to be used when reading additional randomness from a file or device. +
The _number_ argument may be followed by the multiplicative suffixes KiB=1024, MiB=1024*1024, and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB") or the suffixes KB=1000, MB=1000*1000, and so on for GB, TB, PB, EB, ZB and YB.
*-v*, *--verbose*::
Inform where randomness originated, with amount of entropy read from each source.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== FILES
_/dev/urandom_ +
_/dev/random_
== BUGS
It is assumed that none of the randomness sources will block.
== SEE ALSO
*md5sum*(1),
*X*(7),
*xauth*(1),
*rand*(3)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

86
misc-utils/namei.1.adoc Normal file
View File

@ -0,0 +1,86 @@
= namei(1)
:doctype: manpage
:man manual: User Commands
:man source: util-linux {release-version}
:page-layout: base
:command: namei
== NAME
namei - follow a pathname until a terminal point is found
== SYNOPSIS
*namei* [options] _pathname_...
== DESCRIPTION
*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
*-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*::
Don't 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'.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== BUGS
To be discovered.
== AUTHORS
The original *namei* program was written by Roger mailto:rogers@amadeus.wr.tek.com[Roger Southwick].
The program was rewritten by Karel Zak mailto:kzak@redhat.com[Karel Zak].
== SEE ALSO
*ls*(1),
*stat*(1),
*symlink*(7)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

107
misc-utils/rename.1.adoc Normal file
View File

@ -0,0 +1,107 @@
// Written by Andries E. Brouwer (aeb@cwi.nl)
// Placed in the public domain
= rename(1)
:doctype: manpage
:man manual: User Commands
:man source: util-linux {release-version}
:page-layout: base
:command: rename
== NAME
rename - rename files
== SYNOPSIS
*rename* [options] _expression replacement file_...
== DESCRIPTION
*rename* will rename the specified files by replacing the first occurrence of _expression_ in their name by _replacement_.
== OPTIONS
*-s*, *--symlink*::
Do not rename a symlink but its target.
*-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.
*-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.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== WARNING
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.
== INTERACTIVE MODE
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
*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
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
*mv*(1)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

95
misc-utils/uuidd.8.adoc Normal file
View File

@ -0,0 +1,95 @@
////
Copyright 2007 by Theodore Ts'o. All Rights Reserved.
This file may be copied under the terms of the GNU Public License.
////
= uuidd(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: uuidd
== NAME
uuidd - UUID generation daemon
== SYNOPSIS
*uuidd* [options]
== DESCRIPTION
The *uuidd* daemon is used by the UUID library to generate universally unique identifiers (UUIDs), especially time-based UUIDs, in a secure and guaranteed-unique fashion, even in the face of large numbers of threads running on different CPUs trying to grab UUIDs.
== OPTIONS
*-d*, *--debug*::
Run uuidd in debugging mode. This prevents uuidd from running as a daemon.
*-F*, *--no-fork*::
Do not daemonize using a double-fork.
*-k*, *--kill*::
If currently a uuidd daemon is running, kill it.
*-n*, *--uuids* _number_::
When issuing a test request to a running *uuidd*, request a bulk response of _number_ UUIDs.
*-P*, *--no-pid*::
Do not create a pid file.
// TRANSLATORS: Don't translate _{runstatedir}_.
*-p*, *--pid* _path_::
Specify the pathname where the pid file should be written. By default, the pid file is written to _{runstatedir}/uuidd/uuidd.pid_.
*-q*, *--quiet*::
Suppress some failure messages.
*-r*, *--random*::
Test uuidd by trying to connect to a running uuidd daemon and request it to return a random-based UUID.
*-S*, *--socket-activation*::
Do not create a socket but instead expect it to be provided by the calling process. This implies *--no-fork* and *--no-pid*. This option is intended to be used only with *systemd*(1). It needs to be enabled with a configure option.
// TRANSLATORS: Don't translate _{runstatedir}_.
*-s*, *--socket* _path_::
Make uuidd use this pathname for the unix-domain socket. By default, the pathname used is _{runstatedir}/uuidd/request_. This option is primarily for debugging purposes, since the pathname is hard-coded in the libuuid library.
*-T*, *--timeout* _number_::
Make uuidd exit after _number_ seconds of inactivity.
*-t*, *--time*::
Test uuidd by trying to connect to a running uuidd daemon and request it to return a time-based UUID.
*-V*, *--version*::
Output version information and exit.
*-h*, *--help*::
Display help screen and exit.
== EXAMPLE
Start up a daemon, print 42 random keys, and then stop the daemon:
....
uuidd -p /tmp/uuidd.pid -s /tmp/uuidd.socket
uuidd -d -r -n 42 -s /tmp/uuidd.socket
uuidd -d -k -s /tmp/uuidd.socket
....
== AUTHOR
The *uuidd* daemon was written by mailto:tytso@mit.edu[Theodore Ts'o].
== SEE ALSO
*uuid*(3),
*uuidgen*(1)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

80
misc-utils/uuidgen.1.adoc Normal file
View File

@ -0,0 +1,80 @@
////
Copyright 1999 Andreas Dilger (adilger@enel.ucalgary.ca)
This file may be copied under the terms of the GNU Public License.
////
= uuidgen(1)
:doctype: manpage
:man manual: User Commands
:man source: util-linux {release-version}
:page-layout: base
:command: uuidgen
== NAME
uuidgen - create a new UUID value
== SYNOPSIS
*uuidgen* [options]
== DESCRIPTION
The *uuidgen* program creates (and prints) a new universally unique identifier (UUID) using the *libuuid*(3) library. The new UUID can reasonably be considered unique among all UUIDs created on the local system, and among UUIDs created on other systems in the past and in the future.
There are three types of UUIDs which *uuidgen* can generate: time-based UUIDs, random-based UUIDs, and hash-based UUIDs. By default *uuidgen* will generate a random-based UUID if a high-quality random number generator is present. Otherwise, it will choose a time-based UUID. It is possible to force the generation of one of these first two UUID types by using the *--random* or *--time* options.
The third type of UUID is generated with the *--md5* or *--sha1* options, followed by *--namespace* _namespace_ and *--name* _name_. The _namespace_ may either be a well-known UUID, or else an alias to one of the well-known UUIDs defined in RFC 4122, that is *@dns*, *@url*, *@oid*, or *@x500*. The _name_ is an arbitrary string value. The generated UUID is the digest of the concatenation of the namespace UUID and the name value, hashed with the MD5 or SHA1 algorithms. It is, therefore, a predictable value which may be useful when UUIDs are being used as handles or nonces for more complex values or values which shouldn't be disclosed directly. See the RFC for more information.
== OPTIONS
*-r*, *--random*::
Generate a random-based UUID. This method creates a UUID consisting mostly of random bits. It requires that the operating system has a high quality random number generator, such as _/dev/random_.
*-t*, *--time*::
Generate a time-based UUID. This method creates a UUID based on the system clock plus the system's ethernet hardware address, if present.
*-h*, *--help*::
Display help text and exit.
*-V*, *--version*::
Display version information and exit.
*-m*, *--md5*::
Use MD5 as the hash algorithm.
*-s*, *--sha1*::
Use SHA1 as the hash algorithm.
*-n*, *--namespace* _namespace_::
Generate the hash with the _namespace_ prefix. The _namespace_ is UUID, or '@ns' where "ns" is well-known predefined UUID addressed by namespace name (see above).
*-N*, *--name* _name_::
Generate the hash of the _name_.
*-x*, *--hex*::
Interpret name _name_ as a hexadecimal string.
== CONFORMING TO
OSF DCE 1.1
== EXAMPLES
uuidgen --sha1 --namespace @dns --name "www.example.com"
== AUTHORS
*uuidgen* was written by Andreas Dilger for *libuuid*(3).
== SEE ALSO
*libuuid*(3), +
link:https://tools.ietf.org/html/rfc4122[RFC 4122]
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

View File

@ -0,0 +1,83 @@
// Copyright (c) 2017 Sami Kerola
// The 3-Clause BSD License
= uuidparse(1)
:doctype: manpage
:man manual: User Commands
:man source: util-linux {release-version}
:page-layout: base
:command: uuidparse
== NAME
uuidparse - a utility to parse unique identifiers
== SYNOPSIS
*uuidparse* [options] _uuid_
== DESCRIPTION
This command will parse unique identifier inputs from either command line arguments or standard input. The inputs are white-space separated.
== OUTPUT
=== Variants
[cols=",",]
|===
|NCS |Network Computing System identifier. These were the original UUIDs.
|DCE |The Open Software Foundation's (OSF) Distributed Computing Environment UUIDs.
|Microsoft |Microsoft Windows platform globally unique identifier (GUID).
|other |Unknown variant. Usually invalid input data.
|===
=== Types
[cols=",",]
|===
|nil |Special type for zero in type file.
|time-based |The DCE time based.
|DCE |The DCE time and MAC Address.
|name-based |RFC 4122 md5sum hash.
|random |RFC 4122 random.
|sha1-based |RFC 4122 sha-1 hash.
|unknown |Unknown type. Usually invalid input data.
|===
== OPTIONS
*-J*, *--json*::
Use JSON output format.
*-n*, *--noheadings*::
Do not print a header line.
*-o*, *--output*::
Specify which output columns to print. Use *--help* to get a list of all supported columns.
*-r*, *--raw*::
Use the raw output format.
*-V*, *--version*::
Display version information and exit.
*-h*, *--help*::
Display help text and exit.
== AUTHORS
mailto:kerolasa@iki.fi[Sami Kerola]
== SEE ALSO
*uuidgen*(1),
*libuuid*(3), +
https://tools.ietf.org/html/rfc4122[RFC 4122]
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

126
misc-utils/whereis.1.adoc Normal file
View File

@ -0,0 +1,126 @@
////
Copyright (c) 1980, 1990 The Regents of the University of California.
All rights reserved.
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. All advertising materials mentioning features or use of this software
must display the following acknowledgement:
This product includes software developed by the University of
California, Berkeley and its contributors.
4. Neither the name of the University nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
@(#)whereis.1 from UCB 4.2
////
= whereis(1)
:doctype: manpage
:man manual: User Commands
:man source: util-linux {release-version}
:page-layout: base
:command: whereis
== NAME
whereis - locate the binary, source, and manual page files for a command
== SYNOPSIS
*whereis* [options] [*-BMS* _directory_... *-f*] _name_...
== DESCRIPTION
*whereis* locates the binary, source and manual files for the specified command names. The supplied names are first stripped of leading pathname components. Prefixes of *s.* resulting from use of source code control are also dealt with. *whereis* then attempts to locate the desired program in the standard Linux places, and in the places specified by *$PATH* and *$MANPATH*.
The search restrictions (options *-b*, *-m* and *-s*) are cumulative and apply to the subsequent _name_ patterns on the command line. Any new search restriction resets the search mask. For example,
____
*whereis -bm ls tr -m gcc*
____
searches for "ls" and "tr" binaries and man pages, and for "gcc" man pages only.
The options *-B*, *-M* and *-S* reset search paths for the subsequent _name_ patterns. For example,
____
*whereis -m ls -M /usr/share/man/man1 -f cal*
____
searches for "ls" man pages in all default paths, but for "cal" in the _/usr/share/man/man1_ directory only.
== OPTIONS
*-b*::
Search for binaries.
*-m*::
Search for manuals.
*-s*::
Search for sources.
*-u*::
Only show the command names that have unusual entries. A command is said to be unusual if it does not have just one entry of each explicitly requested type. Thus '*whereis -m -u **' asks for those files in the current directory which have no documentation file, or more than one.
*-B* _list_::
Limit the places where *whereis* searches for binaries, by a whitespace-separated list of directories.
*-M* _list_::
Limit the places where *whereis* searches for manuals and documentation in Info format, by a whitespace-separated list of directories.
*-S* _list_::
Limit the places where *whereis* searches for sources, by a whitespace-separated list of directories.
*-f*::
Terminates the directory list and signals the start of filenames. It _must_ be used when any of the *-B*, *-M*, or *-S* options is used.
*-l*::
Output the list of effective lookup paths that *whereis* is using. When none of *-B*, *-M*, or *-S* is specified, the option will output the hard-coded paths that the command was able to find on the system.
*-h*, *--help*::
Display help text and exit.
*-V*, *--version*::
Display version information and exit.
== FILE SEARCH PATHS
By default *whereis* tries to find files from hard-coded paths, which are defined with glob patterns. The command attempts to use the contents of *$PATH* and *$MANPATH* environment variables as default search path. The easiest way to know what paths are in use is to add the *-l* listing option. Effects of the *-B*, *-M*, and *-S* are displayed with *-l*.
== ENVIRONMENT
WHEREIS_DEBUG=all::
enables debug output.
== EXAMPLES
To find all files in _/usr/bin_ which are not documented in _/usr/man/man1_ or have no source in _/usr/src_:
*cd /usr/bin* *whereis -u -ms -M /usr/man/man1 -S /usr/src -f **
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]

116
misc-utils/wipefs.8.adoc Normal file
View File

@ -0,0 +1,116 @@
// Copyright 2009 by Karel Zak. All Rights Reserved.
// This file may be copied under the terms of the GNU Public License.
= wipefs(8)
:doctype: manpage
:man manual: System Administration
:man source: util-linux {release-version}
:page-layout: base
:command: wipefs
== NAME
wipefs - wipe a signature from a device
== SYNOPSIS
*wipefs* [options] _device_...
*wipefs* [*--backup*] *-o* _offset device_...
*wipefs* [*--backup*] *-a* _device_...
== DESCRIPTION
*wipefs* can erase filesystem, raid or partition-table signatures (magic strings) from the specified _device_ to make the signatures invisible for libblkid. *wipefs* does not erase the filesystem itself nor any other data from the device.
When used without any options, *wipefs* lists all visible filesystems and the offsets of their basic signatures. The default output is subject to change. So whenever possible, you should avoid using default outputs in your scripts. Always explicitly define expected columns by using *--output* _columns-list_ in environments where a stable output is required.
*wipefs* calls the BLKRRPART ioctl when it has erased a partition-table signature to inform the kernel about the change. The ioctl is called as the last step and when all specified signatures from all specified devices are already erased. This feature can be used to wipe content on partitions devices as well as partition table on a disk device, for example by *wipefs -a /dev/sdc1 /dev/sdc2 /dev/sdc*.
Note that some filesystems and some partition tables store more magic strings on the device (e.g., FAT, ZFS, GPT). The *wipefs* command (since v2.31) lists all the offset where a magic strings have been detected.
When option *-a* is used, all magic strings that are visible for *libblkid*(3) are erased. In this case the *wipefs* scans the device again after each modification (erase) until no magic string is found.
Note that by default *wipefs* does not erase nested partition tables on non-whole disk devices. For this the option *--force* is required.
== OPTIONS
*-a*, *--all*::
Erase all available signatures. The set of erased signatures can be restricted with the *-t* option.
*-b*, *--backup*::
Create a signature backup to the file _$HOME/wipefs-<devname>-<offset>.bak_. For more details see the *EXAMPLE* section.
*-f*, *--force*::
Force erasure, even if the filesystem is mounted. This is required in order to erase a partition-table signature on a block device.
*-h*, *--help*::
Display help text and exit.
*-J*, *--json*::
Use JSON output format.
*--lock*[=_mode_]::
Use exclusive BSD lock for device or file it operates. The optional argument _mode_ can be *yes*, *no* (or 1 and 0) or *nonblock*. If the _mode_ argument is omitted, it defaults to *"yes"*. This option overwrites environment variable *$LOCK_BLOCK_DEVICE*. The default is not to use any lock at all, but it's recommended to avoid collisions with udevd or other tools.
*-i*, *--noheadings*::
Do not print a header line.
*-O*, *--output* _list_::
Specify which output columns to print. Use *--help* to get a list of all supported columns.
*-n*, *--no-act*::
Causes everything to be done except for the write() call.
*-o*, *--offset* _offset_::
Specify the location (in bytes) of the signature which should be erased from the device. The _offset_ number may include a "0x" prefix; then the number will be interpreted as a hex value. It is possible to specify multiple *-o* options. +
The _offset_ argument may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB"), or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
*-p*, *--parsable*::
Print out in parsable instead of printable format. Encode all potentially unsafe characters of a string to the corresponding hex value prefixed by '\x'.
*-q*, *--quiet*::
Suppress any messages after a successful signature wipe.
*-t*, *--types* _list_::
Limit the set of printed or erased signatures. More than one type may be specified in a comma-separated list. The list or individual types can be prefixed with 'no' to specify the types on which no action should be taken. For more details see *mount*(8).
*-V*, *--version*::
Display version information and exit.
== ENVIRONMENT
LIBBLKID_DEBUG=all::
enables *libblkid*(3) debug output.
LOCK_BLOCK_DEVICE=<mode>::
use exclusive BSD lock. The mode is "1" or "0". See *--lock* for more details.
== EXAMPLES
*wipefs /dev/sda**::
Prints information about sda and all partitions on sda.
*wipefs --all --backup /dev/sdb*::
Erases all signatures from the device _/dev/sdb_ and creates a signature backup file _~/wipefs-sdb-<offset>.bak_ for each signature.
*dd if=~/wipefs-sdb-0x00000438.bak of=/dev/sdb seek=$((0x00000438)) bs=1 conv=notrunc*::
Restores an ext2 signature from the backup file _~/wipefs-sdb-0x00000438.bak_.
== AUTHORS
mailto:kzak@redhat.com[Karel Zak]
== SEE ALSO
*blkid*(8),
*findfs*(8)
include::../man-common/bugreports.adoc[]
include::../man-common/footer.adoc[]
ifdef::translation[]
include::../man-common/translation.adoc[]
endif::[]