LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Read Only (https://www.linuxquestions.org/questions/linux-newbie-8/read-only-592240/)

Nazzgul 10-16-2007 09:46 AM

Read Only
 
How can I remove attribut read only on some file or directory?!

sycamorex 10-16-2007 10:10 AM

su
type your root password

chmod -R a+w name_of_the_directory

a - means for all users
you can change it to 'u' - owner only or 'g' - group only, 'o' - other users

matthewg42 10-16-2007 11:39 AM

Do you mean by regular unix-style write permissions, or the ext2 attributes?

For normal permissions, you can use your file manager, like konqueror, nautilus and so on - just right click on the file/dir and go to properties and there is usually something in there about permissions.

From the terminal you can also use the ls -ld /path/to/your/dir command to view the permissions (the first column of output); and change the permissions using the chmod command (which is a contraction of "change mode"). See the ls and chmod manual pages for more detailed descriptions of what they do. The command to add write permissions to your directory is:
Code:

chmod u+w /path/to/your/dir
This will add the "user is able to write" flag. Note that to modify the permissions of a a file or directory, you must have read write and execute permissions to the parent directory in which the file/directory exists.

If you mean not the unix-style permissions, but ext2 attributes, you can view existing attributes with the lsattr command, and change them with the chattr command. The attribute which sometimes makes files un-writable is the "i" flag - immutable. For example:
Code:

lsattr -d /path/to/your/dir
chattr -i /path/to/your/dir    # to remove the immutable flag.

See the lsattr and chattr manual pages for more information.

I think only root can change attributes. I haven't had much exposure to them, and as far as I know they are not very widely used.


All times are GMT -5. The time now is 01:37 AM.