Get Adobe Flash player

Linux file ownership and file removal

With Linux (Ubuntu), the operating systems is protected in order to avoid improperly deleting or changing of files and folders. The root account is the only account that has the permissions to delete or change any files or folders. It is not possible to login as the root but a user can switch to the super user mode (sudo su).

There are times when you may need to delete a folder or file (that is not needed by the OS). In such a situations you can change the ownership or the file or folder or simply delete the file or folder.

Here are two commands: rm and chown

rm allows the user to delete a file that is owned by another user. The full command for this is sudo rm -rf filename/foldername or rm -rf filename/foldername

This has to be done in the Terminal screen and ran under the su account. You can either switch over to super user first or run the command with the ‘sudo’ ahead of the command. The r stands for recursive removal and the f stands for force.

Another command is chown. This allows you to change the file or folder ownership to another user. You can see an eHow article on how to do this. The command looks like this: sudo chown username filename/file path

Be careful when changing files or folders. Changing the wrong files or folders can cause your OS to no longer function. Know what your changing before you make a change.

Defender USA