Skip to content

Commit 1658b6c

Browse files
Managorsebastiaanspeck
authored andcommitted
util-linux: add option placeholders and properly split posix versions in common (tldr-pages#16037)
1 parent 1ee3f93 commit 1658b6c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+236
-193
lines changed

pages/common/logger.md

+2-18
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
11
# logger
22

3-
> Add messages to syslog (/var/log/syslog).
4-
> More information: <https://manned.org/logger>.
3+
> Add messages to syslog.
4+
> More information: <https://manned.org/logger.1p>.
55
66
- Log a message to syslog:
77

88
`logger {{message}}`
9-
10-
- Take input from `stdin` and log to syslog:
11-
12-
`echo {{log_entry}} | logger`
13-
14-
- Send the output to a remote syslog server running at a given port. Default port is 514:
15-
16-
`echo {{log_entry}} | logger --server {{hostname}} --port {{port}}`
17-
18-
- Use a specific tag for every line logged. Default is the name of logged in user:
19-
20-
`echo {{log_entry}} | logger --tag {{tag}}`
21-
22-
- Log messages with a given priority. Default is `user.notice`. See `man logger` for all priority options:
23-
24-
`echo {{log_entry}} | logger --priority {{user.warning}}`

pages/common/renice.md

+7-11
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,16 @@
33
> Alter the scheduling priority/niceness of running processes.
44
> Niceness values range from -20 (most favorable to the process) to 19 (least favorable to the process).
55
> See also: `nice`.
6-
> More information: <https://manned.org/renice>.
6+
> More information: <https://manned.org/renice.1p>.
77
8-
- Set the absolute priority of a running process:
8+
- Increase/decrease the priority of a running [p]rocess:
99

10-
`renice --priority {{3}} {{[-p|--pid]}} {{pid}}`
10+
`renice -n {{3}} -p {{pid}}`
1111

12-
- Increase the priority of a running process:
12+
- Increase/decrease the priority of all processes owned by a [u]ser:
1313

14-
`sudo renice --relative {{-4}} {{[-p|--pid]}} {{pid}}`
14+
`renice -n {{-4}} -u {{uid|user}}`
1515

16-
- Decrease the priority of all processes owned by a user:
16+
- Increase/decrease the priority of all processes that belong to a process [g]roup:
1717

18-
`renice --relative {{4}} {{[-u|--user]}} {{uid|user}}`
19-
20-
- Set the priority of all processes that belong to a process group:
21-
22-
`sudo renice {{-5}} {{[-g|--pgrp]}} {{process_group}}`
18+
`renice -n {{5}} -g {{process_group}}`

pages/common/whereis.md

-28
This file was deleted.

pages/common/write.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> Write a message on the terminal of a specified logged in user (`<Ctrl c>` to stop writing messages).
44
> Use the `who` command to find out all terminal_ids of all active users active on the system. See also `mesg`.
5-
> More information: <https://manned.org/write>.
5+
> More information: <https://manned.org/write.1p>.
66
77
- Send a message to a given user on a given terminal ID:
88

pages/linux/blkdiscard.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
- Securely discard all blocks on a device, removing all data:
1111

12-
`blkdiscard --secure {{/dev/device}}`
12+
`blkdiscard {{[-s|--secure]}} {{/dev/device}}`
1313

1414
- Discard the first 100 MB of a device:
1515

16-
`blkdiscard --length {{100MB}} {{/dev/device}}`
16+
`blkdiscard {{[-l|--length]}} {{100MB}} {{/dev/device}}`

pages/linux/blkid.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
- List all partitions in a table, including current mountpoints:
1111

12-
`sudo blkid -o list`
12+
`sudo blkid {{[-o|--output]}} list`

pages/linux/cfdisk.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
- Create a new partition table for a specific device and manage it:
1111

12-
`cfdisk --zero {{/dev/sdX}}`
12+
`cfdisk {{[-z|--zero]}} {{/dev/sdX}}`

pages/linux/chcpu.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
66
- Disable one or more CPUs by their IDs:
77

8-
`chcpu -d {{1,3}}`
8+
`chcpu {{[-d|--disable]}} {{1,3}}`
99

1010
- Enable one or more ranges of CPUs by their IDs:
1111

12-
`chcpu -e {{1-3,5-7}}`
12+
`chcpu {{[-e|--enable]}} {{1-3,5-7}}`

pages/linux/choom.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
66
- Display the OOM-killer score of the process with a specific ID:
77

8-
`choom -p {{pid}}`
8+
`choom {{[-p|--pid]}} {{pid}}`
99

1010
- Change the adjust OOM-killer score of a specific process:
1111

12-
`choom -p {{pid}} -n {{-1000..+1000}}`
12+
`choom {{[-p|--pid]}} {{pid}} {{[-n|--adjust]}} {{-1000..+1000}}`
1313

1414
- Run a command with a specific adjust OOM-killer score:
1515

16-
`choom -n {{-1000..+1000}} {{command}} {{argument1 argument2 ...}}`
16+
`choom {{[-n|--adjust]}} {{-1000..+1000}} {{command}} {{argument1 argument2 ...}}`

pages/linux/chrt.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
66
- Display attributes of a process:
77

8-
`chrt --pid {{PID}}`
8+
`chrt {{[-p|--pid]}} {{PID}}`
99

1010
- Display attributes of all threads of a process:
1111

12-
`chrt --all-tasks --pid {{PID}}`
12+
`chrt {{[-a|--all-tasks]}} {{[-p|--pid]}} {{PID}}`
1313

1414
- Display the min/max priority values that can be used with `chrt`:
1515

16-
`chrt --max`
16+
`chrt {{[-m|--max]}}`
1717

1818
- Set the scheduling priority of a process:
1919

20-
`chrt --pid {{priority}} {{PID}}`
20+
`chrt {{[-p|--pid]}} {{priority}} {{PID}}`
2121

2222
- Set the scheduling policy of a process:
2323

24-
`chrt --{{deadline|idle|batch|rr|fifo|other}} --pid {{priority}} {{PID}}`
24+
`chrt --{{deadline|idle|batch|rr|fifo|other}} {{[-p|--pid]}} {{priority}} {{PID}}`
File renamed without changes.

pages/linux/fallocate.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
77
- Reserve a file taking up 700 MiB of disk space:
88

9-
`fallocate --length {{700M}} {{path/to/file}}`
9+
`fallocate {{[-l|--length]}} {{700M}} {{path/to/file}}`
1010

1111
- Shrink an already allocated file by 200 MiB:
1212

13-
`fallocate --collapse-range --length {{200M}} {{path/to/file}}`
13+
`fallocate {{[-c|--collapse-range]}} {{[-l|--length]}} {{200M}} {{path/to/file}}`
1414

1515
- Shrink 20 MB of space after 100 MiB in a file:
1616

17-
`fallocate --collapse-range --offset {{100M}} --length {{20M}} {{path/to/file}}`
17+
`fallocate {{[-c|--collapse-range]}} {{[-o|--offset]}} {{100M}} {{[-l|--length]}} {{20M}} {{path/to/file}}`

pages/linux/findmnt.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717

1818
- Find filesystems in specific type:
1919

20-
`findmnt -t {{ext4}}`
20+
`findmnt {{[-t|--types]}} {{ext4}}`
2121

2222
- Find filesystems with specific label:
2323

2424
`findmnt LABEL={{BigStorage}}`
2525

2626
- Check mount table content in detail and verify `/etc/fstab`:
2727

28-
`findmnt --verify --verbose`
28+
`findmnt {{[-x|--verify]}} --verbose`

pages/common/flock.md pages/linux/flock.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
77
- Run a command with a file lock as soon as the lock is not required by others:
88

9-
`flock {{path/to/lock.lock}} --command "{{command}}"`
9+
`flock {{path/to/lock.lock}} {{[-c|--command]}} "{{command}}"`
1010

1111
- Run a command with a file lock, and exit if the lock doesn't exist:
1212

13-
`flock {{path/to/lock.lock}} --nonblock --command "{{command}}"`
13+
`flock {{path/to/lock.lock}} {{[-n|--nonblock]}} {{[-c|--command]}} "{{command}}"`
1414

1515
- Run a command with a file lock, and exit with a specific error code if the lock doesn't exist:
1616

17-
`flock {{path/to/lock.lock}} --nonblock --conflict-exit-code {{error_code}} -c "{{command}}"`
17+
`flock {{path/to/lock.lock}} {{[-n|--nonblock]}} {{[-E|--conflict-exit-code]}} {{error_code}} {{[-c|--command]}} "{{command}}"`

pages/linux/fstrim.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
77
- Trim unused blocks on all mounted partitions that support it:
88

9-
`sudo fstrim --all`
9+
`sudo fstrim {{[-a|--all]}}`
1010

1111
- Trim unused blocks on a specified partition:
1212

1313
`sudo fstrim {{/}}`
1414

1515
- Display statistics after trimming:
1616

17-
`sudo fstrim --verbose {{/}}`
17+
`sudo fstrim {{[-v|--verbose]}} {{/}}`

pages/common/hexdump.md pages/linux/hexdump.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
- Display the input offset in hexadecimal and its ASCII representation in two columns:
1111

12-
`hexdump -C {{path/to/file}}`
12+
`hexdump {{[-C|--canonical]}} {{path/to/file}}`
1313

1414
- Display the hexadecimal representation of a file, but interpret only n bytes of the input:
1515

16-
`hexdump -C -n{{number_of_bytes}} {{path/to/file}}`
16+
`hexdump {{[-C|--canonical]}} {{[-n|--length]}} {{number_of_bytes}} {{path/to/file}}`
1717

1818
- Don't replace duplicate lines with '*':
1919

20-
`hexdump --no-squeezing {{path/to/file}}`
20+
`hexdump {{[-v|--no-squeezing]}} {{path/to/file}}`

pages/linux/hwclock.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
- Write the current software clock time to the hardware clock (sometimes used during system setup):
1111

12-
`hwclock --systohc`
12+
`hwclock {{[-w|--systohc]}}`
1313

1414
- Write the current hardware clock time to the software clock:
1515

16-
`hwclock --hctosys`
16+
`hwclock {{[-s|--hctosys]}}`

pages/linux/ipcrm.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@
55
66
- Delete a shared memory segment by ID:
77

8-
`ipcrm --shmem-id {{shmem_id}}`
8+
`ipcrm {{[-m|--shmem-id]}} {{shmem_id}}`
99

1010
- Delete a shared memory segment by key:
1111

12-
`ipcrm --shmem-key {{shmem_key}}`
12+
`ipcrm {{[-M|--shmem-key]}} {{shmem_key}}`
1313

1414
- Delete an IPC queue by ID:
1515

16-
`ipcrm --queue-id {{ipc_queue_id}}`
16+
`ipcrm {{[-q|--queue-id]}} {{ipc_queue_id}}`
1717

1818
- Delete an IPC queue by key:
1919

20-
`ipcrm --queue-key {{ipc_queue_key}}`
20+
`ipcrm {{[-Q|--queue-key]}} {{ipc_queue_key}}`
2121

2222
- Delete a semaphore by ID:
2323

24-
`ipcrm --semaphore-id {{semaphore_id}}`
24+
`ipcrm {{[-s|--semaphore-id]}} {{semaphore_id}}`
2525

2626
- Delete a semaphore by key:
2727

28-
`ipcrm --semaphore-key {{semaphore_key}}`
28+
`ipcrm {{[-S|--semaphore-key]}} {{semaphore_key}}`
2929

3030
- Delete all IPC resources:
3131

32-
`ipcrm --all`
32+
`ipcrm {{[-a|--all]}}`

pages/linux/isosize.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
- Display the block count and block size of an ISO file:
1111

12-
`isosize --sectors {{path/to/file.iso}}`
12+
`isosize {{[-x|--sectors]}} {{path/to/file.iso}}`
1313

1414
- Display the size of an ISO file divided by a given number (only usable when --sectors is not given):
1515

16-
`isosize --divisor={{number}} {{path/to/file.iso}}`
16+
`isosize {{[-d|--divisor]}} {{number}} {{path/to/file.iso}}`
File renamed without changes.

pages/linux/lastb.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99

1010
- List all last logged in users since a given time:
1111

12-
`sudo lastb --since {{YYYY-MM-DD}}`
12+
`sudo lastb {{[-s|--since]}} {{YYYY-MM-DD}}`
1313

1414
- List all last logged in users until a given time:
1515

16-
`sudo lastb --until {{YYYY-MM-DD}}`
16+
`sudo lastb {{[-t|--until]}} {{YYYY-MM-DD}}`
1717

1818
- List all logged in users at a specific time:
1919

20-
`sudo lastb --present {{hh:mm}}`
20+
`sudo lastb {{[-p|--present]}} {{hh:mm}}`
2121

2222
- List all last logged in users and translate the IP into a hostname:
2323

24-
`sudo lastb --dns`
24+
`sudo lastb {{[-d|--dns]}}`

pages/linux/logger.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# logger
2+
3+
> Add messages to syslog (/var/log/syslog).
4+
> More information: <https://manned.org/logger>.
5+
6+
- Log a message to syslog:
7+
8+
`logger {{message}}`
9+
10+
- Take input from `stdin` and log to syslog:
11+
12+
`echo {{log_entry}} | logger`
13+
14+
- Send the output to a remote syslog server running at a given port. Default port is 514:
15+
16+
`echo {{log_entry}} | logger {{[-n|--server]}} {{hostname}} {{[-P|--port]}} {{port}}`
17+
18+
- Use a specific tag for every line logged. Default is the name of logged in user:
19+
20+
`echo {{log_entry}} | logger {{[-t|--tag]}} {{tag}}`
21+
22+
- Log messages with a given priority. Default is `user.notice`. See `man logger` for all priority options:
23+
24+
`echo {{log_entry}} | logger {{[-p|--priority]}} {{user.warning}}`

pages/linux/losetup.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@
55
66
- List loop devices with detailed info:
77

8-
`losetup -a`
8+
`losetup {{[-a|--all]}}`
99

1010
- Attach a file to a given loop device:
1111

1212
`sudo losetup {{/dev/loop}} /{{path/to/file}}`
1313

1414
- Attach a file to a new free loop device and scan the device for partitions:
1515

16-
`sudo losetup --show --partscan -f /{{path/to/file}}`
16+
`sudo losetup --show {{[-P|--partscan]}} {{[-f|--find]}} /{{path/to/file}}`
1717

1818
- Attach a file to a read-only loop device:
1919

20-
`sudo losetup --read-only {{/dev/loop}} /{{path/to/file}}`
20+
`sudo losetup {{[-r|--read-only]}} {{/dev/loop}} /{{path/to/file}}`
2121

2222
- Detach all loop devices:
2323

24-
`sudo losetup -D`
24+
`sudo losetup {{[-D|--detach-all]}}`
2525

2626
- Detach a given loop device:
2727

28-
`sudo losetup -d {{/dev/loop}}`
28+
`sudo losetup {{[-d|--detach]}} {{/dev/loop}}`

0 commit comments

Comments
 (0)