Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [util-linux]

A suite of essential system utilities for Linux.

Filter by
Sorted by
Tagged with
-1 votes
2 answers
104 views

runuser: execute commands without use of quotation marks?

Overview I'm attempting to execute commands as a different user without using quotation marks as well as making sure the executed command isn't inheriting environment from the parent shell. runuser ...
GrabbenD's user avatar
  • 144
1 vote
2 answers
80 views

New "more" command form feeds before every file: how to suppress?

For 35 years I've been watching the more command work like this: when specifying multiple files, and without any options, it displays a header and the file contents as follows (most easily seen for ...
rphair's user avatar
  • 53
2 votes
3 answers
2k views

Could you suggest how to use `rename.ul` under Ubuntu 22.04 ? Many thanks?

Could you suggest how to use rename.ul under Ubuntu 22.04 ? Many thanks ! Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.10.102.1-microsoft-standard-WSL2 x86_64) * Documentation: https://...
SOUser's user avatar
  • 329
3 votes
3 answers
352 views

How to know if `script` command (which records terminal sessions as typescript) is already runing?

This SO answer says that script adds the variable SCRIPT to the environment of the command it runs. I tried that but it doesn't seem to be working now. This is what I have tried ma08@IWeighHar:~/pro$ ...
ma08's user avatar
  • 855
2 votes
2 answers
2k views

`column` from `util-linux` and not from `bsdmainutils`

column is available in packages util-linux and bsdmainutils. Both these packages are installed in Linux Mint 20.2 $ type column column is /usr/bin/column column is /bin/column Both these column are ...
Porcupine's user avatar
  • 2,056
2 votes
1 answer
587 views

More / file reporting "not a text file" file which contains only one letter and newline

I am confused by the output of the more program under linux. When creating a file which contains only a single letter (except for special letters like ä which work fine), more does not report the file'...
mutableVoid's user avatar
0 votes
2 answers
148 views

Does logger(1) command belong to util-linux? [duplicate]

Does logger(1) command belong to util-linux? it is not shown in https://manpages.debian.org/testing/util-linux/index.html, but in https://manpages.debian.org/testing/bsdutils/logger.1.en.html.
Ben's user avatar
  • 111
0 votes
1 answer
423 views

blkdiscard hangs on md raid 10 on PCIe SSDs

I have a running Linux 4.19 amd64 system with two PCIe SSDs that I'd like to clear, test, reformat and put in use again. All of the data has already been moved away. I've tried to trim/discard blocks ...
Zrin's user avatar
  • 341
2 votes
2 answers
109 views

How to recover from replacing all characters in my filenames 1:1 with whitespaces?

$ rename 's/./ /g' * $ ls -l total 6832616 -rw-r--r-- 1 jboo jboo 0 Sep 28 01:44 -rw-r--r-- 1 jboo jboo 43361681 Sep 28 01:44 -rw-r--r-- 1 jboo jboo 47499946 Sep 28 01:44 -rw-r--r-- 1 jboo ...
A H's user avatar
  • 183
2 votes
1 answer
192 views

How is the output of `losetup --list` sorted?

When I run losetup --list (or just losetup) to get a list of the loopback devices on my system, the output doesn't seem to be in any meaningful order: 0 $ losetup --list NAME SIZELIMIT OFFSET ...
ash's user avatar
  • 680
2 votes
1 answer
344 views

util-linux look with german umlauts

I am currently having problems with util-linux's look in combination with German umlauts (ä, ö, ü). For testing purposes I set LC_ALL=de_DE.UTF-8. Consider german.dic: Aachen Rindfleisch in UTF-8 ...
writzlpfrimpft's user avatar
4 votes
1 answer
2k views

Is it normal for tune2fs default mount options to not appear in mount output?

I have an SSD with 2 partitions formatted with ext4. On the second partition, I enabled discard as a default option at the filesystem level with this command: $ sudo tune2fs -o discard /dev/sda2 ...
JoL's user avatar
  • 4,805
0 votes
2 answers
268 views

Renaming symlinks, using regex with boolean "|" on Linux

I have three icons: notte (not a symlink), astronomy (symlink) and gnome-astronomy (symlink). ls -l astronomy.svg -> celestia.svg gnome-astronomy.svg -> konquest.svg notte.svg I want to ...
Oo'-'s user avatar
  • 243
1 vote
1 answer
370 views

Installing newer version of lsblk to RHEL

I am trying to install newer version of lsblk to Red Hat Enterprise Linux Server 7.6. I have installed util-linux on my system in version util-linux.x86_64-2.23.2-59.el7_6.1 but due to a compatibility ...
Martin's user avatar
  • 11
2 votes
1 answer
1k views

Why does switch_root delete all the files in the initramfs?

WARNING: switch_root removes recursively all files and directories on the current root filesystem. -- man switch_root from util-linux, version 2.32-2.fc28.x86_64 Why?
sourcejedi's user avatar
  • 51.1k
0 votes
2 answers
808 views

prevent bind mount on login if mounted

At login, a bind mount is created. In ~/.pam_mount.conf.xml: <volume options="bind" user="phg" mountpoint="/nix" path="/store/nix" /> This needs to be done only once per boot. Note that I do ...
phg's user avatar
  • 1,827
18 votes
1 answer
6k views

Why is lazy MNT_DETACH or `umount -l` unsafe / dangerous?

I've read in a few places that umount -l is unsafe: In an answer by @cas: don't use umount's --lazy option if you care about when the external drive can be safely unplugged A comment by @...
Tom Hale's user avatar
  • 31.3k
0 votes
1 answer
151 views

Submit bug report for util-linux

How / where do I submit a bug report for util-linux? Specifically I want to submit a bug for losetup which exits 0 but doesn't actually remove a device under some cirsumstances with the -d flag.
Tom Hale's user avatar
  • 31.3k
2 votes
2 answers
696 views

Remote discovery of hostname and IP address

In my environment there are about 1000 production servers. Direct root login is disabled on all servers. There is one user "abc" which has sudo access. We login to each computer using "abc" and then ...
Ankush kalra's user avatar
0 votes
1 answer
364 views

Where is struct blkid_struct_dev defined?

blkid.h typedefs as follows: typedef struct blkid_struct_dev *blkid_dev; That is the only appearance of the token blkid_struct_dev in blkid.h. grep -rl blkid_struct_dev /usr/include returns only /...
Bandrami's user avatar
  • 850
2 votes
3 answers
2k views

Why does util-linux runuser (su) fork?

Using runuser from util-linux (a different entry point for su, which only operates if starting from root), one sees a process tree that looks something like the following: [root] runuser -u username ...
Charles Duffy's user avatar
2 votes
1 answer
393 views

How does 'whereis' find files so quickly? [duplicate]

I was recently trying to find a binary file with a certain name. I decided to use the whereis search utility (part of the util-linux package). This managed to find the file in half the time than ...
Matt Brown's user avatar
6 votes
1 answer
2k views

Why and when does `lsblk` require `sudo`?

On my up-to-date Arch Linux, lsblk works fine without sudo: $ lsblk -o NAME,FSTYPE NAME FSTYPE sda ├─sda1 ext4 ├─sda2 ext4 ├─sda3 swap ├─sda4 └─sda5 ext4 sr0 $ lsblk --version lsblk ...
muru's user avatar
  • 74.3k
2 votes
1 answer
798 views

lsblk does not return the entire line for the results [closed]

I am having trouble with the command below: ssh -q -o PubkeyAuthentication=yes -o StrictHostKeyChecking=no -o ConnectTimeout=2 -o BatchMode=yes SERVERNAME "lsblk -il" 2>/dev/nul It returns the ...
Shane Barrett's user avatar
4 votes
1 answer
28k views

Ubuntu runuser command?

I am creating a bash script that requires to run commands as a specific user. As a result I am using the command: runuser I have tested this script and it works perfectly in Ubuntu Server 14.10. ...
user3024130's user avatar
3 votes
1 answer
2k views

Set environment inside `nsenter /bin/bash`

I'm entering a namespace with nsenter -m -u -i -n -p -t $PID /bin/bash. However, printenv inside this namespace doesn't have everything I need. I'd like to send these variables in, but I'd like to ...
Dane O'Connor's user avatar
1 vote
2 answers
920 views

Linux why does yum say up-to-date when newer versions available?

I am trying to install an up-to-date version (2.19) of util-linux to get lsblk but yum doesn't find it: [Harry@SN031568820668 ~]$ sudo yum install util-linux Loaded plugins: presto, refresh-...
Harry Weston's user avatar
  • 1,329
6 votes
1 answer
5k views

Is there a command to switch to into an existing namespace?

I am using multiple UTS namespaces, each of them has some servers constantly running. I can get the namespace IDs via readlink /proc/<pid>/ns/uts, now I would like to change into a given ...
replay's user avatar
  • 8,623
7 votes
2 answers
37k views

Trouble getting busybox switch_root to work

I'm working on an embedded ARM Linux system that boots using initramfs. (Here's some background from a couple earlier questions, if you're interested.) So far, thanks in part to help received here, I ...
pingswept's user avatar
  • 1,115
11 votes
1 answer
2k views

How to use the ul command line utility

I wanted to answer Use _roff to underline words with "just use ul, this command is meant specifically for underlining text", however I just can't grasp how to use it. I thought $ echo "hello _kitty_ ...
fschmitt's user avatar
  • 8,840