-1

When running

sudo dd if=/dev/sda

the internal PC speaker makes sounds. Also all fonts, even the prompt and typing input has different characters such as "♡" or "•".

If you need to know more, comment please.

What I usually do is of=/dev/null or >>/dev/null for reading performance testing and for spinning up the optical drive (with count=1 iflag=direct skip=500000), of which I skip to LBA 500000 to put the laser lens in the center of the data part. But I wanted to try out once what happens if I do not redirect the output anywhere, and that happened.

Fun fact: The same happens to Windows too.

3

2 Answers 2

6

This is roughly what happens:

  1. Your dd command does not have an of=... argument so it sends data to stdout.
  2. And as you are running the command in a terminal the stdout of the running process is connected to the terminal.
  3. Terminals can display text and interpret control sequences. Depending on your terminal type there are sequences to change the font or the color or the position of the cursor or to ring the bell (beep) and so on.
  4. Your hard disk (/dev/sda) contains a lot of different data and there are surely some terminal control sequences in there by pure chance.

So you are sending a lot of text & control sequences to your terminal and it dutifully tries to display and interpret it.

4

As Lucas said it's because of random data just happening to contain terminal control codes.

To fix it, run the command:

reset
1
  • You can also type this "blind" if your font/size/color in the terminal is a total mess. Sometimes you have to hit CTRL-C first to delete any text that was put in your command line or to get out of the readline-vi-command-mode (depending on your shell setting).
    – Lucas
    Jul 12, 2018 at 6:22

You must log in to answer this question.

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