How To: Make A File Executable

Today we’re going to learn something important, that is how to make a file executable. This is something everyone should know how to do. It’s not going to be easy to make this into an article, ’cause it’s really quite easy, but I’ll give it a shot.

One of the important things about Linux is that files have various permissions. You can read, write, and execute a file based on the permissions. This helps keep Linux a bit more secure, because files can’t be executed until you’ve given them permission to do so.

I’ll make this article as straightforward as I can, by trying to give you an example of how this works. We’ll create a file, make it executable, and then run said file. This should serve as a good example, so that you can do so in the future.

You’ll see a bunch of commands in this article. If you’re new, just follow ’em until the end and you’ll hopefully understand what’s going on, and see how to make a file executable. Trust me, this isn’t something all that taxing. I’m sure you can get it!

Make A File Executable:

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 open, let’s create a new file. We’ll do that with:

Open love.sh for editing with nano by using the following command:

Enter the following text:

Now, you’ll have to save that. Just press CTRL + X, then Y, and then ENTER. That will save the file with the newly added text.

Now, we’ll make the file executable with the ‘chmod‘ command. That’s done with this command:

With that done, all you need to do now is execute the file. To do that, you just call the file by name in the terminal. As you’re still in the same directory, you’ll need to use ./ – so your command actually looks like:

With that, you should get a message saying that you love Linux Tips. Aww… Isn’t that sweet of you! We love you too! It was also a fun way to create a file, edit it, make it executable, and then actually executed said file.

Closure:

See? That wasn’t all that hard. I hope that method shows you a little about how to make a file executable. It’s a pretty basic skill that all Linux users should be familiar with. It’s not a very complicated article, but that’s just fine. At least we (hopefully) had some fun 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.

How To: Find Out When A File Was Created

Today, we’re going to learn how to find out when a file was created. Odds are good that you could use the right click menu in a GUI file manager and figure it out, or you can sort by time and show details, that sort of stuff. Those being ‘easy’ we’ll learn how to find out when a file was created in the terminal.

Yeah, a lot of these articles explain how to do things in a terminal – even when there’s a nice graphical way to accomplish those same things. While it’s true that we may have different shells, we’re far more universal in the terminal than we are in a graphical desktop environment.

It’s good to learn how to do things in the terminal. If you can accomplish your goal in the terminal – you can accomplish it quickly and easily everywhere. That’s a pretty great benefit. (It’s not even unique to Linux – as you can do a whole lot via command line in Windows and MacOS.)

Also, today’s article feels a bit like work. I was hoping that it’d take longer to really start feeling that way. It’s okay. I picked a brief subject, what should be a short article, and that’ll be almost like a day off.

Find Out When A File Was Created:

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 open, change to the directory that contains the file you want to find out when it was created. Let’s say it’s in your Documents directory:

Now, you can just use the -l flag with the ls command. That’d look like this –  showing the creation date (and maybe time, if the file is recent enough) for all the files in that directory:

That’s pretty messy, especially if you have a lot of files in the directory. So, you can specify the file for which you want to find the creation date by specifying the filename in the command itself, like so:

That’ll do it for you. Well, it should do it for you! If not, something’s broken and don’t ask me to fix it!

Closure:

There you have it… You can now tell when a file was created. It’s not a very difficult process and it’s one you can easily commit to memory. I find myself using it when I’ve created a file and then can’t find it among other files with similar names – I’ll check to wee when a file was created and figure it out that way.

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.

Monitor rsync’s Progress

In this article, we’re going to learn how to monitor rsync’s progress. It’s a pretty trivial article, but it’s something you may want to know – especially if you’re using rsync often. Read on and learn how to monitor the progress of rsync. 

For the curious, I use rsync every day. It’s a part of what I do to beta test Lubuntu. It’s pretty handy for syncing my existing .iso with a fresh daily .iso, saving both Ubuntu and I a bunch of bandwidth.

I also use it locally. If I want to backup something like my home directory, there aren’t many better choices. Rather than mess with various applications, I can just write a simple command and can even automate it by making it a cronjob. 

However, it’s nice to get some feedback. It’s nice to see how far and how fast the syncing is taking place. It’s handy to monitor rsync’s progress. There are a couple of neat ways to do this, so I’ll show you them. 

If you don’t know, rsync is a tool used to sync files. It’s great for copying files from one location to another location. It even has some checks and balances, so it’s pretty great. By the way, the man page defines it like:

rsync – a fast, versatile, remote (and local) file-copying tool

Which I think is an apt and fair description. So, with that in mind, let’s move into the article about how to …

Monitor rsync’s Progress:

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.

For the most part, rsync works like so:

Now, you can just show the progress with the -av flags. The ‘a’ for “archive” and the ‘v’ is for verbose. That is a handy command. You will also need the ‘–info=progress2’ to go along with it. 

To use it, it might look something like this (to backup sync your entire home directory in this example):

See? That’ll output the progress as you go. For local stuff, that’s pretty much my ‘go-to’ command, or close enough.

But wait, there’s more!

That’s right, there’s more to know if you want to monitor rsync’s progress!

First, install ‘progress’. It’s probably not installed by default, so you’ll have to install it manually with your own package manager. For example, with apt in Ubuntu, it’s just:

With that done, it’s a tiny application, open up another terminal window – so that rsync is still happily running in your first terminal instance, and run the following command in the second terminal:

Pretty frickin’ neat, huh? You can monitor your rsync command’s progress quite easily with that command. It gives you a pretty good readout for your rsync’s progress. If nothing else, it’ll keep you amused while your data syncs. 

Closure:

Yay! Today you have another article. I still haven’t missed a day. You’ve had an article every other day for a long time now. Well, today is no different and in this article you learning how to monitor rsync’s progress – a pretty handy tool, especially for the inquisitive. 

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.

Let’s Take A Look At Logged In Users

Today is a good day to learn how to take a look at logged in users. The vast majority of my readers are desktop users, so you can mostly skip this article. On the other hand, when you take a look at logged in users, you might find users you didn’t know were logged in and discover a problem like unknown users.

Yeah, most of you – including me at the moment (which makes it difficult to do things like take useful screenshots) are using Linux (mostly) as a single user. You have a user and you login to that user account when you start your system up.

While you do have other system-configured users, you don’t generally login as those users. As such, you probably spend very little time thinking about the users you have. Those system users aren’t generally logged in but are there for permissions purposes, so they’re out of mind for most of us.

Well, for the rest of you, you can use this article to learn how look logged in users – even getting a glimpse at what they’re doing. I mentioned some difficulty in taking screenshots, so I’ll provide you with just one. Cherish it, as it’s the only one you’re getting!

Here it is:

looking at other users
See? I’ll reference some of this below, in the article itself. I might as well…

Have A Look At Logged In Users:

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.

As you can see from the image above you can see all the logged in users with the first command. The following command will list them:

You’ll see the same thing, with a bit more information, when you use the following command:

Now, in the image above, you can see where I used it once and then ran it again. What you don’t see is that, in between those two commands, I opened up another TTY and logged in again as ‘kgiii’. If you want to replicate that, just press CTRL + ALT, then F3 to F6, and login at the prompt with any user(s) you happen to have.

Finally, you can get a look at what they’re doing – like one has a desktop session open and two of those login instances just have bash sessions open in TTY sessions. To do that,  you just use:

That should be easy enough for you to remember! By the way, if you did login as an additional TTY instance, run ‘users‘ again and you’ll see the output for that command has changed accordingly. The command’s output will may also give you a good idea about how long the system has been up and what the system resources are like.

Closure:

There you have it. You have learned how to have a look at logged in users so that you can have an idea of what’s going on with your system. If you spot a user you don’t recognize, that might be indicative of a problem. If you spot a user you don’t recognize, you’ll need to do some more investigating. By the way, if you have ‘finger’ installed you can always run ‘finger <username>‘.

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.

[Fixed] A Rambling Post About Switching To Linux

Today, we’re going to talk about switching to Linux – in what I believe will be a brief article. This article is just based on some observations, and I think we can have some fun with it. (Ed. Note: It’s not very brief.)

Note: I hit the publish button instead of the Schedule button, so the article was briefly published and notifications went out about this. Sorry ’bout that. I’m an idiot. In my defense, I get it correct the vast majority of the time!

Moving on…

First, for this article, if you want to ‘help’ and ‘contribute’ then please do so as  a comment – you’ll see why before the article ends. Adding your comments as a comment here makes more sense.

When people take piano lessons, and history/experience tell me that this is similar for other instruments, 90% of them will quit within the first year. That is, they will have paid for equipment and formal lessons (as that’s where this data was drawn from) and they still quit taking lessons within a year.

Sure, you can learn a lot in a year – including how to give yourself further instructions. But, are they really quitting taking lessons for that reason – or are they quitting taking lessons for other reasons, like not making progress fast enough, not enough reward for the effort put in, or simply not having enough time to continue with a hobby when life has more pressing problems? Have they truly quit playing Piano?

And, well, I suspect the number is similar for people who try to switch to Linux. I strongly suspect, but have no data – simply observations – that approximately 90% of the people who try Linux will give up and return to using their previous operating system – be it Windows or MacOS, or what have you – within a year.

Let’s talk about …

Switching To Linux:

I get it. It’s hard. If you’ve been using Windows since Windows 95, you’ve got some serious muscle memory going on – and you have some legit knowledge built up. You’re pretty much an expert with Windows by then – or you’ve spent a whole lot of money to get other people to repair your computer for you. I suppose the latter is possible, but let’s just ignore that subset. You’ve still invested a ton of hours into learning how to use Windows itself – never mind the hours invested in learning to use the applications you are used to using.

Right now – and this is what prompted it – I am on my 4th day without smoking. (I am taking the drug Chantix. It’s awesome, at least for me.) 

I’ve tried quitting before – and I’ve even gone extended periods without smoking. I dare say that I’ve quit smoking so many times, I’m an expert at it! However, your odds of success get better every time you try to quit. I’m being optimistic, even though I’d kick a nun for a cigarette. (That’s a figure of speech… Well, it’s my figure of speech. Please don’t send ninja nuns to my house to beat me up.)

I can hear  you now… “Alright, David… What are you on about?”

Well, I’ve written about switching before – but this is a different aspect. See, when you make the switch, you’re not just starting to learn how to use Linux, you’re quitting using Windows. That’s a lot of habits and oh so many countless hours invested in learning to use Windows – and you’re giving up on all of that and all the benefits (and limitations) that entailed. You have things you know and those things you know are now things you knew – ’cause those things you knew ain’t true with Linux.

I don’t want to talk about formalities. This isn’t a technical article. Instead, I just want to show you one of the motivators I keep using to not smoke out of habit. (My cravings are kinda gone, I think. It’s just now the times I’d smoke out of habit.)

Please, click this link to see a timeline of benefits you get from quitting smoking:

What happens after you quit smoking?

Edit: Here’s a link from a .gov site, so maybe having more authority.

Ideally, that link will take you to the anchor – which is a timeline of benefits you get when you quit smoking. If not, scroll down until you get to said section. Those benefits are what’s keeping me motivated. Those are my rewards for putting up with the discomfort. (I dare say they’re pretty good rewards, but that’s a topic for an article on a different site.)

I have a point to this! It’s coming!

Timeline of Benefits:

If you have followed the link(s) above (and please do before commenting), you’ll see that there are benefits as soon as 20 minutes has passed. That’s right, just 20 minutes after quitting smoking you’ll have some benefits.

So, for this exercise, I want you to tell me what benefits you’d have (at those, or other) various timed intervals after quitting Windows and switching to Linux.

Like, so…

After 20 minutes of quitting Windows, you’ll see that you actually decide when your computer is updated and rebooted! So far so good!

After 12 hours of quitting Windows, you’ll see that you don’t have to hunt for software because everything you need to get started is available in the default repositories – and it’s free! These are benefits you get from switching to Linux!

After 24 hours of quitting Windows and switching to Linux…

(And carry on like that…)

You don’t have to do the full list unless you feel like it. You can even change the timeline hours/days/weeks/months, whatever – just have fun with it. It’s not some school exercise, it’s just for fun.

I do ask that you leave these replies as comments here, so that others can find and read them down the road. If you’re unwilling to do that, feel free to leave them on Reddit or on Linux.org, but here would be ideal. So far, in all my years hosting sites, I’ve never sold anybody’s data – and I’ve never had your personal information compromised. Commenting here is pretty painless and relatively low-risk.

Like I said… Don’t just have fun with it, be funny with it – if you want. The sky’s the limit. Do what you will with the idea!

Closure?

By the way, I think users HUGELY underestimate how many hours they’ve invested in learning to use Windows. It’s just like how they don’t recall how many hours they took to learn to walk, to talk, to spell in their native language, etc… They don’t seem to realize they’ll need to put in a similar number of hours to learn to use Linux. Ah well…

Have fun with it. “In 15 years, you’ll be a wizened old graybeard writing shell script like a wizard cast spells, with Windows being naught but a dim memory only recalled when drinking heavily or in the feverish nightmares of an old man.”

What was it like when you were switching to Linux? What was your timeline like? If you’re just switching, what do you want your timeline to look like?

What was the timeline like for you? Feel free to make it an accurate summation of events as you witnessed them. You do what you gotta do, but leaving them as a comment will mean they’re attached to the post ‘forever’ (or as long as I keep paying the bills). So, be funny, be real, be optimistic, or be you. 

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.