Automatically Enable Num Lock In Linux Mint

Sometimes I write articles that scratch my own and this time around it’s how to automatically enable Num Lock in Linux Mint. If you’re using a full-size keyboard and want to automatically enable Num Lock, this just might be the article for you. This article shouldn’t be all that long – and it won’t be very complicated. 

I should explain…

So, I misfired a dd command and hosed my root partition. I then decided to do something I’ve not done in a long time. For a change of pace and a fresh start, I decided not to restore (much of my) data from backups. Sure, I imported passwords, Thunderbird, ~/bash_aliases, and remained logged into browsers, but I didn’t import all my settings, my million browser tabs, or anything like that.

It has been fun! I haven’t done this in a long time. If I hose an OS, I just install and copy my /home directory into the freshly installed OS and I’m good to go.

As an aside, I’m quite grateful that I’ve written these articles. They’ve come in handy while rebuilding my system. I find myself referring to this site quite often. After all, I tend to write about what I know. These are often articles of things I do. This time around, it’s simply how you can automatically enable Num Lock in Linux Mint. This shouldn’t take long.

If you’re interested in this article, you might be interested in this other article:

Disable The Caps Lock Key In Linux Mint

Automatically Enable Num Lock In Linux Mint:

You don’t need an open terminal for this, but we’ll use the terminal because it’s easier for me to do this in the terminal. You can start by pressing CTRL + ALT + T to open your terminal.

With your terminal now open, we’re going to install an application called numlockx.  This is required if you want to use this method of enabling Num Lock automatically. 

If you check the man page, you’ll see that this is the tool we want for this task.

numlockx – Control the state of NumLock

Sure enough, that’s what we want to do! The rest is all in the GUI.

Open your menu and search for “login”. You’ll see an application called Login Window. Open that and then click on the Settings tab. With that Settings tab open, tick the slider to automatically enable Num Lock when you log into the system. It looks like this:

it's easy to automatically enable num lock in Linux Mint
That’s really all there is to it, so long as you first install numlockx. See? I told you it was easy!

That is what your screen should look like to enable Num Lock. This is it at the login window portion of the boot. This means you’ll have the Num Lock enabled and won’t have to remember to press the button when you use it.

Closure:

See? I told you this one would be quick and easy. Like I said, I’m just scratching my own itch. I prefer the Num Lock key to be enabled all the time. It’s just a habit for me and I do use the number pad fairly often. I figured I’d share it, seeing as it was something that was on my mind.

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.

Enable fsck On System Start

If you ever want to check your filesystem’s health in Linux, you might have wanted to enable fsck on system start. This is some maintenance work that we should probably consider performing regularly. Verifying the health of our data is not a bad thing and it doesn’t even take that long.

When you run fsck, you’re not checking the hardware’s integrity. That’s something done with S.M.A.R.T. and is something else you might want to check regularly. This is checking the integrity of our data, the health of your partitions, and that sort of thing.

I’m inept and didn’t remember to write this ahead of time, so this was written after eating way too much and a few glasses of wine. You have been warned.

Anyhow, I’ve written about fsck before:

Repair Your Linux Filesystem With a Live USB or DVD
How To: Check A Disk For Errors
A Couple More Ways To Find Your File System Type

If you get a minute, those articles might interest you.

What Is fsck:

You won’t need to install anything in this article. If you hunt around the ‘net, you’ll find that fsck somehow stands for ‘file system consistency check’. Please don’t blame me, I didn’t name anything. You’ll find that fsck is installed by default on most anything UNIX-like, including the BSD family and MacOS.

You can run fsck manually against unmounted partitions. In this case, we’ll make that easier by running fsck during the boot process. We’ll be telling fsck to run during the startup process. This means it’ll run automatically when you reboot.

If you check the man page for fsck, you’ll see it’s described like so:

fsck – check and repair a Linux filesystem

So, this is the correct tool for the job. If you look further, you’ll also come across this bit of information:

fsck is used to check and optionally repair one or more Linux filesystems.

You can verify that fsck is installed with this command:

The output from that command will tell you the version and the bit about ‘util-linux’ will let you know why I can assume that fsck is installed by default.

We’ll also be using the following tool…

What is tune2fs:

The tune2fs application is the tool we’ll be using to schedule the fsck command. The syntax is quite simple and you’ll be a professional in no time. If you were to check the man page, you’d see it described like this:

tune2fs – adjust tunable file system parameters on ext2/ext3/ext4 filesystems

NOTE: It’s important to realize that this is only going to work if you’re using one of those three formats. If you’re not using an ext* formatted partition, this isn’t going to work for you. There are other tools. This one is not for you.

The tune2fs application is almost certainly installed by default. If you check the man page it says it’s an invalid option – but it does tell you the version. Which means you can ensure that it is installed. However, you can just as easily verify that tune2fs is installed with this command:

While that won’t give you a version number, you don’t need to know the version. This is one of those applications that are robustly finished, for lack of a better term. It’ll work with your system.

lsblk:

We will also be using lsblk. We’ve used this command many times. Several other commands will get you the same information, but lsblk is a nice and easy example. If you check the man page, you’ll see that lsblk is described as:

lsblk – list block devices

Which, as you can see, is exactly the right tool for the job. Block devices are, in this case, drives and partitions. We’re interested in the partitions for this exercise. It’s a basic Linux utility and will be installed by default. You can verify that lsblk is installed by default with this command:

If any of these tools aren’t installed by default, please leave a comment. I don’t think I can recall a server or desktop distro that doesn’t have these basic tools installed by default. You shouldn’t need any additional tools for this exercise.

Enable fsck On System Start:

If it’s not obvious, fsck is a tool usually called from the terminal. I’m sure a GUI frontend exists somewhere, but that’s not covered in this article. So, press CTRL + ALT + T and let’s get started learning how to enable fsck when you start your system up.

First, let me cover another method. If you want to run fsck on the next boot and against your root partition, you can skip all of this and just run this command:

I think I’d be doing you a disservice if I didn’t mention that. The next time you reboot the device, it will run fsck on the root partition. It will clean itself up afterward and only run it that once, assuming all goes to plan.

What we’ll be doing is using tune2fs to schedule running fsck. We’ll specify the disk name and the frequency at which fsck is run. You’ll have options with the tune2fs method. I’ll explain them as well as I can.

Enable fsck With tune2fs:

With that open terminal, we need first to find the name of the partition you want to check. For that, we’ll use the lsblk command. The syntax is easy.

An example output from that command would be:

We are interested in the name section, which is sda* and we’ll be adding /dev to that name.

In this instance, we can see that there’s an efi partition and that efi isn’t an ext* formatted partition. So, that leaves us with sda2. As you learned earlier in this article, we could just run fsck against the root (the / partition) easily enough. So, in this article, we’re going to refer to sdb1 and you’ll apply it to your personal needs.

The syntax to enable fsck on system start is quite simple. I’ll give you an example:

So, let’s say we want to run fsck on sdb1 the next time we reboot. The command would look like this:

If I want to run this command every tenth time the system reboots, I can do that easily. I’d run this modified command:

You can schedule fsck easily this way, and apply it to different partitions without much additional effort. If you want to set it to check every 25 times, you can do that. You can just set it and forget it and then you’d have a slower boot time every 25 system starts because the system would be checking the drive(s) for errors.

When you’re done, you can disable this command easily enough. Just change the frequency to zero. If I were to disable fsck from running at system startup, I’d run this command:

That’s all there is to it. I’m sure you can manage. Hopefully, those directions are clear enough. If not, you can always ask questions!

Closure:

Well, I didn’t expect I’d write a long article tonight. I expected it to be a short and easy article. You can see how that turned out. Though, if you ever need to enable fsck on system start, you now know how you can go about doing so.

Best of all, assuming I’ve done my job well enough, you’ll be able to do so easily and without mistakes. However, mistakes with just this won’t be too worrisome. I suppose the worst case is that you check your filesystem’s health more often than you want to. Even then, that’s easily corrected. 

You might want to write down how to cancel it or remember this page so that you can return to remind you how to disable it. It’s not complicated and might even be stored in your bash history file so that you can reference it easily.

Either way, I hope you all had a happy Thanksgiving – if you celebrate. If you do not celebrate, I hope you had a happy Thursday! As for me and mine, it was a pretty good day. I have no complaints, other than there wasn’t a giant snowstorm to make things interesting.

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.

Show Your Filesystem In The Linux Terminal

Today is going to be a good day if you have decided that you want to show your filesystem in the Linux terminal. If that’s not what you want to do, this might not be the article for you! If it is what you want to do, read on!

I’m going to try to keep this fairly short. There are two commands that I have available to help you show your filesystem in the Linux terminal. There are surely other ways to do so, but I’ll just cover two different ways.

Both of them will be quite simple…

These two commands should be fairly standard. They should work in your distro, regardless of which distro you’ve chosen. There’s nothing special about them.

What do I mean when I say ‘show your filesystem in the Linux terminal’? I mean you can see, and identify, your various drives and their partitions. You can also learn a bit more information about them, but the general idea is that you can see and learn about them in the terminal.

Like I said, this won’t be fairly complicated. It will involve the terminal.

Show Your Filesystem In The Linux Terminal:

Yes, I said the terminal. You will need an open terminal. If you want to open your default terminal, you can usually just press CTRL + ALT + T. That will open your default terminal more often than not. Otherwise, open it from your terminal.

Now, to get to the point… I’m going to show you a couple of commands that you can use to show your filesystem in the Linux terminal. 

Ready?

lsblk:

The first tool we’ll use is lsblk. This is installed by default on any major distro and you won’t need to install anything. If you check the man page, you’ll see that lsblk is described like this:

lsblk – list block devices

That command sounds useful. Block devices are disks, drives, partitions, and the like. So, you can just run that command in the terminal. It looks like this:

The output is easy enough to understand. It might look something like this:

That’s with a bunch of junk still plugged in from a previous article. You can see that the output is easy enough to understand.

df:

The next command we’re going to use is the ‘df’ command. Again, you shouldn’t need to install anything to use the df command. This is something that should already be installed and if you want to use it to show your filesystem type in the Linux terminal, it’s quite easy.

First, you should check the man page. If you do, you’ll see that df is described as:

df – report file system disk space usage

Once again, that sounds like a fine tool for learning about your filesystem. You’ll want two flags. The first flag is -T and will show you the file system type. The second flag is -h and that means it’ll spit the output in human-readable form. An example of that command would look like:

An example output would look like this:

Again, that’s nice and easy to understand. If you want to show your filesystem information, these commands are easily memorized.

You’ll notice that both output is quite similar, as it should be. There are only so many filesystems available in the distro I used to write this. This information can be quite a bit more complicated if you’re running it against a NAS with lots of different storage options, but it’s generally easy enough to understand.

Closure:

There you go… This isn’t even a very long article – because it doesn’t need to be. I wanted to show you how to show your filesystem information in the Linux terminal. None of these commands are all that difficult to use and remember. You can also get some useful information from the mount | grep "^/dev" command, so keep that in mind along with the commands shown in this article.

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.

Find The Last Filesystem Check

If you’ve been using Linux for any time, you may have done a filesystem check and today we’ll find out when you did the last filesystem check with the Linux terminal. This may seem a little complicated, at least at the start, but it should be relatively easy. New Linux users should be able to follow along as we try to make Linux more approachable.

Disks have corruption after a while. Given enough time and data, a filesystem check is likely. Fortunately, Linux has many tools that will help you verify the integrity of your data. These tools are generally installed by default, so we shouldn’t need to install any new tools in this tutorial.

The article will have been tested in Lubuntu. The directions in this article are going to work with Ubuntu, official Ubuntu flavors, Linux Mint, ElementaryOS, and many more distros. I’d say they’re fairly generic instructions and that all these tools will be installed by default in most major distros.

You need good data health. This isn’t about hardware health as much as you’d learn from S.M.A.R.T data, it’s about the integrity of your data. You might use the information from this article to decide to run an fdisk command or two. Of course, you might also be interested in one of my more popular articles:

Repair Your Linux Filesystem With a Live USB or DVD

What we’re going to do is find out when the last filesystem check. What you do with that information is up to you. 

We will be using some tools…

lsblk:

The first tool we’ll be using is one of the default Linux tools. The name of that tool is lsblk. You can verify that lsblk is installed with the following command:

The output should look similar to this:

If you run man lsblk in the terminal, you’ll find that it’s described as this:

lsblk – list block devices

We’ll be using this lsblk command to identify drive names. It’s not complicated and you’ll be able to follow along easily enough. I’m sure of it!

tune2fs:

We’ll also be using the tune2fs command in this exercise. As far as I can tell, tune2fs doesn’t have a formal version flag. If you run a typical version command against it, it does spit out the version but it also spits out some usage information. So, that will do for verifying that you do indeed have tune2fs installed. You can run this command:

The output will look weird, but it’ll confirm that tune2fs is installed. 

Of course, the man page describes tune2fs like this:

tune2fs – adjust tunable file system parameters on ext2/ext3/ext4 filesystems

While that might not seem useful, it is. We’ll be using it to get those system parameters to find out when you did the last system check. Trust me! It’ll come in handy.

We’ll also be using a pipe and grep, but we’ve used those many times before.

Find Your Last Filesystem Check:

If it’s not obvious, we’ll be using the terminal for this. So, press CTRL + ALT + T and let’s get this party started.

The first thing you do is you want to identify the name of the drive. Don’t blame me for calling it the name. That’s what the command outputs. That’s what I’m calling it. The command for this is nice and simple, just run this command:

I plugged a bunch of stuff in, so an example output might look like this:

Next, your command looks like this:

This isn’t always going to spit out the right information. If a drive isn’t an EXT* formatted partition/drive, it’s not going to spit out any useful information. There will be no information if you try to use it with your EFI partition, for example.

An example EFI command and output might be:

On the other hand, an example of a good output might be like this:

As you can see, that was checked just a couple of months ago.

Alternatively, as I plugged some rather random stuff into the USB ports, you might see something as old as this:

That’s been a minute or two since the last filesystem check.

If you’re using an NVMe M.2 SSD, this will still work:

So, it’s not all that difficult to find out when you did your last filesystem check.

Closure:

Careful observation may show you that the site has changed a little. There’s now a way to do sponsorship, seeing as I get asked so many times. Nobody ever follows through, but I have had some contact with a couple of agencies. You may start seeing sponsored content soon. Feel free to about sponsoring Linux-Tips if you want.

As for the article, it’s just another easy enough article. I hope I’ve distilled it down enough to make it approachable for even the newest Linux users. It may be good to check to see when you performed your last file system check. If you have data in cold storage, you may want to check that now and again and check your filesystem’s health once in a while. The goal is to prevent data loss through corruption and this should help with 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.

Find Your Last Boot Time In Linux

It’s a weekend so today’s article will be short and easy, an article for when you want to find your last boot time in Linux. If you want to know when you last booted your computer, there are many ways to get that information. We’ll just cover one way…

We’ve covered a couple of ways to do this in the past. If you want, you can read the following article:

When Did I Last Reboot My Linux Box?

I wrote that article more than two years ago. It was one of my earliest articles. In that article, I covered a couple of different ways that you can find out when you last rebooted your Linux computer. 

In that article, we covered commands like:

There are some advanced commands you can use, so do read the previous article to learn more about how you can find your last reboot time.

In that article, I also mentioned that you could see how long your computer has been on since the last reboot with the uptime command. That’s simply done:

Speaking of the uptime command:

How To: Find Your Uptime In Linux
The Meaning Of “Load Average” On Linux?

Those articles might be of interest. This is a simple article, but it does allow you to read quite a bit more related content.

Find Your Last Boot Time In Linux:

You guessed it. We’ll be doing this in the terminal. That means you’ll need an open terminal. If you’re not sure how to do that, look in your application menu or press CTRL + ALT + T and your default terminal should open.

For this article, we’ll be using the who command. You can check the man page with man who to learn more about the command. If you do that, you’ll learn that the who command is described as:

who – show who is logged on

That may not be as descriptive as it could be. If you just run the following command, you’ll be able to see everyone who is currently logged into your system. That’s just this command:

That simply tells you who is logged in. Your output might look a little like this:

As you can see, I am logged in both on tty7 (the desktop) and tty3.

If you did check the man page, you’d have possibly seen the -b flag. That flag is described accurately:

-b, –boot
time of last system boot

See? Now it should be obvious why I’ve chosen to write this article about how you can find your last boot time with the who command. The command is simply:

Which will output something similar to this:

See? That’s all you need to know if you want to find your last boot time! It’s not all that difficult to get started with the Linux terminal. This is a command any Linux user can learn. It’s also a pretty easy man page to decipher. So, that’d be good for new users as well!

Closure:

It’s a weekend and I’m lazy today. So, you have an easy article. It doesn’t have to be all that easy. I gave you plenty of links that you can (re)visit. Visiting those links will also show you how much the site has changed – specifically with how I write the articles. This particular article is a lot like how I wrote many of the articles, but I’ve been mixing it up quite a bit. I was just really in the mood for an easy article today, so you got this one about using the who command to show when you last rebooted your system.

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.

Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.