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.

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.

Find The Boot Processes That Slow You Down

In today’s article, we’re going to show you how to find the boot processes that slow you down. What you do with this information is up to you. You can opt to tweak and try to speed up the boot process, or you can just learn to live with it. It shouldn’t be too long – or too hard.

Note: This article assumes you’re using systemd. If you’re not, get with the program!

With modern computers, even those a decade old, I don’t really understand the fascination with speeding up your boot process. This is especially true with Linux. After all, how often are you booting? People spend 3 hours improving the boot time by 3 seconds!

using uptime to show how long the system has been running
As you can see, I do not reboot all that often, pretty much only as needed.

Even if you reboot every day, unless your boot time is so slow that it’s indicative of a problem, you can always just press the power button as you walk by the computer to get your morning coffee.

This article is aimed towards those who have a slow boot problem. It’s aimed at you people who have slow boot times, boot processes that slow you down without good reason. People interested in optimizing their boot time can also benefit from this article, but that’s not the point.

Also, this article isn’t going to show you what to do next. This article will just be showing you how to find the boot processes that slow you down. The steps you take from there will vary based on your problems or your objectives.

Find The Boot Processes That Slow You Down:

Like oh so often, this is a trip down Terminal Lane. We do a lot in the terminal on Linux-Tips! It’s great to get new users to get comfortable with using the 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 now open, we can take a look at the boot process. To do so, let’s start with a basic command:

Picking one of the slower devices in my stable, you end up with an output similar to this picture:

output from systemd-analyze
That’s rather middle of the road, I would assume. You can get much faster and slower.

With that information, you can see how long it takes to reach ‘userspace’. For most folks, that’s going to be the number you’re interested in – as it’s when you can graphically interact with the system, usually to login to the system.

I should also mention that that’s not the total boot time. The computer has its own boot process. This time only includes what happens after POST, as the Linux operating system takes over. It doesn’t include how long you saw the original computer’s OEM logo/boot screens or anything like that. Your real-world boot time will be slightly longer.

So, let’s have some more details and see how that startup is actually working. Let’s see how long it takes for each step of the boot process. To do that, you’d want to look at the following command:

Yup, it’s a bit of clever naming. It’s systemd letting you know what process(es) to blame for a slow boot time. Pretty handy, huh?

If you want, you can even make a nifty picture of the boot process – a picture that includes showing  you the dependencies needed to complete the boot process. 

That’ll output an image that’s quite large, to large to bother including, but it’s easy enough to understand. If you’re having serious issues booting, that image might be something you can share with a forum when you’re asking for assistance.

What steps you take next will depend on your individual situation. If you’re looking to speed up your boot process, you can mask services that you don’t need. If you’re having problematic services and/or dependencies, your situation will be different and require different fixes.

Closure:

And there you have it! You have another article. This article tells you how to find boot processes that slow you down, so it’s an article that could be helpful to all sorts of people. Once you have this information, you can start looking to make changes. It’s a handy way to get boot process information with systemd.

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.