Johannes!
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 16 days ago

Linux Users

lemmy.ml

message-square
138
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
1

Linux Users

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 16 days ago
message-square
138
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
alert-triangle
You must log in or # to comment.
  • pcouy@lemmy.pierre-couy.fr
    link
    fedilink
    arrow-up
    0
    ·
    16 days ago

    https://github.com/atuinsh/atuin is a great tool to manage and search your shell history. I especially enjoy it being able to search commands based on the working directory I was in when I ran them.

    It also has more features (which I don’t use) to manage dotfiles and sync shell history across hosts/devices.

    • nameisnotimportant@sh.itjust.works
      link
      fedilink
      arrow-up
      0
      ·
      16 days ago

      I was going to talk about it too ! Even though I’m on fish (which helps a lot with history search) atuin really changed my habits and made my life easier !

  • lmmarsano@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    16 days ago

    meme: bitches dont know bout ctrl-r
    or documentation.

    • Bash command line editing covers searching.
    • Readline library command line editing covers searching.
    • AmidFuror@fedia.io
      link
      fedilink
      arrow-up
      0
      ·
      16 days ago

      To use ctrl-r I have to remember something about the command. To use up arrow I just have to know about how many commands ago I used it.

      • silasmariner@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        16 days ago

        Not if you have fzf you don’t: https://github.com/junegunn/fzf

        Like an interactive fuzzy finding history. It’s sick.

      • Auli@lemmy.ca
        link
        fedilink
        English
        arrow-up
        0
        ·
        16 days ago

        So how well you know which command it is of you won’t recognize it when you see it…

  • NullPointer@programming.dev
    link
    fedilink
    English
    arrow-up
    0
    ·
    16 days ago

    zsh tab completion also looks through history wich is pretty nice.

  • titanicx@lemmy.zip
    link
    fedilink
    arrow-up
    0
    ·
    16 days ago

    I’m in this picture, and I didn’t like it…

  • freewheel@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    16 days ago

    Substring completion on ZSH. Type in a small part of the command you want to find and then press up.

    • entwine@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      16 days ago

      bash supports this feature too btw

      • freewheel@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        ·
        16 days ago

        Added to my mental toolbox, thanks!

  • ɔiƚoxɘup@infosec.pub
    link
    fedilink
    arrow-up
    0
    ·
    16 days ago

    Featherpad, copy, paste. Extra work, but you get a work log

  • iamdefinitelyoverthirteen@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    16 days ago

    …until you press up one too many times and enter the same command but with a typo. Again.

    • AmidFuror@fedia.io
      link
      fedilink
      arrow-up
      0
      ·
      16 days ago

      Been there, done that.

    • layzerjeyt@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      0
      ·
      16 days ago

      There is an option you can set in .zshrc or .bashrc which only includes lines that exit 0 (success)

      • antimidas@sopuli.xyz
        link
        fedilink
        arrow-up
        0
        ·
        16 days ago

        Infuriatingly that would omit things like unit test runners from the history in case they don’t pass. As a developer I tend to re-run failed commands quite often, not sure how widely that applies, though.

        • ulterno@programming.dev
          link
          fedilink
          English
          arrow-up
          0
          ·
          15 days ago

          Oh, stuff like git diff and git log will end up being omitted pretty often.
          And a lot of times, the commands that end with piping into less

  • ѕєχυαℓ ρσℓутσρє@lemmy.sdf.org
    link
    fedilink
    arrow-up
    0
    ·
    16 days ago

    In fish, you can enter part of the command, and then press up to search for it. It’s kinda awesome.

    • rozodru@piefed.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      16 days ago

      yeah I ONLY just recently switched to fish after using zsh and oh my zsh for so long - pretty much since first starting linux cause I once saw someone using it on unixporn and I thought “that’s cool”

      when I switched to NixOS zsh with all the plugins was a total slog. switched to fish and it just HAS everything that zsh/oh my zsh and the various plugins had but baked in.

      so yeah in Fish it’s just starting to type something and hoping it’s still in the history.

    • RedSnt 👓♂️🖥️@feddit.dk
      link
      fedilink
      arrow-up
      0
      ·
      15 days ago

      That’s what I do in bash except for pressing up it’s ctrl+r. FZF does the fuzzy finding for me. It’s so convenient.

  • Endymion_Mallorn@kbin.melroy.org
    link
    fedilink
    arrow-up
    0
    ·
    16 days ago

    I wish this wasn’t so painfully true.

  • salacious_coaster@infosec.pub
    link
    fedilink
    English
    arrow-up
    0
    ·
    16 days ago

    Relevant xkcd: https://xkcd.com/1168/

    • Hammerheart@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      16 days ago

      tar --help

    • drkt@scribe.disroot.org
      link
      fedilink
      arrow-up
      0
      ·
      16 days ago

      tar -xvf <archive-name>

      but only because I had to look it up twice so now my brain has committed it to memory
      I don’t even know what it does

      • nutcase2690@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        0
        ·
        16 days ago

        i just use unar (unarchive) nowadays, since that works with all file formats iirc

      • bitchkat@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        16 days ago

        Extract a tarball with verbose output from the specified file.

        And learn how to use the ‘z’ option

    • ominous ocelot@leminal.space
      link
      fedilink
      arrow-up
      0
      ·
      16 days ago

      tar - h

      • IsoKiero@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        0
        ·
        edit-2
        16 days ago

        Unfortunately that’s not valid.

        $ tar -h
        tar: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options
        Try 'tar --help' or 'tar --usage' for more information.
        

        From man-page:

        -h, --dereference follow symlinks; archive and dump the files they point to

        • ominous ocelot@leminal.space
          link
          fedilink
          arrow-up
          0
          ·
          16 days ago

          Damn.

          • titanicx@lemmy.zip
            link
            fedilink
            arrow-up
            0
            ·
            16 days ago

            Thanks, we all died.

            • ominous ocelot@leminal.space
              link
              fedilink
              arrow-up
              0
              ·
              16 days ago

              :)

  • wewbull@feddit.uk
    link
    fedilink
    English
    arrow-up
    0
    ·
    16 days ago

    The one people see me doing that gets a “huh?” Is:

    ~$ !find
    find -type f -name '*blah*' -print0 | xargs -0 gzip
    ~$
    

    “Wait! What did you do?” “Oh. Do you not know about bang?”

    • UpperBroccoli@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      0
      ·
      16 days ago

      I love the excitement of using !?

      Did I remember correctly what command sequence I last used that pattern with? Will my data be gone? Will I send a vulgar email to my boss? Who knows, let’s find out!

    • merc@sh.itjust.works
      link
      fedilink
      arrow-up
      0
      ·
      16 days ago

      I don’t understand people who have the confidence to just blindly run the last matching command like that. Like, are you 100% sure that the last time you ran find was that one, not the one that piped to xargs rm?

      At least with zsh you can tab to complete the !find and verify it’s what you want before running it. And, AFAIK by default, the shell option hist_verify is set, so if you do just type !find and hit enter, it doesn’t run the command, it loads the command into the editing buffer so you can look it over first. Maybe I just have a weak memory, but I really appreciate the footgun prevention. At worst I have to hit enter twice. At best, I save myself a lot of grief.

  • RustyNova@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    16 days ago

    Oh come on! I at least type the beginning so that it filters the history

  • Mad_Punda@feddit.org
    link
    fedilink
    arrow-up
    0
    ·
    16 days ago

    I’ve probably done that for ls

  • mvirts@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    16 days ago

    ^r

    • veni_vedi_veni@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      16 days ago

      and whenever you forget to sudo: sudo !!

      • Gumus@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        16 days ago

        You need this: https://github.com/nvbn/thefuck

    • bandwidthcrisis@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      16 days ago

      Ctrl-r, l ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r, ctrl-r. To get ls.

      • 2910000@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        16 days ago

        No way! I didn’t know you could cycle through the results like that… awesome!

        • bandwidthcrisis@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          16 days ago

          It’s basically emacs incremental search.

  • killeronthecorner@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    16 days ago

    O(n) access, very efficient.

    No, I do not care to share the value of n

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
Visibility: Public
globe

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

  • 249 users / day
  • 666 users / week
  • 1.77K users / month
  • 4.71K users / 6 months
  • 0 local subscribers
  • 26.8K subscribers
  • 1.36K Posts
  • 32K Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.12
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org