Let’s Learn A Little About The ‘dir’ Command

In today’s article, we’re going to learn about the ‘dir’ command. The ‘dir’ and ‘ls’ command are quite similar, but ‘ls’ seems to get all the press. So, today we’ll be looking at the ‘dir’ command. It will be a relatively short article (I suppose) and easy enough for new people to follow.

You’re possibly already familiar with the ‘ls’ command. I’ve written a variety of articles about ‘ls’. We’ve used ‘ls’ in numerous articles along the way. Here are a couple of ‘ls’ articles:

Some Fun With Sorting The Output Of ‘ls’
Let’s Use ‘ls’ To Sort Files By Time

Those are just a couple. WordPress, the backbone of this site, isn’t very good at searching for just two characters like ‘ls’. That’s for good reason and I’m not sure if that behavior can be changed.

Ah well… Root around and I’m sure you’ll find more. I’ve written about 300 articles and can’t possibly remember them all!

Anyhow, we’ll be using the ‘dir’ command in this article. It describes itself pretty well in the man pages, and is similar to the ‘ls’ command. It describes itself as:

dir – list directory contents

So, if you’re familiar with the ‘ls’ command, you’ll find ‘dir’ to be quite similar. I’m sure there’s a reason that both exist – I’m just not sure what that reason is, nor am I sure why both are included by default. Feel free to let me know your thoughts or theories!

Edit: See this link to see why Linux contains both.

Well then, let’s get on with it…

The ‘dir’ Command:

Well, you shouldn’t need to install anything for this article, but you will need to have an open terminal. By now, you know how to open the terminal if you’re a regular reader, but others need only press CTRL + ALT + T and their default terminal should open.

With your terminal now open, let’s just start with the basics. If you just enter the ‘dir’ command it will output a list of all the visible files in that directory. It looks like:

You can also specify a directory, like:

If you want to show hidden files, you can try this:

If you want to list things in a single column, in a list format, you can just add the -l flag. This also shows the file’s permissions and modification time. So, you could try:

If you want to list files with the ‘dir’ command and to do so recursively (digging into the folders within folders), you can do that too. All you need is the -R flag. So, for example:

That’s just scratching the surface of the ‘dir’ command. There’s a whole lot more that you can do, so just try the man page for more nifty tricks  you can do with ‘dir’.

If you have any questions or nifty ‘dir’ information, please feel free to leave a comment. It’s a pretty handy command to have on hand, much like ‘ls’.

Closure:

And there you have it. You have yet another new article, this one about the ‘dir’ command. It’s not terribly complicated and it’s another tool to toss into your toolbox. You never know when you might want to use it instead of the ‘ls’ command, though they’re awfully similar.

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: Extract Files From An .iso

In today’s article, we’re going to learn how to extract files from an .iso. This is a good tool to add to your toolbox. You never know when you may need it. This really shouldn’t be a very long article, and even a new user should be able to follow along. Read on!

First, an .iso is really an optical disk image – even though some of the current .iso examples far exceed what you can write on a CD or even a DVD. You still use an .iso when  you’re writing a Linux live/boot USB. It’s still an optical image, you’re just not writing it to optical media. It’s a standard.

Commonly, you’ll find that Linux distros come in .iso format. You’ll also find some backup software that creates an .iso image. Traditionally, you don’t extract an .iso, you write it as a single image to your media, be it USB, CD, or DVD. But, sometimes you might want to extract files from the image file, and it’s not terribly hard to do so.

Further Reading:

How Do I Install Linux (A General Guide)
How do I ‘Boot to USB’? (Or CD/DVD, if Such is Available)
balenaEtcher: A Tool To Turn Linux .ISO Files Into Bootable USB Drives

Alas, you might have flubbed a configuration file and want to extract a known good one from the .iso you used to install Linux. You may have a backup in .iso format and not want to recover the entire image just for a few files, so you’ll want to extract the files from the .iso. There are a variety of reasons why you might want to do this, which is what we’ll learn in this article.

Extract Files From An .iso:

Just like so many previous articles, we’re going to do this in the terminal. So, crack open your terminal and we’ll get started. If you don’t know how to open your default terminal emulator, just press CTRL + ALT + T and your default terminal should open.

With your terminal now open, the first thing you have to do is make the correct directory in your /mnt (mount) directory. It looks like:

Next, you want to mount the .iso, which is done like this:

Now, at this point, you can do one of two things. If you want to remain in the terminal, you just ‘cd /mnt/iso‘ and start with ‘ls -la‘ to navigate and find the file(s) you want to extract from .iso. Pretty easy, really!

Alternatively, at this time, your system will now see the .iso as being a mounted image file. You can open your default file explorer (Nemo, PCManFM-Qt, Thunar, Dolphin, and the list goes on and on and on…) where you should see the .iso mounted, especially if you navigate to /mnt/iso. You can then navigate to that mounted image graphically, treating it like its own file system, and extract files as you see fit.

The choice is up to you. You can use a GUI file manager or just use the terminal. Both will be equally effective and allow you to extract files from an .iso. See? Not all that hard at all. Find an .iso on your system and test it.

Closure:

And there you have it, you have yet another article! This time, we’ve gone over how to extract files from an .iso. This isn’t something you’re likely to need often, but it’ll be handy when you do need it. It’s just one of those tools you stuff into the back of your mind for when you do need it – or at least enough to be able to get a reminder by way of a search engine.

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: Open FeatherPad At A Specific Line

Today’s article is going to show you how to open FeatherPad at a specific line. It won’t be a very long article. It won’t be a difficult article. But, ideally, it’ll be a handy article. Read on!

FeatherPad is a pretty decent, lightweight text editor. It reminds me of LeafPad quite a bit, but it’s its own separate project. You will find that FeatherPad is the default GUI plain text editor with Lubuntu, which is how I first learned of it.

FeatherPad supports things like tabs, tab drag and dropping, and can even do things like automatically close brackets when you open them. There are plenty of options, but it’s a basic text editor. You can even use CTR: + + to zoom in, and you can use CTRL + to zoom out. That’s pretty neat.

Me? I love the ability to save a session and have the previous session open automatically when the application is started. FeatherPad lets me have a couple dozen text files that I want to keep open at all times, and this is how I do that. I just use the session manager and open the previous session when FeatherPad starts.

If you’re looking to try a new graphical text editor, I would suggest taking a look at FeatherPad. It’s certainly in your default repositories, assuming you’re using a major distro. As I mentioned above, it’s still a pretty basic editor, that could also be used as a code editor – so don’t expect too much from it, as it’s not intended to do all that much.

So then, let’s learn how to…

Open FeatherPad At A Specific Line:

You can open FeatherPad via the GUI and just navigate to the intended line. It supports line numbering, so that’s not a problem. You can also start FeatherPad from the terminal, which is what we’ll be doing here. Press CTRL + ALT + T and your default terminal should open.

With your terminal now open, you should probably start by installing FeatherPad. It is installed by default in Lubuntu, but to install it in something like Ubuntu you’d run this command:

Now, if you try to run ‘man featherpad‘ you’ll find out that there’s no man page associated with FeatherPad. So, to access the help documents, you’d just run:

Of course, that right there’s enough for the article. What you need to know is mostly right there in the help pages. They’re not even complicated, but that’d make for a very short article. So then…

If you want to open LeafPad at a specific line, it’s this:

A real world example of that would be something like:

You can even open LeafPad at a specific line AND at a specific column. That command isn’t much more difficult, it looks like this:

Again, for a real world example, if you want to open ~/.bashrc on line 12 and at column 5, the command would look like:

Bonus:

In all those instances above, FeatherPad will be attached to the terminal. If you close the terminal FeatherPad will also close. So, if you start the application from the terminal, you have to leave that terminal window open until you’re done with it.

If you close the terminal, FeatherPad would also close. On top of that, there’s no new line for you to continue typing further commands into the terminal. So, you can’t keep using that terminal while FeatherPad is open.

We got this figured out!

Which is also why you might want to read this previous article:

Don’t Let Applications Close When The Terminal Is Closed

Or, to save you some reading time, you can just add a ‘&‘ at the end of the terminal command to open FeatherPad at a specific line number. Like so:

If you use that command, with the ‘&‘ at the end of it, it will detach FeatherPad from the terminal, meaning you can keep FeatherPad open while still using the terminal or that you can even close the terminal while that instance of FeatherPad remains open.

Closure:

And there you have it. You have another article! This time it turned out a bit longer than I expected. I wasn’t going to include the bonus content but that seemed like a good idea. Either way, it’s not very complicated and should be a quick read.

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.

Meta: The State Of Linux Tips #12

Today’s article is just another meta article. It will not be all that long, as not a whole lot of the favorite articles – or even numbers, have changed. This will be published on Sunday, a day when I don’t get a lot of traffic.

Well, some things have changed.

See, if you view the site with ads enabled, this site whitelisted in your ad blocker, and you’ve been clicking ads – please don’t click on ads just to help me out. That’s not how AdSense is meant to work.

If you can’t tell, the ads have been suspended while Google researches the site for ‘invalid traffic’. I’m not sure what that means, but some searching says it could take a month or so for ads to be resumed. Invalid traffic also includes purchased traffic, something I’ve never done. 

I can’t help but wonder if many of us use a VPN to connect? I do. Maybe that’s the kind of traffic, but I can’t imagine Google not knowing how to recognize VPN traffic and to adjust accordingly. That doesn’t seem like invalid traffic to me.

So, don’t click ads to help me out. Ads should only be clicked if you’re genuinely interested in the subject. Otherwise, it screws over the people paying for the ads.

More Meta:

So, last month we kinda had a blow out. In the month of October, we served almost a million pages to about 16,000 viewers. The pages number is kinda wonky, so that probably includes bots. But, for the first time ever, we had over 10,000 unique viewers.

Other than that, not much has changed. The three most heavily visited pages are the following:

Find Out Which Display-Manager You’re Using

Screenfetch vs. Neofetch, You Decide!

How To: Disable Sleep And Hibernation on Ubuntu Server

About 97% of the traffic is using Linux – which is interesting. For a while, it was a lot of Windows users. I never did quite understand that. Windows users are down to like 2% of the traffic.

About 80% of my traffic is from the United States, and about 20% has IP addresses from Russia. It’s safe to discount those Russian numbers as they’re likely bots and people attacking the site. We get a lot of attacks here.

Chrome (and probably others that identify as Chrome is the most common browser. About 85% of you are using Chrome, Chromium, or a derivative like Opera or Brave. Firefox is only about 12% of my traffic.

What Else & Closure:

So, yeah… We’re about at the 300 article mark. That’s a lot of writing. If you feel like writing an article, let me know. This is the meta article for the last month, so November looks even better.

Why is this article late? I typed a bunch of it up and then just plain forgot to proof it and write this part of it. I then didn’t schedule it. So, it’s a bit late, but not terribly late. It also means I got it out in time to not have skipped a day!

I’m not sure how much longer we can go without skipping a day. Winter is definitely coming and I will have connectivity issues as well as losing mains power on a regular basis. I should probably get a few articles ahead and then saving them for any major infrastructure outages that will occur. 

Anyhow…

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.

Sync Mega.nz On Ubuntu 22.04

In today’s article, we’re going to learn how to sync Mega.nz on Ubuntu 22.04. It’s an easy enough article, one even a new user can follow. Read on, my dear readers!

It’s a holiday when/where I write this, largely ’cause I wasn’t ahead of schedule, so a nice and easy article sounds like a good idea. Many of my readers are from the United States, so they’ll be in a turkey coma today. Besides, my right wrist is a bit angry today, so it’s a good excuse for a simple article!

This article was prompted by a question on a forum I frequent. The user was asking about cloud storage solutions that work with Linux. Many of them do, but Mega.nz seemed like a good idea. They support various versions of Linux, but we’re going to concentrate on learning how to sync Mega.nz on Ubuntu 22.04.

You’re going to need an account with Mega.nz. Click that link and sign up. They’ll give you 20 GB of free cloud storage and they encrypt everything you store with them. The URL may redirect to a .io address, but it’s the same company.

The folks at Mega.nz say that not even they can recover your data, so you’ll want to backup your key and never forget your password. But, I’ve used them for a long time and had no problem with their services.

As near as I can tell, they’re telling the truth about the encryption. So, you get 20 GB of storage space for free (among a bunch of other features) but you also get some pretty rock solid privacy. That’s why I’m writing the article about Mega.nz and not some other cloud storage provider.

Sync Mega.nz On Ubuntu 22.04:

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 want to use wget to grab the .deb file needed to install Mega.nz’s sync application. We’ll start by moving to the ~/Downloads directory before initiating the download, and the command will look like:

Then, we’re going to install the Mega.nz sync application right there in the terminal. We’re not going to mess around with a GUI application like GDebi. So, that command would look like:

And that’d be all you need to do – from the installation side. The application will appear in your application menu and you can configure it from there. That’s all going to be straightforward and the help pages at Mega.nz will see you through to the end – but my readers are smart enough to not actually need the help pages.

Closure:

That’s it! That’s all there is to it. You install the Mega.nz sync application, set up folders to sync, let the application run in the background (or only when you start it), and you can now sync Mega.nz on Ubuntu 22.04! I told you that it wasn’t going to be all that hard.

It’s even easy to sign up for an account on Mega.nz. Best of all, it’s 20 GB of encrypted cloud storage for free. On top of that, you can EASILY adjust this article to fit with a number of distros and a number of releases. It’s not hard and I’m sure you can figure it out.

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.

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.