Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I booted my computer, I noticed:

  • that the Trash icon was missing from File Manager;
  • this message when I tried to delete a file:

Are you sure that you want to permanently delete "testFile"?
If you delete a file, it is permanently lost.

  • that I can't restore already deleted files to their previous locations. I can do it manually, but there is no restore feature

I tired apt-get update, apt-get update, apt-get update --fix-missing to try to repair anything broken.

Everything was working fine yesterday. However, I've been working on a java project to send files to trash. I made it about a month ago, so I am not sure if it is relevant, but here is the test code:

public class SendToTrashTest 
    public static void main(String... args)
        try {
            File f=new File("test11");
        } catch (IOException e) {
            // TODO Auto-generated catch block
    public static void sendToTrash(File f)
        try {
            String s[]=f.getAbsolutePath().split(File.separator);
            String baseName=s[s.length-1],name=baseName;
            File trashInfoFile=new File(System.getProperty("user.home")+"/.local/share/Trash/info",name+".trashinfo");
            //handles duplicate files
            for(int i=2;trashInfoFile.exists();i++)
                trashInfoFile=new File(System.getProperty("user.home")+"/.local/share/Trash/info",name+".trashinfo");
            //moves file to trash
            File trashFile=new File(System.getProperty("user.home")+"/.local/share/Trash/files",name);
            Files.move(f.toPath(), trashFile.toPath(), StandardCopyOption.REPLACE_EXISTING);

            //creates trash info file which is used to restore the trash file
            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
            Calendar cal = Calendar.getInstance();
            PrintWriter out=new PrintWriter(trashInfoFile);
            out.println("[Trash Info]");
            //eg deletetion date: DeletionDate=2014-03-01T23:38:18
            out.println("DeletionDate="+dateFormat.format(cal.getTime()).replace(" ", "T"));
        catch (IOException e) {


I have no idea of how to fix my problem, so any help would be appreciated and thanks in advance.

share|improve this question
Are you using Thunar or Nautilus? – landroni May 20 '14 at 5:43
up vote 1 down vote accepted

Open nautilus file manager and goto edit => preferences => Behavior

enter image description here

Under trash select that option

I hope that helps

share|improve this answer
Appologies, I asked this question a year ago, solved it and forgot the solution. I am marking this answer as the accepted answer. – TAAPSogeking Jul 14 '15 at 0:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.