Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
sabreW4K3 ( sabreW4K3@lemmy.tf )  to Programmer Humor@programming.devEnglish · 3 years ago

WDYM your terminal isn't a test suite?

lemmy.tf

message-square
13
link
fedilink
83

WDYM your terminal isn't a test suite?

lemmy.tf

sabreW4K3 ( sabreW4K3@lemmy.tf )  to Programmer Humor@programming.devEnglish · 3 years ago
message-square
13
link
fedilink
alert-triangle
You must log in or register to comment.
  • andrew ( andrew@lemmy.stuart.fun ) 
    link
    fedilink
    English
    arrow-up
    11
    ·
    edit-2
    3 years 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.

    • caseyweederman ( caseyweederman@lemmy.ca ) 
      link
      fedilink
      arrow-up
      2
      ·
      3 years ago

      I’m annoyed when my thirteen bash instances don’t share history, but I’d probably be a lot more annoyed if they did.

      • andrew ( andrew@lemmy.stuart.fun ) 
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 years ago

        That’s one thing I like about zsh, or my config at least, because I use i3 and therefore tend to open lots of shells. History is mostly local until I hit return twice (two empty prompts) at which point I can get history from other sessions. It’s stuck more global at that point though aside from future history.

        • caseyweederman ( caseyweederman@lemmy.ca ) 
          link
          fedilink
          arrow-up
          1
          ·
          3 years ago

          Ooh. I like that. I’m gonna try that, thanks.

    • sabreW4K3 ( sabreW4K3@lemmy.tf ) OP
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 years ago

      Haha, my bad!

      • andrew ( andrew@lemmy.stuart.fun ) 
        link
        fedilink
        English
        arrow-up
        2
        ·
        3 years ago

        Fortunately I have my hourly backups! 😅

  • allywilson ( allywilson@sopuli.xyz ) 
    link
    fedilink
    arrow-up
    11
    ·
    3 years ago

    I just start every command with a space, don’t see the issue.

  • zemja ( zemja@programming.dev ) 
    link
    fedilink
    English
    arrow-up
    9
    ·
    3 years ago

    Can somebody please tell me what history -c is?

    • survivalmachine ( survivalmachine@beehaw.org ) 
      link
      fedilink
      arrow-up
      9
      ·
      3 years ago

      history displays a list of all commands you have run on the terminal since the history list was last cleared. It is invaluable for referring back to a big complex command or set of commands you ran at some point in the past. The -c flag clears that history.

      • zemja ( zemja@programming.dev ) 
        link
        fedilink
        English
        arrow-up
        11
        ·
        3 years ago

        Fuck, I just cleared my history.

      • caseyweederman ( caseyweederman@lemmy.ca ) 
        link
        fedilink
        arrow-up
        5
        ·
        3 years ago

        What does it do again?

        • survivalmachine ( survivalmachine@beehaw.org ) 
          link
          fedilink
          arrow-up
          3
          ·
          3 years ago

          🤣

      • ☂️- ( umbrella@lemmy.ml ) 
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        1 year ago

        deleted by creator

        • survivalmachine ( survivalmachine@beehaw.org ) 
          link
          fedilink
          arrow-up
          1
          ·
          3 years ago

          Yes, my comment only applies to the shell history in memory. -c clears history immediately, but you can still reload it from disk if you haven’t overwritten that with -w. If you tend to close your terminal windows frequently and rely on the history feature between sessions, it would benefit you to learn about the intricacies of the on-disk copy of history and how its affected by writes, appends, clears, crashes, etc. I tend to leave my terminal windows open a long time and copy any complex commands out to my PKM if I need to save them for future sessions, so I generally try not to rely on .bash_history, but it has saved my bacon on more than one occasion.

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn’t find it funny, you’re banned. Ha-ha!.. For real: do not use the community for “statements”. There are other places for such content. Keep it chill and funny.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 873 users / day
  • 2.76K users / week
  • 5.18K users / month
  • 8.36K users / 6 months
  • 465 local subscribers
  • 34.1K subscribers
  • 1.66K Posts
  • 27.4K Comments
  • Modlog
  • mods:
  • Feyter ( Feyter@programming.dev ) 
  • adr1an ( anzo@programming.dev ) 
  • BurningTurtle ( BurningTurtle@programming.dev ) 
  • Pierre-Yves Lapersonne ( pylapp@programming.dev ) 
  • BE: 0.19.21
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code