![如何在 Linux 服务器上将 presto(或任何东西)制作成可执行文件?](https://linux22.com/image/1439634/%E5%A6%82%E4%BD%95%E5%9C%A8%20Linux%20%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E5%B0%86%20presto%EF%BC%88%E6%88%96%E4%BB%BB%E4%BD%95%E4%B8%9C%E8%A5%BF%EF%BC%89%E5%88%B6%E4%BD%9C%E6%88%90%E5%8F%AF%E6%89%A7%E8%A1%8C%E6%96%87%E4%BB%B6%EF%BC%9F.png)
我尝试使用 CHMOD 以及文件目录,但由于某种原因它似乎无法找到它。
我尝试了以下方法:
-bash: homeec2-user: command not found
[ec2-user@_________ ~]$ chmod u+x ./home/ec2-user/presto.jar
chmod: cannot access ‘./home/ec2-user/presto.jar’: No such file or directory
[ec2-user@_________ ~]$ chmod u+x ./home/ec2-user/presto
chmod: cannot access ‘./home/ec2-user/presto’: No such file or directory
[ec2-user@_________ ~]$ chmod u+x ./home/ec2-user/
chmod: cannot access ‘./home/ec2-user/’: No such file or directory
[ec2-user@_________ ~]$ chmod u+x ~/home/ec2-user/
chmod: cannot access ‘/home/ec2-user/home/ec2-user/’: No such file or directory
[ec2-user@_________ ~]$ chmod u+x ~./home/ec2-user/
chmod: cannot access ‘~./home/ec2-user/’: No such file or directory
[ec2-user@_________ ~]$ ./presto --server localhost:8080 --catalog hive --schema default#
-bash: ./presto: No such file or directory
[ec2-user@_________ ~]$ home/
-bash: home/: No such file or directory
这也是我尝试链接到的正确目录。我做错了什么吗?
作为参考,我在教程中提到了这一点(这样您就知道我在尝试做什么)
https://prestodb.io/docs/current/installation/cli.html
答案1
领先.
看起来像是罪魁祸首:
[ec2-user@_________ ~]$ chmod u+x ./home/ec2-user/presto.jar
chmod: cannot access ‘./home/ec2-user/presto.jar’: No such file or directory
应为以下之一:
$ chmod u+x presto.jar
$ chmod u+x ./presto.jar
$ chmod u+x ~/presto.jar
编辑:要展开 - 命令假设您正在操作的文件位于当前目录中(第一个示例)。 A.
明确表示“此目录”(示例 2),并且扩展~
到您的主目录:/home/ec2-user
在本例中(示例 3)。