How To: List Open Files

Today’s article might seem unimportant and that’s okay because we’re just going to examine one way to list often files. So, in a way, it’s probably not all that important. If you are someone who wants to list open files, this would be the article for you!

For the most part, most of my readers aren’t going to want to know how to list open files because they just have no good reason to do so. It won’t be a very long article or anything. I did some long-format articles and they didn’t get much feedback. I’ll do more, but I don’t see them as needing to be all that immediate – or consistent. The shorter articles just seem to be what folks are looking for. I can live with that. (If you do like the longer articles, it’s not too late to mention that.)

Today’s tool will be one you may have never heard of. We’ll be using the right tool for the job, however. That tool will be the ‘lsof’ command. The ‘lsof’ command should be installed by default in any major distro and checking the man page will reveal that it describes itself like so:

lsof – list open files

Read that line and then look at the headline. See? I told you that it was the correct tool for the job. If you want to list open files, a tool that lists open files is the tool for the job. Imagine that?!?

List Open Files:

Of course, the lsof command is run in the terminal. As such, you’ll need an open terminal for this exercise. 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 just run the following command which will show every currently open file (it’s a lot):

You’ll notice some of the output will say something about “permission denied”. So, if you’re going to list all the open files, you probably should use sudo with the command. Like so:

Type in your password at the prompt and be prepared for the deluge of file names. It takes quite a bunch of open files for an operating system to work – and Linux treats everything like it’s a file.

So, what if you just want the output to tell you all the files opened by a specific user? The lsof command will help you out with that. Try this command:

For example:

That command will show you all the files opened by that user. It’s still a lot, but it’s an easier output to process. If you wanted to show the files opened by everyone except a specific user, you’d use this command:

That command would (assuming you removed the brackets) show you all the open files except those files opened by ‘username’. In any of these cases, if you see some permission denied errors you can just slap sudo on the front of it and be good to go.

Closure:

Well… If you’ve ever wanted to list open files you now know how to do so. I suppose it’d mostly be useful for things like auditing or troubleshooting performance issues. I have the command in my book of tricks, but I don’t recall ever needing to use it for much. I’ve played with lsof and it does list open files. So, there’s that.

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: Unzip All The Files In A Directory

Today’s article might seem like a strange one, but it’s all about how to unzip all the files in a directory. It’s something only a few folks will need to know and something you may not need all that often. However, those folks who need to know this, and those folks who need this often, will be grateful to learn this little tip.

I would think that this will be a short article, as I don’t see it taking up that many words. I’m not sure of the appeal, but I want to write it anyhow. So, if you want to know how to unzip all the files in a directory, this is the article for you!

For me, this is another article based on necessity. See, it’s I who frequently has to unzip a bunch of files all at once. They’re fortunately all in the same directory, making this just a pair of easy commands. Sometimes I have to unzip nested files, so I’ll include the command to do that along with the more simple command that I usually run.

Every month, I get a whole lot of documents from my accountant. For bandwidth’s sake, these get organized and compressed before they’re emailed to me. In theory, I’m supposed to go over them and verify them individually. At best, I open them all up and look at a few of them. I do a sanity check every few months. My accountant is an old lady and I’m pretty confident in her integrity. So, I’m pretty lax…

However, see, I’m supposed to check them… So, I kinda go through the motions and at least look at a few of the documents. That’s where this command comes in…

Unzip All The Files In A Directory:

For those following along, it has been a minute since you needed to open a terminal to follow one of these articles! Well, that wait is over! You know what to do. Otherwise, just press CTRL + ALT + T, and your default terminal should open.

With your terminal open, use the cd command to navigate to the directory that contains multiple .zip files. You should know how to do this, but it’s just: 

Once you have reached the directory you’ve chosen, you can just run this command to unzip all the files in a directory:

Now, sometimes there will be folders inside that directory and those folders will also contain .zip files. To unzip the files recursively you’d just want to use the following find command first, like so:

That lovely command will scour the directory you’re in for sub-directories, enter those directories, and then unzip any files it finds in those sub-directories. It’s not all that complicated, you’re just finding files with .zip in their name and then executing the unzip command on them.

As I said at the start, it’s not one of those things you’ll need often – but when you do need it, you need it. Well, your life is significantly improved by it. I suppose it’s not technically a necessity. You could unzip all the files one by one or even unzip them using a GUI. Still, it’s handy to have.

Closure:

And there you have it. Today’s article is back to a shorter format article, largely because this is what I was thinking about today. Because of that, you got an article explaining how to unzip all the files in a directory – and how to do so recursively – unzipping files nested in sub-directories. You’ll eventually need it! Maybe…

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.

The “Linux” or “GNU/Linux” Debate

Today, just for fun, we’re going to touch on the “Linux” or “GNU/Linux” debate. It sounds like a fun subject to cover and who knows where it will lead us. It also sounds like something the Linux-Tips readers might enjoy hashing out in a forum somewhere. So, for the “Linux” or “GNU/Linux Debate, read on!

This article will have a couple of main points. Let’s start with the first…

See, this seemed like a fine question to ask ChatGPT. This is a subject I figured the AI would do well with – and I think they did. So, a giant portion of this article will have been written by AI and then I’ll follow up with my thoughts on the “Linux” or “GNU/Linux” debate.

Most of my readers will already be familiar with this. They’ll have seen people refer to it (a whole distro, multiple distros, the whole subject matter) as “Linux” and have seen others refer to the various distros as “GNU/Linux”. If not, the AI will do a wonderful job explaining the difference to you. So, we don’t need to cover that in the intro! Let’s let the AI take care of that.

I’ve seen people get into pretty heated arguments over this, more so with the GNU/Linux folks, but we can be civil about it all. There’s no need to get upset and the section about my point of view may help with some of that.

Ready? Well then, let’s discuss…

The “Linux” or “GNU/Linux” Debate:

As mentioned in the introduction, I decided to let the chatGPT take a whack at this. However, I didn’t ask what you might have expected me to ask. Instead, I asked a bit of a loaded and biased question. Here’s the question that I asked chatGPT:

With approximately six hundred words, explain the merits of it calling Linux “GNU/Linux” instead of just calling it “Linux”.

So, right off the bat, you can see the question isn’t ‘which is correct’ or ‘which is more valid’. It’s a question asking the AI to explain the reasons why one might favor calling the whole thing “GNU/Linux”.

And, well, here’s what the AI responded with: 

______

Linux, the open-source operating system that powers a significant portion of the world’s computing infrastructure, is often referred to simply as “Linux.” However, there is a growing movement within the open-source community to refer to the system as “GNU/Linux,” in recognition of the crucial role played by the GNU project in the development of the operating system. In this essay, we will explore the merits of calling Linux “GNU/Linux” instead of just calling it “Linux.”

First and foremost, calling Linux “GNU/Linux” acknowledges the contributions of the GNU project to the development of the operating system. The GNU project, which was founded in 1983 by Richard Stallman, set out to create a complete free and open-source software operating system. While the GNU project made significant progress towards this goal, it was not until the Linux kernel was developed in 1991 by Linus Torvalds that a complete operating system was created. However, the Linux kernel alone is not enough to create a functional operating system. It was the combination of the Linux kernel and the GNU system tools and libraries that created the operating system we know as Linux today. By calling it “GNU/Linux,” we recognize the contributions of the GNU project to the development of the operating system.

Secondly, calling Linux “GNU/Linux” highlights the importance of free and open-source software in the development of the operating system. The GNU project was founded on the principle of creating a completely free and open-source software operating system. The Linux kernel is also released under an open-source license, which allows anyone to view, modify and distribute the code. By calling it “GNU/Linux,” we emphasize the importance of free and open-source software in the development of the operating system.

Thirdly, calling Linux “GNU/Linux” helps to distinguish it from other operating systems that use the Linux kernel but are not part of the GNU project. For example, Android, which is widely used on mobile devices, uses the Linux kernel but is not part of the GNU project. By calling it “GNU/Linux,” we can differentiate between the Linux-based operating systems that are part of the GNU project and those that are not.

Fourthly, calling Linux “GNU/Linux” encourages the use of free and open-source software in general. The GNU project and the Linux kernel are both released under open-source licenses, which means that anyone can view, modify and distribute the code. By calling it “GNU/Linux,” we draw attention to the importance of free and open-source software in the development of the operating system and encourage the use of open-source software more broadly.

Finally, calling Linux “GNU/Linux” helps to promote awareness of the history and development of the operating system. The development of Linux and the GNU project is a fascinating story that spans several decades and involves the contributions of thousands of people. By calling it “GNU/Linux,” we acknowledge the history and development of the operating system and promote awareness of the role played by the GNU project in its creation.

In conclusion, there are several merits to calling Linux “GNU/Linux” instead of just calling it “Linux.” Doing so acknowledges the contributions of the GNU project to the development of the operating system, highlights the importance of free and open-source software, distinguishes it from other Linux-based operating systems, encourages the use of free and open-source software more broadly, and promotes awareness of the history and development of the operating system. While it may seem like a minor change, calling Linux “GNU/Linux” can have a significant impact in promoting the values of free and open-source software and recognizing the contributions of the many individuals and organizations that have helped to create the operating system we know and use today.

______

As you can see, the AI answered the question quite well. It does use some loaded language, like “a growing movement”, that’s not supported by any evidence that I’m aware of – it may be growing or it may not be. Otherwise, it does fairly well at explaining the merits of calling it “GNU/Linux” well enough.

If that persuades you to do so, so be it. If it changes nothing, so be it. You can call it just plain Linux if you want – and I do. I do… This brings us to the second segment of this article!

“Linux” or “GNU/Linux” My Personal Views:

From a personal point of view, and being the author of this site, I simply refer to it as “Linux”. It is not that I do not respect or know about the GNU aspect, it’s that I don’t think I need to type it out repeatedly.

Let’s say you were an avid member of a collectible car forum. Let’s also say that, generally speaking, the forum talks about just one make and model car. For the sake of argument, let’s also just say that the car in question is a Volvo 245.

Still with me?

That’s just like when speaking about the 245 you wouldn’t need to keep typing Volvo. You could even use slang words – such as lovingly calling your 245 a ‘Brick’. But, the main point is that you’d not need to keep calling it a Volvo 245 – because everyone expected to read what you wrote is expected to know that you’re talking about a Volvo.

That’s probably a poor analogy, as GNU isn’t the maker of Linux, but you hopefully get the idea – the idea being that specificity is not required when speaking to your peers about a subject with which those peers are already familiar. If I’m speaking to mathematicians, I don’t have to explain Euler’s number, I simply need to refer to it and they’ll understand what I mean.

So, when a new person reads “Linux”, they’re not expected to know that it’s Linux with GNU components – they’re expected to learn that in context. Anyone advanced in the subject is likely to already be aware of the GNU additions and won’t need to be told over and over again.

I know and very much appreciate the contributions made by GNU. I am not lessening their contributions. Nor am I not diminishing their contributions. I just expect you to already know about their contributions or to learn that along the way. I don’t think that’s too much to expect from my readers.

By the way, there are at least a few distros without GNU. A fairly new one would be Chimera Linux – from some searching, whose tools appear to be based on BSD. There’s also HURD, which is an operating system from the GNU folks that contains no Linux. Given their rarity, I’d probably mention them specifically, pointing out that they stray from the norm.

And that’s what it is – it’s the ‘norm’. It’s normal (for me) to just call it Linux. So, that’s what I do. I know there’s a lot of GNU in there. I use GNU tools quite regularly, and I’m grateful for them. When I omit the “GNU”, it’s not intended as a slight. If I omit the “GNU” it doesn’t mean I don’t know what’s in my operating system – it means I don’t need to specify.

So, what do I do when I encounter a ‘militant GNU/Linux verbiage user’ in the wild? I let them say their piece. I consider them a bit pedantic, but they’re correct in calling it “GNU/Linux”. That’s (generally) what is being discussed and GNU has a huge role in this while Linux is ‘merely’ the kernel.

What do you do?

Closure:

This seemed like a fun subject to cover. I knew I’d eventually remark on the “Linux” or “GNU/Linux” debate and this seemed like a fun way to do so. It’s something most folks can offer an opinion on. I don’t let it ruffle my feathers, but I’m very unlikely to change my ways. Odds are really good that I’ll keep using “Linux” and I’ll be specific when I mean just the kernel. So, there’s that, which is nice.

This might be the fourth article in a row that doesn’t require an open terminal. Imagine that… I wouldn’t expect the lull to last all that long. This was meant to be a quick and easy article but has taken me about twice the amount of time I normally allot for article writing.

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.

Meta: The State Of Linux Tips #16

This is going to be published on a Sunday, so it’s a fine day to do a simple meta article. It’s an article about the state of Linux tips. Basically, it’s a lazy article for me, where I just share some stats with you.  If you’re interested in that sort of thing, read on…

There will be another meta article coming up, as we’re soon going to cross the two-year mark. So far, so good… We’ve managed to have an article every other day, which is nice. But, we’ll talk about that in a few articles down the road.

This is just a recap of what last month was like, more than anything else. At least that’s how I’ve done the majority of these things, though I never really know what I’ll write in one of these.

Meta Stuff:

So, the CDN I used raised its prices. I now pay double what I used to pay. You can donate to the right. If people do not donate, the site’s going to stay up and running. I’ll do it without your help if I’ve gotta.

This of course coincided with the site getting the most amount of traffic it has ever had. We used a combined 35 GB of traffic – which isn’t much for many larger sites but is pretty insane for this site. We had more traffic in March than we had in February and more traffic in February than we had in January. (There’s a bit of a pattern there.)

Speaking of patterns, this month appears to be getting slightly less traffic than was seen in March. That’s unusual. The site has experienced fairly consistent growth, but this month appears to be ever so slightly less active. I do not know why and, frankly, don’t feel like trying to figure out why. 

There are bound to be some times when we don’t experience growth and the site is still getting a lot of traffic – meaning we’re helping a lot of people. We’re helping thousands and thousands of people every month. That’s a great thing and it far exceeds what I expected when I started this out.

Some Stats:

So, things are a bit different this month. @BrickWizard would appreciate knowing this, I think. These are the most popular pages:

Find Out Which Display-Manager You’re Using
How To: Disable Sleep And Hibernation on Ubuntu Server
How Do I Install Linux (A General Guide)

The most popular browsers:

Chrome 82.5%
Unknown 14.5%
Firefox 2.2%

(Firefox is struggling in the market perhaps?)

The most popular operating systems: 

Linux 94.4%
Windows 3.2%
Macintosh 1.5%

Other Stuff:

More than 13,000 people visited.
They visited about 19,000 times.
They mostly visited on Monday and Wednesday.
They mostly visited from 15:00 to 22:00 GMT.
Most traffic came from Google searches.

Closure:

So, there you have it, it’s another meta article that lets you know the state of Linux-Tips. I try to remember to do this every month, but I don’t always manage to do so. They’re not very interesting articles from a search engine perspective, but that’s okay. I might as well share the information as they’re generally well-read 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 site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Dealing With Google Chrome Crashes, Freezes And Other Anomalies

Today’s article is about dealing with Google Chrome crashes – and other anomalies. I say ‘other anomalies’ because this helps with many problems. It’s such a common answer for browser-related questions that it’s hard to make this into a succinct article.

See, this is one of my most-voted answers on a support site. But, it’s a valid answer for so many different problems. I’ve long wanted to make this into an article, I just haven’t been able to come up with the words to write that article.

So, if you installed a Google Chromium-based browser (such as Google Chrome, Brave, Opera, Microsoft Edge, or others) then the odds are very good that it came with “Hardware Acceleration” enabled. As a general rule, this doesn’t cause any problems.

However… See, hardware acceleration (that is rendering some content on your hardware instead of doing so in software) isn’t supported and Google has no plans on supporting it. But, for whatever reason, Chrome, Chromium, and all the derivatives ship their Linux version with hardware acceleration enabled.

Having hardware acceleration enabled is, more often than not, nothing to be too concerned about… This article is for when it is a problem. This article is for that subset of users who don’t know to turn it off and don’t realize it’s the problem.

Does your system freeze after leaving your browser open for a while?
Does your browser freeze for no reason?
Does your browser freeze when you play audio or video?
Does your system slow down with just a few tabs open?

The list of symptoms is just too long to make a single headline, even though the fix is simple enough. I’ll show you…

Dealing With Google Chrome Crashes:

So, if you have any of those symptoms listed above, the solution is pretty easy.

I’d go so far as to say that if you’re experiencing problems while you have an instance of Chrome, Chromium, Bing, etc, installed, then the first step I’d take in debugging would be the one that follows.

The answer is simply to disable hardware acceleration. 

Open the offending browser and then it’s under Settings > Advanced > System and it looks like this:

solve the google chrome problem easily
Yup. Just un-tick that bugger and reboot. It’s that simple.

Restart your browser so that the changes take effect.

That’s usually what fixes this. That’s it. That’s all you need to do.

This fixes so many weird problems that it’s worth trying if you’re experiencing weirdness while you have a Chromium-based browser running. If it doesn’t resolve your problem, you’ve not spent a bunch of time on this fix. It’s also trivial to reverse if you want that for some reason.

Closure:

There you go, it’s another article. This time, it’s about Google Chrome (or based on Chromium) based browsers – which, in the Linux world, means said browser is likely Chrome and Chromium, according to the stats I see. Also, this article didn’t even require opening a terminal

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.

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.