bash to zsh in terminal issue
I tried to change bash to zsh, did the update command, and typed my password but it responded with -bash: .: filename argument required What do I need to type in next?
I tried to change bash to zsh, did the update command, and typed my password but it responded with -bash: .: filename argument required What do I need to type in next?
Here is what you need to do in order to switch to the Zsh shell from Bash: In the Terminal application:
sudo /usr/bin/chsh -s /bin/zsh
Since Zsh does not read the Bash startup dotfiles, nor does it create its own, you will need to create the $HOME/.zshrc file minimally configured with your PATH and PS1 prompt exports. Zsh's PS1 prompts are different syntax from Bash. If you have already done this, then ignore the following HERE script. Otherwise, copy/paste this into the Terminal and follow it with a return to run it:
<<"EOF" > ~/.zshrc
export PATH=".:/usr/local/bin:${PATH}"
PS1="%m: %~ %% "
EOF
Once that is done, you can set your PATH and PS1 prompt in the current Terminal session instead of quitting and restarting Terminal:
source ~/.zshrc
There is available documentation on the Zsh prompt and Zsh shell in general.
One indispensible function that you should put in your $HOME/.zshrc file is the following:
hgrep () { fc -Dlim "*$@*" 1 }
This will let you locate any prior command or part of a command line that you may have entered earlier. Let's say you opened a PDF from the command line 20 commands ago as:
open -a Preview kant_jacobian_3u.pdf
You find that command with:
hgrep Preview
hgrep kant
Additional reading:
I have had some really good links to Zsh material but many of the important ones have either become dead links, or saturated with clickbait advertisements.
Here is what you need to do in order to switch to the Zsh shell from Bash: In the Terminal application:
sudo /usr/bin/chsh -s /bin/zsh
Since Zsh does not read the Bash startup dotfiles, nor does it create its own, you will need to create the $HOME/.zshrc file minimally configured with your PATH and PS1 prompt exports. Zsh's PS1 prompts are different syntax from Bash. If you have already done this, then ignore the following HERE script. Otherwise, copy/paste this into the Terminal and follow it with a return to run it:
<<"EOF" > ~/.zshrc
export PATH=".:/usr/local/bin:${PATH}"
PS1="%m: %~ %% "
EOF
Once that is done, you can set your PATH and PS1 prompt in the current Terminal session instead of quitting and restarting Terminal:
source ~/.zshrc
There is available documentation on the Zsh prompt and Zsh shell in general.
One indispensible function that you should put in your $HOME/.zshrc file is the following:
hgrep () { fc -Dlim "*$@*" 1 }
This will let you locate any prior command or part of a command line that you may have entered earlier. Let's say you opened a PDF from the command line 20 commands ago as:
open -a Preview kant_jacobian_3u.pdf
You find that command with:
hgrep Preview
hgrep kant
Additional reading:
I have had some really good links to Zsh material but many of the important ones have either become dead links, or saturated with clickbait advertisements.
bash to zsh in terminal issue