vdir: Consult your doctor before beginning this, or any other exercise program

The tip for the day will be, “How to save yourself at least one keystroke, several times a day.”

But first … a test. Which one of these is vdir and which one is ls -l?

total 80
-rw-r--r-- 1 kmandla users 7711 Jun 14 13:18 output-01.txt
-rw-r--r-- 1 kmandla users 7768 Jun 14 13:18 output-02.txt
-rw-r--r-- 1 kmandla users 7712 Jun 14 13:18 output-03.txt
-rw-r--r-- 1 kmandla users 7792 Jun 14 13:18 output-04.txt
-rw-r--r-- 1 kmandla users 7788 Jun 14 13:18 output-05.txt
-rw-r--r-- 1 kmandla users 7739 Jun 14 13:18 output-06.txt
-rw-r--r-- 1 kmandla users 7753 Jun 14 13:18 output-07.txt
-rw-r--r-- 1 kmandla users 7749 Jun 14 13:18 output-08.txt
-rw-r--r-- 1 kmandla users 7754 Jun 14 13:18 output-09.txt
-rw-r--r-- 1 kmandla users 7715 Jun 14 13:19 output-10.txt
total 80
-rw-r--r-- 1 kmandla users 7711 Jun 14 13:18 output-01.txt
-rw-r--r-- 1 kmandla users 7768 Jun 14 13:18 output-02.txt
-rw-r--r-- 1 kmandla users 7712 Jun 14 13:18 output-03.txt
-rw-r--r-- 1 kmandla users 7792 Jun 14 13:18 output-04.txt
-rw-r--r-- 1 kmandla users 7788 Jun 14 13:18 output-05.txt
-rw-r--r-- 1 kmandla users 7739 Jun 14 13:18 output-06.txt
-rw-r--r-- 1 kmandla users 7753 Jun 14 13:18 output-07.txt
-rw-r--r-- 1 kmandla users 7749 Jun 14 13:18 output-08.txt
-rw-r--r-- 1 kmandla users 7754 Jun 14 13:18 output-09.txt
-rw-r--r-- 1 kmandla users 7715 Jun 14 13:19 output-10.txt

It’s a trick question, I admit it. vdir by default looks like, smells like, tastes like plain old long-form ls. And unless you’ve got color settings or special aliases piping particular flags back into ls, they’re obvious twins.

In fact, their flags are dead ringers. They both arrived in your system on board coreutils. Their man pages are so close as to be copied-and-pasted. The similarity is uncanny.

So what’s the point? Why bother bringing vdir into the picture, if it’s just an ls knockoff?

Beause “v-d-i-r” is exactly one character shorter than “l-s-space-dash-l”.

And given that a 70kg person burns a whopping 50 calories typing for a half an hour … and the commonly accepted words-per-minute calculation is standardized to five-letter words … and a 40 wpm typist covers 1200 words in 30 minutes, pounding out 6000 keystrokes in that amount of time. …

I do believe, if my calculations are correct, each keystroke burns 0.0083 calories. Aha! I just saved you 0.0083 calories, which you can spend walking to the refrigerator, if you like. 🌯 |_|

Oh wait, were you trying to lose weight … ? :/

8 thoughts on “vdir: Consult your doctor before beginning this, or any other exercise program

  1. Billy Larlad

    This wins my award for the most pointless program I’ve ever seen, which is saying something considering I looked at the iOS app store today. Why not just alias ‘ls -l’ to ls, as I do, or, to follow vdir’s logic, something even shorter — perhaps just ‘l’?

    Does arch package this or something? Debian doesn’t seem to.

    1. K.Mandla Post author

      It should be in coreutils in both. And yes, it is rather pointless, but I say that not knowing the history of either. It might be that one or the other is a holdover from earlier days of computing, or for compatibility purposes. 😉

  2. Pingback: Links 19/6/2014: New Mir, Dalvik Changes, X.org Turns 30 | Techrights

  3. Ander GM

    “vidir” (vi to edit directory paths as text files) instead of “vdir” is a more interesting tool

    1. K.Mandla Post author

      I think I saw that when I looked at moreutils. It is very clever. I do almost exactly the same thing with renameutils’ qmv, with a few flag settings. Thanks for the reminder. 🙂

  4. Pingback: text-text-revolution: You can see where this is going | Inconsolation

  5. Pingback: text-text-revolution: You can see where this is going | Linux Admins

Comments are closed.