No command works in Terminal

Hello terminal out of the ordinary

No command works

Mac OS Catalina





[Re-Titled by Moderator]

Posted on Oct 23, 2019 12:20 PM

Reply
Question marked as Top-ranking reply

Posted on Oct 23, 2019 4:42 PM

You will need to create a .zprofile and .zshrc file, the first for Terminal login, and the second for interactive usage. Until you get your PATH set in zsh, you won't be able to do much, or find commands in any path.


I have the same content in both of these dot files:

export PATH=".:$HOME/bin:/usr/local/bin:$PATH"
autoload -U colors && colors
MyHost="$(/usr/sbin/networksetup -getcomputername)"
PS1="%{$fg[blue]%}${MyHost}: %~ %{$reset_color%} %% %{$fg[white]%}"
export EDITOR="/usr/bin/vim"


You can use TextEdit in plain text mode to save these dot files into your home directory, and dealing with command-line Terminal editors and wonky paths will not be fun. Then quit Terminal and relaunch it and zsh should read the .zprofile and set your PATH so you can actually reference commands without the explicit path to them.

3 replies
Question marked as Top-ranking reply

Oct 23, 2019 4:42 PM in response to x3ur

You will need to create a .zprofile and .zshrc file, the first for Terminal login, and the second for interactive usage. Until you get your PATH set in zsh, you won't be able to do much, or find commands in any path.


I have the same content in both of these dot files:

export PATH=".:$HOME/bin:/usr/local/bin:$PATH"
autoload -U colors && colors
MyHost="$(/usr/sbin/networksetup -getcomputername)"
PS1="%{$fg[blue]%}${MyHost}: %~ %{$reset_color%} %% %{$fg[white]%}"
export EDITOR="/usr/bin/vim"


You can use TextEdit in plain text mode to save these dot files into your home directory, and dealing with command-line Terminal editors and wonky paths will not be fun. Then quit Terminal and relaunch it and zsh should read the .zprofile and set your PATH so you can actually reference commands without the explicit path to them.

Oct 23, 2019 4:25 PM in response to x3ur

That looks like zsh prompt, however there is no default "help" command in zsh

% help

zsh: command not found: help




you can verify your shell, copy and paste:

echo $SHELL





You can always see more over the man page, copy and paste:

man zsh | more



or return to something more familiar, like the previous

cat /etc/shells


/bin/bash

/bin/csh

/bin/dash

/bin/ksh

/bin/sh

/bin/tcsh

/bin/zsh


to change back to /bin/bash for example:

chsh -s /bin/bash

Oct 23, 2019 4:52 PM in response to x3ur

Here’s an introduction to zsh, for starters.

zsh has replaced bash as the default command shell, starting in macOS Catalina.

The old bash from earlier macOS releases remains available.

You can change the shell, if you prefer a different default shell.

There’s some documentation on Terminal.app available, too.

Expand the Table of Contents on that latter web page for yet more.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

No command works in Terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.