You don't have to, but there are open source shells A shell is a program that acts as an interface between you and the operating system; you type commands, and it interprets and runs them out there that have really cool functionality to make working from the terminal better.
Modern Macs already works with zsh, while Windows users will want to try this with WSL.
Copy the installation script from their website.
sudo apt install zsh, and then
paste the oh-my-zsh script.
During the installation, it will ask if you want to make oh-my-zsh your default. Type Y for yes (you can always change your shell in the future).
.zshrc with your text editor of
choice. E.g. code .zshrc to open with
VS Code
ZSH_THEME to "random"
Now, everytime you open a new terminal, the theme will
change to something random. It will always tell you what
theme is being used, so if you like it, you can set your
ZSH_THEME in .zshrc.
.zshrc with your text editor of
choice. E.g. code .zshrc to open with
VS Code.
ZSH_THEME to your
chosen theme.
Oh-my-zsh already comes with plugins that are worth exploring. Click here to view their documentation.
To enable these plugins, open .zshrc and on line 73,
add the plugins you want to enable. E.g.
plugins=(git z sudo)
| Plugin | What it does |
|---|---|
| z | Jump to frequently used directories by typing
z folder_name
|
| command-not-found | Suggests packages when a command isn't found |
| sudo | Double-tap "Esc" to prepend sudo to the
last command. Best for Linux/WSL. |
There are also community, custom plugins people create that you can find through searching online. These will always have installation guides, so follow those carefully. The bellow recommendations can be found if you search for them in context with oh-my-zsh.
| Plugin | What it does |
|---|---|
| zsh-autosuggestions | Shows ghost-text suggestions as you type |
| zsh-syntax-highlighting | Colors commands as you type |
| zsh-completions | Expands tab completion |
You can create your own commands that are like mini scripts. For
example, you can make zshconfig a command in the
terminal that opens .zshrc with VS Code.
Go to your .zshrc and at the bottom of the file, you'll
see a commented-out section on aliases. Try adding this line to
your config.
alias zshconfig = code ~/.zshrc
You may have to restart the terminal or reset your computer depending on what you install.
Instead of using cat in the terminal to read a simple
text file, try installing lolcat. Below are the Mac and Linux/WSL
commands.
brew install lolcat
sudo apt install lolcat
This will show you your file system in a hierarchical tree in the terminal.
brew install tree
sudo apt install tree
Your zsh config file executes line-by-line, so you can have it
execute a shell script! Try it out first by copying this line to
the botton of your .zshrc file.
echo "Let's get to work!"
Now open up a new terminal and you'll see your welcome message!
Take this a step further and create an ASCII art script as your welcome message.
welcome.sh. This is how you
typically name script files. Also, make sure you place it in a
folder that you can find. Suggestion: make a directory called
scripts in your home directory.
#!/bin/zsh
ascii_art='
copy paste something here
'
while IFS= read -r line; do
echo "$line" | cat
sleep 0.008
done <<< "$ascii_art"
ascii_art. The white space in the script
file will not be ignored, so make sure the ASCII art looks
exactly how you want to see it.
~/scripts). Run chmod +x welcome.sh to
change the permissions of the file to executable.
.zshrc and add this line to the
bottom: bash ~/scripts/welcome.sh. Save, and open
up a new terminal!
Always check compatibility because not all open source applications will work seamlessly across Mac and Linux/WSL.
| Lesson |
|---|