Linux shell magic and bash easter eggs

Поділитися
Вставка
  • Опубліковано 29 січ 2025

КОМЕНТАРІ • 76

  • @nico1337
    @nico1337 23 години тому +23

    started playing tetris and missed the rest of the video :D

    • @mrlectus
      @mrlectus 16 годин тому

      Lol me too 😂 I didn't know zsh had that

  • @guitarbuddha74
    @guitarbuddha74 19 годин тому +4

    Most linux distros you can prevent the fork bomb by limiting users processes in limits.conf along with controlling any other out of control process. At least that used to be the way not sure if that has been superseded by something yet.

  • @TheLinuxCast
    @TheLinuxCast 14 годин тому +9

    Oh, good. Now I don't need emacs to play Tetris. :)

  • @AxelSeedig
    @AxelSeedig 6 годин тому +2

    1:36 Fork Bomb: As an admin you can mitigate this happening if you use resource limits (ulimit -u 1000) to restrict the number of processes a user can create.

  • @y00t00b3r
    @y00t00b3r 16 годин тому +1

    more content like this, please
    instant subscribe!
    straight to the point, no screwing around
    simple and informative

  • @_bitties
    @_bitties 23 години тому +2

    Absolutely loving your vids

  • @sorphin
    @sorphin 20 годин тому +1

    I've been using BASH since I started back in the early 90s. Doesn't matter if what i'm logging into wants me to use zsh, csh, tcsh, dash, ksh/pdksh (yes, I've had ot deal with all of them)... BASH either gets installed or my shell gets changed to it if it's already installed. Why? Because it's always done what I need a shell to do. That said, it is neat to see oddball things like the zsh tetris.

  • @shateq
    @shateq 22 години тому +4

    You have to prepare a magic hat for the next video for this series

  • @Sr.V85
    @Sr.V85 21 годину тому

    love your videos, keep it up!!

  • @DV-ml4fm
    @DV-ml4fm 19 годин тому +3

    It's hard for me to move to another shell like zsh, fish and etc, after using bash for 15 years.

    • @itstoxicqt
      @itstoxicqt 13 годин тому +2

      I moved to Zsh this past year I absolutely love it

    • @atijohn8135
      @atijohn8135 9 годин тому +2

      zsh is just bash+ anyways, fish is the odd one

  • @ropssalis4891
    @ropssalis4891 23 години тому +4

    Those are in fact really cool tricks, thank you

  • @ArturdeSousaRocha
    @ArturdeSousaRocha 22 години тому +3

    9:20 Or install `watch`. :)

    • @octomancer
      @octomancer 15 годин тому

      But you know how much people hate clock-watching ... I'll get me coat.

  • @ianTnai
    @ianTnai 15 годин тому

    I’ve wondered abit if there’s a prompt to print the time a command started and ended.

  • @peterjansen4826
    @peterjansen4826 14 годин тому

    I knew about the forkbomb, I didn't know that there is Tetris in ncurses hidden in zsh. A cool easter egg. I also have a PS1 prompt which becomes red when I enter a non-command. Just a coincidence, I downloaded one when I switched to zsh.

  • @JZL003
    @JZL003 13 годин тому

    Also if you wanted even shorter, to get a clock I do `watch date` and can use `-n 2` to change the time. Just a llittle faster to type and I love the watch command

  • @Val_Cla
    @Val_Cla 22 години тому +5

    wow ! I knew cal, but didn't knew about that year 1752 thing !

  • @thomasbates9189
    @thomasbates9189 15 годин тому

    Can you make a video to go over the various terminal customizations you have and maybe you neo vim configuration?

  • @ozu7779
    @ozu7779 19 годин тому

    maybe one day, we will get that beautiful nvim setup 😭😭😭😭😭😭

  • @tubeDude48
    @tubeDude48 22 години тому

    Oh, as everyone else has said: "I too am enjoying you YT's".

  •  22 години тому

    Nice 😁 I need to stop watching all the shit I watch on yt, and start relearning all I have forgotten about linux.
    I'll keep watching good content like this. Another great video Bread.

  • @SchalkNeethling
    @SchalkNeethling 23 години тому

    So cool! Thanks for sharing, bread! 🍞

  • @TheDigitalOne
    @TheDigitalOne 15 годин тому

    Enjoyed it, thanks, like the game of Tetris, tho…whats is history in the painting of background, ok painting, I like…👩‍💻🥰⭐️💎

  • @RonaldMarillier
    @RonaldMarillier 14 годин тому

    Everybody born between the 2nd and teh 14th Setember will be one year younger - a free year minus 20 days will be added to your lifespan

  • @anon_y_mousse
    @anon_y_mousse 9 годин тому

    If you can add a feature in under 1M of space, I don't consider that bloat, at least not nowadays. Back when I got started, I would've said bloat at 1K, but now I've got literal terabytes of storage space. In fact, I think I might be willing to go as high as 10M before I grouse.

  • @noodlish
    @noodlish 18 годин тому +2

    Cool to see the carriage return used to, you know, return the carriage.

  • @itsfish8672
    @itsfish8672 22 години тому

    Sweet vid.

  • @theprathamdupare
    @theprathamdupare 13 годин тому

    I have my arrow keys binded to vim keys so this worked out of the box!

  • @VGl0dXM
    @VGl0dXM Годину тому

    HELL YEAH BOIIII

  • @peterjansen4826
    @peterjansen4826 16 годин тому

    Funny story, I had to dump bash previous week. I have no idea why but somehow a recent update of some program made bash crash all the time. I switched to zsh and dash and the crashes disappeared. I would guess that it is related to my hardware.

    • @Toxikuu
      @Toxikuu 15 годин тому +1

      i really doubt bash crashing after an update is a hardware issue

    • @peterjansen4826
      @peterjansen4826 15 годин тому

      @@Toxikuu If it wouldn't be then I should have heard others about it by now. I use Arch. Anyway, I guarantee you that it is bash which crashed and it is a fact that the crashes happened long after the last bash update around late september in 2024 so an update of another program made it crash on my system, that much is certain. When you can't do anything anymore in any terminal or tty, your shell-commands (via the windowmanager hotkeys) don't work but all regular hotkeys for the windowmanager itself do work and open programs still function with the exception of the terminals, alt least for a while, that makes it abundantly clear that your shell crashed. That happened at least around once every hour until I changed to other shells, dash as 'POSIX-compliant' shell (sh=>dash), zsh as the shell of the user (chsh). Nothing else changed.

    • @audiolatroushearetic1822
      @audiolatroushearetic1822 11 годин тому

      Do you have a command or function in your .bashrc that is hardware-specific or refers to a command/program that makes the whole session crash? Otherwise bash should work if the other shells work too.

    • @peterjansen4826
      @peterjansen4826 7 годин тому

      @@audiolatroushearetic1822 Nothing interesting relevant. One line for ghcup which I also have in my zshrc, other than that just a lot of aliases and a few functions. Also, as far as I know this either works or doesn't, it shouldn't suddenly crash. I suspect that ffmpeg could somehow make bash crash but I can't proof it yet. It only crashes while i play audio or video.

  • @comosaycomosah
    @comosaycomosah 11 годин тому

    😂 dang the tetris lol

  • @Alexs23743
    @Alexs23743 18 годин тому

    So, does that mean that, according to the Julian calendar, I am writing this comment on January 18, 2025?
    Whelp, guess I'm going back in time to the massive cold snap that hit my area, that we just emerged from! D:

  • @shateq
    @shateq 23 години тому

    dope wallpaper

  • @5ergius
    @5ergius 20 годин тому

    ups, forgotten the time while playin Tetris in my shell

  • @mnky75
    @mnky75 23 години тому

    If I feel extra fancy, I'll do some of my Terminal generated reports using figlet, toilet and lolcat. I'm an idiot.

  • @Skydleroo
    @Skydleroo 23 години тому

    Cool!

  • @itstoxicqt
    @itstoxicqt 13 годин тому

    More tricks and tips!!!! Just the tips

  • @empathy_monster
    @empathy_monster 3 години тому

    The shell is deeply integrated into the system, so there's definitely certain things it's good at, but you might have a better and more productive time scripting in like Python or Go. The syntax is much, much cleaner, making it easier to reason about what the code is doing.

  • @yomajo
    @yomajo 12 годин тому

    I have "secs" alias for date (time with seconds), since I often work in full screen vscode and jump around to terminal a lot on ubuntu. Needless to aay its suggestive word :D

  • @Toxikuu
    @Toxikuu 16 годин тому +1

    why use `:>filename` instead of `>filename`?

    • @atijohn8135
      @atijohn8135 8 годин тому +1

      : is usually mapped to the 'true' pseudo-command (which just outputs nothing). > filename technically works too, and is fine to use on the command-line, but in scripts it's better to explicitly redirect from some command, because it can be a source of bugs like `command & > output.txt` when `command &> output.txt` was meant.

  • @EgoShredder
    @EgoShredder 18 годин тому

    Bread speaks Linux better than she does English...its scary! 😂

  • @emem666
    @emem666 22 години тому

    Confirmed that fork bomb works. Tried it in virtual machine so no harm done. Out of curiosity: do Americans always treat Sunday as first day of the week? I see it's default in many places and I always have to change it.

    • @SpaceCatKungFu
      @SpaceCatKungFu 18 годин тому +2

      American here. Monday is the first day of my week.

  • @5ergius
    @5ergius 20 годин тому

    peace 🖐

  • @itsamemarkus
    @itsamemarkus 22 години тому +1

    Thanks, I like this format

  • @sotecluxan4221
    @sotecluxan4221 2 години тому

  • @ZentrionDoom
    @ZentrionDoom 22 години тому

    Type this one fun command as root to display cool text in your terminal: `# rm -rf --no-preserve-root /*`

  • @ZentrionDoom
    @ZentrionDoom 22 години тому +3

    Your PS1 doesn't have to be a mess, you can set variables for the colors for example...
    ```
    # ~/.bashrc
    prompt() {
    exit_code=$?
    local red="\[\033[1;31m\]"
    local grn="\[\033[1;32m\]"
    PS1=""
    [ -n "$SSH_CLIENT" ] && PS1+="(ssh from ${SSH_CLIENT%% *}) "
    if test "${exit_code:-0}" -eq 0;then
    PS1+="${grn}( •_•)${rst} "
    else
    PS1+="${red}(;☉_☉)${rst} "
    fi
    }
    PROMPT_COMMAND="prompt;"
    ```

    • @BreadOnPenguins
      @BreadOnPenguins  22 години тому +1

      True, good point. I'm spoiled by just using hex color codes in zsh :-)

    • @gemelen
      @gemelen 18 годин тому +1

      Adding to this from the aspect of calling something compute-heavy: one could prepend the actual calling by test (if cwd contains .git, then query the branch, otherwise do nothing) and do some memorization (if it's know that the state is preserved within the time frame, store and reuse it, otherwise reevaluate)

  • @clintsuperhero
    @clintsuperhero День тому +2

    first

  • @sniper_in_bush
    @sniper_in_bush 23 години тому

    first

    • @grencez
      @grencez 23 години тому +5

      🥈

  • @DavidLindes
    @DavidLindes 4 години тому

    5:17 - haha, what if you replaced the spin characters with ✃ ✂ ✁ ✂ ? :D
    [note, this emojified some of those, but it looks different in shell]
    [I'm sure lots of other fun choices could be made, too.]