0

There are many entries in a linux filesystem that are not regular files, but instead abstract representations of devices and running processes (for example, the entire /proc directory). Some of these special files uniquely effect the system when they are written to in a way that could provoke instability. However, I do not know if any of these files change the system when they are read from, instead of written to.

For example, would any unintended side-effects occur from a command like:

sudo grep -rnw / -e some_pattern

1
  • How long are you willing to wait for a match from /dev/random? No, grep would not go there since it's not a text file, but you could force it... and then it would probably also get stuck at /dev/zero.
    – Kusalananda
    Commented Mar 8, 2021 at 7:49

1 Answer 1

0

The only files that I know of that effect other processes when read are named pipes, and ttys. the effect being that information read by one process cannot be read by another.

So for example your recursive grep could steal keystrokes from other [pt]tys.

1
  • Score +1 for named pipes (which can hang forever or steal data) and sockets (which exist but can't be read). Both soft and hard links will lead to duplication. Commented Mar 8, 2021 at 8:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .