How can I make presto (or anything) an executable file on a Linux Server?

3

1

I tried CHMOD along with the file directory but it just can't seem to find it for some reason.

I've tried the following:

-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     

This is the correct directory I'm trying to link to as well. Am I doing something wrong?
For reference, I'm on this point in a tutorial (so you know what I'm trying to do)
https://prestodb.io/docs/current/installation/cli.html

K_dar

Posted 2015-02-04T16:40:13.927

Reputation:

What's in your .bashrc and .bash_profile files? That first line looks worrying. – shearn89 – 2015-02-04T16:46:08.023

Answers

2

The leading . looks like the culprit:

[ec2-user@_________ ~]$ chmod u+x ./home/ec2-user/presto.jar
chmod: cannot access ‘./home/ec2-user/presto.jar’: No such file or directory

should be one of:

$ chmod u+x presto.jar
$ chmod u+x ./presto.jar
$ chmod u+x ~/presto.jar

EDIT: To expand - commands assume the file you're operating on are in the current directory (the first example). A . explicitly means 'this directory' (example 2), and the ~ expands to your home directory: /home/ec2-user in this case (example 3).

shearn89

Posted 2015-02-04T16:40:13.927

Reputation: 166

Hey thanks, that may have worked but I'm not sure. I'm now stuck on the next part where i'm trying to run it with ./presto --server localhost:8080 --catalog hive --schema default. but am still getting "No such file or directory". Any ideas? I marked your answer as correct anyway because it did answer the first issue – None – 2015-02-04T17:19:03.577

According to the link you posted, you need to rename the file from presto.jar to presto. – shearn89 – 2015-02-04T17:23:29.617

Hey, thanks you solved my issue. For future reference, any idea why I was downvoted so heavily? – None – 2015-02-05T11:36:37.473

Probably because of a general lack of knowledge about linux on what is primarily a site for business/enterprise sysadmins. – shearn89 – 2015-02-05T11:45:46.920

ah yes, we literally are only setting up linux servers now and I've never done it before being a graduate so It's all very new to me. Thanks for your help regardless. – None – 2015-02-05T11:56:20.127