7 ways AI can help with your Linux system management


Linux AI terminal

Jack Wallen/ZDNET

Follow ZDNET: Add us as a preferred source on Google.


ZDNET’s key takeaways

  • AI has its place in the world of Linux.
  • If you’re new or über busy, AI can be a big help.
  • Employ AI in one of these areas to ease your burden.

I’m not a big fan of employing AI for everything. I strongly believe that it should have no place in creative endeavors (with some exceptions — such as DaVinci Resolve’s incredible AI voice isolation), but it does make sense to employ AI in certain areas.

For example: Linux system management. 

Before anyone gets up in arms, I’m not saying that system administrators should be replaced by machines. What I am saying is that AI can help those who are new to Linux learn how to manage (or better manage) their systems. And in cases where a single admin has to manage more machines than they have time for, AI can make for a great assistant.

But in what areas?

I’ve cobbled together seven uses where AI could really make a difference for those who are either very busy or who are just now learning the ins and outs of Linux.

1. Bash scripts

Although bash scripts aren’t a necessity for basic desktop Linux use, anyone who’s ever managed a Linux server or wanted to simply create a custom backup task for their desktops, bash scripts are essential.

For those who are just learning Linux, these scripts can be daunting, which is where AI can be handy. Using AI, you could type a prompt like, “Create a Linux bash script that backs up my ~/Documents directory to an external drive mounted at /backups on a daily basis and retains only the most recent five backups.”

Also: 5 factors steadily fueling Linux’s desktop rise

Your AI will create the bash script for you, which you can then test. If it works, cron that baby (another instance where you might need to use AI), and trust that your backups are going to be successful. Do make sure to check that they are not only working, but that the backups contain the files you want backed up. Because… you never know.

2. Parsing log files

Log files are key to understanding what’s going on with your system or what’s happened to your system. Most Linux log files are contained within /var/log, and some of them can be a bit challenging to understand. Here’s a good example. I recently ran into a syslog entry that I’d never seen before. Each entry contained “cause font doesn’t have a family name.” I did some DuckDuckGo’ing and found nothing. I then opened Opera’s Aria and queried it about the error. Turns out the error relates to font handling or rendering, and that the fonts in question do not have an essential attribute (in this case, a family name). Clearly, that’s not an error I need to worry about, so I decided to suppress those errors by creating a blacklist file in /etc/rsyslog.d/ with the contents:

:msg, contains, “cause font doesn’t have a family name” stop

I then restarted rsyslog with:

sudo systemctl restart rsyslog

Also: 5 surprisingly productive things you can do with the Linux terminal

The error was no more.

3. Understanding journalctrl output

Systemd can be a bit confusing at times, especially when it comes to errors. When you wind up with errors, you’ll be pointed to the journalctl tool, which can contain some really cryptic output. Most of the time, I can understand what it’s saying, but every so often, the journalctl output makes me go, “Huh?” When that happens, AI can be of assistance. 

Keep in mind that you shouldn’t just tell AI, “What does this output mean?” You should also include the app or service you are troubleshooting, as in, “What does this openssh-server journalctl output mean XXX” (where XXX is the actual journalctl output. 

AI is pretty good at helping you understand what you’re looking at.

4. Generating iptables firewall rules

Iptables is the foundation for all Linux firewalls, and man, can it be complex. It’s not often you have to bother with iptables, because you’d mostly be interacting with simpler counterparts, such as UFW. But if there is an occasion where you have to use iptables, you’ll very quickly realize how complicated it is.

Also: The first 5 Linux commands every new user should learn

I remember the first time I had to use iptables (back in the late 1990s), and I thought, “I’m never going to understand this!” Had I had AI to help me unravel the complexity of iptables, things would have been as easy as querying:

Write an IPtables rule to allow SSH connections in through port 2022 on the Ethernet device eth0.

Yeah, that’s so much easier.

5. Process monitoring

Although there are plenty of tools to help you monitor your Linux processes (especially some of the amazing and user-friendly GUIs), you might run into the rare occasion that you have to figure it out with nothing more than the command line. If you understand the ps command, you should be good to go; otherwise, consider querying your favorite AI:

How do I find out which process on a Linux system is using the most system resources, and how do I stop it?

The answer should get you started on your journey of keeping Linux system processes in check.

6. Managing user accounts and permissions

What if you needed to lock a user out of their account on a Linux system that includes agentic AI? You could always query:

Lock Mary out of her account for one week.

If the AI is configured with the proper permissions, you’ll most likely be asked to type your sudo password so the process can continue. After typing your sudo password, most likely your AI is going to run the command:

sudo chage -E $(date -d “+7 days” +%Y-%m-%d) Mary

Also: The best Linux distros for beginners

Because file/folder permissions can be a bit complicated to learn, you might use AI to help you out. This is especially easy on a system that includes agentic AI. With that, you could do something like:

Change the folder ownership and permissions of /data such that the group editors have full access to it.

7. Virtualization

Although you may never have to deal with virtual machines, there may come a time when you want to run a virtual machine in the background, so you have access to a particular server on your LAN, without having to have a GUI running 24/7. 

For example, you might have a virtual machine that runs Nextcloud to serve as your in-home solution for Google Workspace. Instead of running the VirtualBox GUI and then having the server GUI up and running (both GUIs take up valuable system resources), you could run it headless (which means without a GUI) so you can still access it from anywhere on your LAN. 

To that end, you could query:

How do I run a headless instance of a VirtualBox virtual machine named Nextcloud?

You’ll probably see the following in the output:

VBoxManage startvm “Nextcloud” –type headless

There are plenty of other ways you can use AI to help with Linux system management, and the above will easily get you started on that journey.





Source link

Leave a Reply

Subscribe to Our Newsletter

Get our latest articles delivered straight to your inbox. No spam, we promise.

Recent Reviews


The iPhone Shortcuts app reminds me of Minecraft. It might be relatively easy to jump into, but it offers nearly limitless potential, allowing you to build anything you want. The same holds true for the Shortcuts app, and that endless possibilities are what many iPhone users might find intimidating. But you don’t have to.

If you are new to iPhone shortcuts, think of them as little automated helpers. You can build them yourself or find ones that others have built and use them. And that’s the beauty of shortcuts. If you don’t want to get your hands dirty, you can find shortcuts others have created and tailor them to your needs. 

With that said, let’s check out my favorite shortcuts. These are not the best shortcuts on everyone’s list, but they are the ones I use daily to get things done faster and more efficiently.

App settings: stop digging through the settings app

Anyone who has spent more than five minutes hunting for an app’s permissions inside the Settings app knows how frustrating it can be. You have to open the Settings app, scroll all the way down, open the Apps section, scroll again to find your app, and only then can you enter its settings. 

This shortcut fixes that completely. It uses the Get Current App and Open URLs actions in the Shortcuts app to detect which app you are currently in and jump straight to its settings page. Once you set it up and add it to your Control Center, all you have to do is open the app, swipe down from the top, and tap the shortcut. 

It will automatically open the current app’s settings. It is genuinely one of the most practical shortcuts I have ever created, and you can download it using the link below. 

Get App settings shortcut

Apple Frames 4: make your screenshots look professional

If you ever share screenshots on social media, a blog post, or a presentation, this shortcut is for you. Apple Frames 4 is a free shortcut by Federico Viticci of MacStories, which can wrap your screenshots in a proper device frame.

The latest version is noticeably faster, supports all recent Apple devices, and even lets you choose frame colors and scale the images proportionally. What I love most about this shortcut is that it can take multiple screenshots as input and combine them in one image. 

All the images in this article have been created using the same shortcut. If you also take screenshots regularly, I can highly recommend this shortcut. I would also recommend you check out my favorite screenshot utility for Mac. It offers all the missing features of Mac’s built-in screenshot tool and then some. 

Get Apple Frames shortcut

Scan document: your pocket scanner is already in your hand

You don’t need a third-party app to scan documents on an iPhone. You don’t even need to open the Notes or Files app the usual way. With this shortcut, you can open the document scanner instantly and scan and save papers without any extra steps.

I have it in my Home Screen and use it whenever I need to quickly scan a receipt, a letter, or any paper document. It’s one of those shortcuts that sounds simple until you realize how much time it saves you every week.

Get Scan Documents shortcut

Resize & convert: resize images without downloading a third-party app

How many times have you shared a photo only to find out it was too large, or in the wrong format for where you needed it? Since the iPhone Photos app doesn’t let you resize an image or change its format, I found a simple shortcut to do it. 

The steps are pretty easy, too. You pick the image, set the size, and the shortcut handles the rest. I use this a lot when I need to send images for articles or posts that require specific dimensions. 

It handles a task I would otherwise have to do on my Mac or download a third-party app on my iPhone to complete. 

Get Resize & convert shortcut

Extract PDF pages: pull out only what you need

I deal with a lot of PDFs, and sometimes I need to extract a few pages to share or save. So I downloaded a shortcut that lets you select specific pages from a PDF and extract them into a new file.

It sounds like a small thing, but if you have ever had to send someone just two pages from a 40-page PDF, you know how handy this is. You don’t need to download any app, pay a subscription, or open your Mac. Your iPhone handles it in seconds.

Get Extract PDF shortcut

Clipboard history: because you always lose what you copied

This is one of the most underrated shortcuts on this list. While macOS has finally added a clipboard history feature with the macOS Tahoe update, the iPhone still doesn’t have a clipboard history. That means every time I copy something on my iPhone, it erases all the previously copied items. 

So I built a shortcut to work around it. Now, every time I copy something on my iPhone, it saves to a note, creating a running clipboard history I can refer back to whenever I need it. The only issue is that I have to run the shortcut manually for it to work. 

So that’s why I have added it to the Back Tap gesture (go to Settings → Accessibility → Touch → Back Tap) on my iPhone. Once I copy something I want to save, I simply tap the back of my iPhone three times to trigger the shortcut and save the copied item in a preassigned note. 

When you download the shortcut, make sure to edit it by tapping the three-dot menu and selecting the note you want to use as your clipboard history.

Get Clipboard History shortcut

Turn off mobile data when iPhone connects to Wi-Fi

To balance the manual activation of the last shortcut, I give you one that is pure automation. Once you set it up, you never have to think about it again. The shortcut uses the Shortcuts automation feature to detect when your iPhone connects to a Wi-Fi network and automatically turns off your mobile data.

I have also set up the companion automation that turns mobile data back on when you leave Wi-Fi. It saves battery life and prevents your phone from uselessly using mobile data when it doesn’t need to. Since this is an automation, there’s no way to share a downloadable link, but you can learn how to create this shortcut. The screenshot should give you the basics of how to do it.

My 7 favorite iPhone shortcuts

I know the Shortcuts app can feel intimidating at first, but most of these require very little setup, and the payoff is immediately obvious. Start with one that solves a problem you have right now, and before long, you will be building your own.

If you have an iPhone and are not using Shortcuts, you are missing out on one of the most powerful tools Apple has built. So, definitely give this a try, and your life will never be the same.



Source link