Backup Optical Media To .iso

In today’s article, we’re going to learn how to backup optical media to .iso. If you have optical disks you want to backup, this is an easy way to go about it. It will not work with all disks, especially those encumbered with DRM.

This is useful for data disks, for example. It’s also useful for music CDs. It’s less likely to be good for things like game DVDs or movies. Those use various methods to stop you from copying your discs. While there are ways to backup some of them, this article won’t be getting into it.

Instead, we’ll just be using ‘dd’ for this exercise. If you’re unfamiliar with ‘dd’, it stands for:

convert and copy a file

If you’re unfamiliar with the command, you should pay extra attention to the way it is used in this article. It’s a powerful tool and using it with just the slightest error can (and will) make you run for your backups.

So, with all those things in mind, let’s learn how to …

Backup Optical Media To .iso:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, we should probably figure out where your optical disk is. One way to find your optical media drive is with this command:

Inside the results of that command you’ll find something like “[sr0] scsi3-mmc” from which you can glean that /dev/sr0 would be your optical drive. With that information at hand, you’ll fun this command:

Be really sure that the path to save is correct, though this command is less likely to harm you than other ‘dd’ commands.

Anyhow, you can verify the integrity of the file created. That’s an easy enough step to take and looks a bit like this:

That should spit out two numbers. Those numbers should match. If they don’t, then something has gone wrong and you might want to try it again.

Closure:

There you go… Another quick and easy article. This one teaches you how to backup optical media to .iso, a handy skill if you want to preserve the data on the disks before they get worn out, broken, or lost. 

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 own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Check Your Hard Drive Temperature

Today’s article is going to teach you how to check your hard drive temperature (in Linux, of course). There are a number of ways to do this, so we’ll just cover one way in this article. It may seem complicated, but it’s not. This should be a pretty short article.

You should have a general idea of the temperature of components within your computer. The components have various operating temperatures and keeping them within spec means they’ll last longer and give you better performance.

Hard drives generally have temperature sensors and we’ll be using ‘hddtemp’ in the terminal to check your hard drive temperature. It won’t work with every hard drive, but it may work with yours. It’s a pretty easy application to install and use, so we’ll go over it as though you’re using Debian/Ubuntu/Mint or something that uses apt. A quick check says you have this available for other distros.

By the way, ‘hddtemp’ defines itself accurately enough, like so:

hddtemp – Utility to monitor hard drive temperature

Which is, as the article intends, exactly what we’re going to do…

Check Your Hard Drive Temperature:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, let’s install ‘hddtemp’:

Next, we want to start it as a service:

And we’ll want to have ‘hddtemp’ start with the boot process:

That’s about it for the installation. Now all you need to do is know which hard drive you want to check. You can get a list of hard drives by running:

Next, you’ll run ‘hddtemp’ as a privileged user and use the path to the drive you want to check. So, it’d look a lot like this:

If you’re in luck, it’ll spit out the drive temperature. If you prefer Fahrenheit, the command should look similar to this:

That’s really all there is to it. You can check the man page for other options, but this is how most folks are going to use ‘hddtemp’ on their own local computers.

Closure:

Well, this was a short article. I have a bit of a stomach ache, so picked one that’d be shorter than most. Ah well… At least now you know at least one way to check your hard drive temperature. That’s always a good thing.

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 own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Show Hidden Files And Folders

Today, you’ll read an article that tells you how to show hidden files and folders (in Linux, of course). This is something everyone should know. This is a basic skill that you’re almost certain to need if you make the decision to use Linux.

Fortunately, it’s pretty easy to show hidden files and folders. You’ll see…

First, I should probably explain what hidden files and folders are. They’re files and folders that start with a period. So .foo.txt is a hidden file and .bar could be a hidden directory. One should remember that Linux is, by design, a multi-user system. With that in mind, having hidden files makes sense – if you don’t want those files to be accidentally (or maliciously) edited.

Any files or folders that begins with a period will be a hidden file. If you’re new to Linux, you might want to leave them hidden until you’re a bit more comfortable working with system files. Or not… It’s your system, you do what you want with it.

In a GUI file manager, you can usually figure out how to show hidden files and folders pretty easily. Sadly, it’s not universal in a GUI. Look in the right click menu, under the “View” option, or in the application’s preferences. It’s also often ALT + H and I want to say I’ve even seen it be ALT + F4. Look around, you’ll find it.

This article is more about showing those hidden files and folders in the terminal. It’s a really easy command and won’t take too long to explain it to you. So, enough preamble, let’s begin.

Show Hidden Files And Folders:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

We’ll stay right in the default directory, your home directory. If you’re not currently in your home folder,  you can get there with:

Your home folder should have all sorts of hidden files and folders. First, let’s see your home directory without showing the hidden files and folders:

Unless you’re in the habit of storing files in your home directory, you should have a fairly tidy list of folders and files that you’re likely already familiar with. 

Now, let’s try again – this time showing hidden files and folders:

Or, you can get a more easy to read output with this command (and you get more information with it):

If you want to see it in action, you can try this command:

Now, if you use the ls command you won’t see that file. If you use the ls -a command you’ll see the hidden file that you created called .foo.txt. This of works with directories, as they too can be hidden.

Yup, that’s it. That’s today’s article. See? I told you it was easy.

Closure:

Indeed, it is an easy article – and one most of my readers will already know. This one is aimed squarely at the new user who has yet to learn how to show hidden files and folders. It’s a pretty important skill to learn, and it’s also important to know which ones you probably shouldn’t edit. So, judicious use is important.

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 own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Let’s Reduce The Size Of .png Files

In today’s article, we’re going to learn how to reduce the size of .png files. PNG stands for Portable Network Graphics and they can be pretty large. They are raster image format files using lossless image compression. So, today we’ll be doing just that, compressing .png files, in the terminal.

As stated, PNG stands for Portable Network Graphics. Some folks will say that it stands for “PNG’s Not GIF” but they’re incorrect – but are correct about the motive. The .png format was developed to be a free-of-patent alternative to .gif files – some 25 years ago, as of the time this article is published. You can read more about the file format at the PNG Wikipedia Page.

The tool we’ll be using is known as ‘pngquant‘, which should be available in most default repositories. You can check the man page, but it defines itself as:

pngquant — PNG converter and lossy image compressor

You’ll note that it says ‘lossy’ and that means you can lose some image quality with this compression – but from my testing it spits out a perfectly usable image, even while compressing it a great deal. It’s pretty handy. I haven’t tested it as a batch process on a bunch of files, but I have tested it on some files. In each case, I got a perfectly usable image that spit out the other side.

So, with that, let’s move on into the meat of the article, where we’ll learn to …

Reduce The Size Of .png Files:

As pngquant is a terminal-based application, it stands to reason that you’re gonna need an open terminal. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

I’ll give you the installation instructions for Debian/Ubuntu/Mint, but you should be able to find the package in most default repositories. To install in those particular distros:

Once ‘pngquant’ has been installed, navigate to a directory where you have some .png files waiting to be compressed. Once you’re there, run this command:

That’ll tell you the size of the .png in question. Now, you’re going to compress it with the following command:

By default, ‘pngquant’ will retain the original file and create a new file that has appended – fs8 to the file name. So, foo.png becomes foo-fs8.png. You can change that behavior with the --ext flag. 

Here’s an example where an already small .png file was reduced even further by way of pngquant:

pngquant in action - reducing the size of .png files
As you can see, it reduced the file size by about half. The resulting quality was fine.

You can find GUI software that will do this for you, but this is a quick and easy way to reduce the size of .png files in the terminal. While not opensource, there’s XnViewMP and I’m pretty sure XnConvert works with Linux as well. If not, XnViewMP does and has batch conversion as an option – while the latter is specifically for batch conversion.

Closure:

And there you have it… You have a way to reduce the size of .png files in your terminal. Just what you always wanted! I don’t see my average reader doing a whole lot of this, but it’s an option if you want. I use a service that switches my images to WebP as it’s faster and lighter. It’s done by my CDN for me, which is nice and one of the reasons the site loads quickly.

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 own site. The first person to read this sentence should contact me and I’ll donate five dollars to their favorite charity that accepts PayPal. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Free Some Disk Space By Deleting Old Logs

In today’s article, we’re going to free up some of your disk space by deleting old logs. It’s a relatively safe and easy thing to do, and can free some space up if you’re running low. Unless there’s a problem, you really don’t need a bunch of old logs kicking around and taking up space.

There are other reasons for deleting old logs, such as keeping things tidy or even ensuring old activities aren’t easily discovered by browsing old log files. You may have done some debugging and now want to start with a new slate, so there’s another reason to delete logs. 

Who knows what motivations you’ll have, but today we’ll be covering how to do it. The tool we’ll be using for log cleaning is ‘journalctl’, which is used for (according to the man page):

journalctl – Query the systemd journal

While ‘journalctl’ is a pretty nifty tool, we’re only going to scratch the surface. This article is only about deleting old logs and ‘journalctl’ is just the tool we’ll be using. If you want an article about all the features of ‘journalctl’, this is not that article. See? I’m saving at least a few people some time!

Anyhow, this article obviously requires a distro that uses ‘systemd’. If you don’t have ‘systemd’, you probably don’t have ‘journalctl’ and you’ll have to find another way to delete your logs. As most mainstream distros are using ‘systemd’, there’s a pretty good chance that you have ‘journalctl’ available.

So, with all that preamble gibberish out of the way, let’s go about …

Deleting Old Logs:

Like oh so many articles here, this one requires an open terminal. Why? Because of course it does. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

Now, with your terminal open, let’s have a look and see how much space your logs are taking up. You can do that with this command:

Now that you’ve seen how much space your logs are taking up, there are a couple of commands you can use for deleting old logs. If you want to go by space, you can use this command:

You can edit the ‘100m’ to whatever suits your needs. You can also use ‘g’ for gigabytes if you’d like to keep using that much log space.

If you want, you can also delete your old logs by the day. Let’s say you want to retain the last 3 days of logs. Well, that command would be:

I suspect you can figure out that the ‘d’ stands for ‘day’ and the 3 is how many days. You can, of course, change that to any number of days you wish. If you want, you can even use ‘w’ for weeks. Though, if you’re deleting log files to clear up disk space, you’re probably going to want to trim the logs even more than that.

Anyhow, when you’re done running one of the cleaning commands from above, you can verify that the space has been cleaned by running the very first command listed. That will do exactly what it did the first time you ran it – it’ll tell you how much space your logs are taking up. If they’re still not small enough for your liking, feel free to edit and run one of the above commands a second time.

Closure:

Well, there you have it… You have another article! This time I tell you how to go about cleaning old logs from your system. It’s a handy skill to have, though most folks probably have ample disk space – except those running on stuff like Chromebooks or the likes. If you’ve gotta live within 16 GB, you’re going to want to keep your logging to a minimum. Also, I still haven’t skipped a day from writing articles. It seems likely that I’ll do so eventually!

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 own 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.