LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-15-2020, 10:43 PM   #1
davidnozepress
LQ Newbie
 
Registered: Nov 2020
Posts: 2

Rep: Reputation: Disabled
why does terminal say "no file or directory" in downloads wheni do chmod (unbutu)


sudo chmod +x /home/path/to/the/file/OptiFine.jar
is what i have and it says
chmod: cannot access '/home/path/to/the/file/OptiFine.jar': No such file or directory
 
Old 11-15-2020, 11:58 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
My guess is that you mistype the file path. What do you get when you execute the following command?
Code:
sudo ls -l /home/path/to/the/file/OptiFine.jar

Last edited by berndbausch; 11-15-2020 at 11:59 PM.
 
Old 11-16-2020, 04:35 AM   #3
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Do you really need sudo here? If the file is in your own ~/Downloads directory it shouldn't be necessary.
 
1 members found this post helpful.
Old 11-16-2020, 07:20 PM   #4
davidnozepress
LQ Newbie
 
Registered: Nov 2020
Posts: 2

Original Poster
Rep: Reputation: Disabled
the same thing was said and here is the name of the file not sure if it does anything

/home/compudopt/Downloads/OptiFine_1.16.4_HD_U_G5 (1).jar
 
Old 11-17-2020, 06:33 AM   #5
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
This shows that you have to be precise when asking questions and not provide approximate commands.

Is there a space in the filename? If so, put quotes around the filename or a backslash before the space.

Last edited by berndbausch; 11-17-2020 at 06:36 AM.
 
Old 11-17-2020, 11:13 AM   #6
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
OptiFine_1.16.4_HD_U_G5 (1).jar is not the same as OptiFine.jar. There are several ways of dealing with this.
One is:
Code:
chmod +x /home/compudopt/Downloads/OptiFine{tab}
which means type the start of the filename and then press the Tab key, which will autocomplete the filename, or at least to the first variance if there are multiple files with similar names. Or you can be even less specific and use
Code:
chmod +x /home/compudopt/Downloads/OptiFine*
which will make every file in the directory which starts with OpiFine executable.
 
Old 11-17-2020, 11:14 AM   #7
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Parentheses are also special to the shell. File names containing spaces and other special characters need to be quoted on the command line:
Code:
ls /home/compudopt/Downloads/"OptiFine_1.16.4_HD_U_G5 (1).jar"
It's just the special characters that really need quoting, but including more in the quotes is fine.

The quick solution is to type the first few characters of the name (enough to match uniquely) and then press <tab> to let the shell complete the name in a syntactically correct way.

Last edited by rknichols; 11-17-2020 at 11:19 AM. Reason: add tab completion suggestion
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the difference between "man chmod" and "man 2 chmod" ? Victor43 Linux - Newbie 8 06-17-2020 03:59 AM
[SOLVED] Why does terminal say "no such file or directory" when I try to cd/ to it? zavmat Linux - Newbie 9 01-25-2019 02:08 PM
[SOLVED] I say "realloc", you say "SIGABRT" - And I don't understand it. derchris Programming 3 03-25-2011 11:02 AM
[SOLVED] Bind9 stop working wheni installed Postfix on Ubuntu 9.10 Lucard Linux - Server 9 03-01-2010 12:17 PM
Apache: difference between chmod 644 and chmod 666 and chmod 600 for output/txt/dat? frenchn00b Programming 6 04-22-2009 01:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration