Commit graph

206 commits

Author SHA1 Message Date
Thomas Weißschuh
eb8bf48d60 blockdev: add --getdiskseq to bash completion
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-04-26 09:09:09 +02:00
Christian Hesse
7c6e8709f8 add waitpid in bash-completion/Makemodule.am 2023-04-19 15:05:00 +02:00
Christian Hesse
526644982f add fadvise in bash-completion/Makemodule.am 2023-04-19 14:57:31 +02:00
Thomas Weißschuh
97bb98effd nsenter: use explicit argument to follow target PID/GID
Making the argument to -S and -G optional in #2092 broke the cli
compatability.
So replace it with an explicit "follow" argument that provides the new
functionality with a compatible interface.

Fixes #2143
2023-04-03 18:44:15 +00:00
Karel Zak
7dcb35dd17 Merge branch 'waitpid/count' of https://github.com/t-8ch/util-linux
* 'waitpid/count' of https://github.com/t-8ch/util-linux:
  waitpid: allow to only wait for a specific number of process exits
2023-03-03 13:01:18 +01:00
Thomas Weißschuh
f0e793a3d9 waitpid: allow to only wait for a specific number of process exits
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-03-02 22:12:37 +00:00
u2386
4e9ec856a1 nsenter: add --env for allowing environment variables inheritance
This commit adds support for the -e or --env option in nsenter, allowing a new process to inherit the environment va

If the option is not given, the environment variables will stay the same as in the current namespace.

Example:
    Setup the namespace:
        $ docker run -d -e PROJECT='util linux' --rm alpine sleep 10000
        cb0b69aa7aec
        $ docker inspect --format '{{ .State.Pid }}' cb0b69aa7aec
        470012

    Enter the namespace:
        $ nsenter --all -t 470012 --env env
        PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        HOSTNAME=cb0b69aa7aec
        PROJECT=util linux
        HOME=/root

Reviewed-by: Thomas Weißschuh <thomas@t-8ch.de>
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: u2386 <hugo.cavan2386@gmail.com>
2023-03-02 16:24:05 +00:00
Karel Zak
d9b022bd26 whereis: add glob(7) support (new option -g)
$ whereis -b -g 'find???'
find???: /usr/bin/findmnt /usr/bin/findscu

Fixes: https://github.com/util-linux/util-linux/issues/2021
Signed-off-by: Karel Zak <kzak@redhat.com>
2023-01-25 14:30:36 +01:00
Karel Zak
b233ae61db fstrim: add --types to filter out by filesystem types
Fixes: https://github.com/util-linux/util-linux/issues/2040
Signed-off-by: Karel Zak <kzak@redhat.com>
2023-01-24 19:03:15 +01:00
Karel Zak
a5a9b54429 swapon: add --fstab command line option
Let's add --fstab mount option for compatibility with mount(8).

Addresses: https://github.com/util-linux/util-linux/issues/2017
Signed-off-by: Karel Zak <kzak@redhat.com>
2023-01-16 13:47:36 +01:00
Thomas Weißschuh
9d4028ff86 waitpid: adapt bash-completion for current functionality 2023-01-09 13:16:30 +00:00
Thomas Weißschuh
550d32c49e waitpid: add new command
This command implements waiting for the exit of multiple processes.
Especially it allows to wait for process that are not children of the
current process.

In contrast to wait(1P) it does not allow to retrieve the processes exit
codes.
2023-01-04 01:18:33 +00:00
Thomas Weißschuh
d883f868a8 umount: properly handle special characters in completion
Fixes #1834
2022-12-27 03:22:23 +00:00
Karel Zak
85a956a709 hardlink: cleanup options
* add missing stuff to bash-completion
* reorder --help output
* reorder man page

Signed-off-by: Karel Zak <kzak@redhat.com>
2022-12-08 11:12:47 +01:00
Karel Zak
21a73da6c6 bash-completion: add blkdiscard --quiet
Signed-off-by: Karel Zak <kzak@redhat.com>
2022-12-07 11:13:48 +01:00
Karel Zak
1325de1756 rename: (bash-completion) fix typo
Fixes: https://github.com/util-linux/util-linux/issues/1928
Signed-off-by: Karel Zak <kzak@redhat.com>
2022-11-28 09:47:18 +01:00
Karel Zak
1e6393de06 bash-completion: add --zero to rev module
Addresses: https://github.com/util-linux/util-linux/pull/1900
Signed-off-by: Karel Zak <kzak@redhat.com>
2022-11-16 08:48:43 +01:00
Daniel Peukert
3383356263
rfkill: add toggle to bash completion
Signed-off-by: Daniel Peukert <daniel@peukert.cc>
2022-11-08 19:48:08 +01:00
Karel Zak
86938d0633 bash-completion: update lsns
Signed-off-by: Karel Zak <kzak@redhat.com>
2022-11-08 10:11:57 +01:00
Masatake YAMATO
84b63b62f0 fadvise: add bash-completion script
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
2022-10-06 03:05:07 +09:00
zhenwei pi
3b26273394 lsblk: introduce 'MQ' column
Typically a modern block device supports mutil queues feature, count
queues by walking '$sysfs/mq' directory. If no '$sysfs/mq' exists, it
is a legacy single queue.

~# lsblk --nvme -o NAME,TYPE,MODEL,TRAN,RQ-SIZE,MQ
NAME    TYPE MODEL                      TRAN   RQ-SIZE  MQ
nvme0n1 disk INTEL SSDPF2KX038TZ        nvme      1023 135
nvme3n1 disk INTEL SSDPE2KX020T8        nvme      1023 128
nvme1n1 disk SAMSUNG MZQL23T8HCLS-00A07 nvme      1023 129
nvme2n2 disk RP2A03T8RK004LX            nvme      1023  64
nvme2n3 disk RP2A03T8RK004LX            nvme      1023  64

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2022-06-06 12:31:56 +02:00
zhenwei pi
1b3e8f5d2c lsblk: add -v/--virtio
Add -v/--virtio to filter the virtio block devices.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2022-06-06 12:31:56 +02:00
zhenwei pi
97afabf71b lsblk: add -N/--nvme
Add -N/--nvme to filter NVMe device only, NVMe usually has a larger
I/O depth, also show COL_RQ_SIZE by default.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2022-06-06 12:31:56 +02:00
Karel Zak
6be39224f3 column: add --table-maxout
Add option to fill all available space.

Fizes: https://github.com/util-linux/util-linux/issues/1700
Signed-off-by: Karel Zak <kzak@redhat.com>
2022-06-06 11:45:07 +02:00
Nathan Sharp
80af57ed9e pipesz: add bash-completion script
Signed-off-by: Nathan Sharp <nwsharp@live.com>
2022-05-18 10:35:34 +02:00
zhenwei pi
4b2fadb1bc irqtop: support -C/--cpu-list
Specify cpus list format to show by -C/--cpu-list parameters, for
example, on an AMD server with 192 CPUs, to show statistics on NUMA
node 1:
  ~# ./irqtop -d 1 -C 48-95,144-191

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
2022-04-01 10:21:31 +02:00
Bastian Krause
b22b78b1be hwclock: add --param-set option
Implement the RTC_PARAM_SET RTC ioctl in hwclock. The ioctl interface was
introduced with [1], which went mainline in Kernel v5.16. The parameters
are independent of hardware/driver. This means we can read and set
parameters in a generic way.

The new --param-set hwclock function accepts aliases for parameters
currently existent (Kernel v5.16). They can be extended later on. As
fallback and for values, hexadecimal (if prefixed with 0x) and decimal
values, as defined in [2], are accepted.

Example:

  $ hwclock --param-set bsm=0x0

[1] https://lore.kernel.org/all/20211018151933.76865-1-alexandre.belloni@bootlin.com/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/rtc.h

Signed-off-by: Bastian Krause <bst@pengutronix.de>
2022-01-28 11:37:47 +01:00
Bastian Krause
6097b12df7 hwclock: add --param-get option
Implement the RTC_PARAM_GET RTC ioctl in hwclock. The ioctl interface was
introduced with [1], which went mainline in Kernel v5.16. The parameters
are independent of hardware/driver. This means we can read and set
parameters in a generic way.

The new --param-get hwclock function accepts aliases for parameters
currently existent (Kernel v5.16). They can be extended later on. As
fallback, hexadecimal (if prefixed with 0x) and decimal values, as
defined in [2], are accepted.

Example:

  $ hwclock --param-get features

[1] https://lore.kernel.org/all/20211018151933.76865-1-alexandre.belloni@bootlin.com/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/rtc.h

Signed-off-by: Bastian Krause <bst@pengutronix.de>
2022-01-28 11:37:47 +01:00
Karel Zak
c18ed0a6e6 build-sys: install lastb bash-completion
Signed-off-by: Karel Zak <kzak@redhat.com>
2022-01-04 12:05:58 +01:00
Karel Zak
c4762c436b sfdisk add --backup-pt-sectors
The current option --backup is usable only when used with others sfdisk
commands. The new command --backup-pt-sectors create backup and exit.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-12-09 12:07:16 +01:00
Karel Zak
0cbb001a1e nsenter: add --wdns to change working directory
The current --wd=<dir> changes CWD to the path which is opened
*before* nsenter calls setns(). It may be useful if you want to use in
namespace something from your current namespace.  In this case, the
option --wd works like a "tunnel" between namespaces.

For some other use-cases, this is useless and you want to be sure that
CWD always points to the target namespace. For this purpose this patch
implements --wdns <dir>.

Example:

 Setup the namespaces:

  # unshare --mount
  # mount /dev/sdc /mnt/A
  # touch /mnt/A/fooooo
  # echo $$
  2425872

 Enter the namespace from another session:

  # nsenter --all --target 2425872 --wd=/mnt/A ls -a
  .  ..

  # nsenter --all --target 2425872 --wdns=/mnt/A ls -a
  .  ..  fooooo  lost+found

Fixes: https://github.com/util-linux/util-linux/issues/1500
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-11-22 13:18:54 +01:00
Karel Zak
d1732bba38 bash-completion: fix irqtop
Forgot update the option as introduced by commit
17f7caa451.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-11-10 10:56:02 +01:00
zhenwei pi
17f7caa451 irqtop: add -c/--cpu-stat option
Since a23aecc1bf("irqtop: add per-cpu stats"), irqtop always shows
per-cpu stats. Test on a modern AMD server with 2 socket(256 CPU),
irqtop shows messy output with too many columns.

In this patch, add -c/--cpu-stat option to enable/disable per-cpu stats.
And 'auto' option auto-detect window size, only show per-cpu stats
if the length of per-cpu stats is shorter than the width of window.

[kzak@redhat.com: - shorten the commit message
                  - rename --cpu to --cpu-stat
                  - use scols_table_enable_nowrap() rather than trim in irqtop.c
                  - reduce --help for the new option]

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-11-10 10:35:50 +01:00
Karel Zak
b1c137a948 bash-completion: add --json to dmesg
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-11-10 09:31:53 +01:00
Karel Zak
059811d096 su: (bash-completion) offer usernames rather than files
Fixes: https://github.com/karelzak/util-linux/issues/1424
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-08-31 12:51:40 +02:00
Naohiro Aota
ca5f4bd0d6 lsblk: add columns of zoned parameters
Several parameters for zoned devices are missing from lsblk's columns. This
commit introduces them as following.

 ZONE-SZ     zone size
 ZONE-WGRAN  zone write granularity
 ZONE-APP    zone append max bytes
 ZONE-NR     number of zones
 ZONE-OMAX   maximum number of open zones
 ZONE-AMAX   maximum number of active zones

Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
2021-08-31 10:24:20 +02:00
Karel Zak
5a72054bd0 mount: add -m,--mkdir as shortcut for X-mount.mkdir
Suggested-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-08-12 13:51:57 +02:00
Smitty
e091d5b7b1 whereis: use commands for Bash completions
Currently, the Bash completions for `whereis <TAB>` gives
`whereis file` ("file" is not a placeholder here, it literally expands
to that). This fixes that by passing the `-c` flag to `compgen` to
request completions for command names.

Signed-off-by: Smitty van Bodegom <me@smitop.com>
2021-08-08 18:04:30 -04:00
Todd Lewis
a2b23d3a91 rename: add --all and --last parameters
Renaming files with rename often involves multiple passes in order
to, say, replace all spaces with underscores because traditionally
rename only replaces the first occurrence of the expression. The
--all parameter makes this task simple.

With the addition of --last, rename becomes much safer to use when
replacing file extensions, whereas before it would mangle a file
which had its extension also embedded elsewhere in its name.

The implied --first, together with --all and --last, round out the
common cases for renaming files.
2021-07-15 00:15:55 -04:00
Karel Zak
ab2eea4ac3 build-sys: install hardlink bash-completion
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-06-02 11:14:36 +02:00
Ville Skyttä
ca59e01e39 bash-completion: (lsblk) fix -E/-M arg (non-)completion
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
2021-04-16 22:08:48 +03:00
Luca Boccassi
e18f057b56 Automake: install uuidgen bash completion only if it is built
Check for BUILD_UUIDGEN instead of BUILD_LIBUUID
2021-03-15 12:26:27 +00:00
Qais Yousef
860112cb21 uclampset: Plumb in bash-completion
Signed-off-by: Qais Yousef <qais.yousef@arm.com>
2021-02-02 10:56:26 +00:00
Dmitriy Chestnykh
0d182490e3 cfdisk: Implemented cfdisk's opening in read-only mode
[kzak@redhat.com: - clean up the patch
                  - add note "Changes will remain in memory only."]

Addresses: https://github.com/karelzak/util-linux/issues/1209
Addresses: https://github.com/karelzak/util-linux/pull/1213
Signed-off-by: Karel Zak <kzak@redhat.com>
2021-01-04 12:17:57 +01:00
Karel Zak
732d75945e dmesg: add --since and --until
$ date
Wed 21 Oct 2020 12:05:07 PM CEST

$ dmesg --ctime --since '1 hour ago'
[Wed Oct 21 11:47:13 2020] AAA
[Wed Oct 21 11:55:48 2020] BBB

$ dmesg --ctime --since '1 hour ago' --until '10 minutes ago'
[Wed Oct 21 11:47:13 2020] AAA

Addresses: https://github.com/karelzak/util-linux/issues/1166
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-21 12:09:18 +02:00
Karel Zak
a83bea2d3d bash-completion: (lsblk) update columns
and fix lsblk --help output

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-12 13:19:35 +02:00
Karel Zak
7636d906ef lsblk: add --width option
Addresses: https://github.com/karelzak/util-linux/issues/1160
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-10-12 12:19:48 +02:00
Lennard Hofmann
f01e54d7a1 column: Deprecate --table-empty-lines in favor of --keep-empty-lines
`--table-empty-lines` gives the false impression that the option
only applies to table mode.

Signed-off-by: Lennard Hofmann <lennard.hofmann@web.de>
2020-09-29 12:38:18 +02:00
Karel Zak
701f0385a0 mkswap: add --verbose, reduce extents check output
We do not need to provide details in the default output. It seems
better to hide it behind --verbose to be user-friendly.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-09-10 12:54:14 +02:00
Karel Zak
d3f21dca1e bash-completion: add column --table-columns-limit
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-08-25 14:23:28 +02:00