1

I edited .bashrc file using vim. and then source it by command

source ~/.bashrc

or

. ~/.bashrc"

It show something like

/home/usr/.bashrc:16: command not found: shopt
/home/usr/.bashrc:24: command not found: shopt
/home/usr/.bashrc:108: command not found: shopt
/usr/share/bash-completion/bash_completion:35: parse error near `]]'
\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\$  

then I type adt (the alias) it worked. ,but when i closed the terminal & opened again it did not worked. showed zsh: command not found: adt** what should I do to fix it?

  • 2
    looks like you have errors in the .bashrc file .. can you open it and copy the text and edit your question pasting what your .bashrc file looks like .. seems you have errors on lines 16,24 and 108 and maybe other errors – John Orion Dec 15 '17 at 11:46
  • Are you sourcing this in bash? What does echo $0 $BASH_VERSION report? – muru Dec 15 '17 at 11:51
4

The errors message suggests that you aren't using Bash but Zsh as your shell. Use the file ~/.zshrc instead of ~/.bashrc.

  • Can I add alias in zsh file? or can I change bash as shell. – Prithviraj Uttarasili Dec 18 '17 at 5:54
  • Yes, you can add aliases in ´~/.zshrc. Or you can switch your shell using the chsh` command. – Florian Diesch Dec 18 '17 at 14:06

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.