Funny/Useless commands

Hey there,

During a lazy day at work I was using the command “echo -n” and after realising something kind of silly I just started snickering.
So here is the thread: redundant, useless or just amusing linux commands. To start it off, the thing that got me;
‘echo -ne “Hello World! \n”’

1 Like

cat file | grep string

6 Likes

I get the distinct impression I’m getting goofed on…

1 Like

useless use of cat. you should just grep string file.

3 Likes

Oh… I may or may not have actually used cat file | grep string in my script earlier today…

I had no idea that his thread would turn ou to be an educational experience. Thanks! :smiley:

EDIT: Yep, “grep [OPTIONS] PATTERN [FILE…]” from the man page. I really should just dedicate a weekend to reading the entire man pages for commands I use on a regular basis…

1 Like

that doesn’t always work when the file has hidden chars in it and you have to cat -v the file to see them

Try using grep -a

1 Like

Would work on Linux… but not the AIX systems we have.

1 Like

When using the whatis command with something it can’t interpret, you get nothing appropriate. This is usually fun to post.
image

11 Likes

I should totally roll my own version just so it echos “Baby don’t hurt me!”

7 Likes

Sudo is such a useless and silly command. Everyone knows you should always be in root and run everything from root and user accounts are for beginners.

if you took this seriously I’m sorry

3 Likes

Don’t forget that real SysAdmins use rm -rf /

3 Likes
yes

Can be marginally useful?

1 Like

sudo dd if=/dev/zero of=/dev/null bs=1M

4 Likes

Sometimes, I amuse myself by running
clear && fortune | cowsay -n
repeatedly. As for truly useless, maybe a fork bomb?

1 Like

On mac its WAY more sarcastic.

$ whatis love
git-cvsimport(1) - Salvage your data out of another SCM people love to hate

1 Like

Not really a command but one of my old favorites from when I fist used Ubuntu 7.04.

cd /usr/bin/X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11
cd X11

pwd
/usr/bin/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11/X11

Mostly just as a symbolic gesture…

Iirc a linux guide told me to do that and I would usually do that when ever I was trying to think up a new way to break my install.

Used to help from time to time in the Ubuntu IRC and it was always amazing how many people would freak out about that and would get angry that there were so many X11 folders taking up their hard drive space…

Careful if you have a vulnerable Insyde BIOS. Could accidentally wipe some critical boot efi data :wink:

That looks suspicously like mac whatis is an alias for apropos

On linux:

> apropos love
git-cvsimport (1)    - Salvage your data out of another SCM people love to hate
2 Likes

Most useless command:

yes <input>

OR alternatively:

time cat

Getting advanced:

while true; do true; done

What do you get when you pipe useless to null?

yes null > /dev/null

Some light IO CPU load

fulload() { dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null & }; fulload; read; killall dd

Light the entropy burners! (Worse than useless.)

dd if=/dev/urandom | bzip2 -9 >> /dev/null
3 Likes