lemmus.org
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 21 hours ago

Linux Users

lemmy.ml

message-square
119
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
1.05K

Linux Users

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 21 hours ago
message-square
119
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
alert-triangle
You must log in or register to comment.
  • remon@ani.social
    cake
    link
    fedilink
    arrow-up
    2
    ·
    2 hours ago

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

  • MashedTech@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    3 hours ago

    I just use mcfly

  • Auli@lemmy.ca
    link
    fedilink
    English
    arrow-up
    16
    ·
    8 hours ago

    Ctrl R

  • Hammerheart@programming.dev
    link
    fedilink
    arrow-up
    8
    arrow-down
    1
    ·
    10 hours ago

    cat ~/.bash_history | grep

    • echindod@programming.dev
      link
      fedilink
      arrow-up
      10
      ·
      8 hours ago

      Useless use of cat?

      • disobey2623@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        2
        ·
        3 hours ago

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

        • x00z@lemmy.world
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 hours ago

          history | grep 'cat'

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

            How did I not know this. Thank you!

  • aeharding@vger.social
    link
    fedilink
    arrow-up
    22
    ·
    14 hours ago

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

    • Derpgon@programming.dev
      link
      fedilink
      arrow-up
      21
      ·
      13 hours ago

      CTRL+R for those unitiated

    • Everyday0764@lemmy.zip
      link
      fedilink
      arrow-up
      7
      ·
      13 hours ago

      reverse-i-search + fzf = <3

  • lmmarsano@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    50
    arrow-down
    1
    ·
    17 hours 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
      13
      ·
      15 hours 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.

      • Auli@lemmy.ca
        link
        fedilink
        English
        arrow-up
        1
        ·
        8 hours ago

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

      • silasmariner@programming.dev
        link
        fedilink
        arrow-up
        7
        ·
        14 hours ago

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

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

  • Cevilia (she/they/…)@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    9 hours ago

    I feel like there should be a cursed “long way round” for this that involves needlessly copying .bash_history to a “text file”, running it through an asciibetical sorter (for “efficiency”), using sed to null out any command which doesn’t match the search term…

  • iamdefinitelyoverthirteen@lemmy.world
    link
    fedilink
    arrow-up
    34
    ·
    17 hours ago

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

    • layzerjeyt@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      3
      ·
      9 hours 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
        1
        ·
        2 hours 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.

    • AmidFuror@fedia.io
      link
      fedilink
      arrow-up
      8
      ·
      15 hours ago

      Been there, done that.

  • TabbsTheBat@pawb.social
    link
    fedilink
    arrow-up
    80
    ·
    21 hours ago

    I’ve been using ctrl + R more now :3… though I definitely used to ↑↑↑↑↑↑↑

    • I_Am_Jacks_____@sh.itjust.works
      link
      fedilink
      arrow-up
      34
      ·
      21 hours ago

      check out fzf (install fzf and add (assuming bash) eval "$(fzf --bash)" to your .bashrc) Makes ctrl+r a superpower

      • aquovie@lemmy.cafe
        link
        fedilink
        English
        arrow-up
        5
        ·
        17 hours ago

        It’s awesome until you want to put the cursor in a specific spot of a previous command.

        $ rm -f delete-me.txt
        ctrl-r "me", ctrl-b, ctrl-k
        $ rm -f delete
        

        But I still use fzf because while I used to do the above, fzf offered more advantage that made switching worth it.

      • TabbsTheBat@pawb.social
        link
        fedilink
        arrow-up
        3
        ·
        21 hours ago

        I’ll try it if I don’t forget it by the next time I have access to my PC lol :3

    • tyler@programming.dev
      link
      fedilink
      arrow-up
      21
      ·
      21 hours ago

      Ctrl + r with fzf and you’ll never go back.

  • mvirts@lemmy.world
    link
    fedilink
    arrow-up
    27
    ·
    19 hours ago

    ^r

    • veni_vedi_veni@lemmy.world
      link
      fedilink
      arrow-up
      11
      ·
      18 hours ago

      and whenever you forget to sudo: sudo !!

      • Gumus@lemmy.world
        link
        fedilink
        arrow-up
        6
        ·
        15 hours ago

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

    • bandwidthcrisis@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      15 hours 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
        6
        ·
        13 hours ago

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

        • bandwidthcrisis@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          13 hours ago

          It’s basically emacs incremental search.

  • Avicenna@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    14 hours ago

    history | grep then !cmd no

  • Mad_Punda@feddit.org
    link
    fedilink
    arrow-up
    15
    ·
    17 hours ago

    I’ve probably done that for ls

  • merc@sh.itjust.works
    link
    fedilink
    arrow-up
    6
    arrow-down
    1
    ·
    14 hours ago

    Too many people still use Bash.

    • humorlessrepost@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      13 hours ago

      I like zsh on mac because pretty colors

    • Leonardo_da_Vinci@lemmy.world
      link
      fedilink
      arrow-up
      1
      arrow-down
      1
      ·
      12 hours ago

      Too many distributions still ship with Bash.

      • rtxn@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        8 hours ago

        In the real world, the only thing better than perfect is standardized.

      • merc@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        edit-2
        12 hours ago

        Yeah, true. But, it’s easy to change.

        Bash is the Internet Explorer of shells. It’s great for installing a more useful shell.

        • layzerjeyt@lemmy.dbzer0.com
          link
          fedilink
          arrow-up
          8
          ·
          9 hours ago

          That’s super unkind and incorrect. IE was a trash software that was widely available because MS was trying to extend their monopoly into new areas.

          Even if it’s not your taste, bash is a mature, stable FLOSS package with wide community support. The reason it is so common is due to it’s positive attributes, not because there is a plot to make it the only choice available to you.

          • calcopiritus@lemmy.world
            link
            fedilink
            arrow-up
            2
            arrow-down
            1
            ·
            7 hours ago

            Bash might be better than IE. But I think we can agree that it is no longer a good shell.

            Its syntax is awful, and lacks many features that other shells have.

            It is only so widely used because it is a de facto standard. If bash was created today, barely no one would us it.

        • pivot_root@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          11 hours ago

          That’s not true. Internet Explorer was fucking useless for scripting together things, unlike bash.

          • layzerjeyt@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            4
            ·
            9 hours ago

            Internet Explorer shell expansion always trips me up.

        • Croquette@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          12 hours ago

          What shell do you recommend?

          • merc@sh.itjust.works
            link
            fedilink
            arrow-up
            3
            ·
            11 hours ago

            I like zsh, but some people say great things about fish.

            • Auli@lemmy.ca
              link
              fedilink
              English
              arrow-up
              2
              ·
              8 hours ago

              My problem with those is bash is always there and just works.

              • merc@sh.itjust.works
                link
                fedilink
                arrow-up
                2
                arrow-down
                1
                ·
                8 hours ago

                Yes, just like Internet Explorer.

                It’s good to know how to do things in bash, since you’re going to encounter it pretty often. But, that doesn’t mean you shouldn’t customize your shell on the machine(s) you use most often. Why stick with the default when there are better options? You’re just hobbling yourself.

  • B_DL@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    41
    ·
    21 hours ago

    I knew there was an

    ls
    

    In there somewhere

    • emb@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      13 hours ago

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

    • teletext@reddthat.com
      link
      fedilink
      arrow-up
      8
      ·
      edit-2
      19 hours ago

      ctrl + r, l, s

      Much faster than simply typing ls!

    • inktvip@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      2
      ·
      18 hours ago

      ls … enter ↑ enter ↑ enter

  • T156@lemmy.world
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    12 hours ago

    Being able to just enter a partial command, and hit [up] to jump to prior commands that started in the same way in zsh is a godsend.

    • bss03@infosec.pub
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 hours ago

      I use vim keybindings and have ESC,/ to do a reverse command search.

    • Entitle9294@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      12 hours ago

      If you ever have to go back to bash, it supports it as well. In my bashrc:

      bind '"\C-p":history-search-backward'
      

      That’s ctrl-p, but I’m sure the up arrow is possible too.

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.

  • 2.19K users / day
  • 4.93K users / week
  • 8.37K users / month
  • 19.8K users / 6 months
  • 23 local subscribers
  • 26.5K subscribers
  • 1.75K Posts
  • 62.8K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.11
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org