DEV Community

Aravind Reddy V
Aravind Reddy V

Posted on

Unix pranks to slowly drive your friends mad

I made a small, fun list of pranks to troll people. I'm looking forward to see what ideas you have, so please add them in the comments.

1. Slow down their Terminal.

Bash code to slowly slowdown terminal startup

Every time a new Terminal is started, it's slowed down by .1 seconds. 😈

2. Change ssh folder to shh

Sneaky fox changes ssh folder to shh

From this: https://twitter.com/nixcraft/status/1045760653510815744

3. Change Editors!

Vim opens Emacs, nano opens Vi, etc.

Vim opens emacs, nano opens vi, and so on. I've been called one of Top ten evil people for this 😂

4. Make date return random dates

date function returns random date

Similarly, for the cal command,

Make cal return Calender for random years

5. Make cat print an actual cat!

This happens randomly. The base64 string is for the cat.

function cat() {
    rdm=$(( ((RANDOM<<15)|RANDOM) % 5000 ));
    if test $rdm -lt 400
    then
        base64 -D <<< "ICAgICAgICAgICAgICAgICAgVC4iLS5fLi4tLS0uLl8sLSIvfAogICAgICAgICAgICAgICAgICBsfCItLiAgXy52Ll8gICAoIiB8CiAgICAgICAgICAgICAgICAgIFtsIC8uJ18gXDsgX34iLS5gLXQKICAgICAgICAgICAgICAgICAgWSAiIF8ob30gX3tvKS5fIF4ufAogICAgICAgICAgICAgICAgICBqICBUICAsLTx2Pi0uICBUICBdCiAgICAgICAgICAgICAgICAgIFwgIGwgKCAvLV4tXCApICEgICEKICAgICAgICAgICAgICAgICAgIFwuIFwuICAifiIgIC4vICAvYy0uLixfXwogICAgICAgICAgICAgICAgICAgICBeci0gLi5fIC4tIC4tIiAgYC0gLiAgfiItLS4KICAgICAgICAgICAgICAgICAgICAgID4gXC4gICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICAgICAgICAgICAgXSAgIF4uICAgICAgICAgICAgICAgICAgICAgXAogICAgICAgICAgICAgICAgICAgICAgMyAgLiAgIj4gICAgICAgICAgICAuICAgICAgIFkKICAgICAgICAgLC5fXy4tLS5fICAgX2ogICBcIH4gICAuICAgICAgICAgOyAgICAgICB8CiAgICAgICAgKCAgICB+Ii0uX34iXi5fXCAgIF4uICAgIF4uXyAgICAgIEkgICAgIC4gbAogICAgICAgICAiLS5fIF9fXyB+Ii0sXzcgICAgLlotLl8gICA3IiAgIFkgICAgICA7ICBcICAgICAgICBfCiAgICAgICAgICAgIC8iICAgIn4tKHIgciAgXy9fLS0uX34tLyAgICAvICAgICAgLywuLS1eLS5fICAgLyBZCiAgICAgICAgICAgICItLl8gICAgJyJ+fn4+LS5ffl0+LS1eLS0tLi9fX19fLC5efiAgICAgICAgXi5eICAhCiAgICAgICAgICAgICAgICB+LS0uXyAgICAnICAgWS0tLS4gICAgICAgICAgICAgICAgICAgICAgICBcLi8KICAgICAgICAgICAgICAgICAgICAgfn4tLS5fICBsXyAgICkgICAgICAgICAgICAgICAgICAgICAgICBcCiAgICAgICAgICAgICAgICAgICAgICAgICAgIH4tLl9+fn4tLS0uXyxfX19fLi4tLS0gICAgICAgICAgIFwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH4tLS0tIn4gICAgICAgXAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXA=="
    else
        /bin/cat $1
    fi;
}

Cat prints an actual cat


I have a GitHub repository with more pranks and copy-paste-able code: zeroby0/pranks. You can find more pranks at Mathias Bynens' Evil.sh

Also, Hi! I don't believe we've met before. I'm Aravind. I program micro-controllers, and design websites. Take care not to cause damage while you have fun.

Have a great day! (or night, wherever you are)

Top comments (0)