简体   繁体   中英

why does ./ not work as a directory? [Linux]

I'm trying to install NET. 6.3 on my chromebook with Linux but when I try to execute

./dotnet-install.sh -c Current

in the Linux Terminal it always gives me this error:

-bash: ./dotnet-install.sh: No such file or directory

Any way around it/any fix for it?

I have done sudo -i so I got full permission and I have put the file I'm trying to execute in a lot of folders including my Linux folder.

Any help is appreciated!

I suppose you should:

chmod +x ./dotnet-install.sh
./dotnet-install.sh -c Current

or

/bin/bash dotnet-install.sh -c Current

There are two ways to execute a script on a UNIX/Linux platform:

  • Either you make the script executable, as explained in the other answer.
  • Either you use the sh or other relevant command for launching it, I prefer this way of working.

So, I would propose you to launch the following command:

sh ./dotnet-install.sh -c Current


Have you tried the pwd command to see on which path are you working on?
Then try to ls | grep dotnet-install in the current directory, if there isn't output you have to change directory.
Probably you are trying to execute the dotnet-install.sh in a wrong directory, i suppose.


Another way is to get file trough wget command on terminal to be sure you download the file in the correct directory.


Regards

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