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

Linux Users

lemmy.ml

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

Linux Users

lemmy.ml

cm0002@lemmy.world to Programmer Humor@programming.dev · 1 year ago
message-square
135
link
fedilink
  • cross-posted to:
  • programmerhumor@lemmy.ml
alert-triangle
You must log in or register to comment.
  • wewbull@feddit.uk
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year 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?”

    • merc@sh.itjust.works
      link
      fedilink
      arrow-up
      0
      ·
      1 year 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.

    • UpperBroccoli@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      0
      ·
      1 year 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!

  • TabbsTheBat (they/them)@pawb.social
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

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

    • sbeak@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      Woah Ctrl R looks super cool, never knew that I could do that before…

    • I_Am_Jacks_____@sh.itjust.works
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

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

      • TabbsTheBat (they/them)@pawb.social
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

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

      • aquovie@lemmy.cafe
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 year 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.

    • tyler@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

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

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

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

  • clashorcrashman@lemmy.zip
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    …Yeah, you got me.

  • Endymion_Mallorn@kbin.melroy.org
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    I wish this wasn’t so painfully true.

  • merc@sh.itjust.works
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    Too many people still use Bash.

    • humorlessrepost@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      I like zsh on mac because pretty colors

    • Leonardo_da_Vinci@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      Too many distributions still ship with Bash.

      • Err(()).unwrap()@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

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

      • merc@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        ·
        1 year 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
          0
          ·
          1 year 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
            0
            ·
            1 year 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
          0
          ·
          1 year ago

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

          • layzerjeyt@lemmy.dbzer0.com
            link
            fedilink
            arrow-up
            0
            ·
            1 year ago

            Internet Explorer shell expansion always trips me up.

        • Croquette@sh.itjust.works
          link
          fedilink
          arrow-up
          0
          ·
          1 year ago

          What shell do you recommend?

          • merc@sh.itjust.works
            link
            fedilink
            arrow-up
            0
            ·
            1 year ago

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

            • Auli@lemmy.ca
              link
              fedilink
              English
              arrow-up
              0
              ·
              1 year ago

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

              • merc@sh.itjust.works
                link
                fedilink
                arrow-up
                0
                ·
                1 year 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.

  • baltakatei@sopuli.xyz
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    $ history | grep 'gre[p]' | less -S

    • mbp@lemmy.sdf.org
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      Does fuck all when you can’t remember even a piece of the command lol

  • stealth_cookies@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    This is why I like atuin, I can just press up and start typing part of the command and it will likely find it in my history.

    • merc@sh.itjust.works
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      You could already do that with just “Ctrl-R” but without atuin redrawing your screen.

  • Avicenna@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    history | grep then !cmd no

  • aeharding@vger.social
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

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

    • Everyday0764@lemmy.zip
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      reverse-i-search + fzf = <3

    • Derpgon@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      CTRL+R for those unitiated

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

          history is shell dependent.

  • B_DL@lemmynsfw.com
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 year ago

    I knew there was an

    ls
    

    In there somewhere

    • emb@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

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

    • teletext@reddthat.comdeleted by creator
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      ctrl + r, l, s

      Much faster than simply typing ls!

    • inktvip@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      ls … enter ↑ enter ↑ enter

      • ulterno@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 year ago

        You may consider using watch ls

  • ezekielmudd@reddthat.com
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

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

    • Not a newt@piefed.ca
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      Ctrl-R if you know part of the command.

    • Frezik@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

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

    • irish_link@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      1 year 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.

    • Eager Eagle@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

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

      • Sabata@ani.social
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

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

      • merc@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        ·
        1 year ago

        Because you can pipe history to grep.

        • snowe@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          1 year ago

          with fzf you get better grep with fuzzy search

  • flyingSock@feddit.org
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    also when they see this post

  • Cevilia@lemmy.blahaj.zonedeleted by creator
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    7 months ago

    deleted by creator

  • alecsargent@lemmy.zip
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    I always go past it because I go way to fast.

    • nous@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 year ago

      I have more then once gave up on pressing up, hit ctrl + c to reset only to see the command I wanted briefly flash up as I am hitting ctrl + c

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.

  • 197 users / day
  • 334 users / week
  • 1.28K users / month
  • 3.65K users / 6 months
  • 0 local subscribers
  • 34.4K subscribers
  • 2.38K Posts
  • 63.6K Comments
  • Modlog
  • mods:
  • adr1an@programming.dev
  • Feyter@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.20
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org