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

A while ago, I accidentally created hundreds of thousands of files in my home directory which I subsequently deleted.

Since then however, running ls in my home directory has been extremely slow (taking tens of seconds to print). It has also been slow in other directories (as in taking 1s to print) and tab completion has been slow everywhere (also tens of seconds).

What might the problem be?

Edit: As suggested in the comments, the output of the

find ~/ -maxdepth 1 | wc

is 67 and the output of df -h is

/dev/sda2        74G  8.4G   62G  12% / 
none            4.0K     0  4.0K   0% /sys/fs/cgroup 
udev            3.9G   12K  3.9G   1% /dev 
tmpfs           795M  1.1M  794M   1% /run 
none            5.0M     0  5.0M   0% /run/lock 
none            3.9G  4.9M  3.9G   1% /run/shm 
none            100M   52K  100M   1% /run/user
/dev/sda1       825G  408G  376G  53% /home
AFS             8.6G     0  8.6G   0% /afs
/dev/sdb2       1.9T  584G  1.3T  32% /media/sj1/ResearchData1 
/dev/sdc1       932G  409G  524G  44% /media/sj1/ResearchData2 
share|improve this question
Hm. Try running du -hd 1 . (du measures Disk Usage), and see if any unreasonably large numbers pop up. – InkBlend Jun 4 '14 at 3:03
I am going to assume that you emptied the trash, right? – CameronNemo Jun 4 '14 at 3:11
Where is the trash folder? I didn't find it in .local/share where I thought it would be. At any rate, I rm -rfed those files -- actually I had to rm -rf my entire home folder because listing the files was taking too long. Maybe that nuked something important? – Opt Jun 4 '14 at 3:50
I'm trying to run du but it gets stuck. It computes the size of .gnome2-private. The next alphabetical folder is .gnupg but it gets stuck before it can print its size. If I try to run du on .gnupg, that runs fine. – Opt Jun 4 '14 at 3:51
Could you run a short SMART test on the disk just to be sure it has no issues? – Cristian Ciupitu Jun 4 '14 at 19:58

I had the same problem and the reason was a link to a network drive folder which was not working anymore. After removing it everything starts loading instantly.

share|improve this answer
Thanks for contributing. Could you explain how you removed it? – MadMike Oct 23 '14 at 9:58
I also had this issue. The tell-tale sign was that the delay was always 10 seconds, which is the amount of time after which autofs gives up trying to mount. I had a symlink in my home dir pointing to /smb/ which I removed using rm. – Flyte Jan 7 '15 at 11:12

creating the hundreds of thousands of files might have created a lot of filesystem extents that do not necessarily get removed when the files are removed. Get a "fragmentation score" with:

sudo e4defrag -c ~/

and if the score is bad (higher than 50, say), use the same command without the '-c' flag to defragment the filesystem.

share|improve this answer

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.