What is zsh in linux




















So, if you are planning on writing a script that you want many developers to easily be able to run then I'd recommend that you go with Bash. However, this shouldn't stop you from using Z shell if your end goal is more suited to Z shell. Finding the right solution to a problem is much more important than just using what's popular, so keep that in mind as well. Although Bash is much more popular, that doesn't mean Z shell is without any useful features of its own.

It's actually heavily praised for its interactive use, because it's more customizable than Bash. For example, the prompts are more flexible. It can display a prompt on the left and another on the right side of the screen, much like vim's split screen. The auto-completion is also more customizable and is actually faster than Bash's.

To give you a better sense of what kind of features Z shell has, here is a list of things that you will have access to when using Z shell over Bash:. There are also a bunch of features that are present in the Bash terminal but are absent from almost all of the other shells. Here are a few of them as well:. Check out our hands-on, practical guide to learning Git, with best-practices, industry-accepted standards, and included cheat sheet.

Stop Googling Git commands and actually learn it! It's difficult to say which shell is actually better. It all really depends on your own preferences and what you actually want to do with the shell. Here, the error word will be displayed by red color and the correct word will be displayed by green color. The looks of the shell prompt can be changed by using different themes and plugins.

Both bash and zsh shells have many types themes for changing the look of the shell. How theme can be used in bash and zsh shell is shown in the next part of this article. You have to install git to install any bash theme. Run the following command to install git package.

After installing the git , run the following command to make a clone of Bash-it template. Run the following command to install Bash-it template after cloning it. The following prompt will appear in the terminal after installing the template properly.

Now, close the terminal. You will see the same bash prompt whenever you open the terminal. Many themes are available for bash-it template those display bash prompt in different ways. Like bash, zsh shell has many themes. One of the zsh themes is oh-my-zsh. Run the following command to install this theme for zsh shell. It will ask for the root password to complete the installation process. The following output will appear after completing the installation process.

The following arrow symbol will appear after setting this theme. Wildcard expansion can be used in bash in different ways without any setting. Then you can launch Zsh by typing:. The first time you launch Zsh, you're asked to choose some configuration options. These can all be changed later, so press 1 to continue.

At first, Zsh feels a lot like using Bash, which is unmistakably one of its many features. There are serious differences between, for instance, Bash and Tcsh, so being able to switch between Bash and Zsh is a convenience that makes Zsh easy to try and easy to use at home if you have to use Bash at work or on your server. It's the small differences that make Zsh nice. First, try changing the directory to your Documents folder without the cd command.

It seems too good to be true; but if you enter a directory path with no further instruction, Zsh changes to that directory:. That renders an error in Bash or any other normal shell. But Zsh is far from normal, and this is just the beginning. When you want to find a file using a normal shell, you probably resort to the find or locate command.

At the very least, you may have used ls -R for a recursive listing of a set of directories. Zsh has a built-in feature allowing it to find a file in the current or any other subdirectory. For instance, assume you have two files called foo. One is located in your current directory, and the other is in a subdirectory called foo. In a Bash shell, you can list the file in the current directory with:.

To list both, you must use the -R switch, maybe combined with grep :. And you can use this syntax with any command, not just with ls. Imagine your increased efficiency when moving specific file types from one collection of directories to a single location, or concatenating snippets of text into a file, or grepping through logs.

Tab completion is a power-user feature in Bash and some other shells, and it took the Unix world by storm when it became commonplace. Instead, they could just press the Tab key when they entered enough of a unique string. It's fast, it's simple, it's efficient. It also confirms a path exists; if Tab doesn't complete anything, you know you're looking in the wrong place or you mistyped part of the path. However, if you have many directories that share five or more of the same first letters, Tab staunchly refuses to complete.

While in most modern terminals it will at least reveal the files blocking it from guessing what you mean, it usually takes two Tab presses to reveal them; therefore, Tab completion often becomes such an interplay of letters and Tabs across your keyboard that you feel like you're training for a piano recital.

Zsh solves this minor annoyance by cycling through possible completions. Wildcards behave differently in Zsh than what Bash users are used to.

First of all, they can be modified. For example, if you want to list all folders in your current directory, you can use a modified wildcard:. To list just the files, use.



0コメント

  • 1000 / 1000