Wednesday, December 26, 2007

Ubuntu Solving The Problem Of Disappearing Disc Space

For past few days i was puzzled by this problem that i kept deleting files but there was no difference in the hard drive space, so by searching and reading i figured out a way to solve this problem,I thought about writing this small tip/guide for newbies like me

Problem / Symptom

I delete files from my hard drive (it can be linux partition or it can be NTFS partiont) yet the space on hard drive remains the same as it was before deleting the files.

Solution

What happens when you delete a file in GUI is that Linux moves the files to a Trash folder instead of actually deleting the file,

For Linux Partition i would suggest you open the terminal go to

Code:
cd /home//.Trash
Replace the with your user name e..g

Code:
cd /home/baqai/.Trash
now to see if you have any hidden files in the directory

Code:
ls -a
this will show you all the hidden / non hidden files in the directory

now for deleting the files

Code:
rm 
If you want to remove a directory than use

Code:
rm -R 
For Windows Partition

Say you have a windows partition mounted and the volume of that drive is "Downloads" you can follow the same principals as above with slight twist

First lets go to your partition

Code:
cd /media/Downloads
Now lets find those files which you deleted

Code:
cd .Trash-
e.g. in my case i typed

Code:
cd .Trash-baqai
Now you will enter a new directory

Code:
ls -a
You will be again shown a list of files, now you can follow the steps above to get rid of the files once and for all and can recover your hard drive space.

On windows partitions you will also have another directory by name of .Trash-root which you should also check just in case you deleted some files by your root account and they are there, For most of the new users like me it should not be a case normally

1 comment:

Anonymous said...

In windows use if you are using Windows Explorer then use SHIFT+Del, it won't move file to Trash folder.