read only files in Ubuntu

5,179

Solution 1

Sounds to me like a permissions issue. Open terminal and cd to one of the folders/files affected.

sudo chown -R user:group ./folder

sudo chmod -R 755 ./folder

  • More info on setting permissions: chmod
  • More information on setting ownership: chown

Solution 2

Check for commonalities in the file locations. Are they all on the same partition? Only in a few subdirectories?

  • If all affected files are under one (or a small number of) directory(ies), it may be a permissions problem. ricbax's answer gives details to fix the issue, but use ls -l to verify that's the problem first.

  • Ubuntu and other linuxes are often configured to remount the system partition as read-only when errors are detected. If this is the case, chown and chmod won't help -- you'll need to fix the filesystem (eg with fsck) before you'll be able to remount the partition normally. Any partition could potentially be mounted with this option.

Share:
5,179

Related videos on Youtube

Kenster
Author by

Kenster

Software developer in central Ohio. Currently developing a content management system in Java and JBPM on Linux. I've previously worked with Solaris, Oracle, JDBC, C, C++, Perl, and shell scripting.

Updated on September 17, 2022

Comments

  • Kenster
    Kenster over 1 year

    Something has gone weird with Ubuntu 8.4 on my computer. Somehow, many files, docs and audio have decided to become "read only". Other files (that I own) are denying permission to view, move copy or otherwise access.

    Does anyone know how this could suddenly happen?

    Does anyone have a suggestion as to how to return these files to their original status?

  • ElPoney
    ElPoney over 14 years
    of course "user" and "group" must be your actual username and groupname
  • William
    William over 3 years
    Nice :) But when I tried it, it needed to be sudo chmod 755 -R ./folder ---> not sure if that might be related to the flavor of linux I'm using