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.

Smash a button!
[Total: 7 Average: 5]

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.

Smash a button!
[Total: 7 Average: 5]

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.

Smash a button!
[Total: 11 Average: 5]

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.

Smash a button!
[Total: 10 Average: 5]

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.

Smash a button!
[Total: 7 Average: 5]
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.
Zoom to top!