BoiseUbuntu

Started by students at Boise State

In the course of handling my EePC installation I create a bootable USB drive from whatever .iso I am attempting to complete the installation with. When I create this bootable drive it usually leaves my system with read-only files which I sometimes move to my trash folder. What this does, it leave root-level permission files stuck in my trash folder which cannot be simply deleted by using the "Empty Trash" button.

What I hope to help people with is this, read-only (or unremoveable) files from the users Trash can. The commands I will use are executed through the Terminal, some people are apprehensive of doing this, but I will give you an overhead view of what you are doing and why.

/home/user/.local/share/Trash/files - This is the path through the file structure to every users trash bin. If you are looking within your home directory, you will notice there is no .local file at all. The period used before the directory name makes it a hidden directory.

To see hidden files you can use the command ls -a or, within Nautilus by clicking on View > Show Hidden Files. The system generally hides these files, they are used by the system, or other programs and it is not wise to be removing, or modifying them.

Below is a screenshot of the file location of every users trash.


As you can see I have the file hardy-usb within the Trash files directory. Under normal circumstances the "Empty Trash" button cleans my trashed items. The problem with this file, is that I deleted it while it still had root-level permissions. It essentially become stuck in my trash can until I change it's permissions. I will go over two ways of removing this bothersome file.

I could either use chmod command which can change the permissions of the folder and all within it (with use of the -R option), or use the rm command to permanently remove the files from the system.

I screencapped the use of the chmod command:


The use of this command requires a bit of explanation. When used with sudo> it allows me to modify any file or directories permissions. The -R option will apply the permission changes recursively to all files and subdirectories within. In this instance, I need this to occur because not only is hardy-usb read-only for me, all of its contents are as well. The 777 is a value used to change the directories permissions, this is a little outside the scope of this exercise (Chmod info for more information on its use), but it will change the permissions to the allow everyone to read, write, and execute everything within the hardy-usb directory. After this command is executed, exit the terminal and empty the trash.

A one step process of removing this annoying little folder is using the rm command. This command will, after execution, remove the target file or directory.

The command
sudo rm -r .local/share/Trash/files/hardy-usb

The command will recursively delete the folder and anything within it. Again, the use of -r will allow the command to delete the file structure with the hardy-usb directory. The use of sudo is required because it will give the command root-level permissions to remove the directory, without it the command would yield a permission denied statement.

Hopefully this helps anyone who may have accidently put something in their trash that won't go away.

Share 

Comment

You need to be a member of BoiseUbuntu to add comments!

Join this Ning Network

© 2009   Created by Trent Cutler on Ning.   Create a Ning Network!

Badges  |  Report an Issue  |  Privacy  |  Terms of Service