Americas

  • United States
sandra_henrystocker
Unix Dweeb

New Year’s resolutions for Linux sysadmins in 2022

How-To
Jan 03, 20224 mins
Linux

The beginning of a new year is always a good time to review what has gone well and not so well and make decisions about how you want to improve your work and your life.

As the new year gets off to a start, it’s always a good idea to commit to some changes that might improve your life or make your work more rewarding. So, here are some suggestions for Linux sysadmin resolutions for 2022.

Learn some new commands

Even after using Linux for more than 30 years, I often find myself discovering some command that I didn’t know about or didn’t realize how much I could do with it. 2021 was the first year that I used the cheat command or used the –help option for commands more often that I read their man pages. I also started using the bpytop command fairly often. And, whenever I ran across a command I wasn’t previously familiar with, I took the time to look it up, install it (if needed) on one or more of my Linux systems and play with it. Considering that I’m seeing nearly 2,000 files just in /usr/bin on my Fedora system, I’m not surprised that, even after 30+ years, I’m not familiar with all of them.

Manage your backups

Making sure that your backups are running successfully, capturing all the content you need and are usable whenever you need to restore a system or a few important files is a critical part of systems administration. Verify that backups are running properly and restore a file now and then so that you can always be confident that you can do that easily.

Clean up

Get rid of files you no longer need. It’s easy to accumulate a pile of temporary files or one-use data files. And, while you’re at it, check your disk space and make sure you’ve got plenty of free space for moving forward.

Check user permissions and privileges

If you’re managing servers with many users, it’s a good idea to review user accounts periodically. How much room are they taking? Are permissions set properly so that any sensitive files are not viewable by anyone who has no need to see them. If you give users sudo privileges vis the /etc/sudoers file, make sure the rights provided to them are still needed. Check account expirations dates if used and verify that your password reset requirements match what you or your organization require.

Regularize your system updates

Make sure that your systems are updated fairly regularly whether you do this by hand, using an alias or automate the process. For the most recent distributions, those updates will likely be available far more often than for older distros.

Try a different desktop?

Given how many distributions of Linux are available, you might enjoy trying out a different one and explore desktop options. Keep in mind that you can run Linux on a lot of modest laptops. It could be fun to explore one that’s new to you.

Using aliases

I continue to believe that it’s a great idea to turn commands that I use quite frequently into aliases — especially complex commands. Aliases can save us a lot of time and serve as good examples of useful commands. Here’s just a handful of mine:

$ alias | sort | head -10
alias ?='apropos'
alias ByCPU='ps aux --sort -%cpu'
alias ByCPUusage='ps aux | sort -nk 3'
alias ByMem='ps aux --sort -%mem'
alias ByMEMusage='ps aux | sort -nk 4'
alias ByPID='ps aux | sort -nk 2'
alias ByUser='ps aux | sort -k 1'
alias c='clear'
alias ck_iptables='sudo iptables -S'
alias cmds='history | awk '''{print $4}''' | sort | uniq -c | sort -nr''

Writing scripts

I still enjoy writing scripts to do work that I need to do periodically so that I don’t ever have to remember the series of commands that are required to get the job done. Most of my scripts I keep in my personal ~/bin directory. I use bash most of the time, but also use Perl and Python from time to time.

Consider trying out a new scripting language in 2022. You might be surprised how much fun it can be.

Recall how you were first introduced to Linux and how you felt

It was over 30 years ago when I was a programmer on a project to automate the criminal docket for district courts around the US that I was first introduced to the Linux command line. For me, it was “love at first byte.” It felt almost magical that I could get as much done by piping commands together as I could by writing a moderately complex program to do the same thing. In the interim, I’ve managed a number small networks and large groups of Unix and Linux servers. I still enjoy using Linux and looking for ways that I can work smarter, make better use of my time, and discover more tools and commands.

sandra_henrystocker
Unix Dweeb

Sandra Henry-Stocker has been administering Unix systems for more than 30 years. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She lives in the mountains in Virginia where, when not working with or writing about Unix, she's chasing the bears away from her bird feeders.

The opinions expressed in this blog are those of Sandra Henry-Stocker and do not necessarily represent those of IDG Communications, Inc., its parent, subsidiary or affiliated companies.

More from this author