Skip to content

Latest commit

 

History

History
991 lines (952 loc) · 40.8 KB

cix-util-linux.org

File metadata and controls

991 lines (952 loc) · 40.8 KB

Util Linux

|≣|

AuthorKarel Zak
Contributor(s)Ruediger Meier,
Sami Kerola,
Stanislav Brabec (all…)
Released2007
Sourceutil-linux.git
Info

The util-linux package contains a large variety of low-level system utilities that are necessary for a Linux system to function. Among others, Util-linux contains the fdisk configuration tool and the login program.

Packages

nameRPMDEBARCH
utils-linux+++

Libraries

NameRPMDEBARCH
1ld-linux-x86-64++
2libaudit+
3libblkid++
4libcap-ng+
5libcrypt++
6libc++
7libfdisk++
8libmount++
9libm++
10libncursesw++
11libpam_misc++
12libpam++
13librt++
14libselinux++
15libsmartcols++
16libsystemd++
17libtinfo++
18libudev++
19libutempter+
20libutil+
21libuuid++
22libz++

Index

| CMD          | MAN  | DESCRIPTION                                               |
| cal          | (1)  | display a calendar                                        |
| cal          | (1p) | print a calendar                                          |
| chrt         | (1)  | manipulate the real-time attributes of a process          |
| col          | (1)  | filter reverse line feeds from input                      |
| colcrt       | (1)  | filter nroff output for CRT previewing                    |
| colrm        | (1)  | remove columns from a file                                |
| column       | (1)  | columnate lists                                           |
| dmesg        | (1)  | print or control the kernel ring buffer                   |
| eject        | (1)  | eject removable media                                     |
| fallocate    | (1)  | preallocate or deallocate space to a file                 |
| fallocate    | (2)  | manipulate file space                                     |
| findmnt      | (8)  | find a filesystem                                         |
| flock        | (1)  | manage locks from shell scripts                           |
| flock        | (2)  | apply or remove an advisory lock on an open file          |
| getopt       | (3)  | Parse command-line options                                |
| getopt       | (1)  | parse command options (enhanced)                          |
| getopt       | (3p) | command option parsing                                    |
| hexdump      | (1)  | display file contents in hexadecimal, decimal, octal, ... |
| i386         | (8)  | change reported architecture in new program environmen... |
| ionice       | (1)  | set or get process I/O scheduling class and priority      |
| ipcmk        | (1)  | make various IPC resources                                |
| ipcrm        | (1)  | remove certain IPC resources                              |
| ipcrm        | (1p) | remove an XSI message queue, semaphore set, or shared ... |
| ipcs         | (1)  | show information on IPC facilities                        |
| ipcs         | (1p) | report XSI interprocess communication facilities status   |
| isosize      | (8)  | output the length of an iso9660 filesystem                |
| kill         | (1)  | terminate a process                                       |
| kill         | (2)  | send signal to a process                                  |
| kill         | (3p) | send a signal to a process or a group of processes        |
| kill         | (1p) | terminate or signal processes                             |
| last         | (1)  | show a listing of last logged in users                    |
| lastb        | (1)  | show a listing of last logged in users                    |
| linux32      | (8)  | change reported architecture in new program environmen... |
| linux64      | (8)  | change reported architecture in new program environmen... |
| logger       | (1)  | enter messages into the system log                        |
| logger       | (1p) | log messages                                              |
| login        | (3)  | write utmp and wtmp entries                               |
| login        | (1)  | begin session on the system                               |
| look         | (1)  | display lines beginning with a given string               |
| lsblk        | (8)  | list block devices                                        |
| lscpu        | (1)  | display information about the CPU architecture            |
| lsipc        | (1)  | show information on IPC facilities currently employed ... |
| lslocks      | (8)  | list local system locks                                   |
| lslogins     | (1)  | display information about known users in the system       |
| lsns         | (8)  | list namespaces                                           |
| mcookie      | (1)  | generate magic cookies for xauth                          |
| mesg         | (1)  | display (or do not display) messages from other users     |
| mesg         | (1p) | permit or deny messages                                   |
| more         | (1)  | file perusal filter for crt viewing                       |
| more         | (1p) | display files on a page-by-page basis                     |
| mount        | (8)  | mount a filesystem                                        |
| mount        | (2)  | mount filesystem                                          |
| mountpoint   | (1)  | see if a directory or file is a mountpoint                |
| namei        | (1)  | follow a pathname until a terminal point is found         |
| nsenter      | (1)  | run program with namespaces of other processes            |
| vlimit       | (3)  | get/set resource limits                                   |
| prlimit      | (1)  | get and set process resource limits                       |
| prlimit      | (2)  | get/set resource limits                                   |
| raw          | (8)  | bind a Linux raw character device                         |
| raw          | (3x) | curses input options                                      |
| raw          | (7)  | Linux IPv4 raw sockets                                    |
| rename       | (1)  | rename files                                              |
| rename       | (2)  | change the name or location of a file                     |
| rename       | (3p) | rename file relative to directory file descriptor         |
| rename       | (n)  | Rename or delete a command                                |
| renice       | (1)  | alter priority of running processes                       |
| renice       | (1p) | set nice values of running processes                      |
| rev          | (1)  | reverse lines characterwise                               |
| script       | (1)  | make typescript of terminal session                       |
| scriptreplay | (1)  | play back typescripts, using timing information           |
| setarch      | (8)  | change reported architecture in new program environmen... |
| setpriv      | (1)  | run a program with different Linux privilege settings     |
| setsid       | (1)  | run a program in a new session                            |
| setsid       | (2)  | creates a session and sets the process group ID           |
| setsid       | (3p) | create session and set process group ID                   |
| setterm      | (3x) | curses interfaces to terminfo database                    |
| setterm      | (1)  | set terminal attributes                                   |
| su           | (1)  | run a command with substitute user and group ID           |
| tailf        | (1)  | follow the growth of a log file                           |
| taskset      | (1)  | set or retrieve a process's CPU affinity                  |
| ul           | (1)  | do underlining                                            |
| umount       | (8)  | unmount file systems                                      |
| umount       | (2)  | unmount filesystem                                        |
| uname26      | (8)  | change reported architecture in new program environmen... |
| unshare      | (1)  | run program with some namespaces unshared from parent     |
| unshare      | (2)  | disassociate parts of the process execution context       |
| utmpdump     | (1)  | dump UTMP and WTMP files in raw format                    |
| uuidgen      | (1)  | create a new UUID value                                   |
| wall         | (1)  | write a message to all users                              |
| wdctl        | (8)  | show hardware watchdog status                             |
| whereis      | (1)  | locate the binary, source, and manual page files for a... |
| write        | (1)  | send a message to another user                            |
| write        | (2)  | write to a file descriptor                                |
| write        | (3p) | write on a file                                           |
| write        | (1p) | write to another user                                     |
| x86_64       | (8)  | change reported architecture in new program environmen... |
| addpart      | (8)  | tell the kernel about the existence of a partition        |
| agetty       | (8)  | alternative Linux getty                                   |
| blkdiscard   | (8)  | discard sectors on a device                               |
| blkid        | (8)  | locate/print block device attributes                      |
| blockdev     | (8)  | call block device ioctls from the command line            |
| cfdisk       | (8)  | display or manipulate a disk partition table              |
| chcpu        | (8)  | configure CPUs                                            |
| clock        | (8)  | read or set the hardware clock (RTC)                      |
| clock        | (3)  | determine processor time                                  |
| clock        | (3p) | report CPU time used                                      |
| clock        | (n)  | Obtain and manipulate dates and times                     |
| ctrlaltdel   | (8)  | set the function of the Ctrl-Alt-Del combination          |
| delpart      | (8)  | tell the kernel to forget about a partition               |
| fdformat     | (8)  | low-level format a floppy disk                            |
| fdisk        | (8)  | manipulate disk partition table                           |
| findfs       | (8)  | find a filesystem by label or UUID                        |
| fsck         | (8)  | check and repair a Linux filesystem                       |
| fsck.cramfs  | (8)  | fsck compressed ROM file system                           |
| fsck.minix   | (8)  | check consistency of Minix filesystem                     |
| fsfreeze     | (8)  | suspend access to a filesystem (Ext3/4, ReiserFS, JFS,... |
| fstrim       | (8)  | discard unused blocks on a mounted filesystem             |
| hwclock      | (8)  | read or set the hardware clock (RTC)                      |
| ldattach     | (8)  | attach a line discipline to a serial line                 |
| losetup      | (8)  | set up and control loop devices                           |
| mkfs         | (8)  | build a Linux filesystem                                  |
| mkfs.cramfs  | (8)  | make compressed ROM file system                           |
| mkfs.minix   | (8)  | make a Minix filesystem                                   |
| mkswap       | (8)  | set up a Linux swap area                                  |
| nologin      | (8)  | politely refuse a login                                   |
| nologin      | (5)  | prevent unprivileged users from logging into the system   |
| partx        | (8)  | tell the kernel about the presence and numbering of on... |
| pivot_root   | (8)  | change the root filesystem                                |
| pivot_root   | (2)  | change the root filesystem                                |
| readprofile  | (8)  | read kernel profiling information                         |
| resizepart   | (8)  | tell the kernel about the new size of a partition         |
| rtcwake      | (8)  | enter a system sleep state until specified wakeup time    |
| runuser      | (1)  | run a command with substitute user and group ID           |
| sfdisk       | (8)  | display or manipulate a disk partition table              |
| sulogin      | (8)  | single-user login                                         |
| swaplabel    | (8)  | print or change the label or UUID of a swap area          |
| swapoff      | (8)  | enable/disable devices and files for paging and swapping  |
| swapoff      | (2)  | start/stop swapping to file/device                        |
| swapon       | (8)  | enable/disable devices and files for paging and swapping  |
| swapon       | (2)  | start/stop swapping to file/device                        |
| switch_root  | (8)  | switch to another filesystem as the root of the mount ... |
| wipefs       | (8)  | wipe a signature from a device                            |
| zramctl      | (8)  | set up and control zram devices                           |

Receipts

addpart

addpart::options

addpart::examples

addpart::files

addpart::see-also

agetty

agetty::options

agetty::examples

agetty::files

agetty::see-also

blkid

blkid::options

blkid::examples

blkid::files

blkid::see-also

blockdev

blockdev::options

blockdev::examples

blockdev::files

blockdev::see-also

cal

cal::options

cal::examples

cal::files

cal::see-also

cfdisk

cfdisk::options

cfdisk::examples

cfdisk::files

cfdisk::see-also

chcpu

chcpu::options

chcpu::examples

chcpu::files

chcpu::see-also

chfn

chfn::options

chfn::examples

chfn::files

chfn::see-also

chrt

chrt::options

chrt::examples

chrt::files

chrt::see-also

chsh

chsh::options

chsh::examples

chsh::files

chsh::see-also

col

col::options

col::examples

col::files

col::see-also

colcrt

olcrt::options

olcrt::examples

olcrt::files

olcrt::see-also

colrm

colrm::options

colrm::examples

colrm::files

colrm::see-also

column

columnate lists

The column command appeared in 4.3BSD-Reno

column::options

OPT++V.–VDESC
-c, --columns2.132.30width of output in number of character
-s, --separator2.19possible table delimiters
-t, --table2.19format a table output
-x, --fillrows2.19fill rows before columns
-e, --table-header-repeat2.30repeat header for each page
-E, --table-noextreme2.30don’t count long text from the columns to column widt
-N, --table-columns2.30comma separated columns names
-n, --talbe-name2.30table name for JSON output
-o, --output-separator2.30columns separator for table output
-O, --table-order2.30specify order of output columns
-c, --output-width2.30width of output in number of character
-H, --table-hide2.30don’t print the columns
-i, --tree-id2.30line ID to specify child-parent relation
-J, --json2.30use JSON output format for table
-p, --tree-parent2.30parent to specify child-parent relation
-R, --table-right2.30right align text in these columns
-T, --table-truncate2.30truncate text in the columns when necessary

column::examples

column-161120161537

Nicely formated /etc/fstab:

   ~$ sed 's/#.*//' /etc/fstab | column -t
   ~$ grep -v '#' /etc/fstab | column -t

sed (1), grep (1)

column-170729092307

pstree-like output, using libsmartcols from util-linux v2.30:

   ~$ ps -h -o pid,ppid,comm | column --table --tree 3 --tree-id 1 --tree-parent 2 --table-hide 2 --table-right 1

column-170729112444

findmnt-like output from util-linux v2.30:

column /proc/self/mountinfo \
     --table-columns ID,PARENT,MAJMIN,ROOT,TARGET,VFS-OPTS,PROP,SEP,TYPE,SOURCE,FS-OPTS \
     --table-hide=SEP,ID,PARENT,ROOT,PROP,FS-OPTS,MAJMIN \
     --table-order TARGET,SOURCE,TYPE,VFS-OPTS \
     --tree TARGET \
     --tree-id ID \
     --tree-parent PARENT

column-170729112604

Print /etc/passwd in JSON format from util-linux v2.30:

grep -v nologin /etc/passwd | \
     column --separator : --table --table-name passwd --json \
            --table-columns USERNAME,PWD,UID,GID,GECOS,HOME,SHELL \
            --table-hide PWD

column::files

column::see-also

colrm(1), ls(1), paste(1), sort(1)

ctrlaltdel

ctrlaltdel::options

ctrlaltdel::examples

ctrlaltdel::files

ctrlaltdel::see-also

delpart

delpart::options

delpart::examples

delpart::files

delpart::see-also

dmesg

dmesg::options

dmesg::examples

dmesg::files

dmesg::see-also

eject

ject::options

ject::examples

ject::files

ject::see-also

fallocate

fallocate::options

fallocate::examples

fallocate::files

fallocate::see-also

fdformat

fdformat::options

fdformat::examples

fdformat::files

fdformat::see-also

fdisk

fdisk::options

fdisk::examples

fdisk::files

fdisk::see-also

findfs

findfs::options

findfs::examples

findfs::files

findfs::see-also

findmnt

findmnt::options

findmnt::examples

findmnt::files

findmnt::see-also

flock

manage locks from shell scripts Written by H. Peter Anvin

flock::options

flock::examples

flock-170719223531

To protect against multiple run of the script

   ~$ flock -n /tmp/lock.txt -c "./script.sh"

flock::files

flock::see-also

fsck

fsck::options

fsck::examples

fsck::files

fsck::see-also

fsfreeze

fsfreeze::options

fsfreeze::examples

fsfreeze::files

fsfreeze::see-also

fstab

fstab::options

fstab::examples

fstab::files

fstab::see-also

fstrim

fstrim::options

fstrim::examples

fstrim::files

fstrim::see-also

getopt

getopt::options

getopt::examples

getopt::files

getopt::see-also

getopt

getopt::options

getopt::examples

getopt::files

getopt::see-also

getrlimit

etrlimit::options

etrlimit::examples

etrlimit::files

etrlimit::see-also

hexdump

display file contents in hexadecimal, decimal, octal, or ascii

hexdump::options

OPTTYPE++V–VDESC

hexdump::examples

display a hex dump of a file:

   ~$ hexdump -C -v input_file

hexdump::files

hexdump::see-also

hwclock

hwclock::options

hwclock::examples

hwclock::files

hwclock::see-also

ionice

ionice::options

ionice::examples

ionice::files

ionice::see-also

ipcmk

ipcmk::options

ipcmk::examples

ipcmk::files

ipcmk::see-also

ipcrm

ipcrm::options

ipcrm::examples

ipcrm::files

ipcrm::see-also

ipcs

pcs::options

pcs::examples

pcs::files

pcs::see-also

isosize

isosize::options

isosize::examples

isosize::files

isosize::see-also

kill

kill::options

kill::examples

kill::files

kill::see-also

last

last::options

last::examples

last::files

last::see-also

ldattach

ldattach::options

ldattach::examples

ldattach::files

ldattach::see-also

logger

logger::options

logger::examples

logger::files

logger::see-also

login

ogin::options

ogin::examples

ogin::files

ogin::see-also

look

look::options

look::examples

look::files

look::see-also

losetup

losetup::options

losetup::examples

losetup::files

losetup::see-also

lsblk

list block devices Written by Milan Broz, Karel Zak

lsblk::options

OPT++V–VDESC
-a, --allprint all devices
-b, --bytesprint SIZE in bytes rather than in human readable format
-d, --nodepsdon’t print slaves or holders
-D, --discardprint discard capabilities
-z, --zonedprint zone model
-e, --exclude <list>exclude devices by major number (default: RAM disks)
-f, --fsoutput info about filesystems
-i, --asciiuse ascii characters only
-I, --include <list>show only devices with specified major numbers
-J, --jsonuse JSON output format
-l, --listuse list format output
-m, --permsoutput info about permissions
-n, --noheadingsdon’t print headings
-o, --output <list>output columns
-O, --output-alloutput all columns
-p, --pathsprint complete device path
-P, --pairsuse key=”value” output format
-r, --rawuse raw output format
-s, --inverseinverse dependencies
-S, --scsioutput info about SCSI devices
-t, --topologyoutput info about topology
-x, --sort <column>sort output by <column>

lsblk::examples

lsblk-170917210802

output main devises sorted by size (sizes pathes):

   ~$ lsblk -ldnbp | awk '{print $1" ",$2}' | sort -rk1

awk sort

lsblk::files

lsblk::see-also

lscpu

lscpu::options

lscpu::examples

lscpu::files

lscpu::see-also

lslocks

lslocks::options

lslocks::examples

lslocks::files

lslocks::see-also

lslogins

slogins::options

slogins::examples

slogins::files

slogins::see-also

mcookie

mcookie::options

mcookie::examples

mcookie::files

mcookie::see-also

mesg

mesg::options

mesg::examples

mesg::files

mesg::see-also

mkfs

mkfs::options

mkfs::examples

mkfs::files

mkfs::see-also

mkswap

mkswap::options

mkswap::examples

mkswap::files

mkswap::see-also

more

more::options

more::examples

more::files

more::see-also

mount

mount a filesystem Written by Karel Zak

A mount command existed in Version 5 AT&T UNIX

mount::options

OPTFROM V.END V.DESC
-a, --allMount all from /etc/fstab/
-B
-l
-o
-o loop
-t

mount::examples

mount-161120112604

Nicely printed mount table:

   ~$ mount | column -t

column (1)

mount-161120162011

Mount ISO image to the system:

#!/usr/bin/env bash

ISO_PATH="$HOME/Downloads/Fedora-Workstation-Live-x86_64-24-1.2.iso"
MNT_PATH="/mnt/iso"
mount -o loop "$ISO_PATH" "$MNT_PATH"

mount-161121225218

Scratch ram partition for a fast access:

   ~# mount -t tmpfs tmpfs /mnt -o size=1024m

mount-170728234909

View all mounted paritions of specific type:

   ~$ mount -l -t ext2
   ~$ mount -l -t ext4

mount-170728235322

Bind mount points to a new directory:

   ~# mount -B /old_mnt /new_mnt

The mountpoint can be binded to a new directory. So that you would be able to access the contents of a filesystem via more than one mountpoints at the same time.

mount::files

/etc/blkid.conf
/etc/filesystemsa list of filesystem types to try
/etc/fstabfilesystem table
/etc/mtabtable of mounted filesystems
/etc/mtab.tmptemporary file
/etc/mtab~lock file
/proc/self/mountinfo
/usr/lib/locale/locale-archive

mount::see-also

mount(2), umount(2), umount(8), fstab(5), findmnt(8), nfs(5), nfsd(8), xfs(5), xfs_admin(8), mountd(8), mke2fs(8), tune2fs(8), e2label(8), swapon(8), losetup(8)

mountpoint

mountpoint::options

mountpoint::examples

mountpoint::files

mountpoint::see-also

namei

namei::options

namei::examples

namei::files

namei::see-also

newgrp

newgrp::options

newgrp::examples

newgrp::files

newgrp::see-also

nologin

nologin::options

nologin::examples

nologin::files

nologin::see-also

nsenter

nsenter::options

nsenter::examples

nsenter::files

nsenter::see-also

partx

artx::options

artx::examples

artx::files

artx::see-also

pivot_root

pivot_root::options

pivot_root::examples

pivot_root::files

pivot_root::see-also

prlimit

prlimit::options

prlimit::examples

prlimit::files

prlimit::see-also

raw

raw::options

raw::examples

raw::files

raw::see-also

readprofile

readprofile::options

readprofile::examples

readprofile::files

readprofile::see-also

rename

rename::options

rename::examples

rename::files

rename::see-also

renice

enice::options

enice::examples

enice::files

enice::see-also

reset

reset::options

reset::examples

reset::files

reset::see-also

resizepart

resizepart::options

resizepart::examples

resizepart::files

resizepart::see-also

rev

rev::options

rev::examples

rev-170517222532

display sertain part of the path:

#!/usr/bin/env bash

# Default action
GET_PATH="$(pwd)"

DEPTH="2"

echo "$GET_PATH" \
    | rev \
    | cut -d"/" -f"$DEPTH" \
    | rev

# End of script

cut

rev::files

rev::see-also

tac (1)

rtcwake

rtcwake::options

rtcwake::examples

rtcwake::files

rtcwake::see-also

runuser

runuser::options

runuser::examples

runuser::files

runuser::see-also

script

cript::options

cript::examples

cript::files

cript::see-also

setarch

setarch::options

setarch::examples

setarch::files

setarch::see-also

setpriv

setpriv::options

setpriv::examples

setpriv::files

setpriv::see-also

setsid

setsid::options

setsid::examples

setsid::files

setsid::see-also

setterm

setterm::options

setterm::examples

setterm::files

setterm::see-also

sfdisk

sfdisk::options

sfdisk::examples

sfdisk::files

sfdisk::see-also

su

su::options

su::examples

su::files

su::see-also

sulogin

sulogin::options

sulogin::examples

sulogin::files

sulogin::see-also

swaplabel

swaplabel::options

swaplabel::examples

swaplabel::files

swaplabel::see-also

swapoff

swapoff::options

swapoff::examples

swapoff::files

swapoff::see-also

swapon

swapon::options

swapon::examples

swapon::files

swapon::see-also

switch_root

switch_root::options

switch_root::examples

switch_root::files

switch_root::see-also

tailf

ailf::options

ailf::examples

ailf::files

ailf::see-also

taskset

taskset::options

taskset::examples

taskset::files

taskset::see-also

ul

ul::options

ul::examples

ul::files

ul::see-also

umount

umount::options

umount::examples

umount::files

umount::see-also

unshare

unshare::options

unshare::examples

unshare::files

unshare::see-also

utmpdump

utmpdump::options

utmpdump::examples

utmpdump::files

utmpdump::see-also

uuidgen

uidgen::options

uidgen::examples

uidgen::files

uidgen::see-also

vipw

vipw::options

vipw::examples

vipw::files

vipw::see-also

vlimit

vlimit::options

vlimit::examples

vlimit::files

vlimit::see-also

wall

wall::options

wall::examples

wall::files

wall::see-also

wdctl

wdctl::options

wdctl::examples

wdctl::files

wdctl::see-also

whereis

whereis::options

whereis::examples

whereis::files

whereis::see-also

wipefs

ipefs::options

ipefs::examples

ipefs::files

ipefs::see-also

write

write::options

write::examples

write::files

write::see-also

References