Questions tagged [util-linux]

A suite of essential system utilities for Linux.

Filter by
Sorted by
Tagged with
1 vote
2 answers
59 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
2 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
226 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
1 vote
2 answers
1k 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
  • 1,802
2 votes
1 answer
495 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
127 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
340 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
100 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
160 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
  • 671
2 votes
1 answer
324 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
1k 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,590
0 votes
2 answers
258 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
326 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
  • 49.3k
0 votes
2 answers
724 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,782
17 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
  • 29.5k
0 votes
1 answer
145 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
  • 29.5k
2 votes
2 answers
671 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
356 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
1k 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
373 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
5 votes
1 answer
1k 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
  • 71.3k
2 votes
1 answer
752 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
27k 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
902 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,319
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,503
7 votes
2 answers
36k 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,105
9 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,750