Manage Files In A tar Archive

Today we’ll have a fairly simple article, albeit a bit archaic, as we learn how to manage files in a tar archive. We often work with modern compression methods but tar files still exist and are in wide use. If this is something you’re interested in, this is the article for you. If this isn’t something you need right now, remember this article and look it up later when you do need to manage files in a tar archive.

Sure, tar now often ends with .gz or .bz, but they still exist. You’ll still see them and you’ll still get regular questions about them. In fact, a lot of folks will ask questions like, “How do I install files from a .tar file?” Alas, that’s a pretty broad question and not something we’ll answer here. However, the answer is, “Manually.” That’s how you install files from a tar file, generally speaking.

What Are tar Files?

So, I’m pretty sure we’ve covered this before, but ‘tar’ stands for ‘tape archive’ and is a pretty old standard. Yes, I am well aware that tape archives still exist. There’s no reason to leave a comment telling me that. I know, but I suspect most tar files never see a tape throughout their entire lives. If you’re curious, the man page describes the tar application as this:

tar – an archiving utility

The format has been around since 1979, though it has undergone some changes along the way. If you’re interested, there’s an excellent Wikipedia article about tar files. It’s well worth skimming it, as I did when I wrote an earlier article.

Basically, tar is a way to organize multiple files into a single file. Tar files are not compressed in and of themselves. We more often see them compressed with .gz (or the like) but the format doesn’t include compression of any kind. It is also meant to work with any file system, as it contains no real file system in and of itself.

Well, eventually you may want to work with tar files. You may want to add, remove, or modify tar files. That’s all easily done within the Linux terminal and this article will show you how.

Manage Files In A tar Archive:

Obviously, you need a terminal for this application. By now, regular readers will know how to open a terminal. In most distros and desktops, you can just press CTRL + ALT + T and, with that, the default terminal will pop open.

With your terminal now open, let’s go ahead and create a new tar file to mess around with…

Now, we’re all set for this exercise…

Add Files To A tar File:

So, it’s easy enough to add files to a tar file. The syntax to do so is quite simple, though you do need a few flags.

Of course, you can add multiple files by just adding their file name. Using the files you created in the first step, you’d add files to a tar file like so:

To avoid any confusion later, we’re now going to clean up after ourselves, leaving just the foo.tar file.

Now, in your terminal you can type the following:

In the list of files, you should now only have the foo.tar file remaining. For neatness sake, this is an important step. You can list the files in a tar file with the following command:

The output should look like this:

See?

Remove A File From A tar File:

Now that you have created a tar file and added files to it, you next need to learn how to remove a file from a tar file. That’s actually a very simple process. The syntax is as follows:

So, using our current example file, we’d do something like this:

You can check again to see that the foo3 file no longer exists.

Still with me?

Well then, the next logical step in this process would be learning how to…

Change Files In A tar File:

If a file already exists in a tar file, you will first need to extract that file. You can do so easily. Use the tar -tvf <file_name>.tar to find the specific file’s name. With the name of that file, you can extract it with this command:

So, using the example file that we’ve worked through, we’d change the file called foo2 by first extracting it, like so:

That will extract the foo2 file from the archive. You can then edit that file, say with nano, to make it say what you want it to say. Feel free to do so, but you must remember to save the file after you’re done editing the file. (To save files in nano, press CTRL + X, then Y, and then ENTER.)

Now, you just replace the file with the file you’ve edited. In this case, it’d be foo2 that you’ve edited. The syntax is pretty easy:

So, in our case, you’d be replacing foo2 with the previous foo2 file. That’s a nice and simple command. To finish the exercise, you can run this command:

Be sure to check the man page to learn what the flags do and to see the many other options that come with your tar application. It should absolutely be installed by default, on even the most bare of distros.

Closure:

So, well, I figured this would be a fun article to write. I was not wrong. If you want, you can clean up after yourself with this command:

I figured it’d be a fun article for folks to follow and wrote it in a way that I hope facilitates that. There’s nothing all that complicated about it. If you want to manage files in a tar archive, this is a good way to do it. You could probably do it with a GUI, but this way is just as good – I think.

Also, this was the article I wanted to write last time. You got a meta article because of my poor internet connection. This was the article I’d hoped to write. It’s quite a bit different than most of my articles, but hopefully, it takes you clearly from the start to the finish – including cleaning up after yourself!

As always…

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.

Find And Remove Duplicate Files With fdupes

Today’s article has you cleaning up your storage space as you learn to find and remove duplicate files with fdupes. This isn’t something you need to do often and it’s something that could theoretically break your system. If you’re going to remove duplicate files, it’s a good idea to exercise some caution.

I’ve previously shared another way to remove duplicate files:

Find And Remove Duplicate Files With rdfind

I suppose it’s pretty obvious as to why one might want to remove duplicate files. You do so to keep your storage tidy and you do so to make space when space is limited. There are all sorts of ways to make free space and removing duplicate files is just one of them.

The tool we’ll be using this time around is known as ‘fdupes’ and the man page describes it like this:

fdupes – finds duplicate files in a given set of directories

It’s an easy enough application to install and this article shouldn’t be all that long. You’ll find that fdupes is available in your default repositories, or there’s a good chance that it is in there. Of course, this means it’s easy enough to install.

Installing fdupes:

You can install fdupes with a GUI and your software manager, but you can just as easily install it via the terminal. We’ll cover the latter, as it’s the most universal (and, I find, quickest) method. Of course, you’ll need an open terminal. In most cases you can just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, let’s go ahead and install fdupes:

Debian/Ubuntu/derivatives:

SUSE/OpenSUSE/derivatives:

RHEL/Fedora/Rocky/derivatives:

Arch/Manjaro/derivatives:

Gentoo/Calculate/derivatives:

And More! (Just search your default repositories for ‘fdupes’ and it’ll almost certainly be there.)

As you can see, you’ll find that fdupes is available for pretty much every Linux system out there. Not only is it available, it’s already packaged for you and easy enough to install via the terminal. On top of that, it doesn’t take much space to install fdupes, a mere 110 kB or so.

NOTE: I do not have anything against GUI tools. While I have terminals open at all times, I do the majority of my computer interaction in a browser – specifically a GUI browser. I suggest and write about the terminal because it’s more universal. It’s also often faster, assuming you can type or at least cut and paste than it is to go mucking about with a GUI software installer.

Anyhow, it’s nice and easy to remove duplicate files with fdupes. This article is going to show you how – and the article shouldn’t even be that long! It’s pretty simple.

Remove Duplicate Files With fdupes:

I’m going to assume that you left your terminal open after installing fdupes. If you didn’t, you’ll need to open it again. The only way to run the fdupes application is in the terminal. So, even if you installed it with a GUI, it’s a CLI tool and you’ll need the command line to use it.

The basic syntax is pretty easy, and not entirely unlike rdfind. For example, if you want to find duplicate files, you simply run this command:

So, if you wanted to find duplicates in your home directory, you’d run this:

Don’t worry, you’re safe running that command. That won’t delete anything at all. That fdupes command will simply show you the duplicate files that it found.

If you want to run the fdupes command recursively, that is to check all the folders within the directory, you’d run the command like this:

If you want to calculate the size of the files that would be removed when removing the duplicates, the command is just this:

A summary is also available with this command:

You can also search multiple directories for duplicates. That’d be something like this:

Of course, you can run those commands together to get quite a bit of customization. They’re all reasonably harmless and will simply point out the duplicates as well as some meta information. You can then remove the duplicates by hand if you want.

You can also tell fdupes to remove the duplicates that it found. You’d never want to run this command without knowing what exactly is going to be removed, so don’t do that. Always check to make sure you’re not removing anything of value before automatically removing duplicates.

Fortunately, there’s a bit of a stopgap. You can run the following command and fdupes will ask for confirmation before removing the file:

If you want to go whole-hog and remove every duplicate found, and remove the files without any confirmation, you can run this command:

Of course, that’s just the basics. If you want to know more about fdupes, simply check the man page (man fdupes) for more information.

Closure:

Hmm… I think I need to clean or replace this keyboard. The colon key is sticking on me. It’s a bit of a pain in the butt.

Anyhow, if you’ve ever wanted to remove duplicate files with fdupes, you now have directions to do so. This being Linux, you have all sorts of options when it comes to removing duplicate files, though I again urge caution when doing so. If you were to run this on the root directory, you’d likely find a lot of duplicates, and removing them might break your system. So, be careful with these tools, as they’re pretty powerful.

I’m not yet out of ideas for articles but it’d be great if folks might suggest something they’d like to read about. You never know, it might be something I know about. As it is, I have to search this site before writing an article, or else I’d end up with even more duplicate articles. I don’t want that and you don’t want that. It’s not all that easy to keep up this pace, writing a new article every other day. I’ve managed so far, but I’m eventually going to miss a day or two. It’s going to happen.

As always…

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.

Access Recovery Mode On Ubuntu

Today’s article shouldn’t be too long, but covers something important, which is how to access recovery mode on Ubuntu. If your Linux system has problems, you may need to access the recovery mode in order to fix it. This shouldn’t be a very long article, and I don’t think it’s all that complicated. Others may view this as complicated, but it seems pretty basic to me.

It isn’t all that complicated a process, but it’s something you should memorize, just in case you have no other way to access a search engine to learn this information. This is one of those skills you really ought to know by rote. It is one of those things about Linux that you probably should have memorized. 

What is Recovery Mode?

When you boot to recovery mode, you’ll be given a choice of booting to any of your currently installed kernels. The system then boots with the minimal amount of resources and mounts the root partition as read only.

You might be interested in a recent article on the subject of multiple kernels:

Show Installed Kernels In Ubuntu

Recovery mode lets you access the system to troubleshoot problems. It probably isn’t a necessary step for most issues, but it’s a necessary step that you will want to take if your desktop isn’t otherwise loading. If you’re unable to get to the GUI desktop, you should try recovery mode.

You can also try previous kernels by doing this. Recovery mode is just one option you’ll have from the GRUB menu. You get to pick your other kernels and even enter a text mode to work on your system via the CLI. For most folks that have had the kind of difficulties that stop the GUI from loading, trying recovery mode is a good step to take.

This may very well work in other operating systems. I’m being specific to Ubuntu because that’s what I have pictures for. Well, technically I’m using Lubuntu in a VM to get the pictures, but this should work for all sorts of distros. Do me a favor and leave a comment if you know this works in other distros. It’s way too late in the day and I don’t have time to check.

Access Recovery Mode On Ubuntu:

Well, you don’t need a terminal for this exercise, but you do need to reboot your computer. I suppose we can do this from a terminal, if you really want. You can just as easily use the GUI, or you can close things down gracefully and then run the following command in the terminal:

BEFORE YOU DO THAT…

We need to know if you are using EUFI/EFI boot or if you’re using the legacy BIOS mode to boot your computer. Fortunately, I’ve already covered this!

How To: Tell If You Are You Using UEFI or BIOS

Now, when your computer reboots, it’s going to perform a quick POST (Power On Self Test). That’s the point when you can decide to just let it boot or decide to enter a temporary boot menu. These shouldn’t be confused. If you’re interested in accessing your temporary boot menu, read this article:

How do I ‘Boot to USB’? (Or CD/DVD, if Such is Available)

As soon as POST ends and the OS starts to load, there’s a very brief window of time when you can press a key and access the GRUB menu. Trust me, this works. You may have to try multiple times before you get the hang of it, but this 100% works.

If you have a working keyboard, this works. You just need to time it right. You can try pressing and holding the right key as soon as you reboot, or you can try tapping the key over and over again. Should you have issues getting it right, check your settings for “Fast Boot” and temporarily disable that to give you more time.

If you’re using UEFI, the key you’ll press is the ESC key.
If you’re using BIOS, the key you’ll press is the SHIFT key.

Assuming you’ve done this right, you’re now at the GRUB menu…

The GRUB Menu:

GRUB stands for “Grand Unified Bootloader” and is what you’ll be seeing (and using) on a stock Ubuntu configuration. There are other bootloaders out there, but we’re assuming you’ve not changed from the default.

If you’ve done the above steps properly, you’ll see a GRUB screen. If you haven’t done this correctly, you’ll see the splash screen as the operating system starts to load. When you see the splash screen, you might as well just reboot so that you can try this all over again.

The first screen you’ll see will look like this:

the grub boot screen
I’ve highlighted the choice you want to select with your arrow keys and enter button.

As indicated, you want to select the advanced options for Ubuntu. Of course, that won’t be the case if you’re using a different distro. You’ll want to pick the advanced options for that distro.

Finally, you need to select the correct option to access the recovery mode on Ubuntu. It’s really obvious, but here’s a handy picture:

grub option to pick the recovery mode for ubuntu
You can see that you can also select the recovery mode from an older kernel.

Once you’ve done that, and with any luck, your computer will boot to the recovery mode, and you’ll have learned how to access recovery mode on Ubuntu. You can see the option to boot to an older kernel is there as well. That’s another useful tool to have in your Linux toolbox.

Closure:

Well, if everything goes perfect (and it seldom does), you won’t need to access recovery mode on Ubuntu. It’s just not something you’ll need to do. But, if things don’t go perfect – and we tend to tweak, modify, and break things as Linux users, you do have a recovery mode, and it’s not too hard to access it. Of course, what you do once you’ve entered recovery mode is up to you and will depend on your problems, but you now know how to access 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.

Show Installed Kernels In Ubuntu

Today’s article should be fairly short and straight to the point, as we discuss how to show installed kernels in Ubuntu. This isn’t a very complicated thing and we’ll be showing these kernels in the terminal. Sure, there are GUI tools you can use, but you might as well learn to do this in the terminal.

A lot of people ask the question, “What is Linux?”

Well, Linux is just the kernel. The kernel schedules tasks, interfaces with hardware, and generally manages the stuff that goes on at a lower level. This is surrounded by GNU’s tools and you will generally add a window manager and desktop environment on top to turn it into a useable desktop system with a fancy GUI.

You might enjoy reading this article:

The “Linux” or “GNU/Linux” Debate

Under all that is the kernel. It’s very important! Without it, we’d have no Linux. There are other kernels out there, but the topic of this site is Linux Tips. But, without a kernel, your computer would be dead in the water. 

In the course of updating your system, and depending on how you do your updates, you’ll install new kernels as they are released. GRUB will default to the newest kernel in most configurations, but there are other kernels installed and those can be selected from an advanced menu during the boot process.

Unless you have a brand new install that hasn’t been updated recently (kernel updates are common), you’ll have more than one kernel installed. Even if you upgrade Ubuntu in the terminal, even if you use ‘autoremove‘, Ubuntu will store the previous kernel. This is a good thing, as you can boot to that kernel if the new one should give you trouble.

It’s sometimes necessary to wait out a kernel version because it doesn’t run properly on your system. That’s not common, but it does happen. When that does happen, you should update manually and control what software is removed so that you don’t remove the working kernel and can still have a usable system. It happens, it’s just not all that common.

By the way, the kernel is mostly worked on by paid developers these days. The current kernel has more than thirty million lines of code. Of course, it contains drivers for hardware new and old and those folks using the older equipment will scream bloody murder if you remove their drivers from the kernel. Still, stuff gets culled regularly – it’s for the good of the herd! Maintaining all that for three users is asking too much.

What have we learned?

We’ve learned that the kernel is important and kind of what it does. We’ve also learned that you have more than one kernel installed. Additionally, we’ve learned why that’s a good thing. So, we’re doing okay so far!

Show Installed Kernels In Ubuntu:

As the first paragraph said, you’re going to need an open terminal. This is true for most of my articles. You should know how to open a terminal by now. If not, press CTRL + ALT + T and hope for the best! That keyboard shortcut is not quite universal, but fairly close.

These instructions are going to work in Debian, Ubuntu, Mint, etc… At least one of them may work for other distros. I can’t say that I’ve tried recently and I’m not going to make any claims. Where we use ‘dpkg‘, that’s going to be exclusive to those distros with dpkg – the Debian Package Manager.

Seeing as I mentioned dpgk, we can start with that command first. If you want to show installed kernels in Ubuntu using dpkg, the command is simply:

That might look something like this:

showing the installed kernels in Ubuntu
See? There are multiple kernels installed at this point on this particular system.

If you search the ‘net, you’ll find there are all sorts of ways to do this – including some fancy commands that use egrep and show colors. I don’t see any reason to include those. What we have here works.

If you want, you can also use the find command. That’s a nice and handy command and I suppose this command might work on other distros. To show installed kernels in Ubuntu using the find command, try this command:

That should list your installed kernels quickly and without any fuss (and no muss). There are all sorts of ways to find this information but we’ve just covered the two quickest and easiest ways I can think of (in the terminal). It’s probably quicker in the terminal than it is for any other method, especially if you’ve always got an open terminal (or three).

Closure:

Well, there you have it… You have learned how to show installed kernels in Ubuntu, a useful skill to have (especially if you’re having kernel issues). These are easy enough to remember commands, or you can always use this site’s search function to find what you need. I do that myself. I’m always referring to articles I’ve written and the search function isn’t great but it does work.

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.

Increase The Volume Of Thunderbird Notifications

Today’s article is one of a personal nature, an issue that affected me personally, where I needed to increase the volume of Thunderbird notifications. It was a bit of a problem and one easily resolved – at least in my case. I think it will be trivial to overcome this for others and thought that I’d make a quick article about this.

Thunderbird is an email client. The Thunderbird email client is brought to you by the same people, that is Mozilla, that brings you the Firefox web browser. As far as graphical email clients for Linux goes, you’re probably better off using Thunderbird.

This article is specifically about the calendar. It is only applicable if you have the calendar (sometimes called Lightning) installed. Further, it is only applicable if you then also have it set to chime an audio file when a scheduled activity is due. If none of those things are true, this article is not meant for you.

I don’t allow most audio notifications, but I do rely on Thunderbird for scheduling and noting appointments. If you’ve configured Thunderbird to show notifications and to create a sound to denote those notifications, you may notice that the notification is quieter than you’d like.

I searched for a solution for the low volume of Thunderbird notifications. I had a solution in mind, but I looked for something more graceful. The goal was to find something ‘in-app’ that let me set the notification volume. Not only was I unable to find a solution in that direction, I was unable to find anyone suggesting this path to increase the volume of Thunderbird notifications.

I’ll be giving directions for Debian (and derivatives such as Ubuntu, and all official Ubuntu flavors, Linux Mint, ElementaryOS, and such) but you can adapt these directions for your needs. The tool we’ll be using is ‘Audacity’ and that’s probably going to be in everyone’s default repositories.

If you’re unfamiliar with Audacity, the application is used to edit audio. As a general rule, I don’t bother with full-fledged DAWs and prefer the simplicity that Audacity offers. So, I guess that does make it my DAW of choice.

Odds are good that you don’t have Audacity installed by default. Again, assuming you use a distro with apt, you’d simply install Audacity with the following command:

If you’re curious, the man page describes it like this:

audacity – Graphical cross-platform audio editor

That’s a fine description and Audacity is the only tool you’ll need to increase the volume of Thunderbird notifications. As near as I can tell, this will work on default sounds or the sounds you add as your notification sounds.

So then, let’s get on with it… Let’s learn how to…

Increase The Volume Of Thunderbird Notifications:

If you read the intro correctly, or at least as how I expected it to be read, then you should have already installed Audacity. You can do this with any DAW (Digital Audio Workstation) but Audacity is quick and easy, easy enough for me to use.

So, I’ll assume you have Audacity installed.

You can do this with Ocenaudio. If you want a full-blown DAW, you can do this in Reaper. You have choices, but these directions are for Audacity.

Your first step is to open your file manager. With your file manager now open, double-check in Thunderbird to see where your notification sound file is located. It’s in the Settings menu, under the Calendar settings.

Thunderbird's notifications settings.
This should be fairly easily explained. A picture is worth 1,000 words!

As you can see, I’ve chosen a custom audio file. The process is the same. You need to find the file in question or add your file. If you wanted to you could root around and find the default file, but I suggest adding your own.

Once you have found the sound file, right-click on it and open it in Audacity. You can also open Audacity and then open the file by clicking on File and then Open. Both should work on most distros.

You’ll then see a screen that looks similar to this:

We'll increase the volume with Audacity.
That’s the waveform of my ‘cymbals’ notification chime.

What you do from here is right-click on any part of the spectrum shown in the image above.

You then press CTRL + A to select the full file.

You next click on Effect and then you click on Amplify. Adjust the amplification to suit and use the preview button to judge the volume level you’d like to achieve. That screen would look something like this:

Using Audacity to control the reminder sounds from Thunderbird.
If you want to hear your Thunderbird notifications easily, this is how you do it.

This works with more than just increasing the volume of Thunderbird notifications. You can raise and lower the volumes of almost any sound file quickly and easily. Rather than mucking about with some Thunderbird extension, you can just raise the volumes yourself.

Closure:

I’m not sure how many folks will be helped by this article, but I hope it’s some. This was an itch that I needed to scratch and this was how I went about doing so. I figured I’d share that with you by making it into an article. That seemed like a reasonable choice at the time.

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.