Change Ownership Of Files And Folders

Today, we’ll be covering how to change ownership of files and folders. This is a pretty basic task and one every Linux user should know. This needn’t be terribly complicated, so this article will explain all you really need to know about changing ownership of files and folders.

When dealing with file management, permissions are important. It’s a security matter and a usability matter. You can assign various file and folder permissions, such as read and write permissions, a subject for a different article. However, files and folders all should have owners – owners who can do anything they want with the file or folder.

Curiously, your account should not always be the owner. While maybe not all that intuitive, you shouldn’t have ownership of all the files. This is why you have to use elevated permissions to perform certain tasks. This is to keep things segmented and secure.

Remember, Linux is designed to be a multi-user operating system. That’s not just human users, but different processes and applications may also be associated with users. For example, look at all the users on your system by running the following command in your terminal emulator:

You can also see all the groups on your system with this command:

Obviously, if a user is a member of a group they share permissions with that group. Files also only have one owner and one associated group, of course. So, if you want two people to have control over a file, one way to do that would be to make sure they’re both members of the same group. There’s all sorts of creative things you can do with permissions. This article will be covering just one aspect, it’ll be about how you can …

Change Ownership Of Files And Folders:

Like oh so many of these articles, this one requires an open terminal. You can do so using only your keyboard – just press CTRL + ALT + T and your default terminal should open.

Go right ahead and stay in your home directory. You can check the various files and their permissions with the following:

The output of that command will show you the user and group, with the two being listed in that order as in the image below:

ll listing user and groups
See? I even gave you handy arrows. The order is owner:group, to repeat myself.

To change the owner, the format is:

To change the group, the format is:

If you want to recursively take ownership, you need the -R flag. For that, you’d want something that looks a bit like this:

You can actually just use chown to change both the owner and group at the same time. You’ll most often do this with your own user and group, so I’ll show the command that way:

As you can guess, the -R flag will work there and an asterisk will cover all the files and folders within that directory. Obviously, this applies to folders and not to files.

Closure:

There you have it. You have yet another article and this one has hopefully taught you how to change ownership of files and folders. It may not be one of the most interesting articles, but it’s a skill you’ll eventually want to have and another tool for your Linux toolbox. 

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.

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: Transfer Files Over SSH with SCP

In this article, you will learn how to transfer files over SSH by using ‘scp’. If you need to transfer files over a network, this is one way to do so. There are numerous other options to transfer files over a network, and this is just one of them. Feel free to leave a comment sharing other ways you use to transfer files over SSH.

We have had quite a number of articles about SSH. It stands for “Secure Shell” and you can click to find a collection of SSH articles. If you’re entirely new to SSH, you’d probably enjoy learning how to install/enable SSH. As mentioned, there have been a bunch of articles covering this subject.

Today, we’ll be using ‘scp’, which defines itself as:

OpenSSH secure file copy

It shares quite a bit of similarity with the ‘cp’ command, a command we oddly haven’t covered yet. That’s not too important. We’ll eventually get to that article and maybe remember to link back to this one. What’s important to know is that it shares some similar features and syntax.

So, today we’re going to use ‘scp’ to transfer files over SSH, over a network. It’s a pretty good skill to know, as copying files is probably the 2nd most frequently used feature over SSH, with device management being first. At least it’d be 2nd most for me, I’m not sure what you all do with it.

Transfer Files Over SSH with scp:

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.

You’re also going to need a device you can SSH into, and I can’t really help you with that. You can always install OpenSSH on your desktop and practice by using SSH over localhost. 

Now, with your terminal open, it’s time to transfer a file. The very most basic command to copy a file to the remote server would be:

You can also copy multiple files to the remote server:

You can copy all files from the directory you’re in (on the local device) easily enough. It’s just our beloved asterisk.

If you want to copy the files from the folder in AND the files from the folders in that directory (recursively), then the command just requires a -r flag.

You can actually go the other direction. If you want to transfer remote files to your local device, then you’d be looking at this command:

From that, you can use the above commands, extrapolate if you will, for ways to transfer the file to your local device from the remote device. It’s not terribly difficult, and ‘scp’ is something everyone should know if they’re working with remote computers on a regular basis.

By the way, setting up SSH on your computer isn’t a bad idea. Sometimes a malfunctioning computer can be accessed via SSH when nothing else will work. I have SSH installed (and secured) on pretty much every computer in the house.

Closure:

See? Now you know how to use ‘scp’ to copy files over a network via SSH. It’s a pretty awesome skill to have and one you may need until the end of time, or at least as long as Linux lasts as an operating system – which should be quite a long time. So, it’s in your best interests to learn how to use ‘scp’ with at least a basic level of skill.

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.

Install The Snap Version of Chromium

Today’s article will teach you how to install the Snap version of Chromium – the opensource browser from Google. It’s akin to Chrome, but without all the proprietary bits and bobs. This isn’t a difficult article to follow, but may have some information that was easy to miss along the way.

Chromium is also the source for many other browsers, from Brave to Opera, they’re all Chromium underneath – including the Edge browser from Microsoft.

You’ll find things like syncing your passwords and history isn’t really possible with Chromium’s default configuration. Those bits are proprietary, and Google doesn’t want third parties using their resources, so those bits have been disabled for some time now.

However, it’s still very much a usable browser – and I’d know that sorta thing. After all, I’ve made it pretty clear that I’ll try any browser at least once! I’m often checking out the browser market and trying new browsers. With that, I can say that Chromium is generally easy to work with, has the features I use, has great support, and has a ton of available extensions.

Snap Version?

Snap? Yes, this article is about installing the Snap version of Chromium. I actually wrote an article about how to install the non-Snap version. (It was a horrible article written while I was very ill – I need to go back and edit it.)

Snaps are Ubuntu’s (will work on most every distro, with a little effort) ‘new’ package management system. It’s meant to be easier for both you and the developer, as the developer needs to only package one version. As for it being easier for you, it’s meant to avoid needing dependencies and does things like run in a secure container. It has some differences to, and some similarities with, both AppImages and Flatpaks

Snaps are happening. If you don’t like them, you’re going to have to put some effort into not using them – if you want to use Ubuntu and official Ubuntu flavors. Mint is an exception – currently. We’ll see how long they hold out and which side of history they end up on. Still, if you want to use Ubuntu, you might as well adjust and start using Snaps.

In fact, in Lubuntu 22.04, you’ll find that Firefox defaults to a Snap version. That’ll likely be mentioned in the release notes that nobody ever reads, so, we’ll have to see how folks deal with that change. I wonder how many won’t even notice the change?

Yes, there are complaints about Snap applications – some of them even valid complaints. It doesn’t matter. This is the direction Ubuntu is going and there’s no stopping them. I will link to this page again, just to show you how easy they are to use. You might as well jump on the train, ’cause the destination is set for Ubuntu’s locomotive. 

On a personal level, I don’t really mind them. They’re a bit wonky when compared with traditional repositories or PPAs. They do things like save the previous version, so that you still have access to the application if the newer version is buggy. They also take up more space, as one would expect if dependencies are included with each Snap. Indeed, they even take longer to load. Much of that is mitigated by having more modern hardware or being just a little patience – they don’t take all that long to load, after all. They also have some pretty great features.

So, yeah… This article is about a Snap application – specifically Chromium. It’s not terribly complicated – but there’s a second step that many don’t realize and I want to bring attention to that step.

Install The Snap Version of Chromium:

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.

Once you have your default terminal emulator open, you can just install Chromium with the following:

That’s all well and good, but it’s actually just a limited version of Chromium. Perhaps for licensing reasons, I’m not actually sure, you’re probably not done at this point. Well, many people will not be done at this point.

If you, like those many people, want to play things like proprietary media (i.e. DRM encumbered media like Netflix) you actually have to install another package. This step isn’t really all that clear and you’re kinda left blind to figure it out for yourself. Hopefully this makes it a bit more clear for those seeking information about installing the Snap version of Chromium.

Again, it’s not hard. This is not a difficult article to follow. It’s just that it’s not all that clear. You next need to install chromium-ffmpeg. Your regularly installed ffmpeg is not adequate, you need a Chromium specific version. The command is pretty logical, once you know that you need it.

And, that’s actually all you should need to do. Having done that, you can restart your browser and you should be able to use DRM-protected music and video. Yes, you should be able to use Netflix – but not Peacock, ’cause they’re just jackasses.

Closure:

See? I told you that it wasn’t that difficult to install the Snap version of Chromium. It shouldn’t take you more than a few minutes before you’re watching videos and listening to the music. We can argue the merits of DRM some other time, but this is not the article for that.

Well, I mean, you can offer opinions in the comments and feedback, but no amount of opinion will stop me from telling folks how to do this. If they want to consume DRM-encumbered media, they are free to do so, and this is one way of doing so. No amount of opinions offered will sway Ubuntu from this course.

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.

Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.