Show A Specific Networking Interface

Today, I’m just going to write about a simple task, how to show a specific networking interface. This seems like a good short article.  It won’t be too complicated and it’s suitable for a beginner. Read on, if you are interested in learning how to get the information for just a specific networking interface.

It’s also suitable for most people, as most people only need information from a single, specific networking interface. Most folks reading this site are home users of Linux and it’s quite likely that they’re only connecting over one network interface, be it ethernet or wifi. Frequently, you only need to show a specific networking interface when gathering information from the terminal.

If you’re still using ‘ifconfig’ you can close this tab immediately. The tool is deprecated and we’ll just be using the ‘ip’ command. Odds are good that your distro has already moved away and is using the ip command. If your distro hasn’t done so, it should be noted that the process of deprecating ‘net-tools’ (from which you get ifconfig) started in like 2001. You may still have the legacy tool, but we won’t be covering it.

Anyhow…

That’s a long intro for something this short…

Show A Specific Networking Interface:

This is yet another article that requires an open terminal. So, crack open your favorite 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 open, you can run the following command:

You can even run:

Or, you can get that information for a specific networking interface. To do so, we just use the first command, like so:

For example, if your NIC is called ‘eth0’, the command would look like this:

The output from that command will be just the information about that specific networking interface. You won’t have the clutter of the first two commands listed and it will only show the device you specify. If you’ve only got one network interface in use, you can just store the final command in your memory for when you need to check some of your networking information.

Closure:

See? I told you that it’d be quick and easy. Not all of these articles need to be long and complicated. Besides, my 2-year anniversary is coming up, meaning a short and simple article is a good thing. I don’t want to burn out or anything, not at this stage of the game.

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

Another Way To Find A Website’s IP Address

Today’s article will just be a fun one, where we cover yet another way to find a website’s IP address. It’s mostly for fun but it’ll also introduce you to another tool for your terminal-toolbox. After all, there’s almost always more than one way to do things in Linux, including finding a website’s IP address.

So, today we’ll be using a tool I don’t think I’ve covered before. While we have done the website IP address thing before, I don’t see the ‘nslookup’ tool anywhere in the site’s history. We might as well, as I could use a quick and easy article today, as I’ve been busy making a delicious ham.

Odds are good that you have nslookup installed by default. If you don’t, it’ll be easy enough to install with your package manager. If you check the man page, you’ll find the tool describes itself as:

nslookup – query Internet name servers interactively

And, yeah, that’s what we’ll do with nslookup. We will use it to do what it’s designed to do. We do that often around here and, of course, we’ll be doing all this in the terminal. I’m sure there’s some GUI tool you could use, but every Linux distro that I know of comes with a terminal. It just makes good sense for most articles!

Well, that’s enough blathering about what you’re going to read…

Find A Website’s IP Address:

As the intro mentioned, we’ll be doing this in the terminal. So… Open a terminal of your choosing. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T.

With your terminal now open, the syntax is simple:

You’ll often get more than one IP address in the answer, but that’s because sites will often respond on more than one IP address. For example (and considering that I’m behind a CDN), this site would look like this:

it's easy to find a website's IP address
See? It’ll answer on an IPv4 or an IPv6 address at this time. Pretty easy, huh?

Go ahead and try using nslookup to find the IP addresses of your favorite sites. There’s no harm in doing so and it can be a useful bit of information – though usually, that’s more useful for the site’s admin. Still, it can be a handy bit of information.

Closure:

There! See? Another quick and easy article. This time, we’ve shown another way to find a website’s IP address. It’s not complicated and the output is easy enough to process. Enjoy the tool and have 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 site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

How To: Clear Swap

Today’s article is just going to be a quick and easy article, where we learn how to clear swap. I figured I’d do this article while swap was still fresh in my memory so that I’d not forget to write it down the road. If you use swap and want to learn how to clear swap, read on!

Again, this article is only useful for those that use a swap. There are different opinions about using swap and this article is for those who do. I just wrote an article about how to monitor swap, so we might as well learn to clear it.

What do I mean by clearing swap? I mean emptying it. I mean removing all the data held in swap, allowing for data to be written to swap again. It’s not something I worry about, but I know folks have asked about it in the past. I might just as well cover it, though it really won’t take much time.

Clear Swap:

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, you can clear swap with the following command, by turning swap off:

You then turn swap back on with:

Tada! You’re all done. If you want, you can do it all with just a one-liner:

That’s really all there is to it. It’s not terribly complicated and it’s something you might as well know if you’re going to use swap and are concerned with monitoring and clearing it.

Closure:

There you have it. I told you that it’d be short and easy. You now know how to clear swap, should you actually want to do so. You might as well know how. It’s bound to come in handy for someone.

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.

A Couple Of Ways To Monitor Swap Usage

Today’s article will be nice and easy, as we cover just a couple of ways to monitor swap usage. There are several ways to monitor swap usage, so we’ll just cover a couple of them. One of ’em is bound to work.

So, this only applies to those people who use swap. If you use the search feature, you’ll see that I’ve addressed this before and that I tend to use swap – because it’s more than just a place the kernel sticks stuff when you’ve run out of RAM.

swap is still used with plenty of RAM
See? The system happily uses swap with plenty of free rams.

As you can see, on a system with plenty of RAM – and plenty of free RAM – the system still uses swap. I figure that the kernel is smarter than I am. You do you, but I will continue using swap.

But, enough about that. If you don’t use swap, just accept that this article isn’t meant for you and move along. Tomorrow’s article might just have something useful for you. You never know!

So then, I will assume readers know enough about what swap is and will have made their own choices. This article is for those who want to monitor swap usage.

Let’s Monitor Swap Usage:

You guessed it. You’re going to need an open terminal. So, open your favorite terminal emulator. 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, you can try the following command:

(You can just use ‘free‘ but the -m flag makes it easier to read. You can also use ‘free -h‘ if you prefer that output.)

That command should be fairly universal. You can also use the following command if you’d prefer. It’s just:

That command is pretty handy and pretty much is the same as you’d get if you just run’cat /proc/swaps‘ which is, I suppose, yet another way for you to monitor swap usage. Think of it as a bonus way to check swap usage. After all, you can’t have too many ways and one of ’em is bound to stick with you if you use it often enough.

Closure:

And there you have it. You have another article. This time, we’ve discussed how to monitor swap usage (in the terminal, of course). It’s a handy tool for those who do use swap (be it partition or swapfile). If you don’t use swap, you probably won’t get much use from this article. Maybe tomorrow will be more interesting for you?

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

NEWS: List Your LUG At A New LUG Repository

Today’s article is just going to be a brief new article where I share the news of a new LUG repository. It’s an effort to provide a centralized location for those looking to find or promote a LUG. Read on, to learn about a new LUG Repository.

What is a LUG?

A ‘LUG’ is a Linux User Group. You’ll sometimes see folks call them a GLUG, which would be a GNU/Linux User Group. A LUG is a group of Linux users that have formed an organization, often a loosely organized group, to help and inform people interested in the GNU/Linux operating system.

Though they’re not as popular as they once were, there are still many of them, though the pandemic appears to have slowed some down. They still exist and there’s no real central repository – until now.

By the way, local user groups existed long before Linux was around. The PC market was largely prompted by people who participated in groups like that, as OEMs came to realize that the niche could be profitable. Today, you’ll find people still meeting in person, meeting online, or meeting both online and in person.

The Solution:

The admin, @Rob, saw the problem – that there’s no centralized place for people to find their nearest LUG. You can use your favorite search engine and hope for the best, but finding a good repository of LUG information wasn’t realistic – and those that do exist are often woefully out of date and appear to be unmaintained. 

Because of this, the Linux.org site now has a way for you to add (or convince your LUG leaders to add) your LUG to a repository that will hopefully become a great asset for LUG-organizers and those searching for their local LUG.

If you are an organizer or can ‘speak for’ your LUG, you can add your LUG to the repository here:

Linux.org LUG Repository

To avoid abuse/spam, you will need to register to manage your LUG. Once registered, you can then manage your LUG’s information after listing it. 

The goal here isn’t to control anything but to provide a service that was otherwise lacking. So, there are no costs associated with adding your LUG to the repository. 

Disclosure:

I am ‘KGIII’ on Linux.org and am a moderator of the forum. All attempts have been made to remove any potential biases.

Closure:

There you go. There’s a bit of news. Some of my readers will come from Linux.org already, so they should already know this. However, a bunch come from elsewhere, far more than come from Linux.org, so this is aimed at those users – especially if they want to add their LUG to the LUG repository.

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