Let’s Make A Linux Installation Drive

Today’s article might seem like a duplicate article, but it’s just another way that you can make a Linux installation drive. Today, we’ll be showing you yet another way to accomplish your goals. Why? Because we can! Because Linux has umpteen different ways to reach your goals – and that is awesome.

We’ll also be using a different tool for this exercise. It’s a pretty handy tool, suitable for more than just making an installation drive. Specifically, a USB thumbdrive! But, that’s just one thing you can do with this tool. It’s my way of introducing you to the tool in a useful manner. 

So, what tool will be using?

Introduction To ddrescue:​

The tool we’ll be using is called ddrescue and it’s a pretty handy tool. You probably won’t find ddrescue pre-installed, so you’ll almost certainly need to install it yourself. 

Also, if you want some confusion, if you’re using Debian, Ubuntu, Mint, etc., you’ll find it’s gddrescue at least during the installation process. Why? I don’t know. You’ll have to find out from the Turks.

Once you do have ddrescue installed, you’ll find the man page (man ddrescue) describes the application like this:

That’s right, it’s a data recovery tool! We won’t be doing any of that, however. You can probably install ddrescueview and do some of that good old data recovery with a handy GUI. I’m telling you, check the man page. This article is just going to scratch the surface.

Let’s Install ddrescue:

Yes, you can open up some GUI, type in an application name, and then install ddrescue. Or, you can open the terminal and install ddrescue without any GUI help at all. Let’s do that! Press CTRL + ALT + T to (hopefully) open up your terminal.

With your terminal now open, use the appropriate following command to start the installation process:

Debian/Ubuntu/etc:

Fedora/CentOS/etc:

Arch/Manjaro/etc:

If you don’t use any of those package managers, you may still have ddrescue in your default repositories. I just can’t confirm that you do.

Now, with ddrescue installed (even if you had to call it gddrescue during the installation phase), we can get into the meat of the article!

Make A Linux Installation Drive:

Remember that terminal that you opened to install ddrescue? Well, I hope you left it open because you’re going to need it. While the ddrescueview tool is a graphical tool, that won’t help with what we’re doing. We’ll be using the tool to make a Linux installation drive, which is almost an afterthought for this tool.

First, like a previous article about making a Linux install USB, we need to identify your target device. Plug in  your USB thumbdrive and use the following command to identify it:

You should be able to easily pick out your USB device by size. It will begin with an ‘sd’ (remember that it’s case-sensitive) and then may be broken down into partitions. Ignore the partitions and know that you’ll be removing any information on that USB drive.

You’re looking for something like sdb or sdc and you’ll add a ‘dev‘ in front of it. So, if your thumbdrive is sdb, your path is /dev/sdb. If your thumbdrive is located as sdc, the path you want is /dev/sdc. It’s pretty simple.

The syntax is as follows:

For example, this would be a command I could use:

This would let me write today’s current Lubuntu testing .iso to a USB drive so that I can test it on a laptop without having to waste the bandwidth to download the same file twice. 

Pretty handy, huh? 

Well, there’s a lot more you can do with ddrescue. I highly recommend reading the man page to learn more about this nifty application. It can do quite a bit more than this. Indeed, this is more an afterthought than anything else, or so it seems.

Closure:

Well, there you go. You have a new article. That happens regularly around here! Today we talked about yet another way to make a Linux installation drive. Frankly, you can just use balenaEtcher and call it a day. There’s no reason for most of us to do this in the terminal – but we can and it’s not even that difficult. You just need the right tools for the job and Linux has many tools on offer.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Sort Text Alphabetically

Today’s article is mostly just a fun article, one suitable for a beginner, as we learn how to sort text alphabetically. We’ll be doing this in the terminal, of course. If you’re a new user and want to get acclimated to using the terminal, this might be a good article to read. It won’t be short, but it should be easy.

I dimly recall watching an old video about the Unix operating system. Of course, this was all terminal activity. I want to say that it was Dennis Ritchie or some other Unix founder, but they did things like cut and paste along with stuff like piping the output to a new document.

Even though I’d used Unix (and then Linux) before this, I still appreciated the demonstration video. It was indicative of how powerful the terminal can be. If I was less lazy, I’d go hit up YouTube to find the video again. I haven’t seen it in years.

Anyhow, we’ll be learning how to sort text alphabetically. It’ll be fun!

The Sort Command:

As I said, we’ll be doing this text sorting in the terminal. The tool we’ll be using is the sort tool. You won’t need to install anything to use the sort command. It’ll be there by default.

The sort command has a man page. You can access the man page with this command:

If you do that, you’ll see how powerful the sort command can be when used by someone who knows what they’re doing. We’ll just cover some basics. You can also see that the sort command is described as this:

sort – sort lines of text files

That description says that we’re using the right tool for the job. We want to sort lines of text files alphabetically. It’s not hard. You have to learn which tool is the best for the job you want to do. (Also, the tools I think are the best are the best for me, the tools you prefer are the tools that are best for you. This being Linux, there are always multiple ways to accomplish the same goal!)

While not necessarily a part of this article, you might also want to read this article to learn about using the output from these commands.

How To: Write Text To A File From The Terminal with “>” and “>>”

So then, let’s get into the meat of the article…

Sort Text Alphabetically:

For this exercise, we’re going to need an open terminal. This is quickly done. You can, more often than not, just press CTRL + ALT + T to open the terminal. 

With the terminal open, we need to do a little file preparation. This way, we’re all on the same page. I hope that it’ll be easier this way.

Create A Text File:

With your terminal open, I want you to enter the following commands…

You’ll first move to a directory and create a file:

Now, let’s populate that sort.txt file. We’ll edit the file with Nano.

Copy and paste the following text into that sort.txt file:

And, of course, we’ll now save the file. To save a file in Nano, you just need to press CTRL + X, then Y, and then ENTER. That should save the file as sort.txt. You can verify this with this command:

When the output from that command matches your expectations, you’re free to go to the next step. If it doesn’t, repeat the above commands carefully, following them one by one. If you still can’t manage to do this, you can download a copy of sort.txt here.

Using The Sort Command:

Now that you have a file called sort.txt in your ~/Documents directory, you can start to sort it. We’re just going to sort text alphabetically as a way to expose you to the sort command. 

If you want to sort the text alphabetically, you use this command:

It will send the results to standard output, that is it’ll post the sorted output to the terminal. (You can save this output as I’ll show in a minute.) The output of that command should look like this:

If you want to sort the content of the sort.txt file backward, you can do that. You just use the -r flag. That looks like this:

As an example, the output from that command should look like this:

I linked an article above and it’s worth reading if you’re new. But, if you want to output any of this output to a new file, you’d do so like this:

The command’s syntax would be:

That’s not very clear, so you can use this example to figure it out:

That will take the alphabetically sorted output and write it to a file named sorted.txt. It’s a good way to sort text and there’s quite a bit more to the sort command.

Please consider reading the ‘Closure’ bit, thanks!

Closure:

Well, this is a long article – but it should still be an easy article. I’m hopeful that this is written in a way that even a new user can follow. Please consider leaving a comment letting me know if this is easy to follow. Seriously…

See, as the author, I have no flippin’ idea if this stuff is really easy to follow. I legit have no idea if it’s as easy as I think it is to follow along in this article. One of the things I’ve done is play around with formatting and making the articles more verbose. I’ve tried to not increase the verbosity just for verbosity’s sake, but rather to explain more.

I mean, it’s easy enough for me to follow. After all, I wrote it.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Zip Files In Lubuntu

Today’s article will be relatively short and fairly easy as we talk about how to zip files in Lubuntu. This seems like a nice and easy article and something folks might want to know. If you’re in this category, by all means, read on!

NOTE: This is written for Lubuntu, but will work in other distros. I’m just trying something new, specifically doing some distro-specific articles to see how well they do.

If you’re unfamiliar with Lubuntu, it’s a lovely distro that’s fairly lightweight and easily configurable. Lubuntu is an official Ubuntu flavor. The purpose of Lubuntu has changed. The focus has changed from being lightweight (which it still is) to getting out of your way. You can read some of the history on Wikipedia’s Lubuntu article.

I’m biased because I’m an official Lubuntu member. I’m on the team that brings you this distro and have written a few Lubuntu-specific articles.

Disable Window Grouping In Lubuntu
Change Snap Application Privileges In Lubuntu
Change Your DNS Servers To Google’s In Lubuntu

(There are more, of course!)

I’m definitely a fan.

Anyhow, we’ll be learning to zip files in Lubuntu today. When you zip a file, you compress the file and make a new file. Some files don’t compress while other files (such as plain text files) can be compressed quite a bit. There are many different compression tools, methods, and algorithms. I’ve covered some RAR stuff in the past, for example.

Zip Files In Lubuntu:

We’ll be using the zip application in the terminal to zip files in Lubuntu. You can compress files graphically, but we’ll be doing this in the terminal. You can do almost anything in the terminal. So, let’s start by pressing CTRL + ALT + T to open the terminal.

The tool we’ll be using is the zip application, defined simply as:

zip – package and compress (archive) files

For the record, the zip application should be installed by default. I don’t like to assume the default is still true, so I’ll also explain how to install the application, also in the terminal.

You can install the zip application with this command:

You can check the man page for zip with this command:

To zip a file in Lubuntu, you would run this command:

If you want to zip multiple files in Lubuntu, you can just add them to the command by tagging them on the end. That looks like this:

See? It’s just that easy to zip files in Lubuntu – specifically in the terminal. Of course, this is true for all sorts of other distros. The only thing that would change would be the process for installing the application should it not be installed by default.

Closure:

Yup… I told you that this would be a quick and easy article. I will actually (probably) cover more of this very topic. It’s a way to keep fresh articles on the site, by being distro/distro-family specific. Yeah, I know that it’s more convenient to have big articles that cover a lot of information. At the same time, writing them all is a lot like work – largely because you start running out of ideas for new articles.

By the way, I could so use a break. You should write an article for me! In fact, you should write a whole series of articles!

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Kill A User Session

Today’s article won’t be useful for many of my regular readers because it’s about how to kill a user session. This is a skill worth learning, but really only applies to computers that have multiple people logged in at one time. If that’s describing you and your needs, this may be an article worth reading.

Of course, if that’s not something you do, you can still learn from this. It’s not all that complicated and is easy enough to follow. So, feel free to learn something – even if it isn’t something you’re likely to ever need.

There are times when you may have someone logged in and you want to log them out. For example, let’s say you’re getting ready to fire someone. You’re going to want to delete their account, make sure they’re logged out of their account, and then take them to HR where you can file paperwork and escort them (and their property) off the site.

You might also want to do stuff like log people out so that you can perform updates on the server. There are all sorts of reasons why you might want to kill a user session. Your reasons are your own. I’ll simply be showing you the tools.

Kill A User Session:

You’ll need an open terminal and to be connected to the computer you want to control. If you’re doing this, I’ll assume you’re aware of how to do those things. If you’re doing this on your own computer, you can usually press CTRL + ALT + T and your default terminal should open.

Once you’re connected (or have your own terminal) you can find the logged-in users with the following command:

Actually, you can just use this command:

The results are the same. So, either works.

You can now see the output which will show you every logged-in user on that device. Next, you’ll kill a user session with the following command:

If you wanted to use the kill command, you could find the associated processes (the PID) but there’s no reason to do so when you can just kill a user session with the username.

Closure:

There you go. I figured I’d do a nice, short, and easy article. It’s not very complicated and it’s not something many of you will need. However, if you’re managing a system with multiple people logged in, this is a very useful tool to have. You never know when someone’s going to come into your office and ask you to kill a user session. Well, now you know how…

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Make A Linux Install USB

Today’s article is going to be a rather basic article, with worthwhile information, about how to make a Linux install USB. This won’t be too complicated, even if it looks complicated initially. It probably won’t even be a very long article.

If you want to install Linux, you will need some sort of install medium. That can be almost any sort of drive, including some distros that are still small enough to fit on a CD. Heck, if you can get your computer to boot to it, you could even use a MicroSD as your installation media.

We’ll be doing this in the terminal. Why? Well, because it’s not that hard and it’s a fairly universal process. You won’t even need to install anything new! But, if you don’t have any interest in doing this in the terminal (or if you’re not using Linux right now) you can always do this with a GUI. See the following article for more details:

balenaEtcher: A Tool To Turn Linux .ISO Files Into Bootable USB Drives

There’s also Rufus, should you be using a Windows computer. You have options outside of the terminal. Though, I haven’t done an article on using Rufus. I don’t have any Windows devices. (If you want to write said article, feel free to let me know. I love guest articles.)

What You Need:

These are the tools you’ll want to have available. It’s not a long list, so we won’t have too much to deal with.

  1. A blank USB drive, large enough to hold the data.
  2. Any distro with lsblk.
  3. The ability to unmount a disk.
  4. A distro with the dd command.

So, I’ll assume you have the first aspect covered. Everything else is software. They’re standard tools that are available on all but the tiniest of distros.

The first tool is lsblk, which the man page describes as:

lsblk – list block devices

Then you’ll need the obverse of mount, which is unmount. This is a part of the mount command. It doesn’t have a command of its own. That mount command is described as:

mount – mount a filesystem

And, finally, you’ll need the dd command. That’s simply described as:

dd – convert and copy a file

And that’ll be all you need. Well, you’ll need an open terminal, of course! So, let’s cover one way that you can…

Make A Linux Install USB:

Like I said, you’re going to need a USB drive. This drive must be big enough to hold the data. You’ll need to insert the drive and then open the terminal. To open the terminal, just press CTRL + ALT + T or open it from your application menu.

With your USB inserted, you need to identify where it is mounted. You can do that by running the following command:

You should be able to easily identify the USB drive by the size of the drive. The data you want will begin with “sd”, often something like “sdb” or “sdc” (enumerating as you increase mounted storage devices).

Take that information and run the following command:

The next command might look complicated, but just follow the directions and you shouldn’t have any trouble as you make a Linux install USB. The command looks like this:

For example, if the disk identifier was “sdc” and the path to the .iso was something like “~/Downloads/Lubuntu_22.04.iso” the command would look like this:

Then, just wait a few minutes. Let the dd command do its thing and you’ll end up with a bootable USB drive that will let you install Linux. (This also works for other image files, of course.)

Closure:

See? It’s not that complicated to make a Linux install USB. So long as you pay attention, you won’t have much to worry about. There are a few commands that you need to worry about, but those are basic commands in this instance.

I will warn you to be absolutely certain of the path for the dd command because it has the potential to make you have a really bad day. But, if you don’t want to deal with installing a GUI application, or you are in a position where you can’t install a GUI application, this is a way for you to make a Linux USB installation drive to get yourself out of a sticky situation.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.