Questions tagged [zsh]

zsh is a shell designed for interactive use, although it is also a powerful scripting language. Many of the useful features of bash, ksh, and tcsh were incorporated into zsh; many original features were added.

Zsh is a Unix shell used as an interactive login shell as well as a powerful command interpreter for shell scripting.

Zsh has been improved over time, with many of the useful features of other shells like bash, ksh and tcsh being borrowed and incorporated into zsh.

References:

330 questions
129
votes
8 answers

How to set up aliases in zsh?

I know that in bash you can set up aliases in a .bash_aliases file, so that the command you type doesn't need to be a command stored in the binaries in the system. Is there any way I can get aliases into zsh?
Thomas Ward
  • 74,764
35
votes
9 answers

oh my zsh for the root and for all user

I have installed zsh and I am using Oh My ZSH plugins. Everything works fine, but when I become a root user, it changes to the default zsh theme. What should I do to make the Oh My ZSH configuration as the default zsh for all users including root? I…
Tummala Dhanvi
  • 1,821
  • 3
  • 21
  • 34
27
votes
5 answers

Configuring to detect if a command does not exist, suggest installation

Can the zsh shell be configured to show what bash shows when a command does not exist, similarly to this: kahless:~$ sysv-rc-conf The program 'sysv-rc-conf' is currently not installed. You can install it by typing: sudo apt-get install…
Thomas Ward
  • 74,764
22
votes
2 answers

Clear the characters before the current cursor position in Zsh

In bash pressing CTRL + U clears the characters on the line before the current cursor position while in zsh this will clear the entire line. How do I clear the characters on the line before the current cursor position by pressing CTRL + U in zsh?
menteith
  • 271
11
votes
4 answers

Reset Zsh config?

Yesterday I installed Zsh, and tried to configure some things, but somehow everything is messed up. A lot of commands do not work, I've done PROMPT in ~/.zshrc but it does not work correctly either. For example when I am trying to search for…
8
votes
4 answers

Enable Zsh prompt username

So I just installed Zsh, and it shows for each command arrow and then ~. How do I enable my username@computername or something similar? I am reading https://wiki.archlinux.org/index.php/zsh but cannot figure this out. That's how it looks now:
7
votes
2 answers

How do I make named directories permanent in zsh and how do I edit them. Also what is the best place to look for documentation.

I just installed zsh and oh-my-zsh and I would like to use the named directories feature, i.e. % hash -d foo=/etc % echo ~foo /etc However, when I restart my console, these settings are gone. How do I make them permanent? How do I edit them if,…
Zuabi
  • 181
3
votes
1 answer

Syntax in HISTORY_IGNORE?

I am trying to ignore some sensitive commands from being saved in history file in zsh. HISTSIZE=1000 # 1000 lines of history within the shell SAVEHIST=1000 # 1000 lines of history in…
mja
  • 998
3
votes
2 answers

Abbreviations possible in zsh?

Here is a simple thing I want to achieve. In the later part of a command, I want to use an abbreviation. Say, I want to ls ~/Documents but I just enter ls Docs and it expands 'Docs' to '~/Documents' How do I achieve it?
deshmukh
  • 4,061
3
votes
1 answer

Need help with variables like $current_dir, $user_host etc

I am pretty new to Linux so please bear with me here :) I want to customize my shell prompt (in zsh). Right now it looks like this (not written by me): PROMPT="${user_host} ${current_dir} ${rvm_ruby} %B$%b " Now what are these variables…
AlphaOmega
  • 1,423
3
votes
2 answers

Getting defining function based on alias `z' error everytime open the terminal

Getting this bellow error every time when opening my terminal (ZSH using) (eval):10: defining function based on alias `z' (eval):10: parse error near `()' Also why getting this error after every time execute anything via terminal bgnotify_end:5:…
Ferdous90
  • 31
  • 5
3
votes
1 answer

Why does my machine display a different hostname?

I installed ZSH today and whenever I use it, my hostname changes. Outside of ZSH it is: mus@MyMachine However, when I run zsh it then displays as: mus@x86_64-conda_cos6-linux-gnu I have searched for a reason online but can't seem to find anything…
3
votes
1 answer

Shell Prompt Customization?

I have used oh_my_zsh (and tinkered with bash_it) on multiple systems and have generally been happy with it, though I hate it's auto-correction feature and generally turn it off. My usual shell is zsh and I really want just three things from my…
haziz
  • 2,929
3
votes
1 answer

zsh from /usr/local/bin/zsh doesn't recognize vendor-completions

I've built zsh from sources and installed it in /usr/local/bin/zsh. There was a packaged installation in /usr/bin/zsh as well. Now, when I install some other packages they occasionally put their completion file into…
Ivan Smirnov
  • 341
  • 2
  • 14
2
votes
1 answer

Create alias with oh my zsh

Bit confused here, within the ~/.zshrc file I have specified the following: # Set personal aliases, overriding those provided by oh-my-zsh libs, # plugins, and themes. Aliases can be placed here, though oh-my-zsh # users are encouraged to define…
1
2 3