scripts and documents that generate
git clone git://
Log | Files | Refs (4985B)

      1 # Text Interfaces Are The Most User Friendly
      2 ## 05/27/21
      4 The situation I was in had me dealing with a set of about 550k png images in a single directory extracted from a recovery image.
      5 The images were extracted by Foremost on a partition that used to contain a root filesystem.
      6 Since filenames weren't preserved, they weren't named in any way I could pick out the ones I wanted, and I could only go off of image metadata.
      7 There was only a small portion of this massive library of images I needed to recover, and there was no way I could browse that many pictures to pick what I wanted.
      8 Anything I was looking for was randomly placed in a sea of UI images or browser-cached icons.
     10 I knew the images I wanted were likely to be larger than the majority of the rest, and listing images by size decreasing is simple.
     11 However, PCManFM couldn't read the massive directory, and trying to browse it with Geeqie was also unusably slow on my old disk.
     13 I was willing to sift through maybe a few thousand pictures, and I only needed to see the largest ones - maybe over 300x300 in resolution.
     14 I realized I didn't really need a conventional file manager to do this.
     16 ``$ feh -p --min-dimension 300x300 $(find . -maxdepth 1 -type f -printf '%s\t%p\n' | sort -n | tail -n $TOLERABLE_NUMBER | cut -f2)``
     18 It's not the most radical example of shell magic,
     19 but it made me appreciate that a bash interpreter allowed me to make my own rules and answer to a dynamic query.
     20 That snippet is equivalent to the statement:
     22 ``In this directory, use an image viewer to show me a slideshow of the largest X images that are 300x300 or larger. With the smallest ones first, please.``
     24 Or, more literally:
     26 ``In this directory, find files, and give me two fields, their size and name. Sort the entries numerically and give me the first X of those inputs. Now take the name field of each of these and pass them as arguments to the image viewer feh, truncating images whose resolutions are smaller than 300x300.``
     28 With Bash (or most shell language) syntax, the query could go on and on with manipulations or sorts I could do to arbitrary input.
     29 The best part about this is that I don't have to wonder if something's a 'feature' of the program I'm using - it's a matter of using the tools in my toolbox to explain what I want to happen in an exact fashion.
     31 A misnomer I hear all the time is that users are "scared away from using Linux (sic.)"
     32 because there's something terribly awful and *un*intuitive about "the command line" that will cause a new user to suddenly go mad and have no choice but to quit before psychosis sets in.
     34 This post is an argument to the contrary - the text interface of a shell is one of the most ingenious and user-*friendly* interfaces I can think of.
     36 + Small programs that do one thing allow you to intuitively do nuanced things.
     37 + Text is the most accessible medium - there are many ways to enter text.
     38 + It's easy to share text with my friend. If he wants to do what I did, I can send him verbatim what I've just done.
     39 + If the only I/O you have to worry about is text streams, then it's easier to extend scripts.
     40 + Since Bash (or similar shell) is a programming language itself, I can save the text as a script and run it.
     41 + I can access every one of my tools from the same interface. I don't have to learn a new button layout or general syntax to do something else.
     42 + As long as a program takes input, and puts something out, it's useful.
     44 These points might seem obvious, but I've never heard these points brought up from a UX perspective.
     45 If you don't know what something does, you can peruse the manual and see exactly how you can use a program with no ambiguity.
     46 The only real learning hurdle happens when you don't know something exists on your machine,
     47 but most interfaces struggle with that problem somewhat.
     48 Once you add a tool to your mental toolbox, you can use it forever.
     49 I can use grep to apply a regular expression to input.
     50 That input could be a file, but it could be input from anything else.
     51 You kind of get this natural-language feel to it all.
     52 grep is logically less a program and more a verb.
     53 You don't have to be computer-savvy or a programmer to construct a query with some semantics that would be hard or almost impossible to do in an application where the developer has to attempt to accomodate each use case.
     55 There are definitely programs that benefit from not being driven by a text interface,
     56 and they mostly happen to be that way because the core of the purpose of the program can't be practically protrayed by text.
     57 I'll never use GIMP with a CLI, nor will I play SuperTuxKart in the buffer - they are obvious cases.
     59 However, there is still something to be said about the massive versatility of the text interface that can't quite be replicated by any interface that takes pride in their ease of use.
     60 The definition of 'ease' in many minds is not "let the user easily do what they want" but rather "let the user easily do what we think they want."