lsblk -finstead. It does not need sudo.
or put it in a script that enters a password. I would say get used to securely using root. just a suggestion.. . . I would not, in any case, recommend removing sudo requirements to a program that is deemed to require it by the distro makers. You may open up security vulnerabilities by doing things like this.
The simplest way of having a user run the command: blkid, is to use the full path to the executable thus:how to change the right of blkid to be run by all user not only as sudo ?
i need it in a script
[[email protected] ~]$ blkid bash: blkid: command not found [[email protected] ~]$ /sbin/blkid /dev/sda4: UUID="e61bdb54-dc84-403d-bcc3-7615a2e65d33" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="53a851dc-d942-4935-89d0-267519b34363" /dev/sda2: UUID="4cb91113-2989-44cb-9d2d-9888fa140e55" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="6ae0a73d-c3e7-4ed1-94ac-82f14183ad28" /dev/sda3: UUID="a815d92a-29ef-4c49-9e8d-1a79d3513987" TYPE="swap" PARTUUID="63a839e4-ec39-433c-b15b-58e0393fcafe" /dev/sda1: UUID="A926-84F6" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="618562c3-5a87-4f69-b89a-4dc5d1297ec6"
[[email protected] ~]$ iftop bash: iftop: command not found [[email protected] ~]$ /sbin/iftop interface: wlxd037458000c8 IP address is: 192.168.0.14 IPv6 address is: 2001:8003:c436:f401:d237:45ff:fe80:c8 MAC address is: d0:37:45:80:00:c8 pcap_open_live(wlxd037458000c8): wlxd037458000c8: You don't have permission to capture on that device (socket: Operation not permitted)
This doesn't work on Fedora 35. Nor does /usr/sbin/blkid. All produce no output and no error. Fedora may be odd in this regard, if not unique. I don't know. What does work on Fedora is to run sudo blkid one time first, then just blkid alone without sudo will work, and /sbin/blkid and /usr/sbin/blkid also work. After rebooting, sudo is required again./sbin/blkid
It seems that df -h shows different stuff than lsblk -f which simply displays your current devices, their UUID, label and how much space is free on them. Whereas df -h displays something about I-nodes - things I know nothing about.