Shell Shocked
The shell may look like an old-fashioned bit of technology, only useful for the Linux hardcore programmers and system administrators, but knowing a few commands and how to link them together goes long way.
The shell may look like an old-fashioned bit of technology, only useful for the Linux hardcore programmers and system administrators, but knowing a few commands and how to link them together goes long way.
The Linux shell is peculiar old thing. It was developed in the '70s for UNIX computers, and its look and feel has not change much in its forty years of existence. So, what's the deal? Surely we have transcended having to type in obscure commands on a black background. Is this not something reminiscent of the bad old days when floppy disks could hold only a few hundred bytes of data and phosphor green monitors burnt your eyeballs right out of their sockets?
In modern Linux distros, such as Ubuntu, you can spend your whole life within your graphical desktop and not have to deal with a command line once. You can download software, adjust configurations, copy and move files, and start and stop system processes by clicking, dragging, and dropping. What's the point, then, of such an arcane tool?
You could never leave the safe haven of your graphical desktop, true, but you'd definitely be missing out. When we worked on Linux Magazine Spain, from time to time – every year more or less – we produced a special Shell edition that brought together the best articles on shell usage, as well as new material we hadn't been able to fit into other issues. The shell issues were invariably a hit. They would outsell regular issues three to one, and people would order them from us well after they had been taken off the newsstands.
Who bought them? Surely not the old guard. Despite all our efforts, it was very difficult to come up with tricks a weathered *NIX sys admin was not already aware of. No, these were end users. We knew because they emailed us questions and suggestions for future issues; they phoned us to clear up some obscure point. We even got letters, yes, handwritten letters, in envelopes, from several prisons requesting copies for inmates trying to further educate themselves. All these people did not choose to learn about the shell because the desktops were inadequate. The developers of Gnome, KDE, and Unity have done their utmost, bless their penguin-printed knitted socks, to make the shell obsolete.
But no matter how beautiful and feature-packed Linux desktops become, many users – a great many users – still want to learn about and use the shell. There may be a romantic component to it. It looks more like hacking if you're typing green letters on a black background, even if you're only copying files onto a thumbdrive. If we could only get the BZZZZZRT! they dub over in movies and TV shows every time a line of output appears, shell usage would go mainstream in a hurry.
Yet, there's more to it than that. The shell has several clear things going for it. For one, it's universal: Every Linux has it and most tools are the same, regardless of distribution. It's also accessible from anywhere. You can SSH from your laptop into a shell on your local network and start mending, updating, restarting, and configuring right away. The same goes with a machine on the other side of the world, or, instead of from your laptop, from your smartphone. SSH and a shell interface are engineers' gift to sys admins who would prefer not to get out of bed at 4am to restart a service that has crashed at work.
Despite rewrites and improvements, shells remain dependable, compatible, and consistent. Your graphical environment can freeze and the keyboard lock up, but chances are that you can still wiggle your way in via a shell and stop whatever process is messing with your workday. Plus, you can pick up a manual about *NIX administration, and it won't really matter if it was published in the '80s or last month, most of the commands and scripts will still work.
Modern shells also pack a punch. This cannot be stated enough. From where else could you back up and change the format of all the music and sounds in your hard disk, download a whole website including graphics, or harvest every single email from every single text document with one single (and short) line of code? Don't get me started on when you string commands together in scripts.
So, this month we're giving it up for the shell – a powerful thing you'll learn to love.|