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

Linux Users

lemmy.ml

message-square
139
link
fedilink
1.22K

Linux Users

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 6 days ago
message-square
139
link
fedilink
alert-triangle
You must log in or register to comment.
  • Auli@lemmy.ca
    link
    fedilink
    English
    arrow-up
    35
    ·
    5 days ago

    Ctrl R

    • sol6_vi@lemmy.makearmy.io
      link
      fedilink
      arrow-up
      1
      ·
      4 days ago

      holy fucking shit 🤌💪🤯❤️💯

  • lmmarsano@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    56
    arrow-down
    1
    ·
    6 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
      16
      ·
      6 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
        8
        ·
        6 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
        2
        ·
        5 days ago

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

  • iamdefinitelyoverthirteen@lemmy.world
    link
    fedilink
    arrow-up
    43
    ·
    6 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
      9
      ·
      6 days ago

      Been there, done that.

    • layzerjeyt@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      5
      ·
      5 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
        4
        ·
        5 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
          1
          ·
          5 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

  • B_DL@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    49
    ·
    6 days ago

    I knew there was an

    ls
    

    In there somewhere

    • teletext@reddthat.com
      link
      fedilink
      arrow-up
      10
      ·
      edit-2
      6 days ago

      ctrl + r, l, s

      Much faster than simply typing ls!

    • emb@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      5 days ago

      Now I don’t have to type that in again. Phew!

    • inktvip@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      3
      ·
      6 days ago

      ls … enter ↑ enter ↑ enter

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

        You may consider using watch ls

        • inktvip@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          1
          ·
          5 days ago

          I can’t even keep apart ls and cd it seems.

  • aeharding@vger.social
    link
    fedilink
    arrow-up
    31
    ·
    6 days ago

    The number of people who don’t reverse-I-search is too damn high

    • Derpgon@programming.dev
      link
      fedilink
      arrow-up
      25
      ·
      5 days ago

      CTRL+R for those unitiated

    • Everyday0764@lemmy.zip
      link
      fedilink
      arrow-up
      9
      ·
      5 days ago

      reverse-i-search + fzf = <3

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

      It was quite a while before I realised that was possible.
      Then not long after starting to use it, that I got fed up and just started opening up the history file and searching in it.

      • dropcase@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        5 days ago

        why not history | grep -i and the search term?

        even if there are several, you can use ! and the command’s line number to run it again

        • ulterno@programming.dev
          link
          fedilink
          English
          arrow-up
          1
          ·
          5 days ago

          history is shell dependent.

  • dreadbeef@lemmy.dbzer0.com
    link
    fedilink
    English
    arrow-up
    4
    ·
    4 days ago

    Fish once again undefeated. If I want to find that weird image magick command I used earlier with foo.png in it I just type foo.png, hit up and its usually the first one. It doesnt matter where foo.png occurs in the command, fish will find it.

  • mvirts@lemmy.world
    link
    fedilink
    arrow-up
    27
    ·
    6 days ago

    ^r

    • veni_vedi_veni@lemmy.world
      link
      fedilink
      arrow-up
      13
      ·
      6 days ago

      and whenever you forget to sudo: sudo !!

      • Gumus@lemmy.world
        link
        fedilink
        arrow-up
        8
        ·
        6 days ago

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

    • bandwidthcrisis@lemmy.world
      link
      fedilink
      arrow-up
      9
      ·
      6 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
        7
        ·
        5 days ago

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

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

          It’s basically emacs incremental search.

  • Edgarallenpwn@midwest.social
    link
    fedilink
    English
    arrow-up
    7
    ·
    5 days ago

    I typed it once, I’m not typing it again

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

    I write part of the command then ctrl+r. Using FZF mind you. Such a great utility.

  • Yggstyle@lemmy.world
    link
    fedilink
    arrow-up
    14
    ·
    6 days ago

    taptaptaptap… taptaptaptap… taptaptaptap taptaptaptap taptaptaptap

    … taptaptaptap

    … tap …

    … shit I was on a different user when I typed it.

    • iamdefinitelyoverthirteen@lemmy.world
      link
      fedilink
      arrow-up
      7
      ·
      6 days ago

      Or “shit, I did in tmux last time so I could close the terminal window.”

  • salacious_coaster@infosec.pub
    link
    fedilink
    English
    arrow-up
    13
    ·
    6 days ago

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

    • psud@aussie.zone
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      3 days ago

      tar -jcvf archive.tbz ~/stuff/*

      Of course I don’t know the bomb had bzip2 on it… I wonder if we can start with ls to see if there’s anything to tar or untar

    • drkt@scribe.disroot.org
      link
      fedilink
      arrow-up
      9
      ·
      6 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
        4
        ·
        6 days ago

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

      • bitchkat@lemmy.world
        link
        fedilink
        English
        arrow-up
        3
        arrow-down
        1
        ·
        6 days ago

        Extract a tarball with verbose output from the specified file.

        And learn how to use the ‘z’ option

      • jbrains@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        5 days ago

        You don’t even need the hyphen!

        Mind = blown.

    • Hammerheart@programming.dev
      link
      fedilink
      arrow-up
      7
      ·
      5 days ago

      tar --help

    • ominous ocelot@leminal.space
      link
      fedilink
      arrow-up
      4
      ·
      6 days ago

      tar - h

      • IsoKiero@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        13
        ·
        edit-2
        6 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
          12
          ·
          6 days ago

          Damn.

          • titanicx@lemmy.zip
            link
            fedilink
            arrow-up
            8
            ·
            6 days ago

            Thanks, we all died.

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

              :)

  • killeronthecorner@lemmy.world
    link
    fedilink
    English
    arrow-up
    13
    ·
    6 days ago

    O(n) access, very efficient.

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

  • ezekielmudd@reddthat.com
    link
    fedilink
    arrow-up
    11
    ·
    6 days ago

    Or, just type the command “history”, find the index number of the desired command, then type “! <index number>”, then <enter>.

    • Frezik@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      11
      arrow-down
      1
      ·
      6 days ago

      That’s way more mental effort than pressing up a bunch of times.

    • Eager Eagle@lemmy.world
      link
      fedilink
      English
      arrow-up
      8
      ·
      edit-2
      5 days ago

      or Ctrl+R then search? I don’t know why some people still bother with history tbh.

      • merc@sh.itjust.works
        link
        fedilink
        arrow-up
        3
        ·
        6 days ago

        Because you can pipe history to grep.

        • snowe@programming.dev
          link
          fedilink
          arrow-up
          3
          ·
          5 days ago

          with fzf you get better grep with fuzzy search

      • Sabata@ani.social
        link
        fedilink
        arrow-up
        2
        ·
        6 days ago

        This is going to save me so much time pressing the up arrow.

    • Not a newt@piefed.ca
      link
      fedilink
      English
      arrow-up
      2
      ·
      6 days ago

      Ctrl-R if you know part of the command.

    • irish_link@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      6 days ago

      Holy cow!! I didn’t know that. I have been using history > history.txt to find “that one command for that one thing” I only need once every other month or so. Thanks, now I can just do that.

  • Hammerheart@programming.dev
    link
    fedilink
    arrow-up
    9
    arrow-down
    2
    ·
    5 days ago

    cat ~/.bash_history | grep

    • echindod@programming.dev
      link
      fedilink
      arrow-up
      15
      ·
      5 days ago

      Useless use of cat?

      • Hammerheart@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        4 days ago

        Yes, it was meant to be a self deprecating admission that I have used this unnecessarily verbose command.

        • echindod@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          4 days ago

          Ah. Well. I can not be blameless on this. I also probably use cat unnecessarily still. But less so with grep these days. I’m getting better… I swear!

      • disobey2623@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        2
        ·
        5 days ago

        You saying I can just skip cat in that command and it works?

        • x00z@lemmy.world
          link
          fedilink
          English
          arrow-up
          9
          ·
          5 days ago

          history | grep 'cat'

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

            My output was empty for that command.

            Guess why?
            Because history only gives the last few lines in my system.

        • neox_@sh.itjust.works
          link
          fedilink
          Français
          arrow-up
          5
          ·
          5 days ago
          grep ~/.bash_history
          
          • disobey2623@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            4
            ·
            5 days ago

            How did I not know this. Thank you!

            • oozynozh@sh.itjust.works
              link
              fedilink
              arrow-up
              2
              ·
              5 days ago

              it’s grep STRING FILE to be precise

              or awk '/STRING/′ FILE if you prefer that for some reason

  • remon@ani.social
    link
    fedilink
    arrow-up
    7
    arrow-down
    2
    ·
    5 days ago

    You have to be a linux user to use the console now?

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: [email protected]

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.

  • 1.1K users / day
  • 5.63K users / week
  • 8.47K users / month
  • 19.5K users / 6 months
  • 20 local subscribers
  • 26.6K subscribers
  • 1.78K Posts
  • 65.5K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org