tomateaux mutters.
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 1 day ago

Linux Users

lemmy.ml

message-square
131
link
fedilink
1.1K

Linux Users

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 1 day ago
message-square
131
link
fedilink
alert-triangle
You must log in or register to comment.
  • janAkali@lemmy.sdf.org
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    2 hours ago
    • zsh-autosuggestions
    • history | fzf
    • alias cat="bat --plain --theme=gruvbox-dark"
  • remon@ani.social
    cake
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    5 hours ago

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

  • Auli@lemmy.ca
    link
    fedilink
    English
    arrow-up
    19
    ·
    11 hours ago

    Ctrl R

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

    I just use mcfly

    • xoggy@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      14 minutes ago

      Not sure I understand the point of mcfly. zsh and fish have this functionality built in, where pressing Up with a command partially typed will give auto-completions to that partial match.

  • aeharding@vger.social
    link
    fedilink
    arrow-up
    26
    ·
    18 hours ago

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

    • ulterno@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      ·
      22 minutes 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.

    • Derpgon@programming.dev
      link
      fedilink
      arrow-up
      23
      ·
      16 hours ago

      CTRL+R for those unitiated

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

      reverse-i-search + fzf = <3

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

    cat ~/.bash_history | grep

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

      Useless use of cat?

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

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

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

          history | grep 'cat'

          • ulterno@programming.dev
            link
            fedilink
            English
            arrow-up
            0
            ·
            20 minutes 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
          4
          ·
          6 hours ago
          grep ~/.bash_history
          
          • disobey2623@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            3
            ·
            6 hours ago

            How did I not know this. Thank you!

            • oozynozh@sh.itjust.works
              link
              fedilink
              arrow-up
              2
              ·
              1 hour ago

              it’s grep STRING FILE to be precise

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

  • lmmarsano@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    51
    arrow-down
    1
    ·
    21 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
      15
      ·
      18 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
        2
        ·
        11 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
        ·
        17 hours ago

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

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

  • iamdefinitelyoverthirteen@lemmy.world
    link
    fedilink
    arrow-up
    40
    ·
    21 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
      5
      ·
      12 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
        4
        ·
        5 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.

        • ulterno@programming.dev
          link
          fedilink
          English
          arrow-up
          0
          ·
          14 minutes 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

    • AmidFuror@fedia.io
      link
      fedilink
      arrow-up
      9
      ·
      18 hours ago

      Been there, done that.

  • TabbsTheBat@pawb.social
    link
    fedilink
    arrow-up
    83
    ·
    1 day 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
      37
      ·
      1 day 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
        ·
        20 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
        ·
        1 day 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
      22
      ·
      1 day ago

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

  • Cevilia (she/they/…)@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    12 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…

  • mvirts@lemmy.world
    link
    fedilink
    arrow-up
    29
    ·
    22 hours ago

    ^r

    • bandwidthcrisis@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      19 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
        ·
        17 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
          ·
          17 hours ago

          It’s basically emacs incremental search.

    • veni_vedi_veni@lemmy.world
      link
      fedilink
      arrow-up
      12
      ·
      21 hours ago

      and whenever you forget to sudo: sudo !!

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

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

  • B_DL@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    44
    ·
    1 day ago

    I knew there was an

    ls
    

    In there somewhere

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

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

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

      ctrl + r, l, s

      Much faster than simply typing ls!

    • inktvip@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      3
      ·
      22 hours ago

      ls … enter ↑ enter ↑ enter

      • ulterno@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        12 minutes ago

        You may consider using watch ls

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

    I’ve probably done that for ls

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

    Too many people still use Bash.

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

      I like zsh on mac because pretty colors

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

      Too many distributions still ship with Bash.

      • rtxn@lemmy.world
        link
        fedilink
        arrow-up
        11
        ·
        11 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
        15 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
          9
          ·
          12 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
            ·
            11 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
          ·
          14 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
            ·
            12 hours ago

            Internet Explorer shell expansion always trips me up.

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

          What shell do you recommend?

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

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

            • Auli@lemmy.ca
              link
              fedilink
              English
              arrow-up
              2
              ·
              11 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
                ·
                11 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.

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

    history | grep then !cmd no

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.

  • 2.18K users / day
  • 4.99K users / week
  • 8.46K users / month
  • 16.3K users / 6 months
  • 1 local subscriber
  • 26.5K subscribers
  • 842 Posts
  • 15.3K Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.11
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org