Impossibile aprire il terminale normalmente

0

Ho provato a installare opencv tramite homebrew , ma ho sbagliato qualcosa. Ho chiuso Terminal per riavviarlo, tuttavia da allora non posso aprire il terminale normalmente.

 Last login: Wed Sep 20 23:23:15 on ttys001
-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
-bash: touch: command not found
Ys-MacBook-Air:~ hareentej22$ nano ~/.bash_profile
-bash: nano: command not found
Ys-MacBook-Air:~ hareentej22$ ls
-bash: ls: command not found
Ys-MacBook-Air:~ hareentej22$ cd ..
Ys-MacBook-Air:Users hareentej22$ cd ..
Ys-MacBook-Air:/ hareentej22$ ls
-bash: ls: command not found
Ys-MacBook-Air:/ hareentej22$ source ~/.bash_profile
-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
Ys-MacBook-Air:/ hareentej22$ nano ~/.bash_profile
-bash: nano: command not found
Ys-MacBook-Air:/ hareentej22$ xcode --version
-bash: xcode: command not found
Ys-MacBook-Air:/ hareentej22$ brew doctor
-bash: brew: command not found
Ys-MacBook-Air:/ hareentej22$ brew update
-bash: brew: command not found
Ys-MacBook-Air:/ hareentej22$ 

Quando ho aperto Terminal, ho provato le righe di comando sopra, ma nessuna funziona. Come può essere risolto?

modifica: eseguo la riga di comando come @allan menzionato e ottengo il seguente risultato.

Ys-MacBook-Air:~ hareentej22$ /bin/ls -la
total 120
drwxr-xr-x+  32 hareentej22  staff   1088 Sep 17 03:12 .
drwxr-xr-x    6 root         admin    204 Jul  9 10:43 ..
-r--------    1 hareentej22  staff      7 Jul  8 20:16 .CFUserTextEncoding
-rw-r--r--@   1 hareentej22  staff  16388 Sep 21 00:39 .DS_Store
drwxr-xr-x    3 hareentej22  staff    102 Jul 17 00:55 .Seagate
drwx------   72 hareentej22  staff   2448 Sep 20 23:24 .Trash
-rw-------    1 hareentej22  staff  11027 Sep 20 01:01 .bash_history
-rw-r--r--    1 hareentej22  staff    133 Sep 20 17:04 .bash_profile
-rw-r--r--    1 hareentej22  staff      1 Sep 16 20:49 .bash_profile-miniconda3.bak
drwx------  238 hareentej22  staff   8092 Sep 21 21:10 .bash_sessions
drwxr-xr-x    4 hareentej22  staff    136 Sep 16 20:55 .conda
drwxr-xr-x   10 hareentej22  staff    340 Aug 30 23:59 .eclipse
drwxr-xr-x    3 hareentej22  staff    102 Aug 17 00:28 .netbeans-derby
drwxr-xr-x    7 hareentej22  staff    238 Aug 17 00:30 .oracle_jre_usage
drwxr-xr-x    8 hareentej22  staff    272 Sep  5 19:11 .p2
-rw-r--r--    1 hareentej22  staff    243 Sep 11 16:41 .profile
drwxr-xr-x    5 hareentej22  staff    170 Sep 14 13:28 .pyenv
-rw-------    1 hareentej22  staff     12 Sep 14 13:30 .python_history
drwxr-xr-x    3 hareentej22  staff    102 Aug 30 23:48 .tooling
-rw-------    1 hareentej22  staff   6232 Sep 17 00:23 .viminfo
drwxr-xr-x   14 hareentej22  staff    476 Sep 17 03:13 .virtualenvs
drwx------@   3 hareentej22  staff    102 Jul  9 11:02 Applications
drwx------+  31 hareentej22  staff   1054 Sep 20 23:24 Desktop
drwx------+   6 hareentej22  staff    204 Sep 12 22:30 Documents
drwx------+  38 hareentej22  staff   1292 Sep 18 16:43 Downloads
drwx------@  71 hareentej22  staff   2414 Sep 17 00:07 Library
drwx------+   3 hareentej22  staff    102 Jul  8 20:16 Movies
drwx------+   4 hareentej22  staff    136 Jul  8 20:36 Music
drwxr-xr-x    2 hareentej22  staff     68 Jul 29 13:36 Parallels
drwx------+   6 hareentej22  staff    204 Jul  9 10:00 Pictures
drwxr-xr-x+   5 hareentej22  staff    170 Jul  8 20:16 Public
drwxr-xr-x    3 hareentej22  staff    102 Aug 30 23:35 eclipse


 Ys-MacBook-Air:~ hareentej22$ cat .bash_profile
-bash: cat: command not found
Ys-MacBook-Air:~ hareentej22$
Ys-MacBook-Air:~ hareentej22$ cat .bash_profile
-bash: cat: command not found
Ys-MacBook-Air:~ hareentej22$ /bin/cat .bash_profile
export PATH=”/usr/local/opt/python/libexec/bin:$PATH”

# Virtualenv/VirtualenvWrapper
source /usr/local/bin/virtualenvwrapper.sh
    
posta hareen tej 20.09.2017 - 20:09
fonte

2 risposte

3

Modifica il tuo ~ / .bash_profile con nano sostituendo username con il tuo nome utente reale del profilo.

$ /usr/bin/nano /Users/username/.bash_profile

Elimina la / e riga / e contenente la tua istruzione PATH. Salva ed esci. Quando riavvii la sessione di Terminale, il tuo percorso dovrebbe tornare alla normalità.

    
risposta data 20.09.2017 - 20:52
fonte
2

La tua definizione PATH .bash_profile è racchiusa tra virgolette sbagliate.

Devi usare le virgolette " invece del doppio sinistro , doppio destro o singolo ‘’ virgolette o apostrofi ' .

Apri e modifica il file immettendo /usr/bin/nano $HOME/.bash_profile in Terminal.app e sostituendo con " . Premi ctrl O e ctrl X per salvare il file modificato su disco, quindi chiudi la finestra Terminale inserendo% codice%. Riavvia il terminale per iniziare una nuova sessione.

    
risposta data 21.09.2017 - 21:27
fonte

Leggi altre domande sui tag