5 Bash Commands That Make A Computer Completely Unusable (Proceed With Caution!)

These are 5 ways that can make a computer a mere dumpster (temporarily or permanently) and one should never type these scripts in a Bash terminal.

1. Consuming Disk Space With Random Data

This script will quickly fill up the storage space on a computer with random data.

while true; do
    dd if=/dev/urandom of=/tmp/randomfile bs=10M count=100 oflag=direct
done

The breakdown of the script is given below:

  • In the first step, an infinite while loop is started
  • dd: This is the disk/data duplicator command that allows us to copy raw data from one source to another
  • if specifies the input file for the dd command. In our case, the input file is /dev/urandom, a file which produces pseudo-random numbers in Unix-based systems.
  • of specifies the output file for the dd command. In our case, the random data is written to a file named randomfile in the /tmp directory.

Read More