• brsrklf@jlai.lu
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 month ago

    I was expecting some cool Mario strats

    I’m always using “clear” to just get rid of my console’s output. I think it has something to do with me remembering I used that on my old 80’s computer, trying it out on a bash long after that and “oh, that works here too, that’s convenient”.

    Reset looks like it does more stuff, but I don’t know if that’s useful for this use case.

    • lemmydividebyzero@reddthat.comOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 month ago

      I asked this myself, too. AI response:

      clear: clears the visible screen (sends the terminal’s “clear” sequence); usually fast and does not change terminal settings or fully reinitialize scrollback.

      reset: fully reinitializes the terminal (sends init strings, resets modes/attributes, may reconfigure terminfo/baud, and clears); slower and used to recover from garbled output or broken state.

      • MummifiedClient5000@feddit.dk
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 month ago

        I prefer an actual client, especially because I press CTRL+w before my brain sets in, but there are plenty of examples. My latest encounter was Rancher, a k8s management thing.

        But a client running in a browser window does not imply any remotely exploitable vulnerabilities.

      • theherk@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 month ago

        They’re common in clouds like Azure, AWS, etc. Life is better with ssh, but sometimes these are useful for bastions.

    • toynbee@piefed.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 month ago

      Pretty much the one and only good thing about work forcing us to switch from Linux laptops to Macbooks.

      • LiveLM@lemmy.zip
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 month ago

        I hated the Command + C and Command + V for Copy / Paste until I realized it meant not clobbering ^C in the terminal. Instantly loved it.

        • toynbee@piefed.social
          link
          fedilink
          English
          arrow-up
          0
          ·
          1 month ago

          The biggest issue I have with it is that I have Linux on all my personal systems and OSX on my work laptop and sometimes switch rapidly between them.

          My fingers don’t seem to adapt as quickly, though, and I often press the wrong combination between them.

      • MummifiedClient5000@feddit.dk
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 month ago

        The mixed used of the command key and CTRL on Macs has tricked me to pressing command+w in a terminal window quite a few times.

  • Übercomplicated@lemmy.ml
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 month ago

    None of these are accurate. The only shell trick that genuinely saves your sanity is fish. (/jk)

    Also, these are genuinely very basic tips. It’s much more useful to learn about tmux, plugins (e.g., atuin), and useful commands like sed, grep, fd, awk, etc. Pretty much everything this article mentions becomes second nature in fish, leaving you to focus on more important things. Like learning neovim or emacs!

    • mal3oon@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 month ago

      Definitelu second tmux. That being said, I actually didn’t know many of those shortcuts. And I even use nvim btw.

  • CallMeAl (like Alan)@piefed.zip
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 month ago

    Great article but this shouldn’t be called “Tricks” it should be called Shell Basics. I’m old enough to remember taking an Intro To Unix course and there was an entire day on the shell where these types of commands were presented as essential learning.

    • toynbee@piefed.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 month ago

      A fact that I like to share from my personal history: I took four years to graduate from a two year college because I was taking every computer class they offered … Except that I skipped “intro to Unix” because when was I ever going to use that?

      My entire career has been largely based on knowing how to use Linux.

  • amateurcrastinator@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 month ago

    On a new rocky 10 install Ctrl + R doesn’t do much. I can’t find commands I know I typed. I can’t be bothered to find out why

  • john_lemmy@slrpnk.net
    link
    fedilink
    English
    arrow-up
    0
    ·
    edit-2
    1 month ago

    I use CTRL+D a lot, but I didn’t know it was a send EOF command. Why does that close the session / terminal?

    Also, the undo shortcut is also pretty nice (CTRL+_ ?) and missing there

  • Undearius@lemmy.ca
    link
    fedilink
    English
    arrow-up
    0
    ·
    1 month ago

    I’ve seen a few of these “shell tricks” articles. This one I actually learned quite a few, which I will promptly forget when I actually need to use them.

    • Ŝan • 𐑖ƨɤ@piefed.zip
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 month ago

      I keep a text file full of þese sorts of þings. Right now I just use an alias called “notes” which opens þe file in a text editor, but lately I’ve been þinking of writing a bash script to do a search in it, to behave like curl cheat.sh/restic, but tag-based. Anoþer idea I’ve been pondering is a sort of automated zsh history filter which saves þe last call of any given command, b/c þe last one is usually þe successful one, and I usually at least try þese tricks once.

      Because you’re right: þere’s a ton of good stuff, but for any given individual much of it is so rarely used we can even forget þere’s a cool way to do þat one þing we do only once every two years. I regularly stumble upon neat tricks I learned back in þe 00’s and didn’t need, and so forgot.

      • toynbee@piefed.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 month ago

        Wow, haven’t seen your thorns in a while.

        I liked vimwiki for this, except that it set expandtab and I could never find where.

        • Ŝan • 𐑖ƨɤ@piefed.zip
          link
          fedilink
          English
          arrow-up
          0
          ·
          1 month ago

          It depends. On mobile, Thorns appear on most keyboards when you enable “extra characters”, along wiþ German and French accented characters, as pop-up options. Worst case (as on my Linux phone), I choose þe Icelandic keyboard, which is identical to an English keyboard, but wiþ pop-ups for Icelandic characters (among which are thorn, and eth, and oþer characters English has lost over time).

          On my desktop, I just use compose characters. I have an .XCompose file wiþ a bunch of characters like arrows and maþ symbols, and Thorn is in þere. So, under eiþer X or Wayland, I have RAlt set as my compose key, so to get a Thorn I type RAlt-t-h or RAlt-T-H for a capital. It’s an extra keystroke (not chorded).

          Relevant ~/.XCompose lines:

          <Multi_key> <t> <h>                               : "þ"      U00FE           # LATIN SMALL LETTER THORN WITH STROKE
          <Multi_key> <T> <H>                               : "Þ"      U00DE           # LATIN SMALL LETTER THORN WITH STROKE