How To: Terminate A Terminal Command

Today’s article is going to be a very brief article, prompted by a question on one of the Linux support forums about how to terminate a terminal command. The poster got an answer, but it was the additional comments that made me realize how few people know how to properly terminate a terminal command – specifically new users.

So, if you want to learn how to terminate a terminal command, read on!

As I said, this isn’t going to be a very long article. I have actually covered this before in another article – but it kinda deserves its own page/article. It’s not a very long and detailed exercise, but it kind of got lost in the mix and I’m compelled to write this article.

I want to make sure that this information is easily found via search engines because the answers I saw to this question included things like ‘just wait’ or ‘start another terminal, just close that one’. None of those are the ‘right’ answer to the question. None of those are the proper way to terminate a terminal command. 

So, let’s see if I can turn this tiny command into a full article about…

How To Terminate A Terminal Command:

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.

Let’s use the ‘ping’ command as our tool of choice for this exercise. If you type in the following, you’ll continue pinging my site until you tell it to stop.

Of course, you can limit the number of pings you send. That’s easy enough. If you wanted to ‘ping’ linux-tips.us five times, you’d run this command:

The output of which looks similar to:

pinging this site just five times before stopping.
That’s how you properly limit the number of pings to linux-tips.us. Pretty easy, right!?!

But, you can run the first ‘ping’ command and just tell it to stop running whenever you want. The command to do so is:

CTRL + C

The output of this would look similar to this:

stopping a terminal command with ctrl + c
This stopped the command after five runs – but I personally stopped it with the CTRL + C option.

So, if you want to stop a running terminal command, it’s pretty easy. You just need to press CTRL + C on your keyboard and the process will stop. You will have terminated a terminal command the right way.

Note: You don’t always want to terminate processes. Things like terminating a device that’s in the process of upgrading may lead to an unstable condition. Then, for example, terminating a write operation may result in a loss of data.

Processes like that normally shouldn’t be stopped. In those cases, it’s best to just let the computer finish what it is doing – unless, of course, you do need to stop them because you have reasons to do so (like you started writing to the wrong device).

Closure:

Huh… I managed to kinda turn it into a full article, so there’s that. It really is a simple concept and the shortcut to terminate a terminal process is easy enough to remember. In an ideal world, this article will rank well in the search engines and save new Linux users time and effort. I’m not sure if I should aim for ‘terminate’ or ‘stop’, but this needs to be common knowledge – or more widely known than it seems to be at the present.

Also, just because you closed the terminal where you started the process doesn’t mean the process itself has necessarily ended. So, there’s something else to keep in mind. A process can and will happily keep executing even though you’ve closed the terminal. Linux is like that!

I wasn’t really sure that I could fluff this up into a complete article, but it appears that I’ve kinda pretended to do just that! Well, you’ll have another article in just a couple of days. It’ll probably be more involved than this one! This one is all about that CTRL + C function.

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.

Pause And Unpause Your Terminal

Today, we’re going to learn how to pause and unpause your terminal. This will be one of the easiest articles I’ve ever written. It may also be one of the shortest! So, to learn how to pause and unpause your terminal, read on!

In fact, this information is so brief, I’m not quite sure how to turn it into a ‘full-fledged’ article. There’s really not all that much to it, but it’s information that should probably be on the site somewhere, and that somewhere might as well be here.

For many of us, we’ve learned that pressing CTRL + S will save whatever it is we’re working on. Well, that’s not the behavior you’ll see in the terminal – and from my testing, this appears pretty universal.

If you press CTRL + S  while in the terminal, which a new person may do by accident, it pauses the screen – making the screen appear as though it is locked. This can be confusing, especially to a new Linux user that’s not accustomed to using the terminal.

There’s no obvious way to unlock the screen. There’s no tooltip or anything like that involved, so a new person may just end up closing their terminal and opening a new one. You don’t have to close the terminal and start a new one.

Well, you can press CTRL + Q and that will unlock the screen. That’s really all there is to it – but there’s a caveat.

Pause And Unpause Your Terminal – CAVEAT:

Anything typed on the screen, any inputs entered in that terminal, will appear (and function) when you unpause the screen. This could be risky if someone has had access to the computer while you were away. Pausing the terminal in no way should be considered a security measure.

For example, press CTRL + S in an open terminal. Then type the following:

Next, press the ENTER button.

Finally, press CTRL + Q.

When you press that key combination, you’ll see that the ‘uptime’ command is going to be, and will be, executed. So, this isn’t even anything remotely secure. It’s useful for pausing when there’s a lot of information being fed to the terminal, and that’s about it. 

As far as I can tell, it’s more likely to be used by accident, tripping up new Linux users who may have hit the keys by accident or hit them thinking they’re saving something. 

Closure:

Well, that’s about as long as I can make this article without padding it for Google’s sake. It really doesn’t need to be longer than this to show you how to pause and unpause your terminal. It’s really just a simple matter to unpause the terminal without needing to open a new instance.

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.

Review: Ubuntu Cleaner

In today’s article, we’re going to review a piece of software known as ‘Ubuntu Cleaner’. It won’t be a very long article, as there’s not much to cover – as it’s fairly self-explanatory. If you’re interested in learning about ‘Ubuntu Cleaner’ then this is the article for you.

As the name implies, this software is designed to work with Ubuntu. You may find that it works fine with Ubuntu derivatives. It may also work with the various official Ubuntu flavors – in part or in whole. But, the key here is ‘Ubuntu’. It’s software designed for Ubuntu. If you don’t use Ubuntu, this may not be the software for you.

I guess this isn’t a review so much as it is making folks aware of Ubuntu Cleaner. It’s reasonably easy and safe, so it seemed like a good idea to share this with Linux-Tip’s Ubuntu users.

About ‘Ubuntu Cleaner’:

You’ll find that ‘Ubuntu Cleaner‘ does more or less what you’d expect it to do. In many ways, it’s similar to BleachBit. Though, you’ll sometimes read stories of people using BleachBit and hosing their systems. That’s extremely unlikely to happen with ‘Ubuntu Cleaner’.

In short, you’ll see that this application cleans your system. It deletes files you don’t need, reducing the amount of disk space used. It cleans the following things at the push of a button:

  • Clear browser cache
  • Clear APT cache
  • Clear thumbnail cache
  • Remove unneeded packages
  • Remove old kernels
  • Remove old installers

So, ‘Ubuntu Cleaner’ is a system cleaner. If you’re curious about the browser cache, it appears to work with Firefox and the major Chrome/Chromium-based browsers. It did not seem to recognize the Snap version of Firefox, but that could be a problem at my end or something they’re working on.

You can see that it clears other things, like running the APT commands you’d consider running manually. If you have extra kernels installed, it’ll remove them – leaving one kernel version as a backup. 

But, it does what it says it does on the label, it cleans Ubuntu.

Installing/Using ‘Ubuntu Cleaner’:

It’s easy enough to install ‘Ubuntu Cleaner’ in Ubuntu. You will 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.

With your terminal now open, simply follow the directions to install ‘Ubuntu Cleaner’ on their project page. I’ll copy them here, but be aware that things change and these installation directions may change:

Then, open ‘Ubuntu Cleaner’ from your applications list and the rest is pretty obvious. On the left side of the screen, select the category of items you want to clean. On the right side, select the specifics you wish to have cleaned with ‘Ubuntu Cleaner’. When you’re done picking, push the button to clean your Ubuntu system. It’s not complicated, and looks like this:

Ubuntu Cleaner in action.
It’s pretty easy to understand how to use Ubuntu Cleaner.

See? It’s not all that complicated and it does what you’d expect it to do. It cleans Ubuntu’s system files – including your browser cache.

Thoughts and Closure:

These are all things you could manually clean yourself, including being able to run commands to remove your APT cache and the likes. But, if you’re one of those people who likes to stay on top of removing unused system files, this might be an application you’d like to use – assuming you’re an Ubuntu user.

On a scale of 1 to 10, I suppose I can rate it a 9. The application could do more, but it doesn’t need to. It does what it says on the tin and there’s little risk of it harming your system. Ubuntu Cleaner is a safe and effective way for Ubuntu users to remove system files.

If you’re an Ubuntu user, go ahead and install it. If you use an official Ubuntu flavor or a derivative, you can also try installing it – but it may not do things like remove the thumbnail cache. You can give it a shot. It’s unlikely to break anything.

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: Find Files Over A Certain Size

Today’s article is going to be a quick article, one where we learn how to find files over a certain size. We’ll be using the ‘find’ command, which we’ve used previously, even though it can be fairly complicated to use. If you want to play around with the ‘find’ command, read on!

Also, and this wasn’t the first article I wrote tonight. I wrote another article. It was a good article. No, it was a great article! Then, as I’m wrapping that article up and hit the preview button, I scrolled down and saw the automatic article recommendation thing at the bottom…

Yup… It was such a good article, I wrote it twice! Well, I couldn’t let that pass – as I’d just done so recently, so I’m writing a new one and this one should be entirely new!

Making the find command approachable to new users means doing it in small bits. Fortunately, the command tells you what it does by its very name. It does exactly what you’d expect – it helps you find files. In fact, it defines itself as:

find – search for files in a directory hierarchy

So, it does what you’d expect it to do – though it can seem fairly complicated to a new user. Let’s do our best to make it approachable, shall we?

Lets Find Files Over A Certain Size:

If you’re a regular reader, you’ll know what’s coming next…

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.

So, if you just want to run this ‘find’ command in the directory (and recursive into sub-directories) you’re in, it’s nice and easy. Try this:

As you can guess, that finds files bigger than 100 MB in your current directory (and recursively). If you want to find files of a different size, you just change 100M to whatever you need – like 1000M (you can use G for gigabytes, for example).

If you want, you can specify a directory. Let’s say you want to do the entire system from the root directory (not to be confused with the root user). You just specify that – but you’ll want to use ‘sudo’ because you don’t have permission to read all those files.

Like this, you can specify the starting directory. If you want to find all files larger than 2 GB in your home directory (and sub-directories) then you just run this command:

There’s so much that you can do with the ‘find’ command. It’s really quite useful and I find myself using it with some regularity. Don’t forget to run the man find command to learn more about it. You can do a lot more than just find files over a certain size.

Closure:

So, I’ve tried to make the find command approachable by even novice users. It can be a bit complex looking, but it really is useful. If you think I’ve made it approachable, go ahead and comment. Of course, comment if you think the opposite is true. It’s all good, we’ve just tried to learn how to find files over a certain size.

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: Have A Proper Backup Of Your Data

In today’s article, we’re going to show you how to have a proper backup of your data. I’ve wanted to write this article for a while. Few people have a solid backup strategy and many people have no backup strategy at all. Read on while I try to share how to make a proper backup.

In the world of backups, you have some pretty extreme measures. On one hand, you have people who don’t backup any of their data. On the other hand, you have companies that are spending millions of dollars for constant incremental backups sent to disparate sources.

Somewhere between there is a ‘proper backup’. This is a backup of your data that’s reliable and inexpensive. It’s something you can do without investing a whole lot of money. It’s something you can do by just following a few simple rules.

For this exercise, we’re going to be using the ‘3-2-1 backup‘ method. After much research, and some pretty tragic data losses, I’ve concluded that the ‘3-2-1’ method is probably the best way to make a proper backup.

You can do this with any software you want. We won’t actually even discuss software in this article. You can use cut and paste, if you really want. The software process doesn’t matter for this article, oddly enough.

So then, let’s discuss this…

Decide What Data Is Important:

The first thing you need to do is figure out what data is important to you. 

For example, I don’t really backup any of the system’s files. I don’t do drive images. I never perform a backup of my operating system. Instead, I back up my personal files. (I haven’t hosed my OS in ages and I really don’t worry about doing so.)

I back up some text files that I’ve been working on for years. For example, I back up my pictures of friends, family, and locations. If anything, I back up more than I care to, because I’m kinda lazy in these regards. 

See, all I do is backup my /home/<user> directory, and all the directories and files within that directory. That’s it. That’s all of it. Doing it this way does mean I end up with stuff like my ~/Downloads being backed up needlessly, but disk space is cheap these days.

Why? I want my individual config and data files along with my personal files. So, I keep my home directory backed up. If the operating system fails, it’s just a few minutes to install the OS again – and another few minutes to move my backed up home directory to the fresh installation. That saves me all sorts of time configuring the new installation – which is typically done on a new device.

So, you need to decide what data is worth backing up. When you do that, you now need to learn about making a proper backup.

Decide Your Backup Frequency:

It’s up to you to decide how much data you’re willing to risk losing. You can’t sit there backing things up all the time (realistically, you can – if you’re using software to make constant backups in real time, but that’s computationally expensive and financially expensive).

Be realistic about this. You don’t need to be a hoarder in the physical world, and there’s no really good reason to be a hoarder of digital data. (I’m one to talk, one of the biggest bits of data I back up is my email – some of which is more than 20 years old!) I urge you all to be considerate when deciding what is worth preserving. If you’re never going to use the data again, there’s no reason to preserve it. If it can be easily recreated, you may not want to preserve it.

I would say that, as a general rule, I’m willing to lose a week’s worth of data – but I do have some redundancy. If it’s important, like family pictures, there will be the copy on the camera, a copy on external media, and a copy on the computer I’m using. Otherwise, I tend to do my backups once a week, usually on Sunday.

Everything else? Meh… Once a week is a good frequency for me. That’s been my effective schedule for a long time. Sometimes I’ll backup more frequently, because of a major change. Sometimes I’ll not have any special data and will let my backup schedule lapse a little.

This is a decision you’ll have to make. Which data requires redundancy?

Use 3-2-1 To Make A Proper Backup:

The 3-2-1 backup method is basically saying that you should have 3 backups at any one time. So, at any moment in time, you should have 3 backups.

You should have 2 copies of your data at your physical location. You have the one that is on the computer you’re using and another can be an external drive. (In case of drive failure.)

You should have 1 backup that’s off-site. You might think that a garage is a good spot and, for some people, it is. If it’s a detached garage, it’s unlikely to go up in flames if your house burns. But, what if there’s a flood? If there’s a flood, it’s likely to take out your garage at the same time it takes out your house.

Remember, these are the *important* files we’re concerned with. Think of all the worst eventualities and prepare for them.

If you have a friend that lives a distance away, swap disks with them every week/two-weeks/month. This way, you both have backups in separate locations.

Remember, the goal is redundancy. 

You can also use a safe deposit box at your bank. You can also set it up so that you can send your files to your friend’s house (onto your hardware) over the internet. Additionally, you can also use cloud storage. 

If you’re concerned about your private data being out there, learn to use encryption. Use your favorite search engine and learn how to encrypt your data. These days, it’s pretty easy. You can just compress your whole backup and encrypt that file, meaning it can’t be opened without the password.

Test Your Backup!

You need to verify that your backups are working. It is vital that you properly test your backups. In reality, you absolutely need to verify that your backup strategy is effective.

AN UNTESTED BACKUP IS NOT A BACKUP!

You don’t have to write the data back to your drive every time. After all, you have three copies to work with. But, you should consistently and regularly verify the integrity of your backups AND your recovery strategy.

After all, a backup by itself is nothing. You must also have a recovery strategy. That is, how do you get your data back after a catastrophic loss? How are you going to recover after a fire?

It could be as simple as downloading a disk image from the ‘net, to retrieving your drive from the garage and writing the data back to your new computer/fresh installation. But, if you haven’t tested that to ensure it’s working, it’s the same thing as having no backup at all!

For the umpteenth time:

RAID is NOT a backup!

Be Diligent:

A proper backup regimen requires diligence. Once you start on this path to making proper backups, you need to keep doing it. It’s up to you how often you do this, but you do need to adhere to a schedule – if you actually want the system to be effective.

You have a lot of choices to make. You get to decide all the things from frequency to location, from the data you want to preserve to storage devices you will use. We live in great times, as far as hardware is concerned. You can buy additional storage space for dirt cheap. Software choices abound.

Over time, you may find yourself having more confidence and reducing the types of files you that need redundancy. That’s not necessarily a bad thing. For example, you don’t really need to backup your desktop background image, but you do probably want to back up the last pictures you took before a family member passed away.

IMPORTANT:

You can exceed all of this. You can be more diligent. This can be improved upon, if you want to be even more diligent. Increased redundancy can be a great thing.

Think of this as the *minimal* backup strategy. The least you should have is 3-2-1 backup process listed in this article. It’s perfectly okay to have more than that. It’s perfectly okay to have multiple redundant off-site locations. It is absolutely perfectly okay to use both a buddy’s house and a reputable cloud storage company. You do need to be diligent, doing the backups as often as you’ve decided and doing that consistently. 

You get to make all those decisions. They’re your decisions to make. The value of your data should dictate your level of redundancy. The value of your data should dictate your frequency. Find the software that works for you, the locations that work for you, and the file types that you feel need to be preserved.

Closure:

There you have it. You now know about the 3-2-1 backup method. There are other sites that cover this, but I wanted to share it with my readers here and in my own way. It seems important that my readers know how to have a proper backup strategy.

Also, I’ve been meaning to write this article for a while, but I knew it was going to be pretty long. As you can see, this one is definitely one of the longer articles. I hope you enjoyed reading it as much as I enjoyed writing it – but I mostly hope you take this information to create a proper backup process that provides the redundancy you’ll need should you suffer catastrophic data loss.

Hopefully, this is also going to be a useful link for when we see people who have failed to backup their systems and now are facing data loss due to making that decision. Yes, they made a decision to not back up their data. If they didn’t back up their data, they either listened to bad advice or didn’t listen to good advice. Ideally, this link will point ’em back in the right direction.

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.