LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Directory permissions (https://www.linuxquestions.org/questions/linux-newbie-8/directory-permissions-937114/)

gubby 03-29-2012 12:06 PM

Directory permissions
 
A really newbie question I'm sure,but I'll ask anyhow. I have downloaded and installed a program that wants to create a database and put it on the file system. Linux says that it can not be created and then says to check directory permissions. How do I do that?

Sydney 03-29-2012 12:16 PM

Code:

ls -l /target/directory
http://en.wikipedia.org/wiki/Chmod this wikipedia is on the command to change permissions, but summarizes what the output you will get from the ls -l command is.

camorri 03-29-2012 12:21 PM

To check directory permissions, run a command like:

Quote:

ls -dl /var
drwxr-xr-x 18 root root 4096 Mar 28 10:20 /var/
The first line is the command I entered, finding the permissions on a directory /var/

The second line is the response. The d indicates it is a directory.

The next 9 digits are read as Read/Write/Execute for owner/group/other. ) left to right.

This is the 'ls' ( list command ). The d specifies it is a directory, the l asks for the long output, with more details.

That is it. Just change the directory path to the one you need to know about.

MensaWater 03-29-2012 12:26 PM

Quote:

Originally Posted by Sydney (Post 4639852)
Code:

ls -l /target/directory

ls -l <directory> lists the files in the directory - not the directory itself. ls -ld restricts the listing to the directory itself.

One of the files in the directory on UNIX/Linux is "." which is a link back to the directory so you can determine the permissions of the directory by looking at the . file. (.. is also there and is a link to the directory above the current one a/k/a parent directory). However for a large directory the . and .. would scroll off the screen rapidly so it is better to use ls -ld when you just want to know the directory.

gubby 03-29-2012 12:35 PM

Thank you. That was helpful. So, now how do I give this particular program permission to write to the directory?

Sydney 03-29-2012 12:35 PM

Quote:

Originally Posted by MensaWater (Post 4639863)
ls -l <directory> lists the files in the directory - not the directory itself. ls -ld restricts the listing to the directory itself.

One of the files in the directory on UNIX/Linux is "." which is a link back to the directory so you can determine the permissions of the directory by looking at the . file. (.. is also there and is a link to the directory above the current one a/k/a parent directory). However for a large directory the . and .. would scroll off the screen rapidly so it is better to use ls -ld when you just want to know the directory.

I have to mention you will not see the dot notations MensaWater is talking about unless you use the -a switch with ls.

suicidaleggroll 03-29-2012 12:44 PM

Quote:

Originally Posted by gubby (Post 4639870)
Thank you. That was helpful. So, now how do I give this particular program permission to write to the directory?

It depends on the directory it needs write permission for, and what user you're trying to install it using.

The simple answer is with chmod, such as
Code:

chmod u+w /directory
But if your user isn't the owner of this directory, that will probably fail as well, because you don't have the permission to modify the permissions on the directory. In that case, you would need to run the chmod as root, or just simply install your program as root. We need more details before we can say which is the best choice for you.

What is the program
What directory is it trying to write to
What is the output of "ls -ld" on that directory

MensaWater 03-29-2012 12:46 PM

Quote:

Originally Posted by Sydney (Post 4639874)
I have to mention you will not see the dot notations MensaWater is talking about unless you use the -a switch with ls.

touche ;)

MensaWater 03-29-2012 12:50 PM

The program you downloaded ideally has some sort of documentation.

Check for files that start with the name README. Those usually give you a good idea of what you need to do and most people include them with things they give to others to download.

Telling us exactly what you downloaded and providing the exact message you got would be helpful.

Since you're a newbie one major warning: Do NOT change the permission of everything to rwxrwxrwx (read/write/execute or 777) for everything. Many a newbie has broken their systems doing that. Many things break because they should have certain permissions only and this stops dumb hackers who try to open permissions globally that way.

gubby 03-29-2012 01:06 PM

Ok,Ill explain everything I did. BTW I'm not that great with computers and have just went to ONLY Linux for 2 weeks now, trying to learn all this. I down loaded the program and then in a terminal as root did "chmod +x "file",because it said to in the install instructions...hmm...then I ran the auto installer. It installed to /usr/local/"the file folder". In that file is a execute file. I run that and the file tries to create its data base,as it loads the program, but can't because of the directory permissions. So...which directory do I change? ....

gubby 03-29-2012 01:10 PM

Exact message is "! unable to write to file system. Check directory permissions." when the executable is run.

MensaWater 03-29-2012 01:31 PM

You're still being vague.

The "software" and "the file folder" don't really tell us anything. If you're unwilling to share details we are going to have difficulty assisting you.

WHAT is the name of the software you downloaded?
WHERE did you download it from?

You have a document that told you to set execute bit (chmod +x). What else is in that document? Is there a soft copy?

gubby 03-29-2012 02:08 PM

Sorry, not trying to be vague,just not sure what to tell you. The software is called openfitness,downloaded at their website, sorry don't have url handy. Downloaded from the Linux dist download area, that's where the instructions are. Looked around the files that downloaded,did not find a readme or any other install ins.

gubby 03-29-2012 02:11 PM

Complete path to executable is "/usr/local/openfitness

yancek 03-29-2012 04:26 PM

I googled openfitness and came up with a few sites, is the site below the one you are referring to:

http://www.workoutware.com/openfitness/download.shtml

I found several sites with similar software. Without your giving the URL, there's not much more than guessing anyone here can do. The above site seems to do what you indicate but it is simply one very large (6.5MB) bash script.


All times are GMT -5. The time now is 04:11 AM.