Weaned off GUI: Linux Commands for the Total Beginner
December 30th, 2006
Getting started with a Linux operating system is a bit like learning to ride a bike without training wheels. If you’re used to a GUI and don’t want to change that’s okay. The Linux GUI’s are anything but lame. Check out Compiz, a desktop enhancement that blows away anything currently on the market. The KDE and GNOME window managers are refined and complete to the point that a Windows or Mac user would feel right at home. The real power of Linux, however, is locked away in the command line interface (CLI).
As you become more familiar with the CLI you will feel more and more constrained by the GUI. The keyboard is a flexible tool used to encode natural human language as text. The mouse and its buttons are more analogous to a stick with which to point and grunt.
How does one advance from the computer equivalent of point-grunt to, “Please pass the ketchup?” Below is a table of common actions in the GUI and how you might accomplish the same thing on the command line.
If you don’t have Linux installed, stop reading this and get Kubuntu now! By the way, Kubuntu has an automatic installer and it will work right along side Windows. The install is pretty much a no-brainer. And don’t worry if you have another version of Linux. The commands are pretty much the same.
Take note that Linux commands and filenames are case sensitive. GREP is not the same as grep. If there might be more than one way to accomplish a given task there will be several lines. There is usually only one way to point and grunt, and that’s a restriction that does not apply to our command language.
| GUI | CLI |
|---|---|
| Open My Documents | # cd ~ |
| View location of the current open folder | # pwd |
| View the contents of a folder | # ls |
| Go to My Documents and view contents | # cd ~ ; ls |
| View the size and date information | # ls -l |
| View all (including hidden) files in a folder | # ls -a |
| Open My Computer and view contents | # cd / ; ls |
| Open a folder named Stuff | # cd Stuff |
| Open a text file named foo.txt for edit |
# pico foo.txt # kate foo.txt # gedit foo.txt # vi foo.txt |
| Open an html file named bar.html |
# firefox bar.html # konqueror bar.html # links bar.html |
| Select and open all html files in a folder |
# firefox *.html |
| Rename a file or folder from Tara to Samuel | # mv Tara Sam |
| Copy a file named keeper.html into My Documents | # cp keeper.html ~ |
| Move a file named whereami.html into My Documents | # mv whereami.html ~ |
| Search everywhere for a file named elude.jpg | # find / -name elude.jpg |
| Search My Documents for mp3 files | # find ~ -name *.mp3 |
| Search the contents of all files in a folder for the exact prase “lost puppy” | # grep “lost puppy” * |
| Same as above but include all subfolders in the search | # grep -r “lost puppy” * |
| Delete a file named Bubbles.rtf | # rm Bubbles.rtf |
| Delete a folder named OldStuff | # rm -r OldStuff |
| Delete a folder named OldStuff even if it might break something | # rm -rf OldStuff |
You’re not yet fluent but you’re on your way. In Linux, folders aren’t really called folders even though they really are the same thing. Here’s some terminology differences that apply to the table above.
| Windows | Linux |
|---|---|
| Folder | Directory |
| My Documents | Home Directory |
For a more complete list of commands check here.
There is always more to learn and in that sense we stay beginners forever, but language is empowering. It helps us begin and finish things more quickly through education and delegation. Keep hacking and soon you will realize how much you prefer language to grunts.
PS. I plug the Ubuntu/Kubuntu distros because they work right out of the box on most hardware. The tedious stuff is taken care of by the software itself, as it should be.
on December 31st, 2006 at 05:16 AM neat presentation!!!