Skip to main content
14 votes

Why hard link doesn't corrupt if we remove the original file?

You seem to misunderstand what a hardlink and a file is in Unix. The basis of a Unix filesystem are files. A file is an unstructured anonymous bytestream. A file does not have a name. It only has a ...
Jörg W Mittag's user avatar
10 votes
Accepted

Why hard link doesn't corrupt if we remove the original file?

It is because hardlinks are essentially references to the same file, and there's no "original" file in terms of hardlinks. They point to same data structure on the disk (the inode that ...
Danila Vershinin's user avatar
8 votes

I want to copy files that do not have a number in their name

With zsh: set -o extendedglob cp -- ^*<->*(D^/) /path/to/destination/ Or cp -- ^*[0-9]*(D^/) destination/, <-> matching any sequence of one or more ASCII decimal digits (a form of <x-y&...
Stéphane Chazelas's user avatar
6 votes
Accepted

difference NFS proto and mountproto

In older NFS versions (v2 and v3) there are two distinct RPC services handled by separate software: the "MOUNT" protocol that's used only to obtain the initial filesystem handles from rpc....
u1686_grawity's user avatar
6 votes
Accepted

How to specify dynamic "Environment" variables in a systemd unit file?

Most common methods: Use an EnvironmentFile= that is generated on the fly, e.g. via ExecStartPre= that calls a simple script. Current systemd versions will re-read EnvironmentFile before each exec to ...
u1686_grawity's user avatar
5 votes
Accepted

Turn off 'gather_facts' from 'ansible.cfg' or inventory file

From ansible.cfg: # plays will gather facts by default, which contain information about # the remote system. # # smart - gather by default, but don't regather if already gathered # implicit - gather ...
tink's user avatar
  • 6,784
5 votes
Accepted

RHAOS packages on RHEL

RHAOS refers to Red Hat Atomic OpenShift. Those packages are specifically designed for use on OpenShift nodes. While they may work on regular RHEL nodes, it is recommended to use regular RHEL packages ...
Stephen Kitt's user avatar
5 votes

Add a tab to the beginning of lines stored in a variable

% str=$'foo\nbar\ndoo\n' % printf "%s" "$str" |sed -e $'s/^/\t/' foo bar doo (If you're not going to do anything else with the list, just do unzip | sed directly ...
ilkkachu's user avatar
  • 139k
4 votes
Accepted

Is it possible to install an RPM in a RPM?

In short, no. The problem (at it's most basic) is that the RPM database is open during all phases of installation, so when you try to install the second package, it tries to open (for exclusive access)...
John's user avatar
  • 17k
4 votes

Why hard link doesn't corrupt if we remove the original file?

On Linux, what uniquely identifies a file filesystem-wide is the inode number. This is nothing more that a numeric ID, guaranteed to be unique one the entire filesystem (note: inodes can be recycled, ...
shodanshok's user avatar
4 votes
Accepted

ssh prompts for password when providing non-default key

The SSH passphrase protects the secret key. To use the secret key, either directly with ssh or when loading it into an SSH agent, you must unlock it by providing the passphrase you used when creating ...
Kusalananda's user avatar
  • 335k
3 votes
Accepted

How to boot ISO from RHEL 8 VM?

Make sure the VM configuration includes a virtual CD/DVD drive; stop the VM for reconfiguration if necessary. Then tell the virtual drive to use the .ISO file as a virtual disc. Then change the VM's ...
telcoM's user avatar
  • 97.2k
3 votes
Accepted

Multipath Duplicate Drives

sdc1, sdd1, sde1, sdf1 are paths to storage device, known as LUN, for a single LUN, you can have many of them (usualy 2 or 4, sometime 8, depending on SAN configuration).(*) mpathb and san69 are "...
Archemar's user avatar
  • 31.6k
3 votes
Accepted

Is there a way to check the ports that are open in firewalld without sudo?

visudo To check open ports with firewalld this requires administrative privileges sudo. It's not a very clean way, but you can edit the sudoers file with: sudo visudo Add this and replace USER with ...
Z0OM's user avatar
  • 3,159
3 votes

How to detect new hard disk attached without rebooting?

How about this : To scan for new disks : echo "- - -" | sudo tee /sys/class/scsi_host/host*/scan >/dev/null To rescan existing disks : echo 1 | sudo tee /sys/class/block/sd?/device/...
SebMa's user avatar
  • 2,189
3 votes

How to shrink /home

If you have enough free space, the risk is low, but you should have backups anyway. The guide you found separates the file system and volume resize operations, which is unnecessary and makes the ...
Stephen Kitt's user avatar
3 votes

I want to copy files that do not have a number in their name

A POSIX approach could be to save off the files that do contain a character sorting between 0 and 9 (with [0-9]; or decimal digit with [[:digit:]] or only the 0123456789 ones with [0123456789]), copy ...
Chris Davies's user avatar
3 votes

selinux context for ExecStart of custom systemd service

Do I need to make a customservice_exec_t type context? If so, how? You don't need to do this, it would be necessary only if you want to create very specific rules and be sure to control every type ...
setenforce 1's user avatar
3 votes

difference NFS proto and mountproto

From man 5 nfs: mountproto=netid The transport the NFS client uses to transmit requests to the NFS server's mountd service when performing this ...
aviro's user avatar
  • 5,552
3 votes

Is there a way to know who executed a command?

You can look into the shell history file (.bash_history if you're using Bash) of each one of your team members to see if you find the offending command, provided they haven't covered their traces by ...
dr_'s user avatar
  • 29.7k
3 votes
Accepted

Why does ls show this file twice with different sizes?

The two files are different. The one occurring in ssh_config.d contains SSH client configuration. The one found in sshd_config.d contains SSH server configuration.
Kusalananda's user avatar
  • 335k
3 votes
Accepted

Where are RHEL9 bugs reported in 2023?

RHEL moved from bugzilla to Jira see the RHEL project at issues.redhat.com. I didn't find an official announcement, only this thread on Fedora Devel mailing list announcing the move in 2022. CentOS ...
Vojtech Trefny's user avatar
3 votes
Accepted

zsh: no such file or directory error even though the file exists

Looks like you downloaded hyperfine for the wrong architecture, like you're on a GNU/Linux x86_64 system and you downloaded https://github.com/sharkdp/hyperfine/releases/download/v1.17.0/hyperfine-v1....
Stéphane Chazelas's user avatar
3 votes

How can I allow a single member of group as sudoer

Remove the privilege from the group, and add it to the single user that needs it. Alternatively, create a new group that can encompass the users that should have sudo privileges, give that group sudo ...
Natolio's user avatar
  • 1,232
3 votes

Add a tab to the beginning of lines stored in a variable

In the bash shell, you can do it to lines stored as elements of an array variable as follows. First, read the zipinfo output into a shell array instead of a string scalar variable, and then use the ...
steeldriver's user avatar
  • 81.2k
3 votes

Add a tab to the beginning of lines stored in a variable

You could just use a "here string": sed -e $'s/^/\t\t\t/' <<< "$zipflist" This would be appropriate if the list of files (with newlines separating them) were already ...
Wildcard's user avatar
  • 36.6k
3 votes
Accepted

LVM extend filesystem based on increasing existing disk size

I did the following steps , and by this we get the right partition size first we need to rescan the disk echo 1 > /sys/block/sdi/device/rescan pvresize /dev/sdi lvresize --size +50g /dev/mapper/...
yael's user avatar
  • 13.2k
3 votes
Accepted

How to install cryptsetup-luks

The package is called just cryptsetup. It used to be called cryptsetup-luks way back in RHEL 6 but since RHEL 7 it's just cryptsetup and it's in the BaseOS repository so you don't need any other extra ...
Vojtech Trefny's user avatar
3 votes

Installing mysql-community-devel on RHEL9, "Errors during downloading metadata for repository 'mysql80-community'"

Apparently your network connection to the repo.mysql.com is not exactly stable: something keeps interrupting connections to it every now and then. It might be that you just had the bad luck to try and ...
telcoM's user avatar
  • 97.2k
3 votes
Accepted

How to know which repository to add to dnf to install a particular application in RHEL?

How do I reliably know which repositories I need to add to dnf to install a particular application? On RHEL, chances are you want EPEL, a community effort to bring the packages that other distros (...
Marcus Müller's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible