简体   繁体   中英

Tryinf to run existing scripts in shell gives “command not found”

I am trying to install Anaconda with a sh script. I am using Ubuntu 18.

Here is my Downloads folder. We can clearly see the script

sgerodes@sgerodes-TECRA-A50-EC  ~/Downloads  ls -al
total 564196
drwxr-xr-x  2 sgerodes sgerodes      4096 Aug  7 09:43  .
drwxr-xr-x 45 sgerodes sgerodes      4096 Aug  7 09:43  ..
-rw-rw-r--  1 sgerodes sgerodes 576830621 Aug  7 09:36  Anaconda3-2020.07-Linux-x86_64.sh
-rw-rw-r--  1 sgerodes sgerodes    868673 Aug  4 16:32 'Dokumentation Zeitplanung & Auslastung_Teams.pptx'
-rw-rw-r--  1 sgerodes sgerodes     16042 Mai 25 18:50  hw1-11.gif
-rw-rw-r--  1 sgerodes sgerodes      3185 Jun 25 18:19  j-koop-meyer.impex

But running it gives a "command not found".

sgerodes@sgerodes-TECRA-A50-EC  ~/Downloads  sudo ./Anaconda3-2020.07-Linux-x86_64.sh 
sudo: ./Anaconda3-2020.07-Linux-x86_64.sh: command not found

sgerodes@sgerodes-TECRA-A50-EC  ~/Downloads  sudo Anaconda3-2020.07-Linux-x86_64.sh 
sudo: Anaconda3-2020.07-Linux-x86_64.sh: command not found

What could be the issue?

You can see from the permissions -rw-rw-r-- that it is not executable. If you do:

chmod a+x Anaconda3-2020.07-Linux-x86_64.sh

then you should see the permissions become -rwxrwxr-x . You can now do:

sudo ./Anaconda3-2020.07-Linux-x86_64.sh 

and it should work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM