Relative Content

LINUX MANUAL PAGES

category

「texinfo」

info Used to read info pages which are similar to man pages, but often go much deeper than just explaining all the available command line options [For example, compare man bison and info bison.]
install-info Used to install info pages; it updates entries in the info index file
makeinfo Translates the given Texinfo source documents into info pages, plain text, or HTML
pdftexi2dvi Used to format the given Texinfo document into a Portable Document Format (PDF) file
pod2texi Converts Pod to Texinfo format
texi2any Translate Texinfo source documentation to various other formats
texi2dvi Used to format the given Texinfo document into a device-independent file that can be printed
texi2pdf Used to format the given Texinfo document into a Portable Document Format (PDF) file
texindex Used to sort Texinfo index files
参考文献

LFS/6.68. Texinfo-6.1[……]

READ MORE

「info(1)」-

读取Info文档
命令语法格式
info [OPTION]… [MENU-ITEM…]
命令描述
在Info格式中读取文档。
命令支持的选项及含义
-a, –all 使用所有匹配的手册。
-k, –apropos=STRING 在所有手册的所有索引中查找STRING。
-d, –directory=DIR 将DIR添加到INFOPATH中。
-f, –file=MANUAL 指定要查看的Info手册MANUAL。
–index-search=STRING 转到索引条目STRING指向的节点。
-n, –node=NODENAME 指定首次访问的Info文件中的节点
-o, –output=FILE 将所选节点输出到FILE
-O, –show-options, –usage 转到命令行选项节点。
–subnodes 递归输出菜单项目。
-v, –variable VAR=VALUE 将Info变量VAR的值设置为VALUE。
-w, –where, –location 打印Info文件的物理位置
–version 显示版本信息并退出。
-h, –help 显示帮助信息并退出。
注意事项
第一个非选项参数(如果存在)是要开始的菜单项;在INFOPATH的所有’dir’文件中搜索它。如果它不存在,info将合并所有’dir’文件并显示结果。 任何剩余的参数都被视为菜单项的名称(相对于访问的初始节点的)。
有关按键绑定的摘要,请在Info中输入H键。
使用示例
显示顶级的DIR目录:

# info

显示该Info程序的手册:

# info info-stnd

从顶级DIR开始emacs节点:

# info emacs

选择emacs手册中的buffers菜单条目:

# info emacs buffers

起始于emacs手册的Files节点:

# info emacs -n Files
# info ‘(emacs)Files’

起始于emacs的命令行选项节点:

# info –show-options emacs

将整个emacs手册转储到out.txt中:

# info –subnodes -o out.txt emacs

显示./foo.info文件,而不是搜索DIR:

# info -f ./[……]

READ MORE

「time(1)」-

运行程序并总结系统资源使用情况
命令语法格式
time [ -apqvV ] [ -f FORMAT ] [ -o FILE ] COMMAND [ ARGS ]
命令描述
命令time使用任何给定参数ARG运行程序COMMAND。当COMMAND完成时,time显示有关COMMAND使用的资源的信息(默认情况下,在标准错误输出上)。 如果COMMAND以非零状态退出,则time显示警告消息和退出状态。
命令time从字符串FORMAT中确定显示有关COMMAND使用的资源的信息。如果在命令行上未指定格式,但设置了TIME环境变量,则将其值用作格式。 否则,使用内置于time的默认格式。
命令time的选项必须出现在COMMAND之前的命令行中。在COMMAND之后的命令行上的任何内容都作为参数传递给COMMAND。
命令支持的选项及含义
-o FILE, –output=FILE 将资源使用统计信息写入FILE,而不是标准错误。 默认情况下,这会覆盖文件,从而破坏文件的先前内容。对于收集有关“在标准错误上生成输出程序”和“交互式程序”的信息,此选项非常有用。
-a, –append 将资源使用信息附加到输出文件而不是覆盖它。 此选项仅适用于`-o’或`–output’选项。
-f FORMAT, –format FORMAT 使用FORMAT作为控制时间输出的格式字符串。 请参阅以下更多信息。
-p, –portability 使用以下格式字符串,以符合POSIX标准1003.2:

real %e
user %U
sys %S

-v, –verbose 使用内置的详细格式,该格式在其单独的行上显示有关程序资源使用的每条可用信息,并带有其含义的英文描述。
–quiet 不要报告程序的状态,即使是非零状态。
-V, –version 显示版本信息并退出。
–help 显示帮助信息并退出。
格式化输出
格式字符串FORMAT控制time输出的内容。可以使用`-f’或`–format’为选项-v(–verbose)、-p(–portability)设置格式字符串。 如果未给出它们,但设置了TIME环境变量,则将其值用作格式字符串。 否则,使用内置的默认格式。 默认格式为:

%Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k
%Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps

格式字符串通常由散布的“资源说明符”和有[……]

READ MORE

「unzip」

安装的可执行程序
funzip allows the output of unzip commands to be redirected.
unzip lists, tests or extracts files from a ZIP archive.
unzipfsx is a self-extracting stub that can be prepended to a ZIP archive. Files in this format allow the recipient to decompress the archive without installing UnZip.
zipgrep searches files in a ZIP archive for lines matching a pattern.
zipinfo produces technical information about the files in a ZIP archive, including file access permissions, encryption status, type of compression, etc.
参考文献

BLFS/UnZip-6.0[……]

READ MORE

「zipgrep(1)」-

在ZIP存档中搜索与模式匹配的行的文件
命令语法格式
zipgrep [egrep_options] pattern file[.zip] [file(s) …] [-x xfile(s) …]
命令描述
命令zipgrep将在ZIP存档中搜索与给定字符串或模式匹配的行。zipgrep是一个Shell脚本,需要egrep(1)和unzip(1)才能运行。其输出与egrep(1)的输出相同。
命令支持的选项及含义
ZIP存档文件名之前的所有选项都传递给egrep(1)。
[egrep_options] 传递给egrep的选项。
pattern 位于ZIP存档中的模式。可以使用egrep(1)接受的任何字符串或正则表达式。
file[.zip] ZIP存档的路径。(不支持ZIP存档名称的通配符表达式。)如果找不到文字文件名,则追加后缀.zip。请注意,与任何其他ZIP存档一样,支持自解压ZIP文件;只需明确指定.exe后缀(如果有)。
[file(s)] 要处理的可选的归档成员列表,以空格分隔。如果未指定任何成员文件,则会搜索ZIP存档的所有成员。正则表达式(通配符)可用于匹配多个成员:

*,匹配0个或更多字符的序列
?,匹配一个字符
[…],匹配括号内的任何单个字符;范围由起始字符,连字符和结束字符指定。如果感叹号或插入符号(“!”或“^”)在左括号后面,则括号内的字符范围将被补充(即除括号内的字符外的任何内容都被视为匹配)。

请务必引用可能由Shell解释或修改的任何字符。
[-x xfile(s)] 要从处理中排除的可选归档成员列表。由于通配符与目录分隔符(`/’)匹配,因此该选项可用于排除子目录中的所有文件。例如,zipgrep grumpy foo *.[ch] -x */*将在“foo”存档的主目录中的所有C源文件中搜索字符串“grumpy”,但不会在任何子目录中进行搜索。如果没有-x选项,将搜索zipfile中所有目录中的所有C源文件。
相关手册
egrep(1), unzip(1), zip(1), funzip(1), zipcloak(1), zipinfo(1), zipnote(1), zipsplit(1)
The Info-ZIP home page is currently at http://www.info-zip.org/pub/infozip ftp://ftp.info-zip.org/pub/infozip
参考文献

man 1 zipgrep, Version 6.0-21

更新日志

09/2[……]

READ MORE

「zipinfo(1)」-

列出ZIP归档的详细信息
命令语法格式
zipinfo [-12smlvhMtTz] file[.zip] [file(s) …] [-x xfile(s) …]
unzip -Z [-12smlvhMtTz] file[.zip] [file(s) …] [-x xfile(s) …]
命令描述
zipinfo列出了有关ZIP存档中文件的技术信息,最常见于MS-DOS系统。这样的信息包括文件访问权限、加密状态、压缩类型、版本、操作系统或压缩程序的文件系统等。默认行为(没有选项)是列出存档中每个文件,每文件对应一行条目,由标题、尾部行提供整个存档的摘要信息。格式是Unix的“ls -l”和“unzip -v”输出结果的交叉。参见下面的描述。
请注意,zipinfo与unzip是相同的程序(在Unix下,是指向它的链接);但是,在某些系统上,编译unzip时可能省略了zipinfo支持。
命令行参数
file[.zip] ZIP存档的路径。如果file是通配符,则按操作系统(或文件系统)确定的顺序处理每个匹配的文件。只有文件名可以是通配符;路径本身不能。
通配符表达式类似于Unix egrep(1)(常规)表达式,可能包含:

*,匹配0个或更多字符的序列
?,匹配一个字符
[…],匹配括号内的任何单个字符;范围由起始字符,连字符和结束字符指定。如果感叹号或插入符号(“!”或“^”)在左括号后面,则括号内的字符范围将被补充(即除括号内的字符外的任何内容都被视为匹配)。要指定逐字左括号,必须使用序列“[[]”。

请务必引用可能由Shell解释或修改的任何字符,特别是在Unix和VMS下。如果未找到匹配项,则假定file是文字文件名;如果失败,则附加后缀.zip。请注意,与任何其他ZIP存档一样,支持自解压ZIP文件;只需明确指定.exe后缀(如果有)。
[file(s)] 要处理的可选的归档成员列表,以空格分隔。(使用VMSCLI定义编译的VMS版本必须使用逗号分隔文件。)正则表达式(通配符)可用于匹配多个成员;参考之前的说明。同样,请务必引用可由Shell扩展或修改的表达式。
[-x xfile(s)] 要从处理中排除的可选归档成员列表。
命令支持的选项及含义
-1 仅列出文件名,每行一个。此选项排除所有其他选项;从不打印标题、尾部、zipfile注释。它适用于Unix Shell脚本。
-2 列表文件名,每行一个,但允许标题(-h),尾部(-t),ZIP文件注释(-z)。如果存储的文件名特别长,则此选项可能很有用。
-s 以简短的Unix的“ls -l”格式列出ZIP文件信息。这是默[……]

READ MORE

「usbutils」

USB Utils,包含了一些程序,这些程序用于显示系统中的USB总线的有关信息和连接到它们的设备的信息。
安装
从发行版的源中安装

#!/bin/bash

# Kali GNU/Linux Rolling
apt-get install usbutils

从源码中编译安装 参考BLFS/usbutils-008
安装的可执行程序
lsusb 输出USB总线信息和连接到总线上的设备的信息,输出信息可读性并不高;
lsusb.py 和 lsusb 一样,但是输出信息的可读性高; 该命令在Kali GNU/Linux Rolling的usbutils软件包中并不存在。
usb-devices SHELL脚本,作用于lsusb是一样的。该脚本使为了防止/proc/bus/usb/devices不可用的情况;
usbhid-dump 用于从USB设备的HID(human interface device)接口转储报告描述符和流。
update-usbids 用于更新usb.ids文件,该文件命令只在某些Linux发行版中存在。
参考文献

BLFS/usbutils-008
下载usbutils软件包[……]

READ MORE

「lsusb(8)」-

列出USB设备
命令语法格式
lsusb [ options ]
命令描述
命令usb输出USB总线的信息和连接到总线上的设备的信息。
命令支持的选项及含义
-s [[bus]:][devnum] 只显示指定bus或者devnum的设备。给出10进制数值会被忽略。
-d [vendor]:[product] 只显示指定VendorID和ProductID的设备。给出的ID为16进制。
-D device 不扫描/dev/bus/usb目录,只打印device参数指定的设备的信息。参数device的值应该是像/dev/bus/usb/001/001样子的。该选项打印的是详细信息,像-v选项;必须使用root权限来执行。
-t 转储物理USB设备树形结构。该选项会覆盖-v选项。
-v, –verbose 显示设备的详细信息。这包括设备的当前速度的配置描述符。用于USB设备类的类别描述符也会显示出来,包括hub, audio, HID, communications, chipcard。
-V, –version 打印版本信息并退出,返回成功。
相关文件
/var/lib/usbutils/usb.ids 列出所有已知USB设置的ID(vendors, products, classes, subclasses, protocols)。
退出状态
>0 指定的设备未找到
相关手册
lspci(8), usbview(8).
参考文献

man 8 lsusb, Version 1007-4+b1

更新日志

01/19/2017 创建文章
10/03/2018 修改文章内容[……]

READ MORE

「update-usbids」

update-usbids,下载最新的USB ID列表,并安装。
命令行语法格式
update-usbids
命令行选项及含义
-q 安静模式、不打印任何输出,除了错误。
相关文件
/var/lib/usbutils/usb.ids.gz 最新的USB ID文件的安装位置。文件usb.ids的下载地址为:http://www.linux-usb.org/usb.ids 该命令需要wget或者lynx。如果支持gzip或者bzip2,将自动下载压缩的文件。
关于usb.ids文件 该文件是已知的USB ID的列表,它一个数据库文件,里面保存了VendorID和DeviceID相关的详细信息,包含vendors, products, classes, subclasses, protocols。 因为这个文件的存在,在lsusb的时候才能显示USB总线及设备的详细信息,如下图(省略部分内容):
如果该文件不存在,是看不到相关描述信息的,还会给个错误,如下图:
相关文档
lsusb(8)
参考文献

man 8 update-usbids, version usbutils-007[……]

READ MORE

「util-linux」

Util-linux,该软件包中包含了繁杂的命令。这些命令用于文件系统、控制台、分区和信息。
安装的命令列表
addpart,Informs the Linux kernel of new partitions agetty,Opens a tty port, prompts for a login name, and then invokes the login program blkdiscard,Discards sectors on a device blkid,A command line utility to locate and print block device attributes blockdev,Allows users to call block device ioctls from the command line cal,Displays a simple calendar cfdisk,Manipulates the partition table of the given device chcpu,Modifies the state of CPUs chrt,Manipulates real-time attributes of a process col,过滤掉反向换行符号。 colcrt,Filters nroff output for terminals that lack some capabilities, such as overstriking and half-lines colrm,Filters out the given columns column,Formats a given file into multiple columns ctrlaltdel,Sets the function of the Ctrl+Alt+Del key combination to a hard or a soft reset delpart,Asks the Linux kernel to remove a partition dmesg,Dumps the kernel boot messages eject,Ejects removable media fallocate,Preallocates space to a file fdformat,Low-level formats a floppy disk fdisk,Manipulates the partition table of the given device findfs,Finds a file system by label or Universally Unique Identifier (UUID) findmnt,Is a[……]

READ MORE

「addpart(8)」-

告诉内核有关分区的存在
命令语法格式
addpart device partition start length
命令描述
命令addpart告诉Linux内核有关指定分区的存在。该命令是ioctl(2)“添加分区”的简单包装。
此命令不会操作块设备上的分区。
命令参数
device 磁盘设备。
partition 分区号。
start 分区的开始。以512字节的扇区为单位。
length 分区的长度。以512字节的扇区为单位。
相关手册
delpart(8), fdisk(8), parted(8), partprobe(8), partx(8)
参考文献

man 8 addpart, Version addpart from util-linux 2.32

更新日志

07/12/2018 创建文章[……]

READ MORE

「blkdiscard(8)」-

丢弃设备上的扇区
命令语法格式
blkdiscard [options] [-o offset] [-l length] device
命令描述
命令blkdiscard用于丢弃设备扇区。这对于固态驱动程序(SSD)和精简配置存储非常有用。与fstrim(8)不同,此命令直接在块设备上使用。
默认情况下,命令blkdiscard将丢弃设备上的所有块。可以通过使用选项来进行基于范围或大小的修改行为,如下所述。
警告:设备上被丢弃区域中的所有数据都将丢失!
命令支持的选项及含义
device 块设备的路径名。
-o, –offset offset 在设备中开始丢弃的起始位置。提供的值将与设备扇区大小对齐。默认值为零。
-l, –length length 要丢弃的字节数(从起点offset开始计算)。提供的值将与设备扇区大小对齐。如果指定的值超出设备的结尾,则blkdiscard将停在该设备大小边界。默认值为到设备结尾。
-p, –step length 一次迭代中要丢弃的字节数。默认是一次ioctl(2)调用丢弃所有。
-s, –secure 执行安全丢弃。安全丢弃与常规丢弃相同,但是在安全擦除中可能由垃圾收集创建的丢弃块的所有副本也会被擦除。这需要来自设备的支持。
-z, –zeroout 使用零字节填充,而不是擦除。
-v, –verbose 显示offset和length的对齐值,因为这两个值将与设备扇区大小对齐,所以与指定的值会有所出入。如果指定了–step选项,则每秒打印一次丢弃执行的进度。
–help 显示帮助信息并退出。
–version 显示版本信息并退出。
offset, length 这两个参数后面紧跟单位KiB(=1024),MiB(=1024 * 1024),依此类推还有GiB,TiB,PiB,EiB,ZiB,YiB(其中,“iB”是可选的,例如 ,“K”与“KiB”具有相同的含义)。
也可以后跟KB(= 1000),MB(= 1000 * 1000),以此类推还有GB,TB,PB,EB,ZB,YB等。
相关手册
fstrim(8)
参考文献

man 8 blkdiscard, Version blkdiscard from util-linux 2.32

更新日志

07/11/2018 创建文章[……]

READ MORE

「blkid」-

blkid – locate/print block device attributes

命令语法格式

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] device …

blkid –info [–output format] [–match-tag tag] device …

命令描述

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 informatio[……]

READ MORE

「blockdev」-

blockdev – call block device ioctls from the command line

命令语法格式

blockdev [-q] [-v] command [command…] device [device…]
blockdev –report [device…]
blockdev -h|-V

命令描述

The utility blockdev allows one to call block device ioctls from the command line.

命令支持的选项及含义

-q Be quiet.

-v Be verbose.

–report

Print a report for the specified device. It is possible to give multiple devices. If none is given, all devices which appear in /proc/partitions are shown. Note that the partition StartSec is in 512-byte sectors.

-h, –help

Display help text and exit.

-V, –version

Print version and exit.

COMMANDS

It is possible to give multiple devices and multiple commands.

–flushbufs

Flush buffers.

–getalignoff

Get alignment offset.

–getbsz

Print blocksize in bytes.

–getdiscardzeroes

Get discard zeroes support status.

–getfra

Get filesystem readahead in 512-byte sectors.

–getiomin[……]

READ MORE

「cal(1)」-

显示日历和复活节的日期
命令语法格式
cal [-31jy] [-A number] [-B number] [-d yyyy-mm] [[month] year]
cal [-31j] [-A number] [-B number] [-d yyyy-mm] -m month [year]
ncal [-C] [-31jy] [-A number] [-B number] [-d yyyy-mm] [[month] year]
ncal [-C] [-31j] [-A number] [-B number] [-d yyyy-mm] -m month [year]
ncal [-31bhjJpwySM] [-A number] [-B number] [-H yyyy-mm-dd] [-d yyyy-mm] [-s country_code] [[month] year]
ncal [-31bhJeoSM] [-A number] [-B number] [-d yyyy-mm] [year]
命令描述
命令cal以传统格式显示简单日历,ncal提供另一种布局,更多选项和复活节日期。新的格式有点局促,但它可以在25×80终端中显示一年。 如果未指定参数,则显示当前月份。
命令行选项
-h 关闭今天的突出显示。
-J 显示朱利安日历,如果与-o选项结合使用,则根据朱利安日历显示东正教复活节的日期。
-e 显示复活节的日期(西方教会)。
-j 显示朱利安日(基于第一天,从1月1日开始编号)。
-m month 显示指定的月份。 如果将month指定为十进制数字,则附加“f”或“p”将分别显示下一年或上一年的同一月份。
-o 显示东正教复活节(希腊和俄罗斯东正教教会)的日期。
-p 打印国家代码,并将天数从朱利安日历转换为格里高利日历,因为它们由ncal假设。 从本地环境确定的国家/地区代码标有星号。
-s country_code 假设在与country_code关联的日期从Julian切换到Gregorian日历。 如果没有指定,ncal会尝试从当地环境猜测切换日期或者回到1752年9月2日。这是英国和她的殖民地切换到公历的时候。
-w 打印每周列以下的周数。
-y 显示指定年份的日历。 如果在命令行上指定了一年但没有指定月份,则隐含此选项。
-3 显示今天的前一个,当前和下个月。
-1 仅显示当前月份。 这是默认值。
-A number 添加的后几个月。 指定的月数将添加到显示的末尾。 这是由-y,-3,-1选项选择的任何日期范围的补充。 例如,“cal -y -B2 -A2”显示从上一[……]

READ MORE

「cfdisk」-

cfdisk – display or manipulate a disk partition table

命令语法格式

cfdisk [options] [device]

命令描述

cfdisk is a curses-based program for partitioning any block device. The default device is /dev/sda.

Note that cfdisk provides basic partitioning functionality with a user-friendly interface. If you need advanced features, use fdisk(8) instead.

Since version 2.25 cfdisk supports MBR (DOS), GPT, SUN and SGI disk labels, but no longer provides any functionality for CHS (Cylinder-Head-Sector) addressing. CHS has never been important for Linux, and this addressing
concept does not make any sense for new devices.

Since version 2.25 cfdisk also does not provide a ‘print’ command any more. This functionality is provided by the utilities partx(8) and lsblk(8) in a very comfortable and rich way.

If you want to remove an old partition table from a device, use wipefs(8).

命令支持的选项及含义

-h, –help

Display 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[……]

READ MORE

「chcpu(8)」-

对CPU进行配置
命令语法格式
chcpu -c|-d|-e|-g cpu-list
chcpu -p mode
chcpu -r|-h|-V
命令描述
命令chcpu可以修改CPU的状态。 它可以启用CPU、禁用CPU、扫描新CPU、更改底层hypervisor的CPU调度模式,以及从hypervisor(配置)请求CPU、或将CPU返回到hypervisor(解除配置)。
一些选项有一个cpu-list参数。 使用此参数指定时,以逗号分隔的CPU列表。该列表可以包含单个CPU地址或地址范围。 例如,0,5,7,9-11使命令适用于地址为0,5,7,9,10,11的CPU。
命令支持的选项及含义
-c, –configure cpu-list 配置指定的CPU。 配置CPU意味着:hypervisor从CPU池中获取CPU,并将其分配给运行内核的虚拟硬件。
-d, –disable cpu-list 禁用指定的CPU。 禁用CPU意味着:内核将其设置为离线状态。
-e, –enable cpu-list 启用指定的CPU。 启用CPU意味着:内核将其设置为在线状态。请参阅-c选项,必须先配置CPU,然后才能启用它。
-g, –deconfigure cpu-list 取消指定CPU的配置。取消CPU配置意味着:hypervisor从运行Linux实例的虚拟硬件中删除CPU并将其返回到CPU池。在取消配置之前,CPU必须处于脱机状态,请参阅-d选项。
-p, –dispatch mode 设置CPU调度模式(极化,polarization)。 仅当硬件体系结构和虚拟机管理程序支持CPU极化时,此选项才有效。 可用的mode是:

horizontal,工作负载分布在所有可用的CPU上。
vertical,工作负载集中在少数CPU上。

-r, –rescan 触发重新扫描的CPU。 重新扫描后,Linux内核会识别新的CPU。在不自动检测新连接的CPU的系统上,可以使用此选项。
其他选项
-h, –help 显示帮助信息。
-V, –version 显示版本信息。
退出状态
0 成功;
1 失败;
64 部分成功;
相关手册
lscpu(1)
参考文献

man 8 chcpu, Version chcpu from util-linux 2.32

更新日志

07/11/2018 创建文章[……]

READ MORE

「chrt」-

chrt – manipulate the real-time attributes of a process

命令语法格式

chrt [options] priority command [argument…]
chrt [options] -p [priority] pid

命令描述

chrt sets or retrieves the real-time scheduling attributes of an existing pid, or runs command with the given attributes.

POLICIES

-o, –other

Set scheduling policy to SCHED_OTHER. This is the default Linux scheduling policy.

-f, –fifo

Set scheduling policy to SCHED_FIFO.

-r, –rr

Set scheduling policy to SCHED_RR. When no policy is defined, the SCHED_RR is used as the default.

-b, –batch

Set scheduling policy to SCHED_BATCH (Linux-specific, supported since 2.6.16). The priority argument has to be set to zero.

-i, –idle

Set scheduling policy to SCHED_IDLE (Linux-specific, supported since 2.6.23). The priority argument has to be set to zero.

-d, –deadline

Set scheduling policy to SCHED_DEADLINE (Linux-specific, supported since 3.14). The priority argument has to be set to zero. See also –sched-runtime, –sched-deadline and –sched-period. The re[……]

READ MORE

「col(1)」-

从输入过滤反向换行
命令语法格式
col [-bfhpx] [-l num]
命令描述
命令col过滤掉反向换行符和半反向换行符,以便输出的顺序正确,且只包含正向换行符和半正向换行,并在可能的情况下用制表符替换空白字符。这在处理nroff(1)和tbl(1)的输出时非常有用。
命令col从标准输入读取,并写入标准输出。
关于换行、反向换行等概念参考文章「What is a reverse line feed」、「Newline」。
命令支持的选项及含义
-b 不输出任何退格,仅打印写入每个列位置的最后一个字符。
-f 允许半正向换行符(“fine”模式)。通常,打印在半行边界上的字符会被打印在紧跟的行中。
-l num 至少在内存中缓冲num行。默认缓冲128行。
-p 通过不变,强制未知的控制序列。通常,命令col将从输入中过滤掉除自身识别和解释的控制序列之外的任何控制序列,如下所列。
-h 不要输出多个空格,而是输出制表符(TAB)。
-x 输出多个空格,而不是制表符。
下表列出了命令col理解的回车的控制序列及其十进制值:
ESC-7 reverse line feed (escape then 7)
ESC-8 half reverse line feed (escape then 8)
ESC-9 half forward line feed (escape then 9)
backspace moves back one column (8); ignored in the first column
carriage return (13)
newline forward line feed (10); also does carriage return
shift in shift to normal character set (15)
shift out shift to alternate character set (14)
space moves forward one column (32)
tab moves forward to next tab stop (9)
vertical tab reverse line feed (11)

所有无法识别的控制字符和转义序列都会被丢弃。
命令col实用程序会在读取字符时跟踪字符集,并确保输出时字符集正确。
如果输入尝试返回到上一个已刷出的行,则col将显示警告消息。
注[……]

READ MORE

「colcrt(1)」-

过滤器nroff输出,用于CRT预览
命令语法格式
colcrt [-] [-2] [file …]
命令描述
命令colcrt提供虚拟半行和反向LF序列(为没有这种能力的终端),并且在这种终端上高亮是破坏性的。 半行字符和下划线(更改为划线“-”)放在正常输出行之间的新行上。
命令支持的选项及含义
– 抑制所有下划线。此选项对于从tbl(1)预览所有已装箱的表格尤其有用。
-2 导致所有半行打印,有效地使输出双倍间隔。 通常,使用最小空间输出格式来抑制空行。 但是,该程序从不抑制两个连续的空行。 当输出包含将不可见的上标和下标时,选项-2对于将输出发送到行式打印机非常有用。
注意事项
即使使用’ – ‘选项也应该将下划线折叠到空白处,以便显示真正的下划线字符。
无法向后达到超过102行。
一般突出显示会丢失;作为一个特殊情况:带有“-”的“|”突出显示会变为“+”。
行被修剪为132个字符。
应该为处理已经是双倍行距的文件中的上标和下标做出一些规定。
占用多个列位置的字符可能无法正确加下划线。
相关环境变量
LANG, LC_ALL, LC_CTYPE 这些环境变量会影响colcrt的执行,参考environ(7)手册。
退出状态
0 成功;
>0 失败;
使用示例
命令colcrt的一个典型用法:

# tbl exum2.n | nroff -ms | colcrt – | more

如上示例。
相关手册
col(1), more(1), nroff(1), troff(1), ul(1)
参考文献

man 1 colcrt, Version 9.0.12

更新日志

10/05/2018 创建文章[……]

READ MORE

「column(1)」-

列化列表
命令语法格式
column [-entx] [-c columns] [-s sep] [file …]
命令描述
命令column将其输入格式化为多个列。在列之前填充行。输入可以来自文件,或默认情况下来自标准输入。除非使用-e选项,否则将忽略空行。
命令支持的选项及含义
-s sep 指定一组字符,用于分隔-t选项的列。
注意:该组字符是列的分隔标志,而不时输出时分隔列的字符。
-t 确定输入包含的列数并创建表。 默认情况下,列用空格分隔,或使用-s选项提供的字符分隔。 适用于漂亮的打印显示。
-n 默认情况下,命令column会在使用-t选项时,将多个相邻分隔符合并为单个分隔符。 此选项禁用该行为。
此选项是Debian GNU/Linux扩展。
-c columns 输出格式化为显示columns列宽。
-x 在填充行之前填充列。
-e 不要忽略空白行。
注意事项
输入行的长度限制为LINE_MAX(1M)宽字符的512倍。
相关环境变量
COLUMNS, LANG, LC_ALL, LC_CTYPE 这些选项会影响column的执行,参考environ手册。
退出状态
0 成功;
>0 发生错误;
使用示例
指定列的分隔标志为数字3:

# echo 12312312312312312321312321 | column -s 3 -t
12 12 12 12 12 12 21 12 21

列化ls命令的输出,使结果的可读性更高:

# (printf “PERM LINKS OWNER GROUP SIZE MONTH DAY ” ; printf “HH:MM/YEAR NAME\n” ; ls -l | sed 1d) | column -t

如上示例。
相关手册
colrm(1), ls(1), paste(1), sort(1)
参考文献

man 1 column, Version column from util-linux 2.32

更新日志

07/11/2018 创建文章[……]

READ MORE

「ctrlaltdel(8)」-

设置Ctrl-Alt-Del组合的功能
命令语法格式
ctrlaltdel hard|soft
命令描述
基于linux/kernel/reboot.c代码的检查,很明显序列Ctrl-Alt-Del可以执行两个支持的功能:

hard:立即重新启动计算机,而不调用sync(2),并且不做任何其他准备。这是默认值。

soft:使内核将SIGINT(中断)信号发送到init进程(这始终是PID为“1”的进程)。如果使用此选项,init(8)程序必须支持此功能。 由于Linux社区中现在有几个init(8)程序,请查阅当前使用的版本的文档。

当命令ctrlaltdel在没有任何参数的情况下运行时,它将显示当前设置。
组合ctrlaltdel的功能通常在/etc/rc.local文件中设置。
命令支持的选项及含义
-V, –version 显示版本信息并退出。
-h, –help 显示帮助信息并退出。
相关文件
/etc/rc.local
相关手册
init(8), systemd(1)
参考文献

man 8 ctrlaltdel, Version ctrlaltdel from util-linux 2.32

更新日志

07/11/2018 创建文章[……]

READ MORE

「delpart(8)」-

告诉内核忘记分区
命令语法格式
delpart device partition
命令描述
命令delpart要求Linux内核忘记指定设备上的指定分区(数字)。该命令是围绕ioctl(2)“删除分区”的简单包装。
此命令不会操作块设备上的分区。
相关手册
addpart(8), fdisk(8), parted(8), partprobe(8), partx(8)
参考文献

man 8 delpart, Version delpart from util-linux 2.32

更新日志

07/11/2018 创建文章[……]

READ MORE

「dmesg」-

dmesg – print or control the kernel ring buffer

命令语法格式

dmesg [options]

dmesg –clear
dmesg –read-clear [options]
dmesg –console-level level
dmesg –console-on
dmesg –console-off

命令描述

dmesg is used to examine or control the kernel ring buffer.

The default action is to display all messages from the kernel ring buffer.

命令支持的选项及含义

The –clear, –read-clear, –console-on, –console-off, and –console-level options are mutually exclusive.

-C, –clear

Clear the ring buffer.

-c, –read-clear

Clear the ring buffer after first printing its contents.

-D, –console-off

Disable the printing of messages to the console.

-d, –show-delta

Display the timestamp and the time delta spent between messages. If used together with –notime then only the time delta without the timestamp is printed.

-E, –console-on

Enable printing messages to the console.

-e, –reltime

Display the local time and the delta in human-readable format. Be aware that conversion[……]

READ MORE

「eject」-

eject – eject removable media

命令语法格式

eject -h
eject [-vnrsfmqp] [<name>]
eject [-vn] -d
eject [-vn] -a on|off|1|0 [<name>]
eject [-vn] -c slot [<name>]
eject [-vn] -i on|off|1|0 [<name>]
eject [-vn] -t [<name>]
eject [-vn] -T [<name>]
eject [-vn] -x <speed> [<name>]
eject [-vn] -X [<name>]
eject -V

命令描述

Eject allows removable media (typically a CD-ROM, floppy disk, tape, or JAZ or ZIP disk) to be ejected under software control. The command can also control some multi-disc CD-ROM changers, the auto-eject feature supported by
some devices, and close the disc tray of some CD-ROM drives.

The device corresponding to <name> is ejected. The name can be a device file or mount point, either a full path or with the leading “/dev”, “/media” or “/mnt” omitted. If no name is specified, the default name “cdrom” is
used.

There are four different methods of ejecting, depending on whether the device is a CD-ROM, SCSI device, removable floppy, or tape. By default eject tries all four methods in order until it succeeds.[……]

READ MORE

「fallocate」-

fallocate – preallocate or deallocate space to a file

命令语法格式

fallocate [-c|-p|-z] [-o offset] -l length [-n] filename

fallocate -d [-o offset] [-l length] filename

fallocate -x [-o offset] -l length filename

命令描述

fallocate is used to manipulate the allocated disk space for a file, either to deallocate or preallocate it. For filesystems which support the fallocate system call, preallocation is done quickly by allocating blocks and
marking them as uninitialized, requiring no IO to the data blocks. This is much faster than creating a file by filling it with zeroes.

The exit code returned by fallocate is 0 on success and 1 on failure.

命令支持的选项及含义

The length and offset arguments 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.

The options –collapse-range, –dig-holes, –punch-hole and –zero-range are mutually exclusive.

-c, -[……]

READ MORE

「fdformat(8)」-

低级格式化软盘
命令语法格式
fdformat [options] device
命令描述
命令fdformat在软盘上执行低级格式化。参数device通常是以下之一(对于软盘设备,major = 2,而minor显示仅供参考):

/dev/fd0d360 (minor = 4)
/dev/fd0h1200 (minor = 8)
/dev/fd0D360 (minor = 12)
/dev/fd0H360 (minor = 12)
/dev/fd0D720 (minor = 16)
/dev/fd0H720 (minor = 16)
/dev/fd0h360 (minor = 20)
/dev/fd0h720 (minor = 24)
/dev/fd0H1440 (minor = 28)

/dev/fd1d360 (minor = 5)
/dev/fd1h1200 (minor = 9)
/dev/fd1D360 (minor = 13)
/dev/fd1H360 (minor = 13)
/dev/fd1D720 (minor = 17)
/dev/fd1H720 (minor = 17)
/dev/fd1h360 (minor = 21)
/dev/fd1h720 (minor = 25)
/dev/fd1H1440 (minor = 29)

当使用非标准格式时,或者如果之前未自动检测格式,通用软盘设备(/dev/fd0和/dev/fd1)将无法使用fdformat处理。 在这种情况下,使用setfdprm(8)加载磁盘参数。
命令支持的选项及含义
-f, –from N 从轨道N开始(默认为0)。
-t, –to N 从轨道N停止(默认为0)。
-r, –repair N 尝试在验证期间修复失败的轨道(最多N次重试)。
-n, –no-verify 跳过在格式化后通常会执行的验证。
-h, –help 显示帮助信息。
-V, –version 显示版本信息。
相关手册
fd(4), emkfs(8), mkfs(8), setfdprm(8)
参考文献

man 8 fdformat, Version fdformat from util-linux 2.32

更新日志

07/11/2018 创建文章[……]

READ MORE

「fdisk」-

操作硬盘分区表
命令语法格式
fdisk [options] device
fdisk -l [device…]
命令描述
命令fdisk是一个由对话框驱动的程序,用于创建和操作分区表。它可以理解GPT、MBR、Sun、SGI、BSD分区表。
块设备可以分为一个或多个称为分区的逻辑磁盘。此划分记录在“分区表”中,通常位于磁盘的“扇区零”中。 (在BSD世界中,人们谈论的是“磁盘片”(disk slice)和“磁盘标签”(disklabel))
默认情况下,所有分区都由设备I/O限制(拓扑)驱动。命令fdisk能够针对4K扇区大小优化磁盘布局,并在现代设备上使用MBR和GPT的对齐偏移。将fdisk的默认值作为默认值始终是一个好主意(例如,第一个和最后一个分区扇区),并且“+<size>{M,G,…}表示法”指定的分区大小始终是根据设备属性进行对齐 。
请注意,partx(8)为脚本提供了丰富的界面来打印磁盘布局,而fdisk主要是为人类设计的。不保证fdisk输出的向后兼容性。输入(命令)应始终向后兼容。
命令行选项
-b, –sector-size sectorsize 指定磁盘的扇区大小。有效值为512,1024,2048,4096.(最近的内核版本知道扇区大小。仅在旧内核上使用此选项,或者覆盖内核的想法。)自util-linux-2.17起,fdisk区分逻辑扇区和物理扇区大小。 此选项将扇区大小更改为sectorsize。
-B, –protect-boot 创建新磁盘标签时,请勿擦除第一个磁盘扇区的开头。为GPT和MBR支持此功能。
-c, –compatibility[=mode] 指定兼容模式,’dos’或’nondos’。默认为非DOS模式。 为了向后兼容,可以使用不带mode参数的选项,此时使用默认值。 请注意,可选mode参数不能通过空格与-c选项分隔,正确的形式例如是“-c=dos”。
-L, –color[=when] 着色输出。 可选参数何时可以是auto,never,always。 如果省略when参数,则默认为auto。 颜色可以禁用;对于当前内置的默认值,请参阅–help输出。 另请参阅「颜色」部分。
-l, –list 列出指定设备device的分区表,然后退出。 如果没有给出设备,则使用/proc/partitions中提到的那些设备(如果该文件存在)。
-o, –output list 指定要打印的输出列。 使用–help获取所有支持列的列表。
如果以格式+list(例如-o +UUID)指定列表,则可以扩展默认列的列表。
-s, –getsz 在每个给定块设备[……]

READ MORE

「findfs(8)」-

根据标签或者UUID查找文件系统
命令语法格式
findfs NAME=value
命令描述
命令findfs将搜索系统中的块设备,查找具有指定标记的文件系统或分区。
如果找到文件系统或分区,则将在标准错误上打印设备名称。
命令支持的标签
LABEL=<label> 指定文件系统的标签。
UUID=<uuid> 指定文件系统的UUID。
PARTUUID=<uuid> 指定分区UUID。例如,GUID分区表(GPT)分区表支持此分区标识符。
PARTLABEL=<label> 指定分区标签(名称)。 例如,GUID分区表(GPT)或MAC分区表支持分区标签。
注意事项
有关文件系统和分区的完整概述,例如,可以通过

# lsblk –fs
# partx –show <disk>
# blkid

如上命令获得。
相关环境变量
LIBBLKID_DEBUG=all 启用libblkid调试输出。
退出状态
0 成功
1 标签或者UUID未找到
2 用法、参数数值、未知选项错误
相关手册
blkid(8), lsblk(8), partx(8)
参考文献

man 8 findfs, Version findfs from util-linux 2.32

更新日志

07/11/2018 创建文章[……]

READ MORE