< Return to Video

https:/.../clt25-11-deu-Pimp_your_shell_hd.mp4

  • 0:07 - 0:08
    Sound test?
    [Translated by Tom Süßenbach (KYBS2001 course assignment at JYU.FI)]
  • 0:08 - 0:09
    Yeah, that sounds better.
  • 0:10 - 0:11
    That sounds better, good.
  • 0:14 - 0:17
    Who of you already uses a customized shell environment?
  • 0:17 - 0:21
    Maybe made a few adjustments to the prompt, maybe using ZSH,
  • 0:21 - 0:26
    Plug-in managers—those are the things I'd like to show you today.
  • 0:27 - 0:32
    Before I do that, a little
    more about my
  • 0:32 - 0:33
    employer, B1 Systems.
  • 0:33 - 0:38
    I've been working for B1 for eleven years.
  • 0:38 - 0:40
    have also had contact with us.
  • 0:43 - 0:48
    B1 has been around for over 20 years now,
    specializing in Linux and open source from the very beginning.
  • 0:48 - 0:55
    We have about 150 people now.
    When I started 11 years ago,
  • 0:55 - 0:57
    we were still around 60.
  • 0:57 - 1:00
    So it's going pretty well, and we're
    doing things like this, I always like to call,
  • 1:00 - 1:03
    the all-round happy package
    everything around Linux in the data center.
  • 1:04 - 1:08
    From consulting to training to managed service operations.
  • 1:09 - 1:13
    As I said, I've been with B1 for, well, 10 years, now 11
  • 1:13 - 1:17
    years, working as a senior trainer and consultant.
  • 1:17 - 1:20
    The last few years, mainly
    training, but recently
  • 1:20 - 1:25
    significantly more consulting, especially in the area of ​​security,
  • 1:25 - 1:28
    Automation and Kubernetes, a lot.
  • 1:29 - 1:35
    But that's not what we're talking about today, but rather
    a bit of shell operation. Here again
  • 1:35 - 1:39
    a few key points. If you take a look around, we really have everything there.
  • 1:39 - 1:45
    from storage to virtualization,
    config management. I'm also supposed to
  • 1:45 - 1:50
    do a bit of advertising
    for our Linux Client Management, which
  • 1:50 - 1:55
    is the first product we've
    released. a centralized
  • 1:55 - 1:57
    Management solution for Linux clients.
  • 1:58 - 2:01
    There's also a webinar, I think on April 8th.
  • 2:01 - 2:02
    That's April.
  • 2:02 - 2:05
    You can get more information about this
    at our booth.
  • 2:05 - 2:10
    We'll also have a small raffle at our booth in 45 minutes.
  • 2:10 - 2:12
    Or not quite, in 40 minutes.
  • 2:12 - 2:16
    So if you're interested in
    a plush Tux or an
  • 2:16 - 2:19
    Emser coffee mug or a Make subscription, feel free to stop by.
  • 2:19 - 2:21
    I'll make sure I finish on time so that
  • 2:21 - 2:24
    everyone can still come to our booth for the raffle.
  • 2:27 - 2:28
    Pimp Your Shell.
  • 2:28 - 2:32
    I've already seen that some people already have customized shell environments.
  • 2:32 - 2:36
    But let's start at the beginning.
  • 2:36 - 2:40
    Because such a nice terminal emulator as we use today
  • 2:40 - 2:42
    didn't always exist.
  • 2:42 - 2:46
    In the past, computers often didn't have their own displays or
  • 2:46 - 2:52
    keyboards, but rather had truly classic hardware terminals.
  • 2:52 - 2:55
    We see an example here, a VT100.
  • 2:56 - 3:00
    It was connected to the main computer
    so that I could
  • 3:00 - 3:04
    operate it somehow and not just feed it with punch cards.
  • 3:05 - 3:10
    So it was a bit more convenient to
    have a keyboard as an input option
  • 3:10 - 3:11
    and so that I could actually see something a screen.
  • 3:12 - 3:16
    These devices were
    simply connected
  • 3:16 - 3:20
    So that I could even operate the computers
    via a shell.
  • 3:20 - 3:27
    But then it was more or less
    replaced by PCs, where I then
  • 3:27 - 3:30
    built the actual computer into boxes.
  • 3:33 - 3:36
    So now you work
    with terminal emulators.
  • 3:36 - 3:40
    These are virtual devices that are
    mapped in software.
  • 3:40 - 3:43
    You may be familiar with this if you
    take a look around in the DevTree.
  • 3:43 - 3:47
    There I see DevTTY 0 to something.
  • 3:47 - 3:53
    I see my PTYs, i.e. my
    virtual ones from the graphical interface.
  • 3:53 - 3:56
    If I start the GNOME Terminal, for example, I get
  • 3:56 - 4:02
    a corresponding virtual terminal,
    which isn't a direct terminal.
  • 4:03 - 4:07
    So, the first graphical emulator
    that existed was X-Term.
  • 4:08 - 4:12
    I could start it in my X server and then also had a corresponding option for issuing shell commands in my
  • 4:12 - 4:16
    graphical interface.
  • 4:16 - 4:19
    A few more examples are
    listed here: the console, one could
  • 4:19 - 4:22
    also mention the GNOME Terminal,
    and a few others that
  • 4:22 - 4:23
    I will also introduce again.
  • 4:23 - 4:26
    The Windows Terminal is, of course, also a terminal emulator.
  • 4:26 - 4:29
    or even iTerm from macOS.
  • 4:31 - 4:34
    So that's about terminals, now we're talking about shells.
  • 4:34 - 4:40
    This is the user interface of Unix-like operating systems.
  • 4:40 - 4:45
    Linux, BSD, and the like. It's used to execute commands.
  • 4:45 - 4:49
    On the one hand, there are built-in commands, shell build-ins, such as the
  • 4:49 - 4:52
    echo command to display something.
  • 4:52 - 4:56
    Or simply, I call
    third-party programs, such as
  • 4:56 - 4:59
    for example, an editor, VI.
  • 4:59 - 5:07
    or I execute an IP command,
  • 5:07 - 5:09
    a Git clone, or whatever.
  • 5:10 - 5:13
    But shells can do a little more than just run programs.
  • 5:14 - 5:16
    Shells can also work with variables.
  • 5:16 - 5:21
    I can define variables in the shell and then reuse them later.
  • 5:21 - 5:24
    You might also be familiar with it from the
    environment variables I have,
  • 5:24 - 5:27
    accessible via the ENDS command.
  • 5:27 - 5:33
    We can also take a quick look at what kind of
    environment variables there are, but I can
  • 5:33 - 5:34
    of course, also define my own.
  • 5:34 - 5:37
    I can export them so that
    they are then also available for other started
  • 5:37 - 5:39
    shells.
  • 5:40 - 5:45
    I can create linked conditions,
    I can create simple if-then statements,
  • 5:45 - 5:49
    but I can also create loops,
    so that things are simply executed
  • 5:49 - 5:50
    100 times.
  • 5:51 - 5:57
    A shell offers me such things
    and I can, and this is important when
  • 5:57 - 6:02
    combining commands, use the output
    of one command as input
  • 6:02 - 6:03
    for the next command.
  • 6:03 - 6:08
    This is done via the so-called pipe
    or I redirect the output to a
  • 6:08 - 6:11
    file using output redirection.
  • 6:12 - 6:17
    The Born shell was used for a long time,
    still found today
  • 6:17 - 6:23
    as BIN-SH on most systems
    So the classic was eventually
  • 6:23 - 6:27
    replaced by Bash, and I've listed a few more here.
  • 6:27 - 6:32
    The Cornshell, Dash, which was standard in
    Ubuntu for a while.
  • 6:32 - 6:33
    I don't even know if that's still the case.
  • 6:33 - 6:36
    I haven't had Ubuntu in my hands for a while.
  • 6:36 - 6:38
    ZSH or Phish as further examples.
  • 6:38 - 6:41
    I'll show one or two more again later.
  • 6:42 - 6:46
    Then we have the CLI, the command line interface, where I have
  • 6:46 - 6:48
    a line of text as input.
  • 6:49 - 6:52
    Which then executes the commands for me, interpreting them accordingly.
  • 6:54 - 6:58
    It's not just available as a shell,
    but also in interpreted languages, for example.
  • 6:58 - 7:00
  • 7:00 - 7:03
    For example, if I now call Python, I also have Python
  • 7:03 - 7:07
    An interactive way to enter it
    via the command line.
  • 7:07 - 7:12
    In contrast, the graphical user interface, which then
  • 7:12 - 7:16
    I think Firefox or other graphical tools, my presentation tool here, which
  • 7:16 - 7:23
    is used, and of course
    also graphical terminal emulators,
  • 7:24 - 7:27
    so I don't have to switch.
  • 7:27 - 7:29
    A quick recap of Shell history.
  • 7:29 - 7:35
    1941 was the first time, with the
    Zuse Z3, that it was possible
  • 7:35 - 7:41
    to program computers using a keypad. Before that, it was really only possible
  • 7:41 - 7:43
    using appropriate circuitry.
  • 7:45 - 7:54
    The first real terminal that was
    available was the Datapoint 3300, also known as
  • 7:54 - 7:59
    glass teleprinter. I could then
    connect it and then control the connected
  • 7:59 - 8:01
    mainframe computers accordingly.
  • 8:02 - 8:05
    The first original Unix shell
    was the Thomson shell.
  • 8:05 - 8:10
    And then a few years later, the Born shell came along.
  • 8:10 - 8:16
    was replaced primarily by Bash from 1987 onwards.
  • 8:16 - 8:19
    For a long time, it had simply been the default shell in many distributions.
  • 8:19 - 8:21
    Things are a little different these days.
  • 8:22 - 8:27
    Different distributions use
    different default shells.
  • 8:30 - 8:33
    Then, yes, more history about the shell.
  • 8:33 - 8:38
    Shell History is a built-in function within the shell and
  • 8:38 - 8:42
    helps me to revisit commands that have already been executed.
  • 8:43 - 8:47
    How many commands are saved
    is configurable via an
  • 8:47 - 8:53
    environment variable called HisSize. This
    is usually set to 500 or 1000.
  • 8:53 - 8:58
    lines that are saved, which
    I can then easily call up again.
  • 8:58 - 9:02
    I can also display the history
    with the command History.
  • 9:04 - 9:07
    It then shows me all the commands
    with a corresponding number.
  • 9:07 - 9:10
    When it was executed, it simply counts up.
  • 9:10 - 9:14
    And then I can directly execute the command again by entering
    an exclamation mark followed by the
  • 9:14 - 9:18
    corresponding number.
  • 9:18 - 9:23
    Or even the last command entered
    simply via the double exclamation mark
  • 9:23 - 9:26
    For example, if I forgot to
    enter sudo before installing a package,
  • 9:26 - 9:30
    and then I'm not asked for the password somehow
    via Polkit or something,
  • 9:30 - 9:35
    then I can simply
    do, exclamation mark, exclamation mark
  • 9:35 - 9:39
    and then it will execute the last command. Run the command
    again with sudo in front of it, ask me
  • 9:39 - 9:43
    for my sudo password, and
    great, I can install the package.
  • 9:45 - 9:49
    And then we're talking about shell aliases. That's
    the first thing I'd like to show you
  • 9:49 - 9:50
    again.
  • 9:50 - 9:55
    You may be familiar with this: the LL is often preconfigured in the
  • 9:55 - 9:59
    distribution, which then gives me a long listing, which allows me to
  • 9:59 - 10:02
    not only see the file names, but also the permissions,
  • 10:02 - 10:08
    the corresponding timestamps, the
    number of hard links, and so on.
  • 10:08 - 10:12
    And I can configure these aliases very easily on the fly. I
  • 10:12 - 10:16
    simply enter "Alias," then I enter
    the name for my alias and then
  • 10:16 - 10:20
    following the equal sign
    the command I want to alias.
  • 10:20 - 10:24
    It's a very, very practical thing,
    because especially complex, relatively long commands
  • 10:24 - 10:29
    like a Git checkout from
    a specific branch or something like that.
  • 10:29 - 10:32
    tend to be a bit longer, and
    of course, it's nicer if I can simply make it a bit shorter, and
    I do that using an alias that I carry
  • 10:38 - 10:40
    5.000 / 5.000
    920
    I then create one—of course, I don't do this ad hoc, but I enter it
  • 10:41 - 10:47
    in my shell configuration file
    in the etc-profile in the etc-bashrc in
  • 10:47 - 10:51
    the .bashrc in my home directory
    or .zshrc, depending on
  • 10:51 - 10:53
    which shell I'm using
  • 10:56 - 11:00
    And these shell aliases are
    a very, very nice thing.
  • 11:00 - 11:02
    This will allow me to make things shorter.
  • 11:02 - 11:06
    I'll show you soon, when I've updated my ZSH configuration with a few plugins, that there are often quite a few aliases involved.
  • 11:12 - 11:16
    Then there are shell functions.
    So I can define things that I have
  • 11:16 - 11:19
    programmed in the shell as functions.
  • 11:20 - 11:24
    So that I can then call them like a normal external command.
  • 11:25 - 11:29
    Then I simply specify the name
    of the function I have defined.
  • 11:29 - 11:33
    And then I can simply use it.
  • 11:33 - 11:37
    This function, which I listed here as an example, the prefix,
  • 11:37 - 11:40
    You'd better not run it.
  • 11:40 - 11:42
    What does the whole thing do at this point?
  • 11:42 - 11:46
    This defines a function,
    those are the first three characters
  • 11:46 - 11:47
    called a colon.
  • 11:49 - 11:52
    So I define a function, and it's simply called colon.
  • 11:52 - 11:55
    Then the contents of the function appear in the curly braces.
  • 11:55 - 11:57
    And what does this function do?
  • 11:57 - 12:02
    It calls the command or function
    colon and then pipes the
  • 12:02 - 12:04
    output to colon again.
  • 12:04 - 12:07
    That means I have an endless chain of ever-increasing
  • 12:07 - 12:11
    colon functions that are called
    and at some point my
  • 12:11 - 12:14
    system simply crashes because the resources are exhausted.
  • 12:15 - 12:19
    I close the whole thing with
    the semicolon, which is the end
  • 12:19 - 12:21
    of the function definition, and
    then I call it at the end.
  • 12:21 - 12:24
    So if you enter that, it will only take a few seconds.
  • 12:24 - 12:26
    and your computer will be unusable.
  • 12:27 - 12:30
    Of course, that's not a great practical use case,
  • 12:30 - 12:31
    but that's how you saw it.
  • 12:31 - 12:34
    I don't have it here as a sticker for nothing, I think.
  • 12:37 - 12:44
    Okay, then shell plugins so that I don't have to do everything myself by hand.
  • 12:44 - 12:49
    Of course, I can also rely on functions and aliases
  • 12:49 - 12:52
    that people have already done and published.
  • 12:52 - 12:54
    For example, on GitHub.
  • 12:54 - 12:59
    And so that I can easily
    reuse it, there are so-called
  • 12:59 - 13:01
    plug-in managers for the shell as well.
  • 13:01 - 13:06
    The most well-known, oh, my ZSH, that was
    the first major plug-in manager.
  • 13:07 - 13:12
    And I still use it today. It has
    some nice features, gives
  • 13:12 - 13:17
    me the ability to very, very easily
    define a theme for my shell prompts.
  • 13:17 - 13:22
    and also gives me information about other plugins that I
  • 13:22 - 13:26
    can be easily activated, then nice
    things come with it, like auto-completion
  • 13:26 - 13:30
    where you provide your own functions
    or even a whole bunch of aliases
  • 13:30 - 13:31
    I work a lot with Kubernetes.
  • 13:31 - 13:35
    And all the kubectl commands, I might not want to
  • 13:35 - 13:41
    execute them forever, but I just do
    something like that, then use my shortcut.
  • 13:42 - 13:47
    There are now also similar plugin managers for the
    also widely used Bash and
  • 13:47 - 13:51
    Fish shells, and there are also similar plugin managers for a few
    other shells.
  • 13:54 - 13:57
    And that brings us
    a bit to the Beautiful Prompts.
  • 13:57 - 13:59
    I'll show you that in a moment.
  • 14:00 - 14:02
    So ein Share Prompt ist natürlich
    konfigurierbar Häufig ist das
  • 14:02 - 14:06
    einfach User at Host und dann habe
    ich da noch so ein Zeichen und dann
  • 14:02 - 14:06
    simply User at Host and then
    I have another character there and then
  • 14:06 - 14:07
    geht mein eigentlicher Prompt los.
    5.000 / 5.000
    13:59,625 --> 00:14:02,265
    A share prompt like this is, of course, configurable. Often, it's
  • 14:06 - 14:07
    my actual prompt starts.
  • 14:07 - 14:09
    So then I can type.
  • 14:09 - 14:12
    But I can also record further information with it.
  • 14:12 - 14:16
    For example, I can configure it so that the hostname is now
  • 14:16 - 14:19
    only displayed when I'm on a host via an SSH connection and
  • 14:19 - 14:23
    not displayed on my localhost, or when I'm somewhere via SSH, I can then color the whole thing red so that I know
  • 14:23 - 14:27
    I'm not on the current system.
  • 14:27 - 14:30
    I have to be a little careful when
    I do a reboot, not to
  • 14:30 - 14:33
    restart any productive server all at once.
  • 14:33 - 14:36
    It actually happened to me once at a customer's, and it wasn't great.
  • 14:39 - 14:43
    I can also see additional information,
    for example, the time or
  • 14:43 - 14:49
    even dynamic information,
    for example, if I'm in a Git tree.
  • 14:50 - 14:54
    Then I can see which branch I'm on, where I stand with the upstream,
  • 14:54 - 15:00
    because I have any uncommitted stuff in there, am I ahead of
  • 15:00 - 15:04
    or behind the upstream, I can display all that stuff beautifully
  • 15:04 - 15:09
    and that via... Even with
    graphical symbols so that I can have
  • 15:09 - 15:15
    a Git logo in there or I've also configured it in ZSH like this
  • 15:15 - 15:19
    so that I have the distribution logo at the beginning of the line, like a Fedora logo.
  • 15:19 - 15:23
    Or on the Mac, I have
    a little apple next to it.
  • 15:23 - 15:25
    For Kubernetes, I can
    create the Kubernetes logo
  • 15:25 - 15:26
    or, of course.
  • 15:27 - 15:30
    Put in a beautiful penguin.
  • 15:30 - 15:35
    In order for the shell to display such characters, I also need a
  • 15:35 - 15:39
    font that supports the whole thing.
    These are the so-called nerd fonts.
  • 15:39 - 15:44
    There are a whole host of fonts,
    which often also have all these
  • 15:44 - 15:48
    symbols in them, so that I can make my
    Share prompt really colorful and
  • 15:48 - 15:52
    nicely decorated with symbols.
  • 15:53 - 15:55
    Are there a few themes for that too?
  • 15:56 - 15:59
    They preconfigure it for me
    and customize it for me.
  • 15:59 - 16:05
    These are simply themes
    from OhMyZSH, where I simply
  • 16:05 - 16:09
    found the names cool and the power level
    10K, which I'm still using.
  • 16:10 - 16:12
    At least for me in the Z-Shell.
  • 16:13 - 16:17
    I'll also show you the Starship prompt, which I set up in
  • 16:17 - 16:19
    Bash.
  • 16:20 - 16:22
    It's very easy to install,
    very easy to configure.
  • 16:25 - 16:30
    Then there are also a few newer shells that simply offer even more features
  • 16:30 - 16:35
    than classic Bash,
    for example, extended file globbing,
  • 16:35 - 16:40
    things like inline tab completion,
    auto-suggestions, and things like that.
  • 16:40 - 16:43
    As an example, I would like to use ZSH, which was
  • 16:43 - 16:47
    the first shell that was truly modern and offered an expanded range of
  • 16:47 - 16:49
    features.
  • 16:50 - 16:53
    Phish is a bit more suitable for beginners
    because it simply
  • 16:54 - 16:58
    offers similar functionality to
    Z-Shell, but is a bit
  • 16:58 - 17:00
    better preconfigured.
  • 17:02 - 17:06
    Or I've listed Elvish here, but I haven't used it myself yet.
  • 17:06 - 17:10
    It's also a relatively modern variant. There are also
  • 17:10 - 17:17
    a few specialized shells, for example, the Xon Shell as Python.
  • 17:17 - 17:21
    Shell, which is based on Python and is
    ultimately a superset of Python.
  • 17:21 - 17:24
    So for those who program very, very extensively or almost
  • 17:24 - 17:28
    exclusively with Python, this might be an alternative. I don't work with Python that much myself,
  • 17:28 - 17:33
    so I haven't used it yet.
  • 17:33 - 17:39
    Then there's the NuShell, which also takes a slightly different approach.
  • 17:41 - 17:45
    For example, if I run a LS
    or any other command
  • 17:45 - 17:49
    that has a relatively long output,
  • 17:49 - 17:53
    If I then only have a specific
  • 17:49 - 17:53
    information, some commands offer
    appropriate options to filter out exactly
  • 17:53 - 17:57
    the information I want, other commands
  • 17:57 - 18:00
    cannot do that, and if I then only have a
    specific information I want or
  • 18:00 - 18:03
    I want to reformat it, then I
    quickly have to use
  • 18:03 - 18:08
    external tools like Grab or AWK, if
  • 18:08 - 18:12
    want to swap it around, then it quickly becomes complicated,
    while the New Shell is a
  • 18:12 - 18:16
    A bit similar to PowerShell in terms of approach,
    where I can also see the output
  • 18:16 - 18:18
    as objects individually can address.
  • 18:18 - 18:22
    And this is exactly the concept that NuShell follows, where I can then create selectors directly with Wear.
  • 18:22 - 18:23
    It's definitely quite exciting.
  • 18:26 - 18:30
    I've taken a quick look at it. For everyday use, it's probably not
  • 18:30 - 18:33
    yet for me, but it does offer
    a few interesting features.
  • 18:33 - 18:36
    I also installed it and brought it along.
  • 18:36 - 18:42
    Or for SQL fans, Hoth Query, where I use SQL statements to
  • 18:42 - 18:44
    execute commands with my shell.
  • 18:45 - 18:47
    Also really exciting.
  • 18:48 - 18:53
    And then there are terminals. I'll show them now and then.
  • 18:53 - 18:56
    The classic, of course, is X-Term.
  • 18:56 - 19:00
    It's not really pretty, but it's
    very, very functional and does what it's supposed to.
  • 19:01 - 19:06
    But there are also other terminals that
    may be able to do a bit more,
  • 19:06 - 19:10
    that can also handle tabs,
    like the GNOME Terminal
  • 19:10 - 19:15
    or Konsole, iTerm,
    or even Thermos on Android.
  • 19:16 - 19:20
    If I want to have it as a dropdown,
    there are also
  • 19:20 - 19:24
    solutions for Jaguarke, Guarke, or
    Tilder, so that the shell then
  • 19:24 - 19:28
    simply opens dynamically via keystroke,
    for example, F10 or F12,
  • 19:28 - 19:30
    usually drops down from the top.
  • 19:31 - 19:34
    It's quite practical because I don't have to
    open a shell window,
  • 19:34 - 19:37
    but I basically always have it available behind
    the keyboard shortcut.
  • 19:37 - 19:42
    Then there's multiplexing, which
    I can then use to display multiple terminal windows
  • 19:42 - 19:47
    without having to
    deal with the Sundays of Screen or
  • 19:47 - 19:49
    Temux.
  • 19:50 - 19:52
    But that's also possible, of course.
  • 19:52 - 19:58
    And more modern terminals like Alacrity or
    Kitty, which I use myself, also offer such multiplexer functionalities
    that I can very, very
  • 20:01 - 20:04
    easily divide my shell window
    again.
  • 20:04 - 20:07
    I can arrange the shells in different layouts.
  • 20:07 - 20:11
    arrange them side by side without needing any additional tools.
  • 20:11 - 20:13
    for me, that's what the Kitty program does.
  • 20:16 - 20:21
    There's also the Warp Terminal,
    which offers a bit of
  • 20:21 - 20:27
    built-in AI, with which I can then
    also get suggestions. I
  • 20:27 - 20:28
    can actually ask questions.
  • 20:28 - 20:31
    Yes, how do I do that in Bash?
  • 20:31 - 20:37
    Which then talks to ChatGPT, I think, and looks up the answers for me.
  • 20:37 - 20:41
    Or relatively hyped, I am
    I also came across it on
    YouTube
  • 20:41 - 20:47
    GhostDeep. I want to bring the functionality of tools like Kitty
  • 20:47 - 20:52
    and it should be super fast.
  • 20:52 - 20:57
    I think I've installed it myself,
    but haven't really tested it yet.
  • 20:57 - 20:59
    I'm very happy with Kitty.
  • 21:02 - 21:07
    And before we say thank you, let's go back
  • 21:07 - 21:10
    and open a bell.
  • 21:11 - 21:13
    I'll do that, slide 4.
  • 21:14 - 21:16
    We have a bell here.
  • 21:16 - 21:19
    Is it legible if I type something here now?
  • 21:19 - 21:21
    That's fine, right?
  • 21:26 - 21:35
    You've already seen when I do something like this here, it's actually
  • 21:35 - 21:41
    via the ZSH Auto Suggestions and the ZSH
    Completion, which shows me directly here
  • 21:42 - 21:48
    First, the alias I assigned,
    the K for kubectl, so that I don't always have to type it out,
  • 21:48 - 21:52
    but simply
    K and then API Resources shows me
  • 21:52 - 21:56
    the API resources from Kubernetes
    and then I search here
  • 21:56 - 21:58
    for the String Service Account.
  • 21:59 - 22:03
    Works pretty well so far, or something like that. If I now do a K
  • 22:03 - 22:06
    then we can also see here
    the last directory I
  • 22:06 - 22:08
    created is called CLT 2025.
  • 22:10 - 22:13
    If I want to see a little more, I can also
  • 22:13 - 22:17
    look here using Control R and then I can see
    here too what I have I
  • 22:17 - 22:21
    Because everything is listed here last,
    I can search it wonderfully.
  • 22:22 - 22:25
    I think that's pretty sexy.
  • 22:25 - 22:27
    Then I can, for example,
    look here for what
  • 22:27 - 22:29
    Brew has in it somehow.
  • 22:29 - 22:33
    We can see here that I also installed one or two things via Homebrew.
  • 22:33 - 22:37
    It just doesn't come directly from the Fedora package management.
  • 22:37 - 22:41
    We also see Fedora here, I'm
    in my home directory.
  • 22:41 - 22:44
    I can also see how long the last command took.
  • 22:44 - 22:48
    I can then also do nice things
    like... Like showing me whether
  • 22:48 - 22:50
    the last command was successful.
  • 22:50 - 22:54
    If I do something like that now, then we'll see, yes, it didn't find it.
  • 22:55 - 22:57
    That might not have been the best idea.
  • 22:57 - 23:00
    And I see the arrow is no longer green, it's red.
  • 23:00 - 23:04
    That also tells me directly that the last command was unsuccessful.
  • 23:04 - 23:08
    I can also configure it so that I can directly display the return value
  • 23:08 - 23:11
    of the last command.
  • 23:11 - 23:14
    If it's 0, everything's fine; if it's green, it's wonderful.
  • 23:14 - 23:17
    If it's red, then I might also want to know
  • 23:17 - 23:18
    what the return value is.
  • 23:18 - 23:22
    I wonder if that was an error in the shell because I mistyped the command, or if it's an error code from the command itself.
  • 23:22 - 23:26
    I can have things like that displayed.
  • 23:26 - 23:28
    I can have things like that displayed.
  • 23:28 - 23:33
    Here on the right side, I can also see which user I am and which host I'm on.
  • 23:34 - 23:35
    I see the current time.
  • 23:37 - 23:41
    These are all things like that, and
    for me, they mostly come
  • 23:41 - 23:43
    from OMAZSH plugins.
  • 23:47 - 23:49
    And where did I configure them?
  • 23:49 - 23:54
    I have them in... Minus again
  • 23:56 - 24:02
    A1 to the point ZS HAC.
  • 24:02 - 24:07
    Maybe I should also tell them again what I
  • 24:07 - 24:09
    want to grepe for here, that's
  • 24:16 - 24:21
    Exactly, here we can see in Plugins
    which plugins I have installed here.
  • 24:21 - 24:24
    I also had to reinstall a few things, for example
  • 24:24 - 24:27
    I think I had to install the autosuggestions later.
  • 24:27 - 24:29
    And we see, I have a few things here, for
  • 24:29 - 24:31
    Example of using Git.
  • 24:31 - 24:34
    I do a lot with Ansible, so I've installed something there too. I've installed
  • 24:34 - 24:39
    something for DNF. Because I'm on Fedora, which makes it a bit easier for me
  • 24:39 - 24:44
    so I don't have to run sudo dnf update or sudo dnf install
  • 24:44 - 24:48
    I don't have to do anything. I just say
    dnfi and then I specify the package
  • 24:48 - 24:49
    I want to install.
  • 24:49 - 24:51
    So I'm bringing a few aliases with me that will make things a little easier for
  • 24:51 - 24:54
    me.
  • 24:55 - 24:58
    It brings a lot of aliases
    with it, so I don't have to
  • 24:58 - 25:02
    complicatedly specify the brand
    and what I'm doing with Git.
  • 25:02 - 25:04
    Then, of course, I have something for
    kubectl.
  • 25:04 - 25:08
    OC is for OpenShift, and we'll see
    a few other things
  • 25:08 - 25:10
    that I have in here.
  • 25:11 - 25:14
    FZF is a great tool for this.
  • 25:14 - 25:17
    For this, I need to have FZF installed as a fuzzy finder.
  • 25:18 - 25:25
    And that allows me to do things like this advanced reverse search,
  • 25:25 - 25:31
    that I configured, which I showed with CTRL-R, so that I
  • 25:31 - 25:33
    then get a direct list
    with the things that I
  • 25:33 - 25:35
    displayed that were in there.
  • 25:37 - 25:40
    Likewise, the ZSH navigation tools
    and the auto-suggestions, as well as
  • 25:40 - 25:42
    and the ZSH syntax highlighting.
  • 25:42 - 25:45
    You can also see it a bit,
    if I enter a command here,
  • 25:45 - 25:49
    for example, mkdir, then
    we see that it's a wonderful green.
  • 25:50 - 25:53
    As long as it's not a command it recognizes,
    the whole thing is displayed in red.
  • 25:53 - 25:58
    and it's quite good. Nice, in any case.
  • 25:59 - 26:05
    The Colorize Output. That.
  • 26:05 - 26:10
    I definitely recommend anything
    that starts with ZSH and FZF.
  • 26:12 - 26:14
    The Fark, I don't know
    if you know it.
  • 26:14 - 26:17
    If I've entered a command incorrectly, I can say "Fark" and then
  • 26:17 - 26:19
    it will try to correct it for me.
  • 26:19 - 26:20
    There's also an auto mode.
  • 26:20 - 26:22
    That's just a gimmick.
  • 26:25 - 26:29
    I already said, I'm now
    here in Kitty, and I said he
  • 26:29 - 26:35
    can multiplex, it's very easy
    and I have a new shell here
  • 26:35 - 26:38
    inside, I can then also adjust the layout
    accordingly here and, for example, place them side by side, it's very practical
    I don't need Themux for that.
  • 26:45 - 26:48
    Okay, let's go back out and
    then we can take another quick look at the Starship point.
  • 26:48 - 26:50
  • 26:58 - 27:03
    in your line. It's very, very easy to configure, and I've
  • 27:03 - 27:04
    set it up in Bash.
  • 27:04 - 27:09
    So I'll just start a Bash
    and we can see here, I'm on here
  • 27:09 - 27:14
    I chose Penguin because I couldn't find the Kubernetes logo
  • 27:14 - 27:20
    and then I see Default on Default, in
    Default is of course, what is that?
  • 27:20 - 27:22
    This is my Kubernetes context. You
    will then see which user I am in,
  • 27:22 - 27:25
    which cluster I am logged in to,
    and which namespace I am in.
  • 27:25 - 27:27
    In this case, everything is now default.
  • 27:30 - 27:32
    Then I can also see here—I’ve expanded this a bit—
  • 27:32 - 27:39
    which shell I am in,
    and what my username is.
  • 27:39 - 27:44
    If I now switch to a directory
    where I...
  • 27:47 - 27:49
    have Git in there.
  • 27:49 - 27:51
    Let's take a look.
  • 27:52 - 28:05
    And then let's just take my Hyperlint Dots directory here.
  • 28:05 - 28:08
    We can also see which branch I'm in.
  • 28:08 - 28:12
    I can then also see the state of my
    branch and ultimately whether I'm in it.
  • 28:12 - 28:15
    I think that simply means
    there are things that have been marked.
  • 28:15 - 28:17
    We can take a look at that in the
    config right now.
  • 28:17 - 28:21
    The Starship config is very, very simple and very,
  • 28:21 - 28:22
    very nicely modular.
  • 28:25 - 28:28
    And we can take a look at them too. We'll find them
  • 28:28 - 28:32
    under config starship-tommel.
  • 28:45 - 28:49
    Up here, I've enabled Kubernetes, which then also tells me
  • 28:49 - 28:52
    what format the whole thing should have.
  • 28:53 - 28:56
    This ensures that the
    penguin is displayed, then my
  • 28:56 - 29:00
    Kubernetes user, my Kubernetes cluster,
    and the Kubernetes context.
  • 29:01 - 29:05
    Then there's something for terraforming, and
    then Shell and User, which shows me
  • 29:05 - 29:08
    which shell I'm in
    and which user I'm logged in as.
  • 29:08 - 29:10
    and then the Git status stuff.
  • 29:10 - 29:15
    We see beautiful icons here,
    but you can also customize them freely.
  • 29:24 - 29:26
    Okay, what else did we have?
  • 29:26 - 29:29
    I wanted to briefly show you the Nu Shell.
  • 29:29 - 29:33
    But I might have to
    look it up myself again.
  • 29:33 - 29:35
    the syntax. I call it with Nu.
  • 29:37 - 29:44
    And now I have to
    start it again very quickly.
  • 29:45 - 29:46
    I'm still here.
  • 29:50 - 29:52
    Oh God, oh God.
  • 30:03 - 30:07
    And then I can, for example,
    do something like this: LS-Wear-Size over
  • 30:07 - 30:13
    10 megabytes and then Sort by Modified
    without having to work with Grab and
  • 30:13 - 30:16
    Sort and any other shell tools.
  • 30:17 - 30:21
    Can I set such filters and sorting directly with NewShell?
  • 30:21 - 30:25
    And then get a completely different output than I'm used to from LS.
  • 30:25 - 30:28
    I can see it perfectly in the table here.
  • 30:28 - 30:32
    It's quite exciting. I haven't used it much myself yet, but I find it
  • 30:32 - 30:36
    very interesting, and I wanted to at least show it to you.
  • 30:38 - 30:41
    That's actually what I wanted to show you.
  • 30:42 - 30:43
    Do you have any questions?
  • 30:53 - 31:00
    Well, I also use a lot of aliases.
  • 31:00 - 31:04
    That's a Rust tool, a better LS.
  • 31:08 - 31:12
    But would that also work in this new shell, or is it a special
  • 31:12 - 31:14
    LS that's being referenced?
  • 31:16 - 31:18
    NewShell interprets
    the output differently.
  • 31:18 - 31:20
    So it would also work with...
    So would that work?
  • 31:20 - 31:21
    Yes.
  • 31:21 - 31:22
    Okay, that's what I wanted to know.
  • 31:22 - 31:22
    Thanks.
  • 31:27 - 31:28
    Any other questions?
  • 31:33 - 31:35
    Perhaps a brief
    note on the New Shell.
  • 31:36 - 31:38
    Very closely resembles PowerShell.
  • 31:38 - 31:41
    And if you look at how it works internally, they have something like that
  • 31:41 - 31:45
    the... I'd say, typed pipelines.
  • 31:45 - 31:49
    Relatively exciting, if you talk a lot, I'd say, you could
  • 31:49 - 31:51
    even about object orientation, somewhere like that.
  • 31:52 - 31:56
    Very exciting when you move away from the
    pure Bash, Shell, Dash environment
  • 31:56 - 32:02
    and a lot of, I'd say, intelligence into scripts like this
  • 32:02 - 32:03
    what we've just seen here.
  • 32:04 - 32:06
    The only disadvantage is,
    very much on the power level
  • 32:06 - 32:08
    in terms of syntax.
  • 32:17 - 32:23
    Does Alias ​​somehow expand the command by default?
  • 32:23 - 32:29
    So, that I type LL and press Tab and the command
  • 32:29 - 32:35
    which I have set as alias [is auto completed]?
    [Florian Winkler:] It depends, sometimes you have to
  • 32:35 - 32:40
    activate something for that. This is
    how it is with Kubernetes.
  • 32:40 - 32:43
    Since the auto-completion for Kubernetes
    works, where it then directly
  • 32:43 - 32:47
    requests the API, I also have to
    turn it on again for the alias Completion
  • 32:47 - 32:50
    How do I turn it on?
  • 32:50 - 32:51
    It doesn't work for me.
  • 32:55 - 33:04
    I should also have that in the
    ZSH-AC and
  • 33:06 - 33:17
    I'll pull that at the end, if I'm not very sad.
  • 33:17 - 33:21
    Okay, no, I don't seem to have that directly here.
  • 33:21 - 33:23
    The QCTL plugin does that for me.
  • 33:26 - 33:29
    Otherwise, I can
    just quickly find it.
  • 33:29 - 33:36
    Let's take this one, just open
    a new tab, k alias completion.
  • 33:43 - 33:47
    And there we see,
    after I've defined the alias,
  • 33:47 - 33:53
    I still need the complete-f command, so that it
    starts kubectl when I use the
  • 33:53 - 33:57
    alias. Then the built-in kubectl completion also works.
  • 33:57 - 33:59
    Okay, thanks.
  • 34:05 - 34:06
    Any further questions?
  • 34:08 - 34:10
    If not, thank you very much.
  • 34:10 - 34:13
    Then we'll all make it to the raffle.
    [Translated by Tom Süßenbach (KYBS2001 course assignment at JYU.FI)]
Title:
https:/.../clt25-11-deu-Pimp_your_shell_hd.mp4
Video Language:
German
Duration:
34:24

English subtitles

Revisions