Bash history file mac os x

The feature that "save and restore the bash command history independently for each restored terminal session" sounds like a nice feature some program might benefit from. Is there some way to have the benefits from the previous configuration and also the new one with some kind of configuration? Chris Page Chris Page 5, 1 1 gold badge 30 30 silver badges 34 34 bronze badges. I haven't done any special configuration so I guess it's not the problem.

If the latter, I refer you to the code, which is documented in detail. That was the problem for me.


  1. Preserve bash history across multiple terminals and sessions - Leons on Tech.
  2. Apple Footer;
  3. 3d room planner for mac.
  4. Yogesh Khatri's forensic blog: Bash sessions in macOS (and why you need to understand its working)?
  5. Use reverse-i-search to quickly navigate through your history.

Try commenting it out. Nate Nate 4 4 silver badges 6 6 bronze badges. You could also create a. Hunter Hunter 1 1 bronze badge.

Your Answer

Vesal Vesal 21 1 1 bronze badge. Medical School or Games Industry? Featured on Meta. Custom Filters release announcement. Linked Related 0. Hot Network Questions. Question feed. So tired of that one obscure terminal command falling off the end of my history and having to google it every 3 months.

Thanks so much! Not sure when it stopped working, but in Mac OS Sierra both are needed. How to increase the Mac OSX bash shell history length — step by step 4. What is the bash shell history and why would I want it to be longer? For example, to log into one of my home servers when not at home I might use something like: ssh -At kcw home.

If you have previously been using Terminal it will open in whichever directory you were working on last, so you need to be explicit. Job done! How to delete your bash history Having greatly extended your bash history it is useful to know how to delete it. Logging In Wait a minute. If you've owned my user, what's to stop you from setting the histfile even if I turned it off? Not to speak of how you can just listen to my pty. I mean, it's really clever talking like a mafia enforcer making vague threats but everyone here is treating you respectfully and you're not responding in kind.

It's not cool, man.


  • Receive my posts via email!
  • create windows 7 boot usb on mac disk utility?
  • magic lantern raw to dng converter mac?
  • return to castle wolfenstein full download mac.
  • Listing the history.
  • corel draw 11 mac serial number name?
  • If you don't feel like engaging, don't. You have already pwned the machine, what disabling history is gonna do to save someone's ass after that? The hassle of not having a history file every day is a much bigger cost than having it on an already pwned machine, isn't it? Stop being an ass, that's why most people don't listen to security experts, instead of educating people in a kind way and making the world more secure most of you like to live on your high ivory towers with snark comments, passive-aggressiveness doesn't help anyone or any discourse.

    Using and managing the Terminal history in OS X - CNET

    Please, learn some social skills. Attempted to make a shorter version that says most of the important points: You have already pwned the machine, what disabling history is gonna do to save someone's ass after that? This is why most people don't listen to security experts, instead of educating people in a kind way and making the world more secure most of you like to just point out how bad we are.

    I guess you've never typed a password into the command line by accident? As an attacker, your goal is to get the most amount of privilege and credentials in a brief amount of time without being detected while it's happening. So you grab. As a team member with promises to keep my only goals are getting my job done and meeting my KPI's. I cannot afford to not have bash history or any other history. And I certainly don't have time to do the securistatsi's job for them. If a server is 'compromised' I delete it from the stack, spin up another and provision it all within 60's.

    The goal is not preventing being hacked, its being in a position where it does not matter. The "securistatsi" exist for a reason - not to slow you down, but to protect the company from you. If your server is compromised, you shouldn't be back in business in 60s. Your main database that coordinates 50 servers? One of the 50 gets compromised, you need to change the pw on all That should include 3rd party API keys and other fun stuff too.

    I didn't realize I could do that :. With the history file already there, you don't have to wait for it to populate. I'm legitimately curious about their question so I'll phrase it differently: have you ever found something in the shell history that you wouldn't have discovered on your own? Is it more of a delay tactic or real deterrent? I have done my share of internals. Clues that mean you make a good and impactful finding within the timeframe of your timebox. Reality is an attacker with this level of access is going to have more time than I will, but it still means a measurable impact to security because it decreased the time it took to find something.

    So in that sense the OP is correct, it comes down to a risk reward trade off and is it worth clearing the history to potentially buy yourself more time in the event you are owned. I'm not a developer. I'm actually an ex security engineer, but thanks. Restrictions on what people want to do are always a bad idea. Removing history where people actually use it means that you'll get shadow IT.

    That means snippets of commands in home directories, "manual" history equivalents, and expect scripts with passwords embedded shared between teams. Instead of trying to restrict what people want, you can make it easier - spend time automating tasks, providing simple interface to need information, and make sure you can take hosts out of live system for debugging and then rebuild instead of returning. If there's important stuff in the history file, that means there's a need for history access.

    Working on solving that will give you more benefits than killing history files. I really wish it weren't, and a decent penetration tester will know what to do with the known hosts machine on a machine with IP But, like password restrictions, the important thing is is inconveniences everyone, so it looks like the security team is doing something.

    If your on a production server with the ability to read and act on the data in a users. Sean on Apr 13, Well you don't, the user does. As a blue team guy, either I'd catch you before you got that far or I wouldn't catch you even after pivoting. Either way, it's not worth slowing down business for that chance. Sure, I might fail a pentest, but what I'm concerned with is protecting against actual real-world attacks without disrupting business operations. Protecting against a pentest just looks good on the pentester's checklist, what really matters is "did we get hacked? I am biased here, but that isn't really fair if the person performing the penetration test is any good.

    Write a report and say, "yeah, you got pwned". A good penetration tester will look around a bit with their elevated privileges and maybe find some other things and write those up too. A great penetration tester will own everything, document how they did it initially, use their elevated access to gain an advanced understanding of your environment, document this understanding, and find as many nooks and crannies as they can in their assessment time frame.

    But the parent also has a point. These little things are accelerators on a pen test. No they aren't going to be the thing that gets you owned. To be fair I have seen plenty of pen testers that wield findings like this as a hammer making it seem very important while missing the forest for the tree in front of them so to speak. Also, the best question probably isn't "did we get hacked? Yeah, you stated my intent better than I did. Most pentesters I've worked with would show a bash history and say "look, you failed, fix these" and my client would get mad at me for not securing this even though this isn't what would get you hacked.

    It's like a home security company recommending you keep your cell phone in a locked safe at night instead of on your nightstand.


    1. mac viva glam iv lipstick.
    2. halo texture pack 1.6.2 mac.
    3. picsart for mac free download.
    4. Use reverse-i-search to quickly navigate through your history;
    5. review pavtube blu-ray ripper for mac.
    6. kerbal space program mac problems?
    7. Terminal Bash History Not Been Saved.

    Sure it's safer, but it's really inconvenient and a good home security system would notice the robber kick down your door before your phone even gets stolen. The idea of any security system should be to compliment normal business operations, not to hinder them. Bash can as well, though I'm not certain if the OS X version is new enough. TheGRS on Apr 13, If you're an oh-my-zsh user there is a handy part of the. Dead simple. I'm a programmer and an historian.

    So the title of this entry gave me a wrong first impression: there are more people like me! I'm not alone! Imagine the disappointment How to spot a historian: "actually it's 'an' historian, from the old English Thanks for the link! There are more people like you, I bet! There are dozens of us. I am one of the dozens.

    Preserve bash history across multiple terminals and sessions

    If only I was able to locate a history-related technology job. It seems like you need to be in Washington DC to find anything like that. In the Netherlands, where I live, there is the International Institute of Social History, which does a lot of data processing, and has programmers as employees. As a student I screw up an interview very badly , by not showing up. I still regret it after 20 years.

    How stupid can a youngster be.

    How to increase the Mac OSX bash shell history length – step by step

    On the other hand I don't have any complaints about my work and pay and benefits at the jobs I have had since then, which probably would have been very different had I gone the historyprogrammer route. I'm quite happy that at least three historian-programmers have come together, here. Add fourth! But I quit the academic path due to economic reasons, i. My wife is a historian, I'm a programmer. That does not make me the fifth but at least a sympathizer ;.

    We should start a club! BhavdeepSethi on Apr 13, Searching for anything is a simple grep command. I do the same thing, and have a couple of commands set up to run grep over the last day, week, month, or ever in my history. I don't use my full history every day, but it's something worth keeping around.

    I'm still new to bash scripting - how do you use this? It basically takes your command, and appends creates if it does not exist it to a file based on the current date. I have this exact line too. Author unknown. What an interesting contrast in attitudes toward privacy: He makes an extraordinary effort to maintain his bash history whereas I jump through hoops to delete my history on logout using a.

    I also set my browser to maintain no history, disable saving of chats in everything, delete caches wherever possible, and generally wish that apps and programs had an option to save zero information on exit! If I want "history" beyond a session, I'll explicitly make a shell alias for a command that I want to remember, or make bookmark for a site I want to revisit, etc. Your bash history is stored on your computer, so there isn't really a difference toward privacy unless you permit anyone sit on your computer.

    Furthermore, for many people, using the command line is part of their daily job. If there are certain things you don't want in your bash history, use the ignorespace capability and explicitly do not store them. That way the. If you write it to disk, it could available on the disk via an undelete tool or via a backup - which is a concern if you ever accidentally paste a password onto the command line. Yea, I don't know why you would do that, why would you cripple your own tools like that and pay a heavy price each day in productivity and convenience to protect against the really insignificant risk of losing Now paranoia is a scale, and we are, I'm sure, gaussianly distributed on it.

    I approve of this, as it provides a nice safeguard against extinction events against the hump in the middle. But man, I glad AF I'm not on your side of the curve. That would suck. Thanks for standing in the gap. I just don't see the appeal of persistent history. And I've seen too many intrusion pastes where passwords and databases are pulled out of the bash history file. Myrmornis on Apr 13, I see the appeal of this approach.