Search notes:

Linux utilities

util-linux

util-linux is a random collection of Linux utilities.
$ for util in $( apt-file show util-linux  | grep -P '/s?bin/' | cut -d ' ' -f 2 ) ; do  echo "$util   $( man $util| awk 'matched{print;matched=0} /DESCRIPTION/{matched=1}' ) "; done
/bin/dmesg dmesg is used to examine or control the kernel ring buffer.
/bin/findmnt 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.
/bin/lsblk 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 than it tries to read LABELs, UUIDs and filesystem types from the
/bin/more more is a filter for paging through text one screenful at a time. This version is especially primitive. Users should realize that less(1) provides more(1) emulation plus extensive enhancements.
/bin/mountpoint mountpoint checks whether the given directory or file is mentioned in the /proc/self/mountinfo file.
/bin/su su allows commands to be run with a substitute user and group ID.
/bin/wdctl Show hardware watchdog status. The default device is dev/watchdog. If more than one device is specified then the output is separated by one blank line.
/sbin/agetty agetty opens a tty port, prompts for a login name and invokes the /bin/login command. It is normally invoked by init(8).
/sbin/blkdiscard blkdiscard is used to discard device sectors. This is useful for solid-state drivers (SSDs) and thinly-provisioned storage. Unlike fstrim(8), this command is used directly on the block device.
/sbin/blkid 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).
/sbin/blkzone blkzone is used to run zone command on device that support the Zoned Block Commands (ZBC) or Zoned-device ATA Commands (ZAC). The zones to operate on can be specified using the offset, count and length options.
/sbin/blockdev Call block device ioctls
/sbin/chcpu chcpu can modify the state of CPUs. It can enable or disable CPUs, scan for new CPUs, change the CPU dispatching mode of the underlying hypervisor, and request CPUs from the hypervisor (configure) or return CPUs to the hypervisor (deconfigure).
/sbin/ctrlaltdel Based on examination of the linux/kernel/reboot.c code, it is clear that there are two supported functions that the Ctrl-Alt-Del sequence can perform.
/sbin/findfs findfs will search the block devices in the system looking for a filesystem or partition with specified tag.
/sbin/fsck fsck is used to check and optionally repair one or more Linux filesystems. filesys can be a device name (e.g., /dev/hdc1, /dev/sdb2), a mount point (e.g., /, /usr, /home) or a filesystem label or UUID specifier (e.g., UUID=8868abf6-88c5-4a83-98b8-bfc24057f7bd or LABEL=root).
/sbin/fsck.cramfs fsck.cramfs is used to check the cramfs file system.
/sbin/fsck.minix fsck.minix performs a consistency check for the Linux MINIX filesystem.
/sbin/fsfreeze fsfreeze suspends or resumes access to a filesystem.
/sbin/fstrim fstrim is used on a mounted filesystem to discard (or "trim") blocks which are not in use by the filesystem. This is useful for solid-state drives (SSDs) and thinly-provisioned storage.
/sbin/getty agetty opens a tty port, prompts for a login name and invokes the /bin/login command. It is normally invoked by init(8).
/sbin/hwclock hwclock is an administration tool for the time clocks. It can: display the Hardware Clock time; set the Hardware Clock to a specified time; set the Hardware Clock from the System Clock; set the System Clock from the Hardware Clock; compensate for Hardware Clock drift; correct the System Clock
/sbin/isosize This command outputs the length of an iso9660 filesystem that is contained in the specified file. This file may be a normal file or a block device (e.g. /dev/hdd or /dev/sr0). In the absence of any options (and errors), it will output the size of the iso9660 filesystem in bytes.
/sbin/mkfs This mkfs frontend is deprecated in favour of filesystem specific mkfs.<type> utils.
/sbin/mkfs.bfs mkfs.bfs creates an SCO bfs filesystem on a block device (usually a disk partition or a file accessed via the loop device).
/sbin/mkfs.cramfs Files on cramfs file systems are zlib-compressed one page at a time to allow random read access. The metadata is not compressed, but is expressed in a terse representation that is more space-efficient than conventional file systems.
/sbin/mkfs.minix mkfs.minix creates a Linux MINIX filesystem on a device (usually a disk partition).
/sbin/mkswap mkswap sets up a Linux swap area on a device or in a file.
/sbin/pivot_root pivot_root moves the root file system of the current process to the directory put_old and makes new_root the new root file system. Since pivot_root(8) simply calls pivot_root(2), we refer to the man page of the latter for further details.
/sbin/raw raw is used to bind a Linux raw character device to a block device. Any block device may be used: at the time of binding, the device driver does not even have to be accessible (it may be loaded on demand as a kernel module later).
/sbin/runuser runuser can be used to run commands with a substitute user and group ID. If the option -u is not given, runuser falls back to su-compatible semantics and a shell is executed. The difference between the commands runuser and su is that runuser does not ask for a password (because it may be executed
/sbin/sulogin sulogin is invoked by init when the system goes into single-user mode.
/sbin/swaplabel swaplabel will display or change the label or UUID of a swap partition located on device (or regular file).
/sbin/switch_root switch_root moves already mounted /proc, /dev, /sys and /run to newroot and makes newroot the new root filesystem and starts init process.
/sbin/wipefs 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.
/sbin/zramctl zramctl is used to quickly set up zram device parameters, to reset zram devices, and to query the status of used zram devices.
/usr/bin/addpart addpart tells the Linux kernel about the existence of the specified partition. The command is a simple wrapper around the "add partition" ioctl.
/usr/bin/choom The choom command displays and adjusts Out-Of-Memory killer score setting.
/usr/bin/chrt chrt sets or retrieves the real-time scheduling attributes of an existing pid, or runs command with the given attributes.
/usr/bin/delpart delpart asks the Linux kernel to forget about the specified partition (a number) on the specified device. The command is a simple wrapper around the "del partition" ioctl.
/usr/bin/fallocate 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.
/usr/bin/fincore 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.
/usr/bin/flock This utility manages flock(2) locks from within shell scripts or from the command line.
/usr/bin/getopt 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.
/usr/bin/i386 setarch modifies execution domains and process personality flags.
/usr/bin/ionice This program sets or gets the I/O scheduling class and priority for a program. If no arguments or just -p is given, ionice will query the current I/O scheduling class and priority for that process.
/usr/bin/ipcmk ipcmk allows you to create System V inter-process communication (IPC) objects: shared memory segments, message queues, and semaphore arrays.
/usr/bin/ipcrm ipcrm removes System V inter-process communication (IPC) objects and associated data structures from the system. In order to delete such objects, you must be superuser, or the creator or owner of the object.
/usr/bin/ipcs ipcs shows information on System V inter-process communication facilities. By default it shows information about all three resources: shared memory segments, message queues, and semaphore arrays.
/usr/bin/last last searches back through the /var/log/wtmp file (or the file designated by the -f option) and displays a list of all users logged in (and out) since that file was created. One or more usernames and/or ttys can be given, in which case last will show only the entries matching those arguments.
/usr/bin/lastb lastb searches back through the /var/log/wtmp file (or the file designated by the -f option) and displays a list of all users logged in (and out) since that file was created. One or more usernames and/or ttys can be given, in which case last will show only the entries matching those arguments.
/usr/bin/linux32 setarch modifies execution domains and process personality flags.
/usr/bin/linux64 setarch modifies execution domains and process personality flags.
/usr/bin/lscpu lscpu gathers CPU architecture information from sysfs, /proc/cpuinfo and any applicable architecture-specific libraries (e.g. librtas on Powerpc). The command output can be optimized for parsing or for easy readability by humans. The information includes, for example, the number of CPUs, threads,
/usr/bin/lsipc lsipc shows information on the System V inter-process communication facilities for which the calling process has read access.
/usr/bin/lslocks lslocks lists information about all the currently held file locks in a Linux system.
/usr/bin/lslogins Examine the wtmp and btmp logs, /etc/shadow (if necessary) and /etc/passwd and output the desired data.
/usr/bin/lsmem The lsmem command lists the ranges of available memory with their online status. The listed memory blocks correspond to the memory block representation in sysfs. The command also shows the memory block size and the amount of memory in online and offline state.
/usr/bin/lsns lsns lists information about all the currently accessible namespaces or about the given namespace. The namespace identifier is an inode number.
/usr/bin/mcookie mcookie generates a 128-bit random hexadecimal number for use with the X authority system.
/usr/bin/mesg The mesg utility is invoked by a user to control write access others have to the terminal device associated with standard error output. If write access is allowed, then programs such as talk(1) and write(1) may display messages on the terminal.
/usr/bin/namei 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…
/usr/bin/nsenter The nsenter command executes program in the namespace(s) that are specified in the command-line options (described below). If program is not given, then ${SHELL} is run (default: /bin/sh).
/usr/bin/partx Given a device or disk-image, partx tries to parse the partition table and list its contents. It can also tell the kernel to add or remove partitions from its bookkeeping.
/usr/bin/prlimit Given a process ID and one or more resources, prlimit tries to retrieve and/or modify the limits.
/usr/bin/resizepart resizepart tells the Linux kernel about the new size of the specified partition. The command is a simple wrapper around the "resize partition" ioctl.
/usr/bin/rev The rev utility copies the specified files to standard output, reversing the order of characters in every line. If no files are specified, standard input is read.
/usr/bin/setarch setarch modifies execution domains and process personality flags.
/usr/bin/setpriv Sets or queries various Linux privilege settings that are inherited across execve(2).
/usr/bin/setsid setsid runs a program in a new session. The command calls fork(2) if already a process group leader. Otherwise, it executes a program in the current process. This default behavior is possible to override by the --fork option.
/usr/bin/setterm setterm writes to standard output a character string that will invoke the specified terminal capabilities. Where possible terminfo is consulted to find the string to use. Some options however (marked "virtual consoles only" below) do not correspond to a terminfo(5) capability. In this case, if the
/usr/bin/taskset taskset is used to set or retrieve the CPU affinity of a running process given its pid, or to launch a new command with a given CPU affinity. CPU affinity is a scheduler property that "bonds" a process to a given set of CPUs on the system. The Linux scheduler will honor the given CPU affinity and
/usr/bin/unshare The unshare command creates new namespaces (as specified by the command-line options described below) and then executes the specified program. If program is not given, then ${SHELL}' is run (default: /bin/sh`).
/usr/bin/utmpdump utmpdump is a simple program to dump UTMP and WTMP files in raw format, so they can be examined. utmpdump reads from stdin unless a filename is passed.
/usr/bin/whereis whereis locates the binary, source and manual files for the specified command names. The supplied names are first stripped of leading pathname components and any (single) trailing extension of the form .ext (for example: .c) Prefixes of s. resulting from use of source code control are also dealt
/usr/bin/x86_64 setarch modifies execution domains and process personality flags.
/usr/sbin/chmem The chmem command sets a particular size or range of memory online or offline.
/usr/sbin/fdformat fdformat does a low-level format on a floppy disk. device is usually one of the following (for floppy devices the major = 2, and the minor is shown for informational purposes only):
/usr/sbin/ldattach The ldattach daemon opens the specified device file (which should refer to a serial device) and attaches the line discipline ldisc to it for processing of the sent and/or received data. It then goes into the background keeping the device open so that the line discipline stays loaded.
/usr/sbin/readprofile The readprofile command uses the /proc/profile information to print ascii data on standard output.
/usr/sbin/rtcwake This program is used to enter a system sleep state and to automatically wake from it at a specified time.

Print system information

inxi: a Perl script.

TODO

As per its man page, /usr/bin/script is a util-linux utility - but in Debian, its in the bsdutils package.

See also

Linux

Index