Quest for the most useless command

I wrote by accident:

cd .

and even hit ENTER.

Then I realized this is probably the most useless command that you can imagine. Yes, perhaps it could assert that there is still a working filesystem, but I am not sure about it.

What do you think?
Can you think of any more useless commands? :slight_smile:

this thread is the most useless thread. ?

1 Like

...haha.. my initial thoughts exactly ....

1 Like
true

in shell can always be replaced by the built-in command

:
2 Likes

Note that in most shells true is a shell builtin as well:

[root ~]# for _sh in bash ksh mksh dash zsh; do 
  printf '%s: %s\n' "$_sh" "$("$_sh" -c 'type true')"
done 
bash: true is a shell builtin
ksh: true is a shell builtin
mksh: true is a shell builtin
dash: true is a shell builtin
zsh: true is a shell builtin

And it's definitely more readable than `:' :slight_smile:

After a

cd .

you should check the success with

ls -d

And I am guilty occasioanlly... ;o)

echo -n "" > /path/to/emptyfile
printf "" > /path/to/emptyfile
touch /path/to/emptyfile

And others that require a command...

Instead of:-

> /path/to/emptyfile

Also I thought : is a NOP placeholder or am I missing something; e.g.

useless_function()
{
        : # Do nothing.
}