Meta: The State Of Linux Tips #14

I try to do this every month, and this month’s no different, it’s time for a meta article about the state of Linux Tips. This is only the the 14th installation, so I’m obviously not very good at doing this every month. Still, they’re easy enough articles to write and it’s a good night to write one.

So, if you’re interested in what’s going on here at the site, read on! If not, there will be a more informative article in just two days. Well, assuming I keep up the current publication schedule.

Speaking of which, this is the 324th article to be posted at Linux Tips. I’ve had a few helpful articles along the way, but have managed to keep the publication schedule up for this entire time.

I didn’t expect to make it this long. Indeed, it was pretty amazing when I did it for just a year. Here we are, finishing up the second year. Ho hum…

Some Numbers:

Traffic still expanded in December, but the growth was slower than it had been lately. We can be reasonably sure that this has to do with the holidays. Still, it was nice to see the growth. For example, for December:

There were more than 11,600 unique visitors.
They visited more than 18,700 times.
We consumed about 18.5 GB of bandwidth.
Russia was the 2nd most user of my traffic.
96% of my traffic used Linux.
86% of my traffic used a browser that identified as Chrome.
Linux.org provided about 2% of what Google Search provided for visit.
Linux.org provided the most repeat visitors.

As you can see, there’s not much that has changed.

This month, January 2023, looks to be similar with regards to unique visitors – but might actually have slightly fewer people in the ‘visits’ column. Again, it’s likely due to the holidays. Quite a bit of my traffic comes from work-hours in the US. So, the holiday slowdown certainly would explain that.

I’m going to skip the next section and just bring this to a close. The reason I’m skipping the next session is that it literally hasn’t changed. The most popular pages are still the most popular pages.

Also, we’ve captured the number 1 slot at Google for ‘ask a good support question’, which is nice. That doesn’t attract a lot of clicks, but there are some. It’s a nice page to have ranking that well.

Meta Article Closure:

I see no reason to drag this article out. Exactly the same articles are as popular as they were the month before this. You can click back through the Meta Articles if you want. I’ve never had a site this popular, so I’m not sure if that’s normal. It seems to me that it’d be fairly normal.

Until next month…

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.

Show Disk Usage With ‘ncdu’

In today’s article, we’re going to learn how to show disk usage with ‘ncdu’. It’ll be a fun terminal exercise that lets you see your disk usage. I’d say this is on par with a beginner article, ’cause it’s just some simple terminal commands. So, do read on!

If you think ‘ncdu’ sounds familiar, it may be from a previous article. You should probably read the intro to that article, as it will save you some time and is reasonably informative.

How To: Find Large Files Using ‘ncdu’

We’ll be using that same tool, but we’ll be using it in a different manner. That article explains what ‘ncdu’ is. In short, it stands NCurses Disk Usage and it’s a handy enough tool. It describes itself as:

ncdu – NCurses Disk Usage

There are a few ways to use ‘ncdu’ and we’ll be using it to show disk usage in this article. Because you have that handy link up there, I’m going to skip some sections of this article.

Show Disk Usage With ‘ncdu’:

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.

First, you’re going to need to install ‘ncdu’. Rather than duplicate work, please visit this article. Scroll down and you’ll see how to install ‘ncdu’. 

See? All these previous articles sure make some future articles easier.

Anyhow, now that you have ‘ncdu’ installed, just navigate to the root directory run ‘ncdu’ from the there.

Depending on how much disk space you have attached to your system at the time, it could take a while to run. Let it run and eventually you’ll end up with a screen like this:

ncdu in action
Pretty basic looking, right? Well, look deeper.

As you can see, the first line is highlighted. Well, use the arrow keys to move up and down. Then, use the left and right arrow keys to move back and forth. To keep it simple, if you want to dig deeper, just navigate to the directory you’re curious about and run ‘ncdu’ in that directory.

Hmm… I probably should have timed it. I set ‘ncdu’ running on a desktop with a couple of internal disks and attached to an external disk with a whole lot of files on it. It’s like an 8 TB disk and the system is still trying to process that bad boy.

ncdu can take a long time to run...
It has been a while… It’s okay, I have faith, It’ll finish someday!

Anyhow, read the man page:

There’s more to be done with ‘ncdu’ when you want to explore disk usage. It can take a minute or ten to run, but the information is worth it.

Closure:

There you have it, a fairly short article that explains how to show disk usage with ‘ncdu’. It seemed like a good article to write and it was nice having already covered so much of it. That saves some time and I was a bit late in writing this one.

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 Little About The ‘echo’ Command

That’s right, in today’s article we’re going to learn a little about the ‘echo’ command. We’ll barely be scratching the surface of the ‘echo’ command. There are so many ways to use ‘echo’ that we simply can’t fit it all into an article. Do, read on!

So, what is ‘echo’? Well, basically, the ‘echo’ command is a command that tells the computer to output text – be it in the terminal or using standard output to add that text to a file. It’s useful for regular people, but you’ll find it’s most commonly used in things like bash scripting

That sort of thing, scripting, is outside the scope of this article – and probably beyond the scope of the entire site. Maybe I’ll get to it, but those would end up being long articles, or articles written in parts. Besides, I’m not really all that good with scripting. (If you are good with scripting and would like to write some articles, do let me know.)

This is how the man page describes the ‘echo’ command:

echo – display a line of text

That’s indeed what it does. When you combine it with things like variables, you open up a whole new world. I don’t actually have a very good article about variables, other than existing variables. I should probably have said article.

Anyhow, we’ll just be scratching the surface of the ‘echo’ command. There are all sorts of ways to use ‘echo’, but we’re just going to use it in ways that a new Linux user might use it. Some basic familiarity is probably a good thing.

The ‘echo’ Command:

This article requires 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. Otherwise, just open your terminal like you normally would.

So, how you start with this ‘echo’ command:

You can also add quotes, and in some cases probably should:

You can also use the > operand and echo the text to a file. Like so:

Read: How To: Write Text To A File From The Terminal with “>” and “>>”

However, that’s not all you can do with the ‘echo’ command. You can also automatically fill in the information by way of environment variables. For example, try this:

Or you can try:

Read: How To: Show All Environment Variables

See? It’s good that I’ve written so many articles. I get to refer to ’em and save us all a bunch of time. So, be sure to visit those articles – especially if you’re a new user. If you’ve forgotten something, you can ‘echo’ the variable to be reminded.

Bonus:

This next bit is really just some information you’re gonna need down the road. I can sense it! This is a bit advanced for some of you, and you won’t need this until later in your Linux journey, but others will see this and suddenly understand the potential. If you’re new, you’ll get there.

The first thing we’re going to do is set a variable. It’s actually very easy to set your own variables in Linux. In this case, we’ll use:

Now, let’s just ‘echo’ the variable you just created:

Or, even better, you can then try:

See? It will output the variable when you echo it. You can create all the variables you’ll realistically ever need. 

You can actually format the output from the ‘echo’ command. For example, the -e flag with the \n separator. An example command looks like:

You can format the text in a variety of ways, just read the man page. You can do quite a lot with the ‘echo’ command and you should definitely check the man page if you’re interested in exploring all the possibilities:

There’s a ton of ways to use ‘echo’ (and with it variables) for those with a clever mind. When you do move on to learn about scripting, you’ll learn that it’s a basic tool used for all sorts of things, in all sorts of clever ways.

Closure:

And there you have it. You have a new article. This time, we’ve covered just the slightest bit of the ‘echo’ command. It’s enough to get your mind working, or so I hope. It’s enough to get a slight taste of the potential and to understand why you may want to be familiar 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.

Fix The Application Menu For Shutter

Today’s article is pretty niche, one where we fix the application menu for Shutter. On one hand, if you don’t use Shutter, this probably isn’t the article for you – but you can still read it and learn something useful. On the other hand, it fixes a ‘problem’ with Shutter and I think this is a fine time to cover it.

So, if you use Shutter, read on! (Hint: Even if you don’t personally use Shutter, you can still benefit from this article.) You’ll just need to understand what was done and how to apply it to other shortcuts.

By the way, Shutter has been mentioned here (and elsewhere):

Take, Edit, And Upload Screenshots With Shutter

I use Shutter all the time. It’s my go-to when I need to share a screenshot. It’s handy and I recommend it to anyone who has to deal with a lot of screenshots. I also use Flameshot, but that’s less often.

Alas, when you install Shutter it wants to put the application menu shortcut under something like ‘Utility’, so it appears as an administration tool or doesn’t show up where you’d expect it to be. This is just silliness.

What Shutter should do is should show up under ‘Graphics’ in the application sub-menu! So, that’s what this article will do. It will show you how to fix the application menu for Shutter so that it shows up under ‘Graphics’.

This article shouldn’t be all that long. It seems to me that it should be pretty brief… We’ll just have to wait and see!

Also, as mentioned above, this article should be easy enough for my readers to extrapolate into resolving other application menu gaffes/choices. It’s a nice and easy article. Or at least I hope it is…

Fix The Application Menu For Shutter:

Now, when I did this, I did it with the GUI. You will not be doing it in the GUI, if you follow this article’s advice. When you do it graphically, it’s still pretty simple. It looks something like this:

You can use a GUI to change where the file is listed in the application menu.
Fixing the application menu to show Shutter under the ‘graphics’ heading.

That’d be a bit convoluted to explain because everyone’s using a different desktop environment and different file managers. So, instead of doing this is a GUI, we’re doing to do this in the terminal. (Of course we are.)

Open your default terminal now. If you don’t actually know how to, you can just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, enter the following command:

That will open the .desktop file with Nano.

From there, scroll down to where you see “Categories” and change the ‘Utilities’ to ‘Graphics’. With that done, you need to save your changes. As we’re using Nano, you save your changes by just pressing CTRL + X, then Y, and then ENTER

The results should be immediate, though I’ve seen this require logging out and back in again. For the most part, it should just work – and it should work immediately. When you next open the application menu, you should find Shutter where it belongs – under the ‘Graphics’ sub-menu.

Now, you can do this with all sorts of other applications. If you don’t like the existing category, just change it until you do like the category. When you change that, the shortcut should appear in the expected sub-menu.

Feel free to try this will all the applications you want. It should work with any of them. If you do decide to do this in a GUI, you’ll need root and the files need to be edited as though they’re plain text. Enjoy!

Closure:

And there you have it… You have another article. In this article, you’ll have learned how to fix the application menu for Shutter – and other applications. Best of all, you’ll have done it in the terminal, which means you can do this with pretty much every operating system without needing to change the commands. The terminal is pretty awesome.

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 Little About The ‘lspci’ Command

Today’s article is going to be another article where we get back to the basics, where we’ll learn a little about the ‘lspci’ command. As far as articles go, this one should be both fairly brief and easy to understand. To learn more about the ‘lspci’ command, read on! 

I am going to be writing some articles that cover the basics. I decided to not write them all at once, but to intersperse them with other articles. So far, we’ve had:

A Little About The ‘lsusb’ Command
A Little About The ‘lscpu’ Command

Well, this time around we’re going to cover ‘lspci’. 

So, what is ‘lspci’? We can find no better source than the man pages, which helpfully describe ‘lspci’ as:

lspci – list all PCI devices

Well, we see that it lists PCI devices, but what are those? PCI is another way hardware components talk with the CPU. If you have a fancy graphics card, it’s probably PCI-based (but likely PCI-X). If you’re really curious, PCI stands for “Peripheral Component Interconnect” but think of it as a way hardware can talk to the central processing unit.

So, the ‘lspci’ command will list things attached to the computer on the PCI bus. This is remarkably similar to the ‘lsusb’ command, though PCI can have a USB device attached to it through a hub.

Anyhow, that’s what PCI is and that’s what ‘lspci’ is meant to do. So, with that in mind, let’s just belly-flop into the article!

The ‘lspci’ Command:

You’ll find that ‘lspci’ is a terminal-based command. As such, you’ll have to have a terminal window open. If you don’t know how to open your default terminal emulator, just press CTRL + ALT + T and your default terminal should open.

We will not be covering everything that can be done with the ‘lspci’ command. We might have time and space (this time around), there’s really no reason to dive deeper into the ‘lspci’ command. We’re just going to cover the basics – because that’s all you’ll realistically have to worry about.

With your terminal now open, just run the command with no flags (but with sudo, ’cause ‘lspci’ wants elevated permissions to operate):

If you want a more verbose output, you can do that. Your choices are -v, -vv, and -vvv with ever-increasing amounts of verbosity. That can be pretty handy. Try this command to experience the most verbose output:

Where you might find the ‘lspci’ command most useful would be when you already know the class and category of information you want returned. When you use ‘lspci’ with ‘grep’, it gets more useful. For example, to learn about your memory:

See? It’s pretty straightforward. You’ll get this. I’m sure of it! (See 2nd edit below.)

As you can see, there’s quite a bit that you can do with the ‘lspci’ command. It’s a pretty handy command and we’ve just covered the ways you’re most likely to use ‘lspci’. 

EDIT: Fixed some information. I had somehow started to include lshw commands.
EDIT: So, this article was horribly written. Now it’s just short. I conflated ‘lspci’ with ‘lshw’ somehow – probably ’cause they’re next to each other in my notes. I’m just going to leave it as it is now.

Closure:

There it is, another new article! This time, we’re learning a little about the ‘lspci’ command. It’s a handy command to have learned, as you’ll eventually want to know about the hardware using the PCI bus. When that day does come, you’ll be able to use the command. Also, I’m ahead of schedule with pre-written articles.

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.