• Pup Biru
      link
      fedilink
      English
      17 months ago

      i’d like to introduce you to your new best friend: reset… it doesn’t everything clear does and a LOT more

    • @omxxi@feddit.org
      link
      fedilink
      English
      17 months ago

      haha, I can relate to that :). formerly I had the compulsion to execute sync frequently. Now my compulsion is to push Ctrl-C like 4 times every time I need it. I read somewhere that’s common because of ^C has a lack of feedback to the user, so, a script showing an alert that the clipboard received some information helped with this compulsion.

        • @7dev7random7@suppo.fi
          link
          fedilink
          17 months ago

          Someone who doesn’t know the benefits of dedicated, unlimited scrollback buffers. This command is useful but has a bad effect (when unintentionally).

          • @ripcord@lemmy.world
            link
            fedilink
            27 months ago

            No, I do. Clearing the scrollback because I want a new, very clear start point for a new activity and don’t care about the rest is frequently the goal.

            If I do care about the history I’ll do something else or possibly been saving history to disk, although that’s far more rare.

  • @_thebrain_@sh.itjust.works
    link
    fedilink
    97 months ago

    Not a command as much as I press the up arrow a lot. I’m.pretty lazy and hitting the up arrow 12 times is easier then retyping a complex rsync command.

    • @krash@lemmy.ml
      link
      fedilink
      27 months ago

      Fzf is so useful its ridiculous. I recreated the functionality of sshs with fzf and a small bash script.

    • Korthrun
      link
      fedilink
      1
      edit-2
      7 months ago

      Check out the fzf docs. It ships with helpers that offer better shell integration than you’re getting here.

  • @notfromhere@lemmy.ml
    link
    fedilink
    327 months ago

    Since nobody has said yet, I use screen pretty heavily. Want to run a long running task, starting it from your phone? Run screen to create a detachable session then the long running command. You can then safely close out of your terminal or detach with ctrl a, d and continue in your terminal doing something else. screen -r to get back to it.

    • @gitamar@feddit.org
      link
      fedilink
      Deutsch
      87 months ago

      I recently switched to tmux and boy, it’s way better. I basically use only tmux now anymore. Creating panes to have two processes in one glance, multiple windows, awesome. Plus all the benefits of screen.

    • @krash@lemmy.ml
      link
      fedilink
      17 months ago

      How does screen / tmux work when detached from a session, how does it keep the session alive (both when running locally, and while ssh:ing to a server)? Is there a daemon involved?

        • Caveman
          link
          fedilink
          17 months ago

          Eyyy, don’t hate, this is how I start all my work programs. That command is really nice and creates all work programs as children of a single terminal session for easy closing later.

          • @pyr0ball@sh.itjust.works
            link
            fedilink
            27 months ago

            No hate! Just need to make sure people know so they don’t create a bazillion threads without realizing it, or how to stop them effectively

      • huf [he/him]
        link
        fedilink
        English
        87 months ago

        no, tmux is a newer screen. some of us havent switched cos we’re too lazy i guess? i think the common wisdom is that it’s better. i havent tried cos i already know enough of screen and it’s fine for me

  • Maple Engineer
    link
    fedilink
    -1
    edit-2
    7 months ago

    <Esc>[2J<Esc>[H

    Is one of my favorites. Of course, most of you are too young to know what that means.

    • JackbyDev
      link
      fedilink
      English
      37 months ago

      Is that easier than typing clear? Also, not sure why you’d say something like that about people’s age. Anyone using terminals today is often going to run into weird quirks of them being around for decades even if they’re young.

      • Maple Engineer
        link
        fedilink
        07 months ago

        In the days before *nx, “terminal” meant a VT terminal and “clear” wasn’t a thing.

  • @macattack@lemmy.world
    link
    fedilink
    English
    6
    edit-2
    7 months ago

    Getting cheatsheets via curl cheat.sh/INSERT_COMMAND_HERE

    No install necessary, Also, you can quickly search within the cheatsheets via ~. For example if you copy curl cheat.sh/ls~find will show all the examples of ls that use find. If you remove ~find, then it shows all examples of ls.

    I have a function in my bash alias for it (also piped into more for readability):

    function cht() { curl cheat.sh/"$1"?style=igor|more }

  • Jess
    link
    fedilink
    417 months ago

    tldr because I am too impatient to read through man pages or google the exact syntax for what I want to do.

    • @pixelscript@lemm.ee
      link
      fedilink
      English
      277 months ago

      There are exactly three kinds of manpages:

      1. Way too detailed
      2. Not nearly detailed enough
      3. There is no manpage

      I will take 1 any day over 2 or 3. Sometimes I even need 1, so I’m grateful for them.

      But holy goddamn is it awful when I just want to use a command for aguably its most common use case and the flag or option for that is lost in a crowd of 30 other switches or buried under some modal subcommand. grep helps if you already know the switch, which isn’t always.

      You could argue commands like this don’t have “arguably most common usecases”, so manpages should be completely neutral on singling out examples. But I think the existence of tl;dr is the counterargument.

      Tangent complaint: I thought the Unix philosophy was “do one thing, and do it well”? Why then do so many of these shell commands have a billion options? Mostly /s but sometimes it’s flustering.

      • wuphysics87
        link
        fedilink
        87 months ago

        tldr is the first of 4 ways I rtfm. Then -h, man, and then the arch wiki

          • wuphysics87
            link
            fedilink
            47 months ago

            I can appreciate that. Appologies if you know this already, but just don’t like them. Here are some tips.

            It helps a lot to get title/subtitle/flag highlighting. By default man pages are hard to use simply because of how dense they are. It’s much easier to skim when you can separate the parts you are looking for up front from the text.

            Don’t forget ‘/’, ‘n’, and ‘N’. First way to use man pages more effectively is to search them easily. And you can search via regex. Often I’m looking for more info on a particular flag. So I’ll press ‘/’ followed by ‘^ *-g’. For a g flag.

            Take notes on the side. It saves you time later. Your future self will thank you. And you learn a lot by skimming them.

            Man pages can be intimidating/confusing, but, imho, it’s worth training that skill. Even if you are slower up front, it’s totally worth it.

            • @vrighter@discuss.tchncs.de
              link
              fedilink
              2
              edit-2
              7 months ago

              thanks for the advice. I knew about the search feature, but sometimes the stuff you need isn’t even on the page. I have no idea how to find what I need when it’s not in “man cmdname” how am I supposed to know that the feature i want has a dedicated page?

              how could I find certain commands if i didn’t already know it was a shell builtin and not a command? It’s not like you get a manpage saying “this is not a command”. And even if i did have the idea to open the bash page, it’s still useless, because builtins are their own dedicated page. That sort of stuff. It rarely ever makes things easier for me.

              edit, it is occasionally useful phen I have already found what I want on google and just want some more in depth details.

              • JackbyDev
                link
                fedilink
                English
                17 months ago

                If something is a bash built-in run help blah for it’s “man page”

                But yeah, man pages tick me off. Wait until you learn that there are sometimes more than one per command. I have to Google which page is which because they’re all for specific things. man foo is the equivalent of man 1 foo. What’s annoying is that the few times I’ve seen something referenced on another page the entry usually just says something like it’s on “the relevant man page” rather than just telling you exactly which.

                • @vrighter@discuss.tchncs.de
                  link
                  fedilink
                  17 months ago

                  ok but that still entails trying random things until i find it. If I didn’t already know it was a builtin i wouldn’t know to search there. The bash thing was just an example. I have learned this stuff since i encountered the problem. This is just me recollecting my experience of trying to use man

              • wuphysics87
                link
                fedilink
                17 months ago

                Unfortunately, sometimes (often) there is no man page for what you are looking for. So if you get a page not found, that’s usually the case. You can usually find associated pages all the way at the bottom. That helps when what you are looking for isn’t a command, but a reference. I don’t remember exactly where it is, but man pages are stored in a directory. Probably /etc or /usr. You can always dump that list into fzf or use grep to search to see if there is a page for what you are looking for. It’s not a perfect system by any means, but it’s a good one to have in your toolbelt.

  • ☂️-
    link
    fedilink
    357 months ago

    control+R

    in bash, it lets you quickly search for previously executed commands.

    its very useful and makes things much quicker, i recommend you give it a try.