How to Make a File Not Read Only Debian

Download Commodity

Download Commodity

If you want to delete a file that has read-but permissions in Linux, you have a few options. If the file belongs to you, you can either change the file's permissions or use the sudo command to delete the file as root. Only if you lot're trying to delete a file that has write permissions and still tin't delete it (or you see a "Read Just File System" mistake), y'all may need to remount the drive with proper permissions. We'll prove y'all how to remove any read-only file on any Linux distribution, including Ubuntu and Linux Mint.

  1. 1

    Open a terminal window. If a file you own is read-only, you won't be able to delete it unless you lot give yourself write permission for that file. If yous're using a window manager, press Ctrl + Alt + T to open a terminal window now.

    • Use this method if you're trying to delete a file that belongs to you but (e.g., you're the owner or in a group that has admission to read the file) but don't have permission to delete it.
    • If you lot're signed in remotely and already at a control prompt, merely skip to the next footstep.
  2. 2

    Use cd to enter the directory of the file you desire to delete. For example, if the file you desire to delete is inside a folder called documents in your dwelling directory, you'd use cd documents or cd /home/username/documents.

    Advertising

  3. 3

    Use ls -al to display the file permissions for the files in the directory. Using ls -fifty displays a list of files in the directory, along with the owner of each file and its permissions. Adding the a to ls -fifty also shows hidden files and folders in the directory.

  4. 4

    Evaluate the permissions of the file you want to delete. The permissions for a file appear before its name like this: r--r--r--. The owner's proper noun appears after information technology, followed past the grouping name.

    • r is read permissions, westward is write permissions, and x is execute permissions.
    • The beginning three characters in the permissions (in this example, r--), are the file possessor'due south permissions. So, in this example, the owner of the file only has read permissions, which means they tin't write to, execute, or delete the file.
    • The second three characters are group permissions. If you're a member of a group and that group has write permissions to the file, yous'll be able to delete information technology even if yous're not the owner.
    • The third three characters are world permissions, which is everyone else.
  5. 5

    Utilise chmod -v u+rw filename to give yourself read and write permissions. You can omit the r if you already have read permissions. Once y'all have write permissions, y'all'll be able to delete the file.

    • If you're not the file owner simply accept root admission to the organisation, you can use sudo chmod -v u+rw filename to give yourself the right permissions.
    • To see the file'due south new permissions, run ls -al again.
  6. half-dozen

    Use rm filename to delete the file. At present that yous have write permissions on the file, deleting it will be uncomplicated.

    • If yous aren't able to delete the file after making information technology writable, its sectionalization may exist mounted read-but. See Fixing the Read Only File Organisation Fault to troubleshoot.

    Advertizement

  1. 1

    Open a terminal window. You can apply the sudo command to delete a read-just file that yous aren't able to delete with your user account. If you're using a window manager, press Ctrl + Alt + T to open up a last window now.

    • Use this method if you are non the owner of the file you want to delete and you'd rather only delete the file instead of showtime irresolute its permissions.
    • If you're signed in remotely and already at a command prompt, just skip to the next step.
  2. 2

    Use cd to enter the directory of the file you want to delete. For example, if the file you lot desire to delete a file inside a folder chosen documents in your home directory, you'd apply cd documents or cd /home/username/documents.

  3. 3

    Use ls -al to view the contents of the directory. This command will display all of the files in the current directory, as well every bit each file's owner and permissions.

  4. iv

    Use sudo rm filename to delete the file. You lot'll be prompted to enter your countersign to obtain root-level permissions. In one case your password is accepted, the read-only file volition be deleted.

    • If you aren't able to delete the file with sudo, its partitioning may be mounted read-only. See Fixing the Read Only File System Error to troubleshoot.

    Advertisement

  1. 1

    Open a final window. If you're trying to delete a file and getting an error that says rm: cannot remove '(filename)' : Read but file system, there are a few possible causes. Start by pressing Ctrl + Alt + T to open a terminal window if you're using a window manager.

    • If yous're signed in remotely, simply move to the side by side step.
  2. 2

    Run df -h to view all mounted devices. Y'all'll need to know the verbal mount signal of the drive that's giving you trouble. This displays all mounted drives.

  3. three

    Run the command mount . Replace mountain point with the actual mount bespeak, e.one thousand., /media/usbdisk. If you're trying to delete a file on a removable disk or network bulldoze, such every bit an old backup, the disk where the file is stored might be mounted as read-only.

    • If you come across ro in the results, the file system is read-but. Remounting the drive should fix the error. To do so, use mount -o remount,rw mount signal . You lot can then delete the file.
    • If the permissions are rw, the disk is mounted with read-write permissions, which means you should be able to delete files without issues. This normally means there's a problem with the file system on the drive. Continue with this method.
    • If yous meet remount-ro, this means the there's a trouble with the file system and the drive was remounted every bit read-only to limit additional damage. This also means at that place's a trouble with the file organization on the bulldoze. Continue with this method.
  4. 4

    If the permissions are correct, unmount the drive. To practise this, run sudo umount device . Supersede device with the device name, e.yard., /dev/sdd1.

    • Since you lot can't unmount a root file system, you tin can't cheque the file system of the root partitioning unless you're booted into recovery mode. If the error is on the root file system, boot into recovery fashion start.
  5. 5

    Run sudo fsck -n device to check the drive. This checks the integrity of the drive without making any changes. If the drive is okay, you'll see "clean" in the results. If in that location are errors, you will see them.

    • If there are errors, support the drive before you continue in case the file system cannot be repaired.
  6. vi

    Run sudo fsck device to repair errors. If in that location are errors, you'll exist prompted to correct them.

    • Even if you are able to correct errors, make a backup just in case the drive is dying.
  7. 7

    Remount the drive one time repaired. If you were able to repair the errors, remounting the drive volition go far so you can delete your files. Employ mount -o remount,rw mount point to ensure the bulldoze is remounted with read and write permissions. You should then be able to modify and delete files on the drive.

    Advert

Inquire a Question

200 characters left

Include your email address to go a message when this question is answered.

Submit

Advertising

Most This Article

Commodity Summary X

one. Use cd to enter the directory that contains the file.
2. Use ls -al to view file owners and permission attributes.
3. Utilise chmod -v u+rw filename to requite yourself read and write permissions.
4. Use rm to delete the file.

Did this summary assist y'all?

Thanks to all authors for creating a page that has been read 3,721 times.

Is this article up to date?

hesterforkeded.blogspot.com

Source: https://www.wikihow.com/Delete-Read-Only-Files-in-Linux

0 Response to "How to Make a File Not Read Only Debian"

Publicar un comentario

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel