New Projects - Fresh from the Labs
htop aims to be a better version of the long-lived UNIX program, top. Allowing you to browse through your system processes with the keyboard, htop is a much more intuitive way of doing things than the traditional and archaic UNIX way. The htop Web site gives the best summary with this comparison of htop and top:
In htop, you can scroll the list vertically and horizontally to see all processes and complete command lines.
In top, you are subject to a delay for each unassigned key you press (especially annoying when multikey escape sequences are triggered by accident).
htop starts faster (top seems to collect data for a while before displaying anything).
In htop, you don't need to type the process number to kill a process; in top, you do.
In htop, you don't need to type the process number or the priority value to renice a process; in top, you do.
htop supports mouse operation; top doesn't.
top is older, hence, more used and tested.
If you're chasing binaries, packages are provided in either native or third-party form for GoboLinux, Debian, Fedora, Red Hat, Slackware, Gentoo, ALT Linux, OpenSUSE, Mandriva, KateOS and Zenwalk. For those going with source, head to the Downloads/SVN page, grab the latest tarball and extract it, or SVN the nightly development tree. In terms of requirements for compiling the source, the only oddity I ran into was that I needed to install the development files for ncurses (in my case, libncurses5-dev).
Open a terminal in the new source directory (whether from an extracted tarball or SVN), and enter the usual:
$ ./configure $ make $ sudo make install
Once the compilation finishes, run the program by entering:
Once inside the htop screen, you'll see things arranged in a way that will make instant sense to those used to some Linux mainstays, such as xosview, Midnight Commander and various system monitors, including, of course, top. At the top of the screen is a selection of handy system information, such as CPU usage, free memory, swap usage and so on. In the center of the screen are all of your system's processes waiting to be browsed, and in classic Norton/Midnight Commander style, the functions of the program are sensibly linked to the function keys of your keyboard, laid out clearly on the bottom of the screen. Take note of that in particular, as you'll be using those functions the most.
To get started, you can browse through your processes with the arrow keys along with Page Up and Page Down. If you want to kill or tinker with a process, press either K or F9. At this point, htop brings up a menu of possible signals to send the program, with SIGTERM being the default choice. Scroll through these if you want to play with more-advanced features, but for most users, just pressing F9 and Enter will do the job fine.
You can kill multiple jobs by pressing the spacebar on each one. The Search function is mapped to F3, allowing you to search for any part of text in the name of the process you're chasing, which comes in handy particularly for overburdened systems with too many processes. The SortBy function, mapped to F6, also is of great help, especially when you want to sort between system- and user-owned processes. And, the Tree function, mapped to F5, is fantastic for seeking things like tricky child processes. This program is fairly loaded with features, so it's worth checking the htop man page and the help screen (assigned to F1) for more information.
Ultimately, htop is a good evolutionary step from unintuitive, older programs like top, and with any luck, it will be included by default with most distros in the years to come. Although the interface still might be a little intimidating for novices, intermediate or advanced users should come to grips with it easily (and let's face it, they're the ones who'll be using it anyway).
John Knight is the New Projects columnist for Linux Journal.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Server Hardening
- BitTorrent Inc.'s Sync
- The Death of RoboVM
- EnterpriseDB's EDB Postgres Advanced Server and EDB Postgres Enterprise Manager
- The Humble Hacker?
- The US Government and Open-Source Software
- New Container Image Standard Promises More Portable Apps
- Open-Source Project Secretly Funded by CIA
- AdaCore's SPARK Pro
- ACI Worldwide's UP Retail Payments
In modern computer systems, privacy and security are mandatory. However, connections from the outside over public networks automatically imply risks. One easily available solution to avoid eavesdroppers’ attempts is SSH. But, its wide adoption during the past 21 years has made it a target for attackers, so hardening your system properly is a must.
Additionally, in highly regulated markets, you must comply with specific operational requirements, proving that you conform to standards and even that you have included new mandatory authentication methods, such as two-factor authentication. In this ebook, I discuss SSH and how to configure and manage it to guarantee that your network is safe, your data is secure and that you comply with relevant regulations.Get the Guide