A Couple of Ways To Resize Images With ImageMagick

In today’s article, we’re going to go over a couple of ways to resize images with ImageMagick. It’s a useful skill to have if you’re into sharing images or the likes. This will actually be pretty quick and easy. I won’t take much of your time today but it’ll be longer than some other articles – but it really should be a quick read for you today.

It’s nice to not put full resolution pictures online – unless there’s a reason for the higher resolution. So, it’s a bit of a politeness to resize your images. I try to be considerate, ’cause I know what it’s like to have limited bandwidth. You people who started off in life with things like 100 GB fiber have no idea the pain we went through to get here! Alas, that whining is perhaps subject to another article, though probably not really a suitable article for this site. There are people who still use slow connections, and metered connections are entirely too popular.

So, what is ImageMagick? It describes itself as:

ImageMagick – is a free software suite for the creation, modification
and display of bitmap images.

ImageMagick is actually quite a useful application for quickly and easily manipulating images in the terminal. ImageMagick is so robust that trying to cover all of it in a single article would be foolish. I simply couldn’t do it within the bounds of a single article.

That’s why we’ll just be examining a couple of quick ways to resize images with ImageMagick. We couldn’t possibly cover it all today. If you want to see what all the options are, I’d recommend checking the man pages – and reading other tutorials that cover the things you’d like to do.

With that said and done, let’s resize some images with ImageMagick!

Resize Images With ImageMagick:

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.

The first thing we’re going to need to do is make sure you have ImageMagick installed. So, let’s install it. The command below is for those who use apt, but you can easily change it to your own package manager. I’m 99% certain that ImageMagick will be in your default repositories! It’s a pretty widely used application! The command for those of us who are apt-using people is simply:

Follow any on-screen prompts to install it, else it’ll tell you that it is already installed. ImageMagick appears to be installed by default on a number of distros, but it’s easy enough to install. You can actually just add a -y to it and skip some of the prompts:

Of course, you’ll still need to enter your password. Well, if you really want to live on the edge, you can enable passwordless sudo easily enough. I don’t really suggest that, but I do tell you how to do it. ‘Snot something for the faint of  heart.

Ah well… Onto the meat of the article!

Resize By Resolution:

Now that you have ImageMagick installed, let’s try resizing something. What we’re going to do first is resize it by way of the resolution. That is, we will resize it by declaring the new height and length. To do so, you’d use a command like:

For example, you might try something like this:

See? Pretty easy. I told you this wouldn’t be too hard – nor will this article be all that long. Well, it might be a bit longer than some, but I won’t let it be too long. I know my reader’s attention span! You should make sure to use the same base resolution. If the image is 16:9, your resized image should retain that aspect ratio. Otherwise, your images may appear warped and ugly.

I should probably mention that it’s possible to make images larger with this command. However, when you make an image larger you lose fidelity. Making an image too large is going to result in an ugly image. It’s not like the television where you can just keep zooming in and enhancing. Ones and zeros don’t work like that.

Resize By Percentage:

This is my favorite way to resize images with ImageMagick, unless I have a specific reason to resize images by resolution. In this case, you just declare a percentage of the original and ImageMagick does the rest. It’s really a very easy command. It looks a little like this:

If you want, here’s an example of how you can use that command to resize images by percentage with ImageMagick:

That command will make ImageMagick output a file that’s 50% smaller than the original image. Not only will this be a smaller image visually, it will have a smaller file size. Because of the way images work, this doesn’t mean the new file size, size on disk, will be reduced by 50%. It just means you’ve reduced the image’s dimensions by 50%. The size on disk will also be lower, but it’s not directly proportionate. 

Like above, where  you resize the image by resolution, you can use this to make images larger. The same caveats exist that existed above. That is making an image too large means it results in a poor quality image. As you can guess, making images larger isn’t always a good idea, but it’s generally fine if the operation is making the images smaller.

Closure:

And there you have it. You have another article! This time, we’ve covered how to resize images with ImageMagick. I think that’s a useful skill to have and it’s a quick/easy thing to learn. Of course, you can always check man imagemagick to check the man page. That man page will be enlightening, I suspect.

I’ve changed the format a bit for this article (though I’ve used it before), and made it a bit longer than the recent articles. If you have an opinion on the matter, please feel free to leave a comment. The more I know about your wants, the more I can tailor the content. The more I can tailor the content, the better you’ll enjoy the content. To do this, I need to know your thoughts on the matter. Speak up!

So, do you enjoy the longer articles? Do you enjoy the shorter articles? Do you appreciate a mix of them, and each article only being as long as it really needs to be? I normally try to keep all my articles friendly, informative,  and fairly strictly informal. Lately they’ve been pretty  short, but I can be more verbose, as many of you will have witnessed.

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 Install Microsoft Edge

Today, we’re going to learn how to install Microsoft Edge. That’s the browser made by Microsoft that even has a Linux version. That’s right, it’s from Microsoft but has a Linux version – and a version packaged for pretty much everyone.

We’ll be installing on Linux Mint, just to mix things up a bit. It’s really not that much of a change, it’s still using apt. It just so happens that I’m sitting at a Linux Mint computer when I’m writing this. We might as well use GDebi while we’re at it.

Yes, I’m well aware that many of you hate Microsoft with a passion. That’s fine. If you don’t want to install Microsoft Edge, just move on and don’t bother those of us who are curious about the browser. You’ll have another article in a couple of days, and it quite likely won’t have anything to do with Microsoft.

If you don’t know, Microsoft Edge is based on Chromium – which is the opensource version of Chrome, more or less. Chromium doesn’t have feature parity with Chrome, so it’s not quite the same version. Chrome is mostly based on it.

There are many browsers based on Chromium. Brave, Vivaldi, Opera, etc.? They’re all based on Chromium. There are only so many browser engines out there, and Chromium being opensource means people are going to use it. Microsoft jumped on the bandwagon with their Edge and made it available for Linux users. So, we’re going to…

Install Microsoft Edge:

This article requires an open terminal, but only for a minute. 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.

To keep things easy, we’re going to install GDebi. As we’re doing this on Mint, the command will work with any apt-using distro, the command to install GDebi is:

Follow any prompts to ensure you install GDebi properly.

Next, fire up your favorite browser and:

Click to download Microsoft Edge for Linux (make sure to get the right one for your distro). There are a number of choices, so pick the right version of Microsoft Edge for you.

Let it download, say to your Downloads directory. When your download is complete, right click on it and choose to open it with GDebi directly from the right click menu.

That part is easy, just let it do its preliminary checks and then  you can click on the install button (upper right) when it’s ready to be installed. Later, if you don’t like it, you can open the .deb with GDebi again and opt to uninstall the package. See? It’s pretty handy.

Closure:

I actually wrote a review of Edge before, but it’s on the old site and not really very good. Even if you can’t stand Microsoft, it’s not a bad browser. It’s not one that I’m going to use in my day-to-day browsing, largely due to lethargy, but it’s still a viable browser.

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 Learn Some apt Basics

Today we’ll be learning a little about some apt basics. This is only useful if your distro uses apt to manage software. If you aren’t using a distro that does (Debian, Ubuntu, Mint, etc) then this probably isn’t an article that will interest you much, and that’s fine. With the great variety there is in the Linux world, it won’t always be an article that matters to you. Better luck tomorrow! Well, two days from now… 

In the past we’ve covered quite a few apt commands. Here are a few that are poorly formatted ’cause, you know, WordPress…

How To: Clear The apt Cache

Use ‘apt’ To Download A Program And Its Dependencies

Use ‘apt-cache’ To Find An Application’s Homepage

Those are a few – but there are actually more than that. If you’re unfamiliar with apt, you can click any of those articles and learn more about it.

For those of you whose systems use apt to manage packages, this article is for you. If you aren’t aware, apt is the package manager application that you’ll interact with more often than not (if you do things in the terminal).

Apt has a number of commands, of course. As a package manager, it’s bound to be a robust and potentially complicated application. Today, we’ll just be covering a few simple apt commands that you’re most likely to use. It will not be an exhaustive article because of time constraints, reader attention limits, and usefulness. My goal was never to replicate man pages. You’ve still gotta read ’em.

So then, without further ado…

Some apt Basics:

If you want to use apt, you have to have an open terminal. If you don’t know how to open the terminal, you can do so with your keyboard. Press CTRL + ALT + T and your default terminal should open.

With your terminal now open, you can easily install applications with apt. You’ll need to know the package name for the software you want to install, however. So, you can search for packages easily enough:

For example, you can use ‘terminal’ in there as a keyword and get a ton of options, all of which should be installable easily. Again, these are just apt basics.

Now that you know, or you may already have known, the package name, you can install it with:

You don’t need to do the runaround with dpkg for local .deb files, by the way. I’m not sure why people still suggest that? If there’s a good reason for doing it that way, please let me know in the comments. You can just use apt and it works just fine – including resolving dependencies (when they’re able to be resolved). To install a local .deb file with apt:

If you want to get the information for a specific package, you can use the ‘show’ command. That’s easy enough:

If you want to see the dependencies, that is the other applications that need to be installed in order to make it work, then you just check the dependencies with:

If you want to remove a package with apt, then you can just read this article to decide which command is right for your needs:

‘sudo apt remove’ vs ‘sudo apt purge’

That’ll answer it nicely enough.

Closure:

There you have it. You have an article about apt basics, and that’s all it is. You’ll note that not all apt commands need elevated permissions, so there’s no need to use sudo unless you’re adding or removing software. The other commands can be run without elevated permissions.

There’s more to apt. Yes, yes there is. Type man apt and you’ll get an idea of the available options. This article is just some apt basics, the things I think you’re most likely to need on a day to day basis. 

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 Reboot Your Linux Computer

Today is another article with one of those things you probably already know, it’s about how you can reboot your Linux computer. Specifically, we’re going to reboot from the terminal. You can use the GUI to reboot easily enough, but if that’s frozen and you don’t really want to do a hard restart, you might as well reboot it if you can.

If you can’t reboot your computer because it appears frozen, consider the Magic SysReq Keys. (More specifically, the REISUB method.)

If you aren’t already aware, there are all sorts of ways to reboot your Linux computer. Like oh so many things in Linux, there’s a multitude of ways. We’re just going to cover a few of them, because you really don’t need to know more. Well, if you do need to know more,  you probably already know those ways to reboot your Linux computer!

It’s also another fairly simple article. That’s good (for me) as it’s a bit like work lately and I don’t want the site to really be about work but rather being about a hobby. If it’s work, I wanna get paid… 

This is also useful information if you’re working on something remote. You don’t want to shut that system down and have to have someone go physically turn it back on, so you reboot the system – making sure to reboot the right system and not the system you’re physically using. I’ve done that more times than I care to share – and I’ve done the reverse as well. It’s seldom good if you enter the reboot command and immediately follow it with a verbal, “Oops.”

Reboot Your Linux Computer:

This article requires an open terminal, because we’ll be learning how to reboot your Linux computer from said 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.

With your terminal now open, let’s start with the easiest of the commands to reboot your Linux computer:

With some distros, that’ll be all you need. With others, you may need to have elevated permissions. This is also often true if you’re connected remotely, via SSH. So, in those instances, you’ll need to preface it with sudo and use your password when asked. Like so:

If you want,  you can also use the shutdown command. That’s pretty easy, you can just use:

The -r flag tells the system to reboot and the ‘now‘ means to do so right now – immediately. You can play around with that ‘now’ bit, like so:

Instead of ‘now‘ you’ll see there’s a ‘1‘ and that’s how many minutes you want to wait before rebooting the system. You can change that to any number you’d like, I suppose.

Finally, you can use systemd to reboot. Why? Because of course you can! It’s systemd, and you can do anything with it! (Kinda like zombo.com, I guess.)

That’ll happily reboot your Linux computer, all nice and neat and proper. It does exactly what you’d expect it to do, so there’s that.

Closure:

There you have it. You now have a few ways to reboot your Linux computer from the terminal. There are other ways, including init or whatnot. You can also just use the GUI if you’re working locally. It’s Linux. There are all sorts of ways to accomplish a given task. That’s a good thing.

I find myself rebooting from the terminal more often than not, simply because I’ve already got a terminal open and it’s just as quick for me to type the reboot command as it is for me to go clicking around. I’m also often testing other systems and really don’t want to have to go fishing around to find the command, then click on some sort of secondary agree menu or the likes.

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: Make A File Executable

Today we’re going to learn something important, that is how to make a file executable. This is something everyone should know how to do. It’s not going to be easy to make this into an article, ’cause it’s really quite easy, but I’ll give it a shot.

One of the important things about Linux is that files have various permissions. You can read, write, and execute a file based on the permissions. This helps keep Linux a bit more secure, because files can’t be executed until you’ve given them permission to do so.

I’ll make this article as straightforward as I can, by trying to give you an example of how this works. We’ll create a file, make it executable, and then run said file. This should serve as a good example, so that you can do so in the future.

You’ll see a bunch of commands in this article. If you’re new, just follow ’em until the end and you’ll hopefully understand what’s going on, and see how to make a file executable. Trust me, this isn’t something all that taxing. I’m sure you can get it!

Make A File Executable:

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 open, let’s create a new file. We’ll do that with:

Open love.sh for editing with nano by using the following command:

Enter the following text:

Now, you’ll have to save that. Just press CTRL + X, then Y, and then ENTER. That will save the file with the newly added text.

Now, we’ll make the file executable with the ‘chmod‘ command. That’s done with this command:

With that done, all you need to do now is execute the file. To do that, you just call the file by name in the terminal. As you’re still in the same directory, you’ll need to use ./ – so your command actually looks like:

With that, you should get a message saying that you love Linux Tips. Aww… Isn’t that sweet of you! We love you too! It was also a fun way to create a file, edit it, make it executable, and then actually executed said file.

Closure:

See? That wasn’t all that hard. I hope that method shows you a little about how to make a file executable. It’s a pretty basic skill that all Linux users should be familiar with. It’s not a very complicated article, but that’s just fine. At least we (hopefully) had some fun with 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 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.