One of the things that’s always attracted me to Linux is the simplicity and elegance of working on the command line. Even with all the GUIs, Web apps and touch-screen interfaces out there, it’s nice to type in a couple of commands and get the results displayed on a terminal. No frills, no fuss, just formatted information that I can use right away. Typically, I leave a terminal up on the XFCE desktop and switch over as I need to.
Here are some of the command line tools I regularly use.
The top command prints out a near-real-time text display of my machine’s processes and metrics. The image below shows a screen shot of the top session I had up as I wrote this story. Across the top you’ll see up-time, number of users and load average. On the second row, there’s the number of tasks. Further down you’ll find memory and swap tallies. Finally, below the white background line are the details of the running tasks. Top gives me a great snapshot of how everything is running.
On most Linux systems, you can use the up and down arrow in a terminal to recall commands. Type in a few commands, then hit the up arrow to bring them back up. Instead of up-arrowing 100 times to get back to something I used yesterday, I rely on history to show me the commands I’ve used recently. In the screen below displays my history. The leftmost field is the process ID and other field is the command. To recall a commant, type a bang (!) symbol.
df shows the disk space on my your file systems. Take a look at this screen for an example. Notice that the root file system (/) is at around 25 percent capacity and my home (/home) file system is at 100 percent. I guess it’s time to archive off a few directories.
When writing, I frequently have to go looking for files. To me, it’s much better to use the command line than an X Window-based file manager. I was never very good at visually scanning long lists to find the file I want. It’s so much simpler to punch in “locate” and a file name.
Cat is short for concatenate. I use cat to print files to my terminal screen and you can view just about any text file with it. I use cat to look at log files and HTML files, and to read in Arduino data over the USB port.
Do you want to see the plain HTML text for a website? Just type “curl” and the URL. You’ll get a printout of the file with all the tags. Yes, it’s a little hard to read sometimes. To deal with that, maximize the X terminal window and the text will fill out the screen. Long inline URLs show up much better that way.
On our Linux Talent Community discussion boards, we’ve had some comments about the power of the command line. It certainly isn’t dead, and it offers great time-saving advantages over a graphical environment.
Do you use the Linux command line interface? Feel free to share your best tips in the comments below.