How to teach the value of the command line in high school? Part of what I love about the particular adaptation I use for AP CS Principles — CS50 AP — is that my curriculum teaches students basic Linux shell commands in the Cloud9 IDE. Students learn things like cp, mv, mkdir, cd, ls, and zip (just to name a few).

However, at the beginning of the year, it is challenging to motivate why the command line is a powerful tool to learn. They just take my word for it even though it is a big struggle. It is much more frustrating for beginners than a GUI and has no forgiveness for a mistyped character.

How do you communicate the value of the command line to your students? Are there specific examples you use that effectively illustrate the power of a CLI?

Note: This question is not a duplicate of Command-line Java in AP CS A (although it is tangentially related) as that question asked whether or not a CLI should be taught in AP CS A. This one is focusing on how it can be motivated when it has to be taught regardless of course.
I can't speak to cloud9 but I've always taught on Linux and am a CLI wonk. 

One thing I do is differentiate between user friendly and learner friendly. GUI interfaces are learner friendly - they're easy to learn but they're not user friendly because they're not that powerful. They're basically program loaders. You load your program, work in it, exit, next.

The Shell is a little less learner friendly (although the fish shell is amazing from the learning point of view) but it is amazingly user friendly because it allows the user to do all sorts of things.

I try to model this over the course of my classes and I try to provide examples.

For instance, if I wanted to resize a bunch of gifs in a directory, I might show the class something like:

ls *gif | while read i 
do
  f=`basename $i .gif`
  convert $i -resize 200x200 smaller-$f.gif
done


If you make it useful to them, they'll appreciate it more and use it more.

I wrote a few blog posts over the years with examples including:


pre-processing and cleaning up dirty downloaded data
processing info from google forms (downloaded as csv)
operating on many files across directories


The posts can be found here: https://cestlaz.github.io/categories/cli/