neulab/tldr huggingface dataset:
The following environment variables may be used for configuration as described in the section above:
•   LPASS_HOME
•   LPASS_AUTO_SYNC_TIME
•   LPASS_AGENT_TIMEOUT
•   LPASS_AGENT_DISABLE
•   LPASS_PINENTRY
•   LPASS_DISABLE_PINENTRY
•   LPASS_ASKPASS
•   LPASS_CLIPBOARD_COMMAND
In the following examples, "$" indicates a shell prompt while "#" indicates a comment.
# login, generate and retrieve a new password $ lpass login user@example.com $ lpass generate work/email 20 G</Czo4*c;A+g;KIHkO- $ lpass ls work work email [id: 140613939481239829] $ lpass show -p email G</Czo4*c;A+g;KIHkO-
# Copy password to clipboard $ lpass show -cp email
# Add a new secure note $ lpass add --note-type=ssn info/my-ssn # (editor shows a template file; fill in and save) Name: info/my-ssn NoteType: Social Security Name: My Name Goes Here Number: 123-45-6789 Notes:    # Add notes below this line Any notes I want to save go here. ~ ~
$ lpass show my-ssn info/my-ssn [id: 0] Number: 123-45-6789 Name: My Name Goes Here NoteType: Social Security Notes: Any notes I want to save go here.
# Display a secure note attachment $ lpass show my-secure-note info/my-secure-note [id: 1426405543365295118] URL: http://sn att-1426405543365295118-94690: travel-flight.pdf $ lpass show my-secure-note --attach att-1426405543365295118-94690 "travel-flight.pdf" is a binary file, print it anyway (or save)?  [y/n/S] s Wrote 122864 bytes to "travel-flight.pdf"
# Display secure note attachment to standard output $ lpass show my-secure-note --attach att-1426405543365295118-94690 --quiet [... binary data on stdout ...]
# Add an account non-interactively by creating the proper template printf "Username: wizard97\nPassword: vJwhFfBBtn8hj4" | \ lpass add Facebook --non-interactive
sk(1)                   sk - a command-line fuzzy finder                   sk(1)
sk - fuzzy finder in rust
sk [options]
sk is a general-purpose command-line fuzzy finder.
Search mode -e, --exact Enable exact-match
--regex Search with regular expression instead of fuzzy match
--algo=TYPE Fuzzy matching algorithm (default: skim_v2)
skim_v2 Almost always the one to choose skim_v1 The legacy algorithm clangd  the one used by clangd for keyword completion
--case=[smart,respect,ignore] To ignore case on matching or not. (default smart)
Search result --tac  Reverse the order of the search result(normally used together with --no-sort)
--no-sort Do not sort the search result(normally used together with --tac)
e.g. history | sk --tac --no-sort
score   Score of the fuzzy match algorithm index   Prefers line that appeared earlier in the input stream begin   Prefers line with matched substring closer to the beginning end     Prefers line with matched substring closer to the end
- Each criterion could be negated, e.g. (-index) - Each criterion should appear only once in the list
Interface -i, --interactive Start the finder in the command query
-c, --cmd [cmd] Specify the command to invoke for fetching options
-I replstr Replace replstr with the selected item
-m, --multi Enable multi-select with tab/shift-tab
--no-multi Disable multi-select
--bind=KEYBINDS Comma-separated list of custom key bindings. See KEY BINDINGS for the details.
--height=HEIGHT[%] Display sk window below the cursor with the given height instead of using the full screen.
e.g. sk --margin 10% sk --margin 1,5%
--inline-info Display finder info inline with the query
-p --prompt=STR Input prompt (default: '> ')
--cmd-prompt=STR Command prompt (default: 'c> ')
--skip-to-pattern Line will start with the start of the matched pattern. Effective only when the query string is empty. Was designed to skip showing starts of paths of rg/grep results.
e.g. sk -i -c "rg {} --color=always" --skip-to-pattern '[^/]*:' --ansi
--no-clear-if-empty Do not clear previous items if new command returns empty result. This might be useful to reduce flickering when typing new commands and the half-complete commands are not valid.
This is not default however because similar usecases for grep and rg had already been optimized where empty result of a query do mean "empty" and previous results should be cleared.
--show-cmd-error If the command fails, send the error messages and show them as items. This option was intended to help debugging interactive commands. It's not enabled by default because the command often fails before we complete the "cmd-query" and error messages would be annoying.
--color=[BASE_SCHEME][,COLOR:ANSI] Color configuration. The name of the base color scheme is followed by custom color mappings. Ansi color code of -1 denotes terminal default foreground/background color. You can also specify 24-bit color in #rrggbb format.
e.g. sk --color=bg+:24 sk --color=light,fg:232,bg:255,bg+:116,info:27
dark    Color scheme for dark 256-color terminal light   Color scheme for light 256-color terminal 16      Color scheme for 16-color terminal bw      No colors
COLOR: fg                Text bg                Background matched|hl        Text of highlighted substrings matched_bg        Background of highlighted substrings current|fg+       Text (current line) current_bg|bg+    Background (current line) current_match|hl+ Text of Highlighted substrings (current line) current_match_bg  Background of highlighted substrings (current line) query             Text of Query (the texts after the prompt) query_bg          Background of Query info              Info border            Border of the preview window and horizontal separators (--border) prompt            Prompt pointer|cursor    Pointer to the current line (no effect now) marker|selected   Multi-select marker spinner           Streaming input indicator header            Header
--cmd-history=HISTORY_FILE Load command query history from the specified file and update the file on completion.  When enabled, CTRL-N and CTRL-P are automatically remapped to next-history and previous-history.
--cmd-history-size=N Maximum number of command query entries in the history file (default: 1000).  The file is automatically truncated when the number of the lines exceeds the value.
e.g. sk --preview='head -$LINES {}' ls -l | sk --preview="echo user={3} when={-4..-2}; cat {-1}" --header-lines=1
sk overrides $LINES and $COLUMNS so that they represent the exact size of the preview window.
e.g. sk --multi --preview='head -10 {+}' git log --oneline | sk --multi --preview 'git show {+1}'
Also, {q} is replaced to the current query string. {cq} is replaced to the current command query string. {n} is replaced to zero-based ordinal index of the line. Use {+n} if you want all index numbers when multiple lines are selected
--preview-window=[POSITION][:SIZE[%]][:wrap][:hidden][:+SCROLL[-OFFSET]]
Determine the layout of the preview window. If the argument ends with :hidden, the preview window will be hidden by default until toggle- preview action is triggered. Long lines are truncated by default.  Line wrap can be enabled with :wrap flag.
If size is given as 0, preview window will not be visible, but sk will still execute the command in the background.
+SCROLL[-OFFSET] determines the initial scroll offset of the preview window. SCROLL can be either a numeric integer or a single-field index expression that refers to a numeric integer. The optional -OFFSET part is for adjusting the base offset so that you can see the text above it. It should be given as a numeric integer (-INTEGER), or as a denominator form (-/INTEGER) for specifying a fraction of the preview window height.
e.g. # Non-default scroll window positions and sizes sk --preview="head {}" --preview-window=up:30% sk --preview="file {}" --preview-window=down:2
# Initial scroll offset is set to the line number of each line of # git grep output *minus* 5 lines (-5) git grep --line-number '' | sk --delimiter : --preview 'nl {1}' --preview-window +{2}-5
# Preview with bat, matching line in the middle of the window (-/2) git grep --line-number '' | sk --delimiter : \ --preview 'bat --style=numbers --color=always --highlight-line {2} {1}' \ --preview-window +{2}-/2
--cmd-query=STR Specify the initial query for the command query
-f, --filter=STR Filter mode. Do not start interactive finder. It's like a fuzzy- version of grep. skim will output the score and the item to stdout.
--expect=KEY[,..] Comma-separated list of keys that can be used to complete sk in addition to the default enter key. When this option is set, sk will print the name of the key pressed as the first line of its output (or as the second line if --print-query is also used). The line will be empty if sk is completed with the default enter key. If --expect option is specified multiple times, sk will expect the union of the keys. --no-expect will clear the list.
e.g. sk --expect=ctrl-v,ctrl-t,alt-s --expect=f1,f2,~,@
--no-clear Do not clear finder interface on exit. If skim was started in full screen mode, it will not switch back to the original screen, so you'll have to manually run tput rmcup to return. This option can be used to avoid flickering of the screen when your application needs to start skim multiple times in order.
-1, --select-1 Automatically select the only match
-0, --exit-0 Exit immediately when there's no match
--sync Synchronous search for multi-staged filtering. If specified, skim will launch ncurses finder only after the input stream is complete.
e.g. sk --multi | sk --sync
--pre-select-n=NUM Pre-select the first NUM items in the multi-selection mode.
--pre-select-pat=REGEX Pre-select the items that matches the REGEX specified in multi- selection mode. Check the doc for the detailed syntax: https://docs.rs/regex/1.4.1/regex/
--pre-select-items=$'item1\nitem2' Pre-select the specified items (separated by newline character) in multi-selection mode.
--pre-select-file=FILENAME Pre-select the items read from FILENAME (separated by newline character) in multi-selection mode.
SKIM_DEFAULT_COMMAND Default command to use when input is tty. On *nix systems, sk runs the command with sh -c, so make sure that it's POSIX-compliant.
SKIM_DEFAULT_OPTIONS Default options. e.g. export SKIM_DEFAULT_OPTIONS="--multi
Unless specified otherwise, sk will start in "extended-search mode". In this mode, you can specify multiple patterns delimited by spaces, such as: 'wild ^music .mp3$ sbtrkt !rmx
Exact-match (quoted) A term that is prefixed by a single-quote character (') is interpreted as an "exact-match" (or "non-fuzzy") term. sk will search for the exact occurrences of the string.
Anchored-match A term can be prefixed by ^, or suffixed by $ to become an anchored-match term. Then sk will search for the lines that start with or end with the given string. An anchored-match term is also an exact-match term.
Negation If a term is prefixed by !, sk will exclude the lines that satisfy the term from the result. In this case, sk performs exact match by default.
Exact-match by default If you don't prefer fuzzy matching and do not wish to "quote" (prefixing with ') every word, start sk with -e or --exact option. Note that when --exact is set, '-prefix "unquotes" the term.
You can customize key bindings of sk with --bind option which takes a comma-separated list of key binding expressions. Each key binding expression follows the following format: KEY:ACTION
e.g. sk --bind=ctrl-j:accept,ctrl-k:kill-line
AVAILABLE KEYS: (SYNONYMS) ctrl-[a-z] ctrl-space ctrl-alt-[a-z] alt-[a-zA-Z] alt-[0-9] f[1-12] enter       (ctrl-m) space bspace      (bs) alt-up alt-down alt-left alt-right alt-enter   (alt-ctrl-m) alt-space alt-bspace  (alt-bs) alt-/ tab btab        (shift-tab) esc del up down left right home end pgup        (page-up) pgdn        (page-down) shift-up shift-down shift-left shift-right alt-shift-up alt-shift-down alt-shift-left alt-shift-right or any single character
ACTION:               DEFAULT BINDINGS (NOTES): abort                 ctrl-c  ctrl-q  esc accept                enter append-and-select backward-char         ctrl-b  left backward-delete-char  ctrl-h  bspace backward-kill-word    alt-bs backward-word         alt-b   shift-left beginning-of-line     ctrl-a  home clear-screen          ctrl-l delete-char           del delete-charEOF        ctrl-d deselect-all down                  ctrl-j  ctrl-n  down end-of-line           ctrl-e  end execute(...)          (see below for the details) execute-silent(...)   (see below for the details) forward-char          ctrl-f  right forward-word          alt-f   shift-right if-non-matched if-query-empty if-query-not-empty ignore kill-line kill-word             alt-d next-history          (ctrl-n on --history or --cmd-history) page-down             pgdn page-up               pgup half-page-down half-page-up preview-up            shift-up preview-down          shift-down preview-left preview-right preview-page-down preview-page-up previous-history      (ctrl-p on --history or --cmd-history) select-all toggle toggle-all toggle+down           ctrl-i  (tab) toggle-in             (--layout=reverse* ? toggle+up : toggle+down) toggle-out            (--layout=reverse* ? toggle+down : toggle+up) toggle-preview toggle-preview-wrap toggle-sort toggle+up             btab    (shift-tab) unix-line-discard     ctrl-u unix-word-rubout      ctrl-w up                    ctrl-k  ctrl-p  up yank                  ctrl-y
Multiple actions can be chained using + separator.
sk --bind 'ctrl-a:select-all+accept'
With execute(...) action, you can execute arbitrary commands without leaving sk. For example, you can turn sk into a simple file browser by binding enter key to less command like follows.
sk --bind "enter:execute(less {})"
If the command contains parentheses, sk may fail to parse the expression. In that case, you can use any of the following alternative notations to avoid parse errors.
execute[...] execute'...' execute"..." execute:... This is the special form that frees you from parse errors as it does not expect the closing character. The catch is that it should be the last one in the comma-separated list of key-action pairs.
sk switches to the alternate screen when executing a command. However, if the command is expected to complete quickly, and you are not interested in its output, you might want to use execute-silent instead, which silently executes the command without the switching. Note that sk will not be responsive until the command is complete. For asynchronous execution, start your command as a background process (i.e. appending &).
With if-query-empty and if-query-not-empty action, you could specify the action to execute depends on the query condition. For example
sk --bind 'ctrl-d:if-query-empty(abort)+delete-char'
If the query is empty, skim will execute abort action, otherwise execute delete-char action. It is equal to `delete-char/eof`.
Jinzhou Zhang (lotabout@gmail.com)
Project homepage: https://github.com/lotabout/skim
Extra Vim plugin: https://github.com/lotabout/skim.vim
NAMEI(1)                          User Commands                         NAMEI(1)
namei - follow a pathname until a terminal point is found
namei [options] pathname...
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.
-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'.
To be discovered.
The original namei program was written by Roger Southwick <rogers@amadeus.wr.tek.com>.
The program was rewritten by Karel Zak Karel Zak <kzak@redhat.com>.
ls(1), stat(1), symlink(7)
The namei command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.
FDISK(8)                      System Administration                     FDISK(8)
fdisk - manipulate disk partition table
fdisk [options] device
fdisk -l [device...]
fdisk is a dialog-driven program for creation and manipulation of partition tables. It understands GPT, MBR, Sun, SGI and BSD partition tables.
Block devices can be divided into one or more logical disks called partitions. This division is recorded in the partition table, usually found in sector 0 of the disk. (In the BSD world one talks about `disk slices' and a `disklabel'.)
All partitioning is driven by device I/O limits (the topology) by default. fdisk is able to optimize the disk layout for a 4K-sector size and use an alignment offset on modern devices for MBR and GPT. It is always a good idea to follow fdisk's defaults as the default values (e.g., first and last partition sectors) and partition sizes specified by the +/-<size>{M,G,...} notation are always aligned according to the device properties.
CHS (Cylinder-Head-Sector) addressing is deprecated and not used by default. Please, do not follow old articles and recommendations with fdisk -S <n> -H <n> advices for SSD or 4K-sector devices.
Note that partx(8) provides a rich interface for scripts to print disk layouts, fdisk is mostly designed for humans. Backward compatibility in the output of fdisk is not guaranteed. The input (the commands) should always be backward compatible.
-b, --sector-size sectorsize Specify the sector size of the disk. Valid values are 512, 1024, 2048, and 4096. (Recent kernels know the sector size. Use this option only on old kernels or to override the kernel’s ideas.) Since util-linux-2.17, fdisk differentiates between logical and physical sector size. This option changes both sector sizes to sectorsize.
-B, --protect-boot Don’t erase the beginning of the first disk sector when creating a new disk label. This feature is supported for GPT and MBR.
-c, --compatibility[=mode] Specify the compatibility mode, 'dos' or 'nondos'. The default is non-DOS mode. For backward compatibility, it is possible to use the option without the mode argument — then the default is used. Note that the optional mode argument cannot be separated from the -c option by a space, the correct form is for example -c=dos.
-h, --help Display a help text and exit.
-L, --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.
-l, --list List the partition tables for the specified devices and then exit.
If no devices are given, the devices mentioned in /proc/partitions (if this file exists) are used. Devices are always listed in the order in which they are specified on the command-line, or by the kernel listed in /proc/partitions.
-x, --list-details Like --list, but provides more details.
-n, --noauto-pt Don’t automatically create a default partition table on empty device. The partition table has to be explicitly created by user (by command like 'o', 'g', etc.).
-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., -o +UUID).
-s, --getsz Print the size in 512-byte sectors of each given block device. This option is DEPRECATED in favour of blockdev(8).
-t, --type type Enable support only for disklabels of the specified type, and disable support for all other types.
-u, --units[=unit] When listing partition tables, show sizes in 'sectors' or in 'cylinders'. The default is to show sizes in sectors. For backward compatibility, it is possible to use the option without the unit argument — then the default is used. Note that the optional unit argument cannot be separated from the -u option by a space, the correct form is for example '*-u=*cylinders'.
-C, --cylinders number Specify the number of cylinders of the disk. I have no idea why anybody would want to do so.
-H, --heads number Specify the number of heads of the disk. (Not the physical number, of course, but the number used for partition tables.) Reasonable values are 255 and 16.
-S, --sectors number Specify the number of sectors per track of the disk. (Not the physical number, of course, but the number used for partition tables.) A reasonable value is 63.
-w, --wipe when Wipe filesystem, RAID and partition-table signatures from the device, in order to avoid possible collisions. The argument when can be auto, never or always. When this option is not given, the default is auto, in which case signatures are wiped only when in interactive mode. In all cases detected signatures are reported by warning messages before a new partition table is created. See also wipefs(8) command.
-W, --wipe-partitions when Wipe filesystem, RAID and partition-table signatures from a newly created partitions, in order to avoid possible collisions. The argument when can be auto, never or always. When this option is not given, the default is auto, in which case signatures are wiped only when in interactive mode and after confirmation by user. In all cases detected signatures are reported by warning messages before a new partition is created. See also wipefs(8) command.
The device is usually /dev/sda, /dev/sdb or so. A device name refers to the entire disk. Old systems without libata (a library used inside the Linux kernel to support ATA host controllers and devices) make a difference between IDE and SCSI disks. In such cases the device name will be /dev/hd* (IDE) or /dev/sd* (SCSI).
The partition is a device name followed by a partition number. For example, /dev/sda1 is the first partition on the first hard disk in the system. See also Linux kernel documentation (the Documentation/admin-guide/devices.txt file).
The "last sector" dialog accepts partition size specified by number of sectors or by +/-<size>{K,B,M,G,...} notation.
If the size is prefixed by '+' then it is interpreted as relative to the partition first sector. If the size is prefixed by '-' then it is interpreted as relative to the high limit (last available sector for the partition).
In the case the size is specified in bytes than the number 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".
The relative sizes are always aligned according to device I/O limits. The +/-<size>{K,B,M,G,...} notation is recommended.
For backward compatibility fdisk also accepts the suffixes KB=1000, MB=1000*1000, and so on for GB, TB, PB, EB, ZB and YB. These 10^N suffixes are deprecated.
fdisk allows reading (by 'I' command) sfdisk(8) compatible script files. The script is applied to in-memory partition table, and then it is possible to modify the partition table before you write it to the device.
And vice-versa it is possible to write the current in-memory disk layout to the script file by command 'O'.
The script files are compatible between cfdisk(8), sfdisk(8), fdisk and other libfdisk applications. For more details see sfdisk(8).
GPT (GUID Partition Table) GPT is modern standard for the layout of the partition table. GPT uses 64-bit logical block addresses, checksums, UUIDs and names for partitions and an unlimited number of partitions (although the number of partitions is usually restricted to 128 in many partitioning tools).
Note that the first sector is still reserved for a protective MBR in the GPT specification. It prevents MBR-only partitioning tools from mis-recognizing and overwriting GPT disks.
GPT is always a better choice than MBR, especially on modern hardware with a UEFI boot loader.
DOS-type (MBR) A DOS-type partition table can describe an unlimited number of partitions. In sector 0 there is room for the description of 4 partitions (called `primary'). One of these may be an extended partition; this is a box holding logical partitions, with descriptors found in a linked list of sectors, each preceding the corresponding logical partitions. The four primary partitions, present or not, get numbers 1-4. Logical partitions are numbered starting from 5.
In a DOS-type partition table the starting offset and the size of each partition is stored in two ways: as an absolute number of sectors (given in 32 bits), and as a Cylinders/Heads/Sectors triple (given in 10+8+6 bits). The former is OK — with 512-byte sectors this will work up to 2 TB. The latter has two problems. First, these C/H/S fields can be filled only when the number of heads and the number of sectors per track are known. And second, even if we know what these numbers should be, the 24 bits that are available do not suffice. DOS uses C/H/S only, Windows uses both, Linux never uses C/H/S. The C/H/S addressing is deprecated and may be unsupported in some later fdisk version.
Please, read the DOS-mode section if you want DOS-compatible partitions. fdisk does not care about cylinder boundaries by default.
BSD/Sun-type A BSD/Sun disklabel can describe 8 partitions, the third of which should be a `whole disk' partition. Do not start a partition that actually uses its first sector (like a swap partition) at cylinder 0, since that will destroy the disklabel. Note that a BSD label is usually nested within a DOS partition.
IRIX/SGI-type An IRIX/SGI disklabel can describe 16 partitions, the eleventh of which should be an entire `volume' partition, while the ninth should be labeled `volume header'. The volume header will also cover the partition table, i.e., it starts at block zero and extends by default over five cylinders. The remaining space in the volume header may be used by header directory entries. No partitions may overlap with the volume header. Also do not change its type or make some filesystem on it, since you will lose the partition table. Use this type of label only when working with Linux on IRIX/SGI machines or IRIX/SGI disks under Linux.
A sync() and an ioctl(BLKRRPART) (rereading the partition table from disk) are performed before exiting when the partition table has been updated.
DOS MODE AND DOS 6.X WARNING Note that all this is deprecated. You don’t have to care about things like geometry and cylinders on modern operating systems. If you really want DOS-compatible partitioning then you have to enable DOS mode and cylinder units by using the '-c=dos -u=cylinders' fdisk command-line options.
The DOS 6.x FORMAT command looks for some information in the first sector of the data area of the partition, and treats this information as more reliable than the information in the partition table. DOS FORMAT expects DOS FDISK to clear the first 512 bytes of the data area of a partition whenever a size change occurs. DOS FORMAT will look at this extra information even if the /U flag is given — we consider this a bug in DOS FORMAT and DOS FDISK.
The bottom line is that if you use fdisk or cfdisk to change the size of a DOS partition table entry, then you must also use dd(1) to zero the first 512 bytes of that partition before using DOS FORMAT to format the partition. For example, if you were using fdisk to make a DOS partition table entry for /dev/sda1, then (after exiting fdisk and rebooting Linux so that the partition table information is valid) you would use the command dd if=/dev/zero of=/dev/sda1 bs=512 count=1 to zero the first 512 bytes of the partition.
fdisk usually obtains the disk geometry automatically. This is not necessarily the physical disk geometry (indeed, modern disks do not really have anything like a physical geometry, certainly not something that can be described in the simplistic Cylinders/Heads/Sectors form), but it is the disk geometry that MS-DOS uses for the partition table.
Usually all goes well by default, and there are no problems if Linux is the only system on the disk. However, if the disk has to be shared with other operating systems, it is often a good idea to let an fdisk from another operating system make at least one partition. When Linux boots it looks at the partition table, and tries to deduce what (fake) geometry is required for good cooperation with other systems.
Whenever a partition table is printed out in DOS mode, a consistency check is performed on the partition table entries. This check verifies that the physical and logical start and end points are identical, and that each partition starts and ends on a cylinder boundary (except for the first partition).
Some versions of MS-DOS create a first partition which does not begin on a cylinder boundary, but on sector 2 of the first cylinder. Partitions beginning in cylinder 1 cannot begin on a cylinder boundary, but this is unlikely to cause difficulty unless you have OS/2 on your machine.
For best results, you should always use an OS-specific partition table program. For example, you should make DOS partitions with the DOS FDISK program and Linux partitions with the Linux fdisk or Linux cfdisk(8) programs.
Implicit coloring can be disabled by an empty file /etc/terminal-colors.d/fdisk.disable.
See terminal-colors.d(5) for more details about colorization configuration. The logical color names supported by fdisk are:
header The header of the output tables.
help-title The help section titles.
warn The warning messages.
welcome The welcome message.
FDISK_DEBUG=all enables fdisk debug output.
LIBFDISK_DEBUG=all enables libfdisk debug output.
LIBSMARTCOLS_DEBUG=all enables libsmartcols debug output.
LIBSMARTCOLS_DEBUG_PADDING=on use visible padding characters.
Karel Zak <kzak@redhat.com>, Davidlohr Bueso <dave@gnu.org>
The original version was written by Andries E. Brouwer, A. V. Le Blanc and others.
cfdisk(8), mkfs(8), partx(8), sfdisk(8)
The fdisk command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.
GREP(1)                           User Commands                          GREP(1)
grep, egrep, fgrep - print lines that match patterns
grep [OPTION...] PATTERNS [FILE...] grep [OPTION...] -e PATTERNS ... [FILE...] grep [OPTION...] -f PATTERN_FILE ... [FILE...]
grep searches for PATTERNS in each FILE.  PATTERNS is one or more patterns separated by newline characters, and grep prints each line that matches a pattern.  Typically PATTERNS should be quoted when grep is used in a shell command.
A FILE of “-” stands for standard input.  If no FILE is given, recursive searches examine the working directory, and nonrecursive searches read standard input.
In addition, the variant programs egrep and fgrep are the same as grep -E and grep -F, respectively.  These variants are deprecated, but are provided for backward compatibility.
Generic Program Information --help Output a usage message and exit.
-V, --version Output the version number of grep and exit.
Pattern Syntax -E, --extended-regexp Interpret PATTERNS as extended regular expressions (EREs, see below).
-F, --fixed-strings Interpret PATTERNS as fixed strings, not regular expressions.
-G, --basic-regexp Interpret PATTERNS as basic regular expressions (BREs, see below). This is the default.
-P, --perl-regexp Interpret I<PATTERNS> as Perl-compatible regular expressions (PCREs).  This option is experimental when combined with the -z (--null-data) option, and grep -P may warn of unimplemented features.
Matching Control -e PATTERNS, --regexp=PATTERNS Use PATTERNS as the patterns.  If this option is used multiple times or is combined with the -f (--file) option, search for all patterns given.  This option can be used to protect a pattern beginning with “-”.
-f FILE, --file=FILE Obtain patterns from FILE, one per line.  If this option is used multiple times or is combined with the -e (--regexp) option, search for all patterns given.  The empty file contains zero patterns, and therefore matches nothing.
-i, --ignore-case Ignore case distinctions in patterns and input data, so that characters that differ only in case match each other.
--no-ignore-case Do not ignore case distinctions in patterns and input data.  This is the default.  This option is useful for passing to shell scripts that already use -i, to cancel its effects because the two options override each other.
-v, --invert-match Invert the sense of matching, to select non-matching lines.
-w, --word-regexp Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character.  Similarly, it must be either at the end of the line or followed by a non-word constituent character.  Word-constituent characters are letters, digits, and the underscore.  This option has no effect if -x is also specified.
-x, --line-regexp Select only those matches that exactly match the whole line.  For a regular expression pattern, this is like parenthesizing the pattern and then surrounding it with ^ and $.
-y     Obsolete synonym for -i.
General Output Control -c, --count Suppress normal output; instead print a count of matching lines for each input file.  With the -v, --invert-match option (see below), count non-matching lines.
--color[=WHEN], --colour[=WHEN] Surround the matched (non-empty) strings, matching lines, context lines, file names, line numbers, byte offsets, and separators (for fields and groups of context lines) with escape sequences to display them in color on the terminal.  The colors are defined by the environment variable GREP_COLORS.  The deprecated environment variable GREP_COLOR is still supported, but its setting does not have priority.  WHEN is never, always, or auto.
-L, --files-without-match Suppress normal output; instead print the name of each input file from which no output would normally have been printed.
-l, --files-with-matches Suppress normal output; instead print the name of each input file from which output would normally have been printed.  Scanning each input file stops upon first match.
-m NUM, --max-count=NUM Stop reading a file after NUM matching lines.  If the input is standard input from a regular file, and NUM matching lines are output, grep ensures that the standard input is positioned to just after the last matching line before exiting, regardless of the presence of trailing context lines.  This enables a calling process to resume a search.  When grep stops after NUM matching lines, it outputs any trailing context lines.  When the -c or --count option is also used, grep does not output a count greater than NUM.  When the -v or --invert-match option is also used, grep stops after outputting NUM non-matching lines.
-q, --quiet, --silent Quiet; do not write anything to standard output.  Exit immediately with zero status if any match is found, even if an error was detected.  Also see the -s or --no-messages option.
-s, --no-messages Suppress error messages about nonexistent or unreadable files.
Output Line Prefix Control -b, --byte-offset Print the 0-based byte offset within the input file before each line of output.  If -o (--only-matching) is specified, print the offset of the matching part itself.
-H, --with-filename Print the file name for each match.  This is the default when there is more than one file to search.  This is a GNU extension.
-h, --no-filename Suppress the prefixing of file names on output.  This is the default when there is only one file (or only standard input) to search.
--label=LABEL Display input actually coming from standard input as input coming from file LABEL.  This can be useful for commands that transform a file's contents before searching, e.g., gzip -cd foo.gz | grep --label=foo -H 'some pattern'.  See also the -H option.
-n, --line-number Prefix each line of output with the 1-based line number within its input file.
-T, --initial-tab Make sure that the first character of actual line content lies on a tab stop, so that the alignment of tabs looks normal.  This is useful with options that prefix their output to the actual content: -H,-n, and -b.  In order to improve the probability that lines from a single file will all start at the same column, this also causes the line number and byte offset (if present) to be printed in a minimum size field width.
-Z, --null Output a zero byte (the ASCII NUL character) instead of the character that normally follows a file name.  For example, grep -lZ outputs a zero byte after each file name instead of the usual newline.  This option makes the output unambiguous, even in the presence of file names containing unusual characters like newlines.  This option can be used with commands like find -print0, perl -0, sort -z, and xargs -0 to process arbitrary file names, even those that contain newline characters.
Context Line Control -A NUM, --after-context=NUM Print NUM lines of trailing context after matching lines.  Places a line containing a group separator (--) between contiguous groups of matches.  With the -o or --only-matching option, this has no effect and a warning is given.
-B NUM, --before-context=NUM Print NUM lines of leading context before matching lines.  Places a line containing a group separator (--) between contiguous groups of matches.  With the -o or --only-matching option, this has no effect and a warning is given.
-C NUM, -NUM, --context=NUM Print NUM lines of output context.  Places a line containing a group separator (--) between contiguous groups of matches.  With the -o or --only-matching option, this has no effect and a warning is given.
--group-separator=SEP When -A, -B, or -C are in use, print SEP instead of -- between groups of lines.
--no-group-separator When -A, -B, or -C are in use, do not print a separator between groups of lines.
File and Directory Selection -a, --text Process a binary file as if it were text; this is equivalent to the --binary-files=text option.
--binary-files=TYPE If a file's data or metadata indicate that the file contains binary data, assume that the file is of type TYPE.  Non-text bytes indicate binary data; these are either output bytes that are improperly encoded for the current locale, or null input bytes when the -z option is not given.
By default, TYPE is binary, and grep suppresses output after null input binary data is discovered, and suppresses output lines that contain improperly encoded data.  When some output is suppressed, grep follows any output with a one-line message saying that a binary file matches.
If TYPE is without-match, when grep discovers null input binary data it assumes that the rest of the file does not match; this is equivalent to the -I option.
If TYPE is text, grep processes a binary file as if it were text; this is equivalent to the -a option.
When type is binary, grep may treat non-text bytes as line terminators even without the -z option.  This means choosing binary versus text can affect whether a pattern matches a file. For example, when type is binary the pattern q$ might match q immediately followed by a null byte, even though this is not matched when type is text.  Conversely, when type is binary the pattern . (period) might not match a null byte.
Warning: The -a option might output binary garbage, which can have nasty side effects if the output is a terminal and if the terminal driver interprets some of it as commands.  On the other hand, when reading files whose text encodings are unknown, it can be helpful to use -a or to set LC_ALL='C' in the environment, in order to find more matches even if the matches are unsafe for direct display.
-D ACTION, --devices=ACTION If an input file is a device, FIFO or socket, use ACTION to process it.  By default, ACTION is read, which means that devices are read just as if they were ordinary files.  If ACTION is skip, devices are silently skipped.
-d ACTION, --directories=ACTION If an input file is a directory, use ACTION to process it.  By default, ACTION is read, i.e., read directories just as if they were ordinary files.  If ACTION is skip, silently skip directories.  If ACTION is recurse, read all files under each directory, recursively, following symbolic links only if they are on the command line.  This is equivalent to the -r option.
--exclude=GLOB Skip any command-line file with a name suffix that matches the pattern GLOB, using wildcard matching; a name suffix is either the whole name, or a trailing part that starts with a non-slash character immediately after a slash (/) in the name.  When searching recursively, skip any subfile whose base name matches GLOB; the base name is the part after the last slash.  A pattern can use *, ?, and [...] as wildcards, and \ to quote a wildcard or backslash character literally.
--exclude-from=FILE Skip files whose base name matches any of the file-name globs read from FILE (using wildcard matching as described under --exclude).
--exclude-dir=GLOB Skip any command-line directory with a name suffix that matches the pattern GLOB.  When searching recursively, skip any subdirectory whose base name matches GLOB.  Ignore any redundant trailing slashes in GLOB.
-I     Process a binary file as if it did not contain matching data; this is equivalent to the --binary-files=without-match option.
--include=GLOB Search only files whose base name matches GLOB (using wildcard matching as described under --exclude).  If contradictory --include and --exclude options are given, the last matching one wins.  If no --include or --exclude options match, a file is included unless the first such option is --include.
-r, --recursive Read all files under each directory, recursively, following symbolic links only if they are on the command line.  Note that if no file operand is given, B<grep> searches the working directory. This is equivalent to the -d recurse option.
-R, --dereference-recursive Read all files under each directory, recursively.  Follow all symbolic links, unlike -r.
Other Options --line-buffered Use line buffering on output.  This can cause a performance penalty.
-U, --binary Treat the file(s) as binary.  By default, under MS-DOS and MS- Windows, grep guesses whether a file is text or binary as described for the --binary-files option.  If grep decides the file is a text file, it strips the CR characters from the original file contents (to make regular expressions with ^ and $ work correctly).  Specifying -U overrules this guesswork, causing all files to be read and passed to the matching mechanism verbatim; if the file is a text file with CR/LF pairs at the end of each line, this will cause some regular expressions to fail.  This option has no effect on platforms other than MS-DOS and MS-Windows.
-z, --null-data Treat input and output data as sequences of lines, each terminated by a zero byte (the ASCII NUL character) instead of a newline. Like the -Z or --null option, this option can be used with commands like sort -z to process arbitrary file names.
A regular expression is a pattern that describes a set of strings. Regular expressions are constructed analogously to arithmetic expressions, by using various operators to combine smaller expressions.
grep understands three different versions of regular expression syntax: “basic” (BRE), “extended” (ERE) and “perl” (PCRE).  In GNU grep there is no difference in available functionality between basic and extended syntaxes.  In other implementations, basic regular expressions are less powerful.  The following description applies to extended regular expressions; differences for basic regular expressions are summarized afterwards.  Perl-compatible regular expressions give additional functionality, and are documented in B<pcresyntax>(3) and B<pcrepattern>(3), but work only if PCRE support is enabled.
The fundamental building blocks are the regular expressions that match a single character.  Most characters, including all letters and digits, are regular expressions that match themselves.  Any meta-character with special meaning may be quoted by preceding it with a backslash.
The period . matches any single character.  It is unspecified whether it matches an encoding error.
Character Classes and Bracket Expressions A bracket expression is a list of characters enclosed by [ and ].  It matches any single character in that list.  If the first character of the list is the caret ^ then it matches any character not in the list; it is unspecified whether it matches an encoding error.  For example, the regular expression [0123456789] matches any single digit.
Within a bracket expression, a range expression consists of two characters separated by a hyphen.  It matches any single character that sorts between the two characters, inclusive, using the locale's collating sequence and character set.  For example, in the default C locale, [a-d] is equivalent to [abcd].  Many locales sort characters in dictionary order, and in these locales [a-d] is typically not equivalent to [abcd]; it might be equivalent to [aBbCcDd], for example.  To obtain the traditional interpretation of bracket expressions, you can use the C locale by setting the LC_ALL environment variable to the value C.
Finally, certain named classes of characters are predefined within bracket expressions, as follows.  Their names are self explanatory, and they are [:alnum:], [:alpha:], [:blank:], [:cntrl:], [:digit:], [:graph:], [:lower:], [:print:], [:punct:], [:space:], [:upper:], and [:xdigit:].  For example, [[:alnum:]] means the character class of numbers and letters in the current locale.  In the C locale and ASCII character set encoding, this is the same as [0-9A-Za-z].  (Note that the brackets in these class names are part of the symbolic names, and must be included in addition to the brackets delimiting the bracket expression.) Most meta-characters lose their special meaning inside bracket expressions.  To include a literal ] place it first in the list. Similarly, to include a literal ^ place it anywhere but first.  Finally, to include a literal - place it last.
Anchoring The caret ^ and the dollar sign $ are meta-characters that respectively match the empty string at the beginning and end of a line.
The Backslash Character and Special Expressions The symbols \< and \> respectively match the empty string at the beginning and end of a word.  The symbol \b matches the empty string at the edge of a word, and \B matches the empty string provided it's not at the edge of a word.  The symbol \w is a synonym for [_[:alnum:]] and \W is a synonym for [^_[:alnum:]].
Repetition A regular expression may be followed by one of several repetition operators: ?      The preceding item is optional and matched at most once. *      The preceding item will be matched zero or more times. +      The preceding item will be matched one or more times. {n}    The preceding item is matched exactly n times. {n,}   The preceding item is matched n or more times. {,m}   The preceding item is matched at most m times.  This is a GNU extension. {n,m}  The preceding item is matched at least n times, but not more than m times.
Concatenation Two regular expressions may be concatenated; the resulting regular expression matches any string formed by concatenating two substrings that respectively match the concatenated expressions.
Alternation Two regular expressions may be joined by the infix operator |; the resulting regular expression matches any string matching either alternate expression.
Precedence Repetition takes precedence over concatenation, which in turn takes precedence over alternation.  A whole expression may be enclosed in parentheses to override these precedence rules and form a subexpression.
Back-references and Subexpressions The back-reference \n, where n is a single digit, matches the substring previously matched by the nth parenthesized subexpression of the regular expression.
Basic vs Extended Regular Expressions In basic regular expressions the meta-characters ?, +, {, |, (, and ) lose their special meaning; instead use the backslashed versions \?, \+, \{, \|, \(, and \).
Normally the exit status is 0 if a line is selected, 1 if no lines were selected, and 2 if an error occurred.  However, if the -q or --quiet or --silent is used and a line is selected, the exit status is 0 even if an error occurred.
The behavior of grep is affected by the following environment variables.