Lemmy Today
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Carly™@lemmy.world to linuxmemes@lemmy.worldEnglish · 2 年前

Look, I'm lazy, okay?

lemmy.world

message-square
85
link
fedilink
1.24K

Look, I'm lazy, okay?

lemmy.world

Carly™@lemmy.world to linuxmemes@lemmy.worldEnglish · 2 年前
message-square
85
link
fedilink
alert-triangle
You must log in or register to comment.
  • HorreC@kbin.social
    link
    fedilink
    arrow-up
    54
    ·
    2 年前

    control shift R, then start typing, it will search your bash history

    • LobsterDog@frig.social
      link
      fedilink
      arrow-up
      16
      ·
      2 年前

      Is it not just Ctrl-R or is that platform dependent

      • count_duckula@discuss.tchncs.de
        link
        fedilink
        English
        arrow-up
        6
        ·
        2 年前

        I have always used ctrl-r but I just checked and both work. TIL.

        • tsukassa@lemmynsfw.com
          link
          fedilink
          English
          arrow-up
          3
          ·
          2 年前

          Thanks for clearing up this mystery.

    • mrmanagerA
      link
      fedilink
      arrow-up
      13
      ·
      2 年前

      Hmm, normally it’s just ctrl - r… Are you sure the shift is needed on your system?

      • lungdart@lemmy.ca
        cake
        link
        fedilink
        arrow-up
        3
        ·
        2 年前

        Don’t forget fzf. That will really jazz up your history search!

        • mausy5043@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          2 年前

          No man entry for fzf

          • mrmanagerA
            link
            fedilink
            arrow-up
            2
            ·
            2 年前

            Ok if you want to learn Linux, you need to start web searching for stuff you hear about. :)

          • lungdart@lemmy.ca
            cake
            link
            fedilink
            arrow-up
            1
            ·
            2 年前

            https://github.com/junegunn/fzf

            I recommend installing it as an oh-my-zsh plugin, but it’s not hard to get running in vanilla zsh/bash

      • HorreC@kbin.social
        link
        fedilink
        arrow-up
        2
        ·
        2 年前

        you are right, I must have just learned it with a shift for some dumb reason and it stuck, thank you internet person.

      • med@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        2 年前

        Some variants have ctrl+r bound to something else

    • whofearsthenight@kbin.social
      link
      fedilink
      arrow-up
      7
      ·
      2 年前

      Now if you had to guess how often I remember that there is a keyboard shortcut that does this, but don’t remember what it is, and do remember that I can just press up 30-70 times…

      • HorreC@kbin.social
        link
        fedilink
        arrow-up
        3
        ·
        2 年前

        you can hit it again after you are dialed in as much as you want and it will keep going back in time with the words you have in there and stuff that matches!

    • Rikudou_Sage@lemmings.world
      link
      fedilink
      arrow-up
      5
      ·
      2 年前

      I recommend using mcfly for that, it makes it even better.

    • fuckstick@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      2 年前

      This. It took a while for it to sink in but now it’s muscle memory and a huge time saver

      • Bipta@kbin.social
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        2 年前

        What now? What is r? How does this work?

        • fuckstick@lemmy.world
          link
          fedilink
          English
          arrow-up
          6
          ·
          2 年前

          CTRL+R brings up a prompt and allows you to search through commands you’ve run before. If you’ve run different variations of the command hitting CTRL+R or CTRL+SHIFT+R cycles through commands similar to what you’ve typed out.

          • gaiussabinus@lemmy.world
            link
            fedilink
            English
            arrow-up
            8
            ·
            2 年前

            I’m new to linux and i’ve been using $history | grep <thingy>. This information is very useful, thank you.

            • fuckstick@lemmy.world
              link
              fedilink
              English
              arrow-up
              4
              ·
              2 年前

              Sure thing! There’s lots of ways to do the same things, but either way stops you from hitting the up key a bajillion times

    • DontRedditMyLemmy@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      2 年前

      Why r? Maybe if I knew why r, then I wouldn’t forget this every 13 seconds…

      • danielton@lemmy.world
        link
        fedilink
        English
        arrow-up
        10
        ·
        2 年前

        Reverse search

  • m15otw@feddit.uk
    link
    fedilink
    English
    arrow-up
    50
    ·
    2 年前

    Ctrl+R

    Then type any part of the command (filename, search string, etc)

    Ctrl+R again to cycle through the matches.

    (Best feature in bash)

    • p0q@sh.itjust.works
      cake
      link
      fedilink
      English
      arrow-up
      12
      ·
      2 年前

      Use fzf for a more visual search.

      • LeanFemurs@lemmy.world
        link
        fedilink
        English
        arrow-up
        5
        ·
        2 年前

        This is the way.

    • brakenium@lemm.ee
      link
      fedilink
      English
      arrow-up
      8
      ·
      2 年前

      I’ve been using this for a long time, never knew I could press Ctrl + R again. Thanks!

      • wandering_nomad@lemmy.world
        link
        fedilink
        English
        arrow-up
        8
        ·
        2 年前

        Ctrl + S to go the other way if you overshoot!

    • spoopyking@lemmy.fmhy.ml
      link
      fedilink
      English
      arrow-up
      6
      ·
      2 年前

      Or history | grep 'command'

      • m15otw@feddit.uk
        link
        fedilink
        English
        arrow-up
        3
        ·
        2 年前

        Can’t just hit enter to run the one you want then, though.

        • rufus@lemmy.world
          link
          fedilink
          English
          arrow-up
          7
          ·
          2 年前

          Type: !1234 … to run whatever history number of the command.

    • Sorse@discuss.tchncs.de
      link
      fedilink
      arrow-up
      1
      ·
      4 个月前

      Also works in fish

    • LucidDaemon@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 年前

      Wish I knew this sooner.

    • Sidewayspeach@feddit.nl
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 年前

      But how to go backwards and forwards through the results? I just cycle through again!!

      • m15otw@feddit.uk
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 年前

        As @wandering_nomad@lemmy.world said above, Ctrl+S

  • runswithjedi@lemmy.world
    link
    fedilink
    English
    arrow-up
    12
    ·
    2 年前

    deleted by creator

    • Skyler@kbin.social
      link
      fedilink
      arrow-up
      7
      ·
      2 年前

      This is my approach, and for those who don’t know, you can use those line numbers that come back from history to rerun the command. Like if your output is something like this:

      $ history | grep tmp
        501  ls /tmp
        502  history | grep tmp
      
      

      You can run !501 and it will just re-run ls /tmp

      • IthronMorn@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        2 年前

        Woah! I had no clue!

    • bustrpoindextr@lemmy.world
      link
      fedilink
      English
      arrow-up
      6
      ·
      2 年前

      I got that as hgrep

      • runswithjedi@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 年前

        deleted by creator

    • pleb@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      6
      ·
      2 年前

      Yall are missing out on autocomplete.

      • runswithjedi@lemmy.world
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 年前

        deleted by creator

    • notasandwich1948@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      2
      ·
      2 年前

      didn’t know there was a comment for that, I just always used cat to read the bash history file

      • mrmanagerA
        link
        fedilink
        English
        arrow-up
        2
        ·
        edit-2
        2 年前

        Wait until you learn about ctrl-R to search the bash history… :) If you press that and start typing, you will get auto complete from previous commands you typed. This is how an experienced linux user can be so fast in the terminal.

        There are even better tools for this, so ctrl R is just the built in way. Later you should look into https://github.com/junegunn/fzf

      • runswithjedi@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 年前

        deleted by creator

  • skomposzczet@vlemmy.net
    link
    fedilink
    English
    arrow-up
    10
    ·
    2 年前

    up, up, up, up, up, cd …, ah there it is.

  • tobier@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    ·
    2 年前

    This is why I switched to fish; it seems to be much smarter understanding what I want to type.

    • amos@lemmy.world
      link
      fedilink
      English
      arrow-up
      7
      ·
      2 年前

      Yeah it’s great how ctrl-r is kinda the default instead of something you have to go out of your way to use. Just start typing a command and the up arrow will only cycle through history that matches what you’ve typed so far.

      • sneeple@reddthat.com
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 年前

        Idk exactly what plugin it is, but zsh + oh my zsh has exactly this same thing. So hard to live without now that I’m used to it. Probably my favorite feature

        • notavote@lemmy.world
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 年前

          That is default zsh history search, pretty nice.

          • sneeple@reddthat.com
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 年前

            Oh is it just a setting then? I remember using plain zsh and it didn’t have that functionality until I installed omz, but I could see it being an option that omz enables on install.

            • notavote@lemmy.world
              link
              fedilink
              English
              arrow-up
              1
              ·
              2 年前

              I think that it is.

    • amos@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 年前

      Yeah it’s great how ctrl-r is kinda the default instead of something you have to go out of your way to use. Just start typing a command and the up arrow will only cycle through history that matches what you’ve typed so far.

    • amos@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 年前

      Yeah it’s great how ctrl-r is kinda the default instead of something you have to go out of your way to use. Just start typing a command and the up arrow will only cycle through history that matches what you’ve typed so far.

  • ttk@feddit.de
    link
    fedilink
    English
    arrow-up
    10
    ·
    2 年前

    fzf masterrace

  • vimdiesel@lemmy.world
    link
    fedilink
    English
    arrow-up
    10
    ·
    2 年前

    ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬆️ ⬇️ ⬇️

  • rocket@wirebase.org
    link
    fedilink
    English
    arrow-up
    10
    ·
    edit-2
    2 年前

    deleted by creator

  • Ignacio@kbin.social
    link
    fedilink
    arrow-up
    7
    ·
    2 年前

    It’s even faster if you look for it inside .bash_history.

    • Teeetris@feddit.nl
      link
      fedilink
      arrow-up
      2
      ·
      2 年前

      Still noup

  • Sketchpad01@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    2 年前

    Using the history command just to find the specific IP I need to ssh to

    • driving_crooner@lemmy.eco.br
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      2 年前

      More like to find ping -O 8.8.8.8

  • Badland9085@lemm.ee
    link
    fedilink
    English
    arrow-up
    7
    ·
    2 年前

    To anyone who uses vim mode, ? lets you search through your stored command history, from normal mode ofc.

  • Aceticon@lemmy.world
    link
    fedilink
    English
    arrow-up
    7
    ·
    2 年前

    It’s like the bus-stop-paradigm: If I wait just a bit longer and it will come. Meanwhile it would’ve been faster to walk.

  • Astaroth@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    edit-2
    2 年前

    deleted by creator

    • pleb@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      2 年前

      Same. Look at all these people using grep to search their history.

  • Ephur@lemmy.world
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 年前

    I create so many aliases with the notion of how much time I’ll save… never use ‘em. Works out okay though because a much richer history to fzf through

  • corytheboyd@kbin.social
    link
    fedilink
    arrow-up
    5
    ·
    2 年前

    https://github.com/junegunn/fzf

linuxmemes@lemmy.world

linuxmemes@lemmy.world

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: !linuxmemes@lemmy.world

Hint: :q!


Sister communities:
  • !tech_memes@lemmy.world
  • !memes@lemmy.world
  • !lemmyshitpost@lemmy.world
  • !risa@startrek.website

Community rules (click to expand)

1. Follow the site-wide rules
  • Instance-wide TOS: https://legal.lemmy.world/tos/
  • Lemmy code of conduct: https://join-lemmy.org/docs/code_of_conduct.html
2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like “every user of thing”.
  • Don’t get baited into back-and-forth insults. We are not animals.
  • Leave remarks of “peasantry” to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn, no politics, no trolling or ragebaiting.
4. No recent reposts
  • Everybody uses Arch btw, can’t quit Vim, <loves/tolerates/hates> systemd, and wants to interject for a moment. You can stop now.
5. 🇬🇧 Language/язык/Sprache
  • This is primarily an English-speaking community. 🇬🇧🇦🇺🇺🇸
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
6. (NEW!) Regarding public figures

We all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.

  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.

 

Please report posts and comments that break these rules!


Important: never execute code or follow advice that you don’t understand or can’t verify, especially here. The word of the day is credibility. This is a meme community – even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don’t remove France.

Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1.09K users / day
  • 4.85K users / week
  • 9.24K users / month
  • 19.5K users / 6 months
  • 160 local subscribers
  • 25.5K subscribers
  • 1.69K Posts
  • 97.1K Comments
  • Modlog
  • mods:
  • Kevin@lemmy.world
  • zephyr@lemmy.world
  • rtxn@lemmy.world
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org