Skip to main content
2 of 3
deleted 29 characters in body
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 237

Why strings command won't stop?

The strings command behaves weirdly, apparently it doesn't stop writing to a file even if drive run out of space. or perhaps I'm missing something?

I run the following:

# strings /dev/urandom > random.txt

this was keep running and didn't stop even after filling the disk (a regular usb flash).

then to be quicker I created a ramdisk and tried again the same command. it also didn't stop.

I understand that urandom is't a regular file and also strings output is redirected, however in both cases above, the cat command reported the error when there was no more space.

# cat /dev/urandom > random.txt
cat: write error: No space left on device

q: Is this normal behavior of strings? if so, why?

q: where the data is written after no more space left?

user174174
  • 479
  • 1
  • 7
  • 15