The are a couple of things that make the command line superior to GUI interfaces:
Command history
The one killer feature (in my opinion). If you remember that you have performed a command before, and remember anything about that command you can quickly find it by typing ^R
and do a backward incremental search through the command history. Or you can press up/down arrow until you find the command you're looking for.
If the shell only had this single feature going for it, I would still use it above a GUI, any day. (But there is sooo much more...)
Pipes
Piping the output of one command into the next makes for powerful combinations.
Say that I have a large directory of files, of which I suspect some are identical, but with different names?
The following commands will can be used to (line 1): compute a list of checksums; then (in line 2) create a list of all the checksums that are repeated more than once; and (in line 3) display all files (and their checksum) that are occur multiple times. That line 2 there is a killer line! :)
md5sum * >checksums
sort checksums | cut -f1 | uniq -c | grep -v '^ *1 ' | sed 's/^.* //' >doubled
grep -fdoubled checksums
(BTW, teaching this to your student you should caution them that lines with newlines and spaces may fare badly in the above process.)
Scriptability
I guess I sorta touched on this in the above heading, but there is so much more than just pipes.
Stuff like while read LINE; do ...; done <FILE
and for *.txt; do ...; done
, and functions are really all nifty stuff.
Combining functions and pipes to produce filters of various kinds is also neat and nifty. For example, you could type:
trim() { sed 's/^ *//; s/ *$//' }
and thereafter you can use cat FILE | trim
to output a file with all its leading and trailing whitespace removed.
Language-Like Fluency
The scriptability and pipes points above combine to something new and powerful, which I usually compare to language fluency.
In a GUI your reacting to elements presented to you, if there isn't a button or menu option for something onscreen then that functionality does not exist for you. You're sorta piggybacking on your sense of direction, or ability to navigate through space to find your way. "Oh, I'm here, that means I can click that menu, to get that window to pop up, so I can select that tab, which does what I want." – You're forever navigating around, using recognition to see where you are and what your options are right here.
A CLI, on the other hand, gives you a language. A whole vocabulary which you can use creatively to express stuff, and which you can expand with your own scripts and functions (such as, for example the trim
function above).
Some of this language you use often, and so it becomes part of your active vocabulary (ls
and cd
and most of the other basic file and directory commands come to mind). Other stuff you recognize by sight, but might not come to mind as you're looking for a solution (or come to mind only partially – which is where the command history comes into play) so its more of a passive vocabulary to you.