How To: Stop, Pause, and Resume Processes Running in Your Terminal

As you learn Linux, you’ll possibly find yourself using the terminal more often. You’ll run processes in the terminal because you need to or because you prefer to. This is how you stop, pause, and resume those processes running in your terminal.

There are any number of reasons why you’d need to do this. I’ll give you an example in the main part of the article, but there are all sorts of reasons to know and use this information. There are a few generic reasons to do so, of course.

First, you’d want to stop processes because you don’t just want them to keep running forever. That’s the easy one, though they’re all easy. Speaking of which, this article should be pretty short and easy.

Second, you’d possibly want to not stop but rather pause a running process because you expect to return to it. This is different than stopping the process. It’s very much like pausing a movie.

Third, obviously, will be resuming the above mentioned process. If you’ve paused a running process then it only makes sense to know how to resume said process. If you don’t intend to resume it, it doesn’t make much sense to pause it.

This article will explain how to do all three of these operations!

Stop, Pause & Resume Terminal Processes:

So, we’re going to need both a practice exercise and an open terminal. Let’s start by getting the terminal open by using your keyboard and pressing CTRL + ALT + T.

That should open your default terminal. Assuming it does open your terminal, I want you to run the following command:

Once started that command will keep running over and over again. I assume you don’t need to keep pinging forever, so you can stop it with CTRL + C. That’s it. Once you issue that command, the process will stop.

What if you don’t want to stop it – you just want to pause it for a little while? Well, run the ping command again and this time use CTRL + Z. When you issue that key combination, the running process will pause and be pushed into the background.

If you want to resume running that process in the terminal, in that same terminal, you just use the following command:

Unlike the first two, it’s text that you enter into the terminal before you press enter. There’s no CTRL + anything that you use. You just literally type ‘fg’ (think foreground) and press enter. That brings the paused process back into the foreground and resumes running it.

The above commands, when run in succession, should look a little something like this:

terminal
It should look a little something like that. Those are the commands from above.

You can do this with all sorts of applications that run in the terminal. You can stop, pause, or resume, as needed by moving the running process into the background and then bringing it back into the foreground.

If you look carefully at the above image, you’ll see that it counted five packets as being transferred. This indicates that the process doesn’t keep running in the background. It’s truly paused. Typing ‘fg’ and pressing return brought the process back to the foreground, where it continued pinging this site.

Closure:

There you have it. It’s another article in the books! This one tells you how to start, pause, and resume processes running in a terminal. Hopefully, you can find some use for it. If you have any ideas for articles, feel free to leave a comment. My publication schedule seems to be working, so you can expect another article every other day.

Thanks for reading! Your readership and feedback helps keep me motivated! 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 How To Change The Default Terminal

There are many reasons why you may want to change your default terminal emulator. It’s actually nice easy to change the default terminal. This article explains how and anyone should be able to do it, even a beginner!

First, it’s often called a terminal emulator because it allows you to emulate the terminal in a graphical environment. There are other ways to refer to it, but just calling it the terminal is usually enough for all but the most pedantic. We’ll mostly just call it the terminal from here on out.

The people who put your distro together also picked the default terminal. It’s usually a basic terminal, and often just a terminal that has been around for a long time. That’s not a bad thing, but there may be better terminals than the default. There are terminals with all sorts of features, from multi-window terminals to terminals that support drag-and-drop!

Perhaps you might like XFCE-terminal, or you may prefer Terminator? Maybe you’d like Guake or TildeThe choices for new terminals are vast, and Wikipedia has a ton of them listed.

You can find even more by using your favorite search engine and searching for Linux terminals. Someone is always writing a new terminal and you can pick a new one to be your default terminal any time you want. There’s bound to be one out there ticks all your boxes.

If you want to open your default terminal, you can usually use your keyboard. Just press CTRL + ALT + T and it should open your terminal. If you don’t like the default, you can make any other terminal your default.

Change the Default Terminal:

For the purpose of this exercise, we’ll start with assuming you’re using Ubuntu and that you want to install Terminator and then set Terminator as the new default. However, aside from the initial installation command, it should work for other distros just fine. In fact, the installation command will work for most any distro that uses the apt package manager.

So, seeing as you opened the terminal up above, we’ll just skip right ahead to installing our example, Terminator:

Go ahead and let it finish the installation after you enter your password and agree to install it. Terminator should be in your default repositories and easily installed. This is true even if you’re not using Ubuntu or an Ubuntu derivative.

Once you’ve done that, you will need to set Terminator as the new default. To do that, run this command:

That should bring up some information that looks a little like this:

change default terminal emulator

From there you just pick the number of the terminal emulator you’d like to be the new default and press enter. That’s it. That’s all you should need to do.

You can test this by simply using your keyboard to open the default terminal like you did in the first section of this article. Once you’ve made the change, it should take effect immediately and the new default terminal should open up when you next open the terminal with the keyboard. You’ll still have the old links to the original default, but you can move those around at your leisure.

Closure:

And there you have it. That’s how you change your default terminal emulator. It’s not terribly difficult but it’s a quick and easy step you can take to make your Linux a little more customized, a little more something of your own. If you have any ideas for articles, feel free to leave a comment suggesting them. We’ll see what we can do!

Thanks for reading! It’s truly appreciated and there have been a lot of readers lately. 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.

Screenfetch vs. Neofetch, You Decide!

Should you use screenFetch or Neofetch? That’s up to you to decide. This article will share some info about both of them. This should be a pretty short article.

I also confess that there’s not much of a “vs.” here. The screenFetch app hasn’t been updated in a long time and Neofetch is the clear winner for most folks. But, well, it seems like people have forgotten that screenfetch exists and that it existed well before neofetch was conceived. That’s why I’ve picked ‘History’ as one of the categories.

See, the thing is, screenfetch (I’m tired of capitalizing the F, and the N, just to be right!) still exists and still works just fine. In some cases, you might get the wrong information from it, especially with newer distros, so why use it? Well, you use it because it shouldn’t be forgotten – and ’cause it still works most of the time.

So, you decide… Screenfetch or neofetch? Or maybe both?

Screenfetch:

The screenfetch application was was created to gather system information so that it could be presented in a screenshot format. In fact, their GitHub page clearly states the purpose as:

Fetches system/theme information in terminal for Linux desktop screenshots.

Though it’s old, it’ll almost certainly be available in your default repositories. Just because it’s old doesn’t mean it isn’t still useful! (Perhaps I’m having some sort of crisis, ’cause I too am old and part of the purpose of this site is to be useful!)

Assuming you’re using a distro with apt, it’s a mere install command away:

Then, well, you use it. You could just run it with ‘screenfetch’, but you can also actually use the -s switch and create a screenshot of your full screen, making it easy to take and share a picture of your desktop to show others in forums and social media sites.

This is an edited down screenshot, ’cause the rest of my desktop isn’t all that interesting right now.

screenfetch
See? Screenfetch in action. I like the ASCII art better, actually. That’s a matter of taste.

As you can see, that was with the -s switch. It happily generates a screenshot of the entire screen, but I edited it down to just the terminal. There’s nothing interesting on my screen right now. Just a bunch of open windows, largely with text in them.

Screenfetch still works, and I like the ASCII art better. I suppose I could probably customize neofetch to make it do the same thing, but I’m way too lazy for that. Either way, it works – and it works just fine. It still does the task it was designed to do, even without any recent updates.

Neofetch:

Neofetch is newer and probably better in every single way. (Though I do have some issues with it on some systems, as it won’t create its own screenshot! That’s a ‘me’ thing, I suspect.) It’s also familiar to many people, and indeed has been mentioned on this site multiple times.

It gets regular updates and has a ton of options. It’s also able to be highly customized. In pretty much every single way, it’s the superior solution. It’s described by the authors like so:

The overall purpose of Neofetch is to be used in screen-shots of your system. Neofetch shows the information other people want to see. There are other tools available for proper system statistic/diagnostics.

It’s a much newer application. Screenfetch last had a release in 2019, while neofetch had a release just last August (at the time of writing). It should be noted that there have been some commits at the screenfetch repository, but they’ve not yet been released. The project isn’t dead. It just isn’t as active as neofetch.

Again, it’s easy to install. It’s in the default repositories for most any distro out there, at least the major ones. There are some distros that include it by default, including Lubuntu! Again, assuming you’re using a distro with the apt package manager, it’s installed just like screenfetch:

And, like screenfetch, you can just run it as ‘neofetch’. However, check the man page for it and you’ll see there are a ton of other options. It’s seriously highly configurable. It looks like this:

neofetch in action
This looks a lot like screenfetch, doesn’t it? The art is different. The output is also different!

For whatever reason, on that system the neofetch doesn’t seem to want to take a screenshot. I’m probably missing scrot or something like that. I’m too lazy to figure it out, but it’ll likely work just fine on your system. It’s a great way to gather a bunch of presentable information about your system, with the end goal being to show it to other people.

So, is neofetch the one for you? Is it really any better?

Screenfetch or Neofetch:

Sure, there hasn’t been a screenfetch release in a long time – but there’s sure to be one eventually. There’s activity in the repository at GitHub. That’s usually an indicator that there’s still more to come. I wouldn’t count it out and it’s pretty much feature complete.

Neofetch? Well, it’s much newer and has more consistent releases lately. It’s also highly configurable. You’ll be able to customize it all you want. You’re encouraged to edit ~/.config/neofetch/config all you want, making neofetch your own. It’s also a mature application, with a large install base and likely also feature complete.

Either one works. They do spit out different information. If you examine both screenshots above, you’ll see the data output is different. Not gonna lie, I ain’t gotta clue why they’re different. The areas where they’re different are trivial and I’ve made no effort to find out which is correct. 

What? It’s a blog. I have finite time for these things, you know! 😊

You can decide between screenfetch or neofetch – or you can use both. They’re both very similar and neither should be used for anything all that serious. They spit out some system information in a form that’s convenient for screenshots so that you can show off your system to your forum friends.

Closure:

Here’s another article in the books. It’s not really about a ‘vs’ anything, but the title seemed appropriate. It’s a good time to expose some of the newer Linux users to the venerable screenfetch tool, as choice is 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: Disable Sleep And Hibernation on Ubuntu Server

For some reason, Ubuntu Server comes with ‘power management’ enabled. This is an article that tells you how to disable sleep and hibernation in Ubuntu Server. It’ll work just fine for non-server installs, but this is aimed specifically at the Ubuntu Server release.

I recently was working on my own router. For this, I used Ubuntu Server as the base operating system. For some reason, it was shutting itself down after periods of inactivity. This isn’t acceptable behavior for a device that’s meant to be running all the time.

I checked in my logs and I found entries like this one:

Apr 3 12:18:27 server systemd[1]: Reached target Sleep.

That was entirely unacceptable. I do not know why power management was installed, nor do I know why it was active by default. I merely know that it was and that I couldn’t have that behavior with a server, a device meant to be always powered on.

So, I did what anyone would do in my shoes. I disabled sleep and hibernation entirely. It’s quick and easy – and effective! I’ll show you how!

Disable Sleep/Hiberation:

Like most articles, you’re gonna need a terminal. If it’s actually a server, you’re likely already able to connect with SSH. So, add the step of connecting to the server if you’re doing this remotely. If not, just proceed.

Once you have your terminal open, you’re to kill everything that has to do with suspend, sleep, or hybrid-sleep. It’s actually pretty easy. Start by opening said terminal, by pressing CTRL + ALT + T and then enter the following commands:

First, you mask ‘sleep.target‘:

Then mask ‘suspend.target‘:

And mask ‘hibernate.target‘:

Finally, mask ‘hybrid-sleep.target‘:

Later, should you change your mind, you can unmask them and that’ll enable them again. Just change ‘mask’ to ‘unmask’ and run the commands again. See? Pretty easy!

If you want, you can verify the efficacy. Simply use the following:

(You can change ‘sleep.target’ to one of the above services and check them individually.) 

Closure:

That’s it! I told you that it’d be pretty easy. It’s not only easy, it’s easy to undo this should you change your mind. Again, I do not know why power management is enabled by default in a server release. Nobody asked me! So, that’s how you disable sleep and hibernation with Ubuntu. (It’ll surely work with other distros.)

Thanks for reading! If you want to help, you can donate, write an article, vote for articles you like, share this article on social media, buy cheap hosting, register to help, etc… Nobody ever reads the last paragraph anyhow. Still, you can help if you want!

Update 01.27.2020 Per comment.

‘vnStat’ A Tool For Monitoring Your Bandwidth Usage

‘vnStat’ is a wonderful tool for monitoring your bandwidth usage. This article will show you how to use vnStat effectively. For bonus points, we’ll also look at ‘vnstati’ so you can make pretty graphs to visualize your bandwidth usage. This article shouldn’t take too long!

vnStat‘ stands for ‘view network statistics’ and has been around for like 18 years at the time of this writing. It’s so common that it has its own Wikipedia page. Of course you know that already, you can see the handy link I already provided!

Anyhow, ‘vnStat’ is a tool that runs in the terminal, a console tool as it helpfully describes itself:

vnstat – a console-based network traffic monitor

It’s a pretty great tool that generates some neat information and displays it in the terminal. It looks a little something like this:

vnStat in action!
See? I’ve stopped taking screenshots with a semi-transparent terminal! I’m pretty much a pro!

That image should save me a whole bunch of time! I trust that my readers are smart enough to figure out the gist of it with just a handy screenshot. For those not fluent in the ways of vnStat, ‘rx’ means received and ‘tx’ means sent. The rest should be pretty easy to figure out.

Install vnStat:

In order to get vnStat, you have to actually have to install it. It’s available in the default repositories in the popular distros (and even the BSD family). If it isn’t, you can always build it from source. But, you can probably install it much like you’d install anything else. For example, in a distro that uses apt you’d install it with:

(We might just as well install vnstati at the same time. Also, adjust that command for your own package management system.)

You can next go ahead and enable the service and start it next. That will be:

Once it is installed, you should set up database(s) for vnStat. This is done with:

Where you have “<device_name>” you replace it with the name of your internet adapter. For example, lots of Ethernet adapters are ‘eth0’. You can find the name of your adapter(s) by using either ‘ifconfig -a’ or ‘ip addr’. You can repeat this with all the names of the internet adapters you use, if you do in fact use more than one.

Then you can verify your vnStat installation with:

Assuming that spits out a version number you should be good to go.

Using vnStat (& vnstati):

So, by now you should have vnStat installed, and its sister app vnstati should also be installed. Let’s examine how you use them.

First, you can just call the application in the terminal. There’s nothing complicated about it and it may be your choice if you have more than one network interface. To do so, it’s just:

You can also be more specific, getting the data for just a single device:

Where ‘eth0’ is, change it to the name of your device. So, for a wireless device, it may look something like:

There are a ton of other options, so be sure to check the man page. Those are the options that I use most often, so those are the only ones we’ll be concentrating on.

Now, you can also use vnstati to make a nifty graphic that will show you your bandwidth usage. It looks a little something like this:

vnstati in action
That’s the graphical outcome I prefer.

That’s the output of this command:

As you can guess, you can change the output path to anything you want (and have permissions for). I prefer that particular graphic, but there are a ton of options and you can gather all sorts of information. For example, there’s also this to show the hourly rate from the past 24 hours:

vnstati in action
This is an hourly output, which may be of value if you have limited bandwidth.

That is the output from this command:

And, again, you can modify the outputted .png to place it where you want. There are a whole lot more options and this article isn’t going to cover them all. That’s not the kind of article I write. There are tons more options in the man page, if you want to explore them.

Find what works for you and run with it. You should be able to find a format you like that has the information you’re looking for. I’m just introducing you, you decide how you use it.

Closure:

And there’s another article in the books! This one explains vnStat and vnstati. Both are pretty great tools that go well together, and they help you monitor your bandwidth usage. If you have any questions or comments, feel free to scroll down and leave a message.

Thanks for reading! If you want to contribute, you can donate, you can write an article, you can register to help, you can buy inexpensive hosting, you can rate the articles, you can scroll down to sign up for the newsletter, or you can share this site on social media. If you can think of anything else to help, jump right in and start doing it!

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