There is a particular directory that I am working with that has about 50,000 files in it. When I try to list the contents using ls -f -1 is generates a list that repeats forever. Here are a couple of other commands I've tried that don't work at all:

Command  Result
-------  ---------------
find     "killed"
updatedb "updatedb: memory exhausted"

I even wrote a python script to list the files, but it didn't work either.

This problem directory is a Windows file share, so maybe that is part of the problem. When I list the contents in Windows, it does fine. When I use Windows powershell to copy the contents of the directory into a new directory and then try to list the contents on my Linux (RHEL) system, it works fine.

Lastly, in Windows, I compared the contents of original directory that was giving me problems with the new directory I just created. I did this by listing in windows powershell with the command 'dir -Force', to include hidden files. I diff'ed the two files and they were exactly the same.

  • 2
    What type of share?: How is it being shared? – ctrl-alt-delor Apr 19 at 22:15
  • What do you mean, "it repeats forever"? Listing 50000 files will take quite a time; are you really sure you're seeing the same set of files repeated? (That would be exceedingly unusual.) – roaima Apr 19 at 22:36
  • What did you try with find? Did you had the -P flag so that it does not follow symlinks... – Patrick Mevzek Apr 20 at 21:34
  • I don't know what type of windows share. I'd have to ask around. It's repeating the same 4096 files over and over. When I try 'find -P', it runs for 10-20 seconds and then reports, "Killed". – macdays Apr 22 at 14:39
  • I ssh'ed into a a Solaris computer and was able to list the files just fine for the problem directory. This is truly baffling why Solaris works, but Linux does not. – macdays May 16 at 23:13

I tried using a CIFS mount instead of NFS and this solved the problem! Linux doesn't like to talk to Windows via the NFS mount.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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