• andrew@lemmy.stuart.fun
    link
    fedilink
    English
    arrow-up
    16
    ·
    edit-2
    10 months ago

    I legitimately back up my history file. Mostly because it likes to truncate itself randomly (though this may have been fixed in zsh, or my config, because it’s been a while). Just a systemd timer that triggers a shell script to copy it by date and rotate anything older than 100 copies.

    Edit: WHY DID I SAY ANYTHING? After like 3 months of no problems, my history truncated itself to 3 entries a few minutes ago. I’ve only ever seen a few days of loss before that lol.

    • mumblerfish@lemmy.world
      link
      fedilink
      arrow-up
      13
      ·
      edit-2
      10 months ago

      Was working on a server where I did not want to put some dumb command into the history, so I add a space like you do. Press up. The command is there. The fucking insult I felt.

      • PoolloverNathan@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        edit-2
        10 months ago

        It’s disabled by default, but you can enable it in .bashrc and then delete that edit session using a spaced command.

        Edit: brain fart

      • superbirra@lemmy.world
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        10 months ago

        it also depends on the shell, in zsh it persists on local history but does not get written to history file

  • textik
    link
    fedilink
    arrow-up
    6
    ·
    10 months ago

    Don’t fucking do this in zsh, it does NOT do the same thing that it does in bash.