kuuhana
  • Communities
  • Multi-communities
  • Support Lemmy
  • Search
  • Login
  • Sign Up
Programmer Humor@programming.devbycm0002@lemmy.world
1 year

Linux Users

lemmy.ml
140
    You must log in or register to comment.

    • TabbsTheBat (they/them)@pawb.social
      1 year

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

        • I_Am_Jacks_____@sh.itjust.works
          1 year

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

            • aquovie@lemmy.cafeEnglish
              1 year

              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 (they/them)@pawb.social
                1 year

                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
                1 year

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

                • sbeak@sopuli.xyzEnglish
                  1 year

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

                • iamdefinitelyoverthirteen@lemmy.world
                  1 year

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

                    • AmidFuror@fedia.io
                      1 year

                      Been there, done that.

                      • layzerjeyt@lemmy.dbzer0.com
                        1 year

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

                          • antimidas@sopuli.xyz
                            1 year

                            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.devEnglish
                                1 year

                                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

                          • Auli@lemmy.caEnglish
                            1 year

                            Ctrl R

                              • sol6_vi@lemmy.makearmy.io
                                1 year

                                holy fucking shit 🤌💪🤯❤️💯

                              • aeharding@vger.social
                                1 year

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

                                  • Derpgon@programming.dev
                                    1 year

                                    CTRL+R for those unitiated

                                    • Everyday0764@lemmy.zip
                                      1 year

                                      reverse-i-search + fzf = <3

                                      • ulterno@programming.devEnglish
                                        1 year

                                        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
                                            1 year

                                            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.devEnglish
                                                1 year

                                                history is shell dependent.

                                          • mvirts@lemmy.world
                                            1 year

                                            ^r

                                              • veni_vedi_veni@lemmy.world
                                                1 year

                                                and whenever you forget to sudo: sudo !!

                                                  • Gumus@lemmy.world
                                                    1 year

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

                                                  • bandwidthcrisis@lemmy.world
                                                    1 year

                                                    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
                                                        1 year

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

                                                          • bandwidthcrisis@lemmy.world
                                                            1 year

                                                            It’s basically emacs incremental search.

                                                      • Mad_Punda@feddit.org
                                                        1 year

                                                        I’ve probably done that for ls

                                                        • Yggstyle@lemmy.world
                                                          1 year

                                                          taptaptaptap… taptaptaptap… taptaptaptap taptaptaptap taptaptaptap

                                                          … taptaptaptap

                                                          … tap …

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

                                                            • iamdefinitelyoverthirteen@lemmy.world
                                                              1 year

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

                                                            • salacious_coaster@infosec.pubEnglish
                                                              1 year

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

                                                                • drkt@scribe.disroot.org
                                                                  1 year

                                                                  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
                                                                      1 year

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

                                                                      • bitchkat@lemmy.worldEnglish
                                                                        1 year

                                                                        Extract a tarball with verbose output from the specified file.

                                                                        And learn how to use the ‘z’ option

                                                                        • jbrains@sh.itjust.works
                                                                          1 year

                                                                          You don’t even need the hyphen!

                                                                          Mind = blown.

                                                                        • Hammerheart@programming.dev
                                                                          1 year

                                                                          tar --help

                                                                          • ominous ocelot@leminal.space
                                                                            1 year

                                                                            tar - h

                                                                              • IsoKiero@sopuli.xyzEnglish
                                                                                1 year

                                                                                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
                                                                                    1 year

                                                                                    Damn.

                                                                                      • titanicx@lemmy.zip
                                                                                        1 year

                                                                                        Thanks, we all died.

                                                                                          • ominous ocelot@leminal.space
                                                                                            1 year

                                                                                            :)

                                                                                    • psud@aussie.zoneEnglish
                                                                                      1 year

                                                                                      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

                                                                                    • killeronthecorner@lemmy.worldEnglish
                                                                                      1 year

                                                                                      O(n) access, very efficient.

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

                                                                                      • ezekielmudd@reddthat.com
                                                                                        1 year

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

                                                                                          • Frezik@lemmy.blahaj.zoneEnglish
                                                                                            1 year

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

                                                                                            • Eager Eagle@lemmy.worldEnglish
                                                                                              1 year

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

                                                                                                • merc@sh.itjust.works
                                                                                                  1 year

                                                                                                  Because you can pipe history to grep.

                                                                                                    • snowe@programming.dev
                                                                                                      1 year

                                                                                                      with fzf you get better grep with fuzzy search

                                                                                                    • Sabata@ani.social
                                                                                                      1 year

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

                                                                                                    • irish_link@lemmy.world
                                                                                                      1 year

                                                                                                      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.

                                                                                                      • Not a newt@piefed.caEnglish
                                                                                                        1 year

                                                                                                        Ctrl-R if you know part of the command.

                                                                                                      • pcouy@lemmy.pierre-couy.fr
                                                                                                        1 year

                                                                                                        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
                                                                                                            1 year

                                                                                                            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 !

                                                                                                          • Edgarallenpwn@midwest.socialEnglish
                                                                                                            1 year

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

                                                                                                            • freewheel@sh.itjust.works
                                                                                                              1 year

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

                                                                                                                • entwine@programming.dev
                                                                                                                  1 year

                                                                                                                  bash supports this feature too btw

                                                                                                                    • freewheel@sh.itjust.works
                                                                                                                      1 year

                                                                                                                      Added to my mental toolbox, thanks!

                                                                                                                  • ѕєχυαℓ ρσℓутσρє@lemmy.sdf.org
                                                                                                                    1 year

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

                                                                                                                      • rozodru@piefed.socialEnglish
                                                                                                                        1 year

                                                                                                                        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
                                                                                                                          1 year

                                                                                                                          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.

                                                                                                                        • flyingSock@feddit.org
                                                                                                                          1 year

                                                                                                                          also when they see this post

                                                                                                                          Programmer Humor@programming.dev

                                                                                                                          programmer_humor@programming.dev

                                                                                                                          Subscribe from remote instance

                                                                                                                          Create post

                                                                                                                          Report community

                                                                                                                          Modlog
                                                                                                                          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

                                                                                                                          This community is visible to everyone.

                                                                                                                          • 390 users / Day
                                                                                                                          • 3.65K users / Week
                                                                                                                          • 7.84K users / Month
                                                                                                                          • 12.1K users / 6 months
                                                                                                                          • 2.63K posts
                                                                                                                          • 98.1K comments
                                                                                                                          • 2 local subscribers
                                                                                                                          • 34.3K subscribers
                                                                                                                          • UI: 1.0.0-beta.0
                                                                                                                          • BE: 1.0.0-alpha.20
                                                                                                                          • Modlog
                                                                                                                          • Instances
                                                                                                                          • Docs
                                                                                                                          • Code
                                                                                                                          • join-lemmy.org