Search For Command History By Date

Today’s article is going to show you how to search for the command history by date. This isn’t hard, but might seem a little advanced for some of the newer users. We’ll be doing this through the terminal, of course. That seems like a good idea to me!

Unless you’ve made some fairly drastic changes, Linux terminals keep a log of previously entered commands. This is on a per-user basis and considered relatively secure, or at least as secure as your user account is. It’s helpful to be able to look at your command history, especially if you’ve forgotten what you did and you really need to undo it!

Previous history articles include:

Delete An Entry In Your bash_history

Dealing With Duplicates In Your Bash History

So, I haven’t really covered the .bash_history (proper name, I suppose) all that much. There really isn’t all that much to cover, but today we’ll learn how to search your command history by date. It’s most useful when you remember when you made changes but you can’t remember the precise commands used when you made those changes.

Find Command History By Date:

Like oh so many articles, this one too requires an open terminal. You can open one easily enough. Just press CTRL + ALT + T and your default terminal should open.

With  your terminal open, we first have to tell Bash to store and show dates along with the history. That’s an easy command that you need only run once:

When you next type ‘history‘, it’ll look like a hot mess until you figure out what the command has done.

Now, to find command history by date. To do that, you just enter:

The format for me is YYYY-MM-DD, though I suppose it could be different for others who have an alternative date format set up. I don’t really know, but it’s easy to figure out by just running the history command and deducing the format from those results. If you’ve done it properly, it might look a little something like this:

searching command history by date
See? It works! It does show the command used to show these results, of course.

So, if you want to see what commands were run on a certain date, you can do that. You can also find what you entered when you remember the day but not the commands you entered. It can be pretty handy so search the command history by date. Keep it as a handy tool, as you never know when you’re going to need it.

Closure:

And there you have it. You have another article in a very long list of articles. This one is  handy if you need to know your command history by  date. I know I’ve been known to use this myself, largely because I sometimes need to narrow down my history quite a bit, as I do a great deal in the terminal and my history is a hot mess.

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 Learn How To Change The Open File Limit In Linux

Today, lacking anything better to do, we’re going to learn how to change the open file limit in Linux. Why would you want to do this? Buggered if I know! But, I’m gonna tell you how! (You’re welcome!)

Actually, you could be working with many files and want to increase the number of files that can be open at one time. You might also want the opposite, as a way of limiting system resources.

Basically, in Linux, anything that can use resources has some sort of limitation. For example, there’s a limit to how many arguments that can be passed in a single command or for a new process. You’re unlikely to bump into that limit as a regular desktop Linux user, but that limit is there.

Heck, if you want to learn more about that, click this. I’m not entirely sure how to change that value, but it might actually be in some notes somewhere. Someone’s gotta know how.

Again, you’re very unlikely to run into problems as regular ol’ desktop Linux user. Realistically, you’re unlikely to have to change the open file limit in Linux. However, today is the day I tell you how! Why? ‘Cause I ain’t scared – and it’s not my computer that you’re mucking about in!

I should also mention, more to remind you gentlefolk, that everything in Linux is a file. Everything… So, you’d be surprised how many files you have open at times. Even then, you still probably don’t have too much of a need to change the open file limit.

Change The Open File Limit:

Like many articles, this one requires an open 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 open, now is a good time to tell you that there’s a hard limit and a soft limit. The hard limit can only be changed by root and the soft limit can be altered dynamically by the process.

You can learn those limits. To find the hard limit, use this command:

And, to find the soft limit, use this command:

Those commands will output the value of your hard and soft limits, respectively. 

You can obviously change those limits, else this wouldn’t be an article. To change the open file limit, you just add a new value as an additional argument. It’s something like:

And, again for the soft limit:

For example, you might increase the hard limit with a command like so:

If  you want to make them permanent changes, you can do that. It’s a little different for the hard limit and the soft limit. So, to make them permanent we need to use nano to do some file editing:

And add this line:

If you want to change the soft limit, it’s a little different. It’s just:

If it’s not obvious, replace the username with your username (and no brackets, of course). Then, of course, you’ll need to save the file. To do that, just press CTRL + X, then Y, and then ENTER and that’ll save the file properly.

You shouldn’t need to reboot. The changes should be immediate and you can run the above commands to verify this. If the changes somehow didn’t take effect, reboot and  you should be good to go.

Closure:

I’ve never really needed to change the open file limit as a desktop Linux user, but you might have a reason to do so. If that’s the case, it makes sense to have this information handy, and now you do.

It’s yet another article in a long, long list of articles – a list that’s growing steadily! I have yet to miss a single publication date, though I feel compelled to do so – as it’d take the pressure off knowing that I no longer have a “perfect” record.

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.

What It Means To Volunteer

Today, I want to talk about what it means to volunteer. I’m going to try to keep this brief and to the point. While I generally avoid vulgarities, there’s going to be some swearing in this article – unless I edit it out later and forget to remove this sentence. It could happen…

I’m also not going to publish this immediately. I don’t want to ruffle feathers and I don’t want there to be any fallout beyond me having said my piece, while also holding my tongue.

Some backstory…

Due to another project’s use of some software, we were forced to make a change to that software. That change adds friction to a subset of new users and a subset of people who need support. You know, at the exact time you don’t want there to be friction.

There was a better solution available, but people complained about the time the solution would take. It was a clearly better solution and yes it’d take some time and a commitment to that time in the future.

When proposing that we discuss this better solution, it was thrown in my face (and I’ll be careful to not be verbatim) that, “We’re all volunteers and I don’t want to spend my time this way.”

Another amusing comment was, “Our time can be better used to make the project better.”

Bitch, please… I put in more volunteer hours than any of them and there’s no better way to make the project better than to ensure people are able to easily access the product’s support! If we don’t have new users, we stagnate. If we can’t help people who are having problems, we lose users.

This is the very basic foundation  you need to make a good product. Without that foundation, you don’t have a product, you have a few people making a personal project for themselves.

What It Means To Be A Volunteer:

I am still angry and disappointed as I write this. Well, I’m mostly disappointed. That disappointment is a bit abstract. I’m disappointed that they’d add friction to a process that should be as easy as possible – and I’m disappointed that they’d hide behind their ‘volunteer’ status.

If you volunteer on a farm, you agree to shovel shit.

If you volunteer on a farm, you don’t just get to pet the animals.

In this case, the solution available is to “simply” package a flavor-specific package. This would take some time – though the person did brag about being fast. It’d then take some time every time a new version of that package was released. (Updates are seldom, as the project is quite mature.)

Another option was for them to use a different application, rather than using the same application and forcing the existing users to make things harder for users. There are many, many usable and mature applications in the category. 

So, yes, it’d require some time and work.

That’s what you volunteered for. That’s what you signed up for. When it gets tough, you don’t hide behind the word ‘volunteer’ like a coward. You step up and do what needs to be done. Using your volunteer status as an excuse for shitty work ethics isn’t acceptable behavior!

Closure:

I could go on, but that’d just be me ranting. At the end of the day, they’re going to do whatever it is they want to do and justify their shitty behavior by telling themselves and others that they’re a volunteer.

Worse, they throw the word volunteer out there like it’s some vaunted position in the community. It’s not… We’re all volunteers and I guarantee that I give more time to the Linux community than they do. They throw the term out there like they know best, when they’re ignoring the very elements that make our project a product. (Don’t get hung up on the word ‘product’, as a distro/flavor is indeed a product that people use to get real world work done.)

They ignored the bit about making it harder for those who should have it the easiest. They basically said ‘let them eat cake’, and we all know how that ended up. Except, it’s unlikely we’ll have a revolution with beheading – and indeed that’d be a bit much. Instead, we’ll bleed users at a slow but predictable rate and people will pretend it isn’t happening or that they don’t know why it’s happening.

It also doesn’t bode well for the many other decisions made by this person. They’re the head of a different project, one that’s fading into obscurity already. The death of a distro isn’t a sudden thing, unless they willfully make it so. It’ll be a slow demise, a shit-show of politics and mudslinging.

When it happens that their project dies, assuming I remember, I’ll return here and fill in some more of the details – because history should be complete. Until then, I’ll watch with morbid curiosity. The scent of shit is in the air.

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 Root Around In The /proc Directory

Today, we’re going to root around in the /proc directory. Why? So we can learn about our Linux system. See, there’s quite a bit of information hidden in there and I’m going to show you how to get it out of there. You’ll have to root around for it, as I’m not going to document every possible combination, but you’ll have the tools to do so.

We will be using the terminal for this, but we’ll only be using a couple of tools. The first tool we’ll use is the ‘ls’ command. We’ve used it before to sort files by time and sort files by size and even to show hidden files and folders. So, as you can guess, it’s a pretty handy command.

The other application we’ll be using is ‘cat’. We’ve used that less often, but we’ve used it before, but here’s a brief overview of the ‘cat’ command. You might want to read that. But, basically, we use the cat command to read files in the terminal. 

The ‘cat’ command is also a pretty handy command. You can try it out yourself. If we assume you’re using bash and have history enabled (the vast majority of Linux users) you can do something like:

That command should spit out the history of commands you’ve typed into the terminal. Perhaps some of ’em will have been things you learned right here on Linux-Tips! Well, maybe… I mean, people tell me they learn stuff here, though I’m never quite sure how! 😉 Anyhow…

So, this will be a fairly informal article. It should also be quick and easy. You’re welcome!

Rooting Around In The /proc Directory:

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.

Like I said, this is a fairly informal article. Quick and easy, right? Well, I’m going to show you everything you need to know in one command. Ready?

You’ll see a whole lot of files. What you want to do is use ‘cat’ on those files. Like, if you want to read/check your CPU information, you’d use:

Do you want to see the information the system has for your memory?

Not all the files have useful data, but some of them do. That’s why you’ve gotta root around in there. You’ve gotta learn which files contain which information – but I’ve given you a head start with two of them. You’re on a path of discovery, ’cause I’m surely not going to go through all of ’em to tell you what they do. I give you the tools, you do the work. Or something like that…

Closure:

See? Nice and easy, and very much an informal article. You can now root around in the /proc directory to get some system information. You may need elevated permissions to read some files, and some of them contain what’s pure gibberish to me. They might make more sense to 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.

Meta Article, Something like #9…

I’ve done a few meta articles over the past year and a half. Not all of them have really been ‘meta’, meaning having to do specifically with the site Linux-Tips.us and what’s specifically going on here. I want to say this is the 9th one? Something like that? Either way, we’re going to call it #9 and keep using that number as our starting base. I’ll make a point out of remembering it, and the next will be #10.

So, I figured I’d write one now… Why? Meh… I want a day off. I have an article I could edit and publish, a nice guest article that looks pretty solid, but I’m saving that for a few more days. I have a plan for that one – meaning I plan on enjoying my day off!

Like I mentioned the other day, it’s sometimes starting to seem like work. I publish every other day and that’s effort. If it’s work, I wanna get paid – and not the pittance Google AdSense provides. It’s never going to happen, so this needs to firmly remain in the hobby category.

So, what to write about?

I learned something new… It turns out that interactive websites have less activity during summer (northern hemisphere) months, though that doesn’t quite cover the decrease in traffic. No, that was something else – and appears to be on the upside.

Allow me to explain…

So Meta It’s Meta Meta!

You all may recall an article that made no sense. It stood out like a sore thumb and was so distantly related to Linux that it might not be Linux-related at all. It was even factually ‘questionable’.

Well, I’d be more than happy to give them their money back – ’cause that’s the only thing that really changed and I can cite it to the exact day.

I didn’t make much in the way of compensation, but thought it’d be a great way to help fund the site when I received an email asking if I’d accept paid guest posts that included a link or two. (They’re used for SEO purposes, as links from sites with good authority make Google like you.)

They paid me a pittance and I agreed to not mention (in the article) that it was a paid article. I also agreed to not disclose much, but they can have their 30 talons of silver back if they want it.

It was pretty much the very next day that traffic from Google slowed down.

Even though it’s automated, Google is not as mentally handicapped as we might think. No, no they are not…

There’s absolutely nothing else that can explain the drop in traffic – ’cause nothing else changed. So, I accepted my bribe money and Google spanked me. They spanked me like they’re dressed up like a nun, except I didn’t pay extra for it.

Fortunately…

My time in the penalty box appears to be over. Traffic from Google is once again climbing up. I’d share exact numbers with you, but this is an ‘easy’ article and I’m not gonna go taking screenshots and getting exact numbers.

Closure:

If you have a website and someone contacts you wanting to pay you for a guest article, run away. They paid me a paltry sum. Sure, they paid more more than I’d have made in ads, but it still wasn’t worth it to see the traffic slow down.

Yeah, that’s right… The ads pay so little that I still made more money from accepting the guest article. 

However, that’s now the site’s goal. Remember, it’s a hobby and not a job. At least that’s the goal. Any money made goes right back into the site. Currently, the ads are paying enough for me to pay for hosting and to pay for the CDN on a very low level. (It shouldn’t need much in the way of payment in the near future, so that’s fine.)

But, yeah… I accept the article and published it. In response, Google trashed the search engine traffic, sending less than half the traffic they had been sending. 

If you’re interested in short-term money, go ahead and take their offer for a guest article. If you’re interested in a long-term relationship with the people who frequent your site, or you’re interested in a higher calling (like educating new Linux users), then run away. If they ask for a guest article, run away and never speak to them again – even if it does pay better than AdSense.

I think I’m barely going to proofread this one. If you found errors, let me know. I’ll fix ’em when time allows.

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.

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