When CPUs were single core and either expensive or directly soldered onto the main board, many of us actually cared about what our CPUs were doing. This was because they couldn't do much, and every cycle counted. The humble Commodore 64 CPU was running under a single megahertz in PAL-inflicted regions, for example, while the Amiga 500 only just broke the 7MHz barrier – while its rival, the Atari ST, gloated from the realm of 8Mhz. However, the Amiga did have an important advantage. You could swap out the scheduler for something more aggressive or more multitasking friendly, depending on whether you were accessing a BBS or number crunching a scene in LightWave 3D. Of course, now speed isn't everything. Whether your CPU is clocked at 2, 3, 4, or 5Ghz, it's likely you have more than one core to parallelize tasks, and a big part of your CPU management is now about keeping the temperature down and the battery life maximized rather than getting things done faster.

But sometimes you still need to get things done faster, and you still need that hands-on control over how things are prioritized. But rather than swapping out the process scheduler, the best approach in Linux is to control how aggressive its CPU management is. This is known as CPU scaling, and it allows you to set a minimum and maximum CPU frequency, either for each CPU, or for all of them at the same time. You may want maximum battery life, for instance, which means limiting them all to the lowest frequency. Or you may want maximum CPU speed all the time, or you may just want to tweak your distribution's default values. A common tool for setting these values is cpupower, but it can be tricky to use. Try this, cpupower-gui, instead. It's an easy to use portal to the same functionality where you can easily access the dark arts of CPU management while seeing the changes you're making.

Project Website

Scaling governors operate like presets for CPU management, varying between Powersave and Performance with Userspace for your own frequencies.

ls replacement


It's a brave project that challenges the status quo, and few commands are as much a part of the status quo as the humble ls. For most of us, ls and its permutations have long been committed to command-line muscle memory. You type ls to see what's going on in the current directory, type ls -l to see file permissions and a little more detail, and type ls -l --time-style=full-iso to show off. And yet, this isn't enough for the nat project, which boldly proclaims itself "the better ls" before you even get to the documentation. Nat is indeed an ls alternative, written in the system language du jour, Rust. Typing natls is intended to be a more fulfilling experience than typing ls. Your terminal bursts with color (if your terminal supports it). There isn't just a different hue for the size, date, ownership, and file columns, there are also different colors for the user, group, and system permissions. It's like a psychedelic version of ls -l.

Alongside the colorful output, natls provides all the same functionality you'd expect from ls. This includes output showing file permissions, file sizes, modification dates, and group and user ownership. These options are also well organized, with flags to disable them individually in the output, turn off sorting, and fit everything into as wide a space as your terminal can spare. It also uses a sensible time format, which can be easily changed with another argument. But the best thing about natls is that most of its Rust source code can be found in a single, manageable, file, which makes it incredibly easy to understand and modify. This makes the project much easier to modify than the original ls, and it could be an ideal starting point to create your own perfect ls replacement while also learning about a strong contender for the next standard system programming language.

Project Website

Make ls a thing of the past by making your own modifications to the excellent natls.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95