After using Bash for years on Debian, Ubuntu, and Linux Mint, when I first came across Zsh on Kali Linux, it was like a new world just opened in front of me.Syntax highlighting, command suggestions, and all the gorgeous colors made me rethink my decision to ignore the command line.I had plenty of reasons to replace Bash with Zsh.
Add How-To Geek on Google Add as Preferred Source Follow on Google Discover The second shock came when I learned I could extend Zsh even further, using a framework called Oh My Zsh.Together with Zsh and Oh My Zsh, I knew that I was in for a treat in the terminal.Kali Linux handed me Zsh without me even asking.
I was only interested in the distro but ended up with my favorite shell Those of you who don't know about Kali Linux, it's a specialized Linux distro meant for learning cybersecurity.I installed it because I wanted to play some CTFs and tinker with security tools.When I first opened the terminal, I was delighted.
Kali made Zsh its default shell back in its 2020.3 release, at least on its desktop and cloud images.The first thing I noticed was the prompt, which sat on two lines.When I started typing, things got more interesting.
Gray text appeared ahead of my cursor, and commands changed color as I typed them.It felt like the terminal was paying attention to me for the first time.Kali had solid reasons for the switch, too.
Kali's release notes explain that Bash can do a lot, but Zsh lets you do even more.They also considered fish, a shell many people love, but skipped it because it isn't POSIX-compatible.In simple terms, many common one-liners just wouldn't work there.
The suggestions sold me before anything else Gray text that remembered my commands did more than any cheat sheet For me, the autosuggestions were a total breakthrough.Especially for navigating long nested folders.In my experience, there were a few directories I visited a lot.
It was also helpful for very specific long commands with hard-to-remember flags.Shortly after, I found myself pressing Tab to get more suggestions and the right arrow key to complete them in the terminal.I didn't have to memorize or repeatedly type my frequently used commands anymore.
The suggestions you get are based on recency.In other words, the first suggestion you receive is the latest command you used starting with those letters.The colors did the other half of the job.
Syntax highlighting marks up your command while you type.That way, you can review it before running it.A misspelled command stands out right away, instead of failing after I press Enter.
Here's the funny part, though.Neither of these two features is built into Zsh itself.Both are separate plugins, zsh-autosuggestions and zsh-syntax-highlighting.
Kali bundles them into its default Zsh setup.So the add-on that convinced me to learn the terminal was really a pair of add-ons I never installed myself.Oh My Zsh is where the real gem lies Making the stock Zsh even more powerful Previously, I made the Windows Terminal look cool using Oh My Posh.
So, when I learned about Oh My Zsh, I got excited.I quickly installed it using the official script: sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)" With over 300 optional plugins and well over a hundred themes, this community-driven framework was the missing puzzle piece I needed to manage my Zsh configuration.One heads-up, though.
Right after installation, I found that the syntax highlighting and autosuggestions were not working anymore.That's because the installer renames your existing .zshrc file to .zshrc.pre-oh-my-zsh.On Kali, that old file is what loads the suggestions and colors, so I had to bring those lines back into the new config.
Close Then I started exploring the plugins and themes.I was amazed by how detailed each plugin's documentation was in its GitHub README.Using them was pretty straightforward.
All I had to do was add the plugin name in the configuration file.To change themes, I just updated the theme name in use.Some of the plugins deserve permanent spots A handful of small add-ons that will change your everyday work Once I was settled in the framework, I started searching for some useful plugins.
There are so many on the list that it was hard to locate some I needed at first.Since I didn't want to bloat my setup, I started with a few.git As a programmer, I need to touch Git almost every day.
So, this one was a must.It adds a long list of short aliases for common commands.For example, gst runs git status, and gcmsg runs git commit --message.
Even better, the README lists the full command behind every alias, so you pick up Git's own flags along the way.sudo If you ever type a long command and realize you didn't add sudo in front of it, you don't have to go back and add it.Press Esc twice and this plugin will add sudo at the front.
zoxide Typing long folder paths gets old fast.zoxide calls itself a smarter cd command.It remembers the directories you use most often.
So instead of typing a full path, you type z followed by part of the folder's name.python I write Python code a lot.Whenever I need to start a project, there's a lot of setup needed.
Now this plugin handles it easily.Typing mkv creates a virtual environment in the current folder, and vrun activates it.There's also pyclean, which deletes bytecode and cache files.
The terminal doesn't feel like a stranger anymore When I think about it, the terminal first seemed scary because so many commands and flags were thrown at me at the same time.Eventually, I found many alternative CLI tools, time-saving terminal tricks, and, of course, a new shell that responds to me.All paired together helped me conquer the command line.
Read More