I am trying to delete some files and folders, but I can't because the system keeps re-creating the files.

All these files are named .nfsXXXX, where XXXX is some random 4-character hexadecimal number. Whenever I delete one of these files, it creates another one with a different name but the same contents.

This is happening in several unrelated directories. What could be causing this and how can I fix it?


4 Answers 4


Quoting verbatim from https://uisapp2.iu.edu/confluence-prd/pages/viewpage.action?pageId=123962105 :

Under linux/unix, if you remove a file that a currently running process still has open, the file isn't really removed. Once the process closes the file, the OS then removes the file handle and frees up the disk blocks. This process is complicated slightly when the file that is open and removed is on an NFS mounted filesystem. Since the process that has the file open is running on one machine (such as a workstation in your office or lab) and the files are on the file server, there has to be some way for the two machines to communicate information about this file. The way NFS does this is with the .nfsNNNN files. If you try to remove one of these file, and the file is still open, it will just reappear with a different number. So, in order to remove the file completely you must kill the process that has it open.

If you want to know what process has this file open, you can use 'lsof .nfs1234'. Note, however, this will only work on the machine where the processes that has the file open is running. So, if your process is running on one machine (eg. bobac) and you run the lsof on some other burrow machine (eg. silo or prairiedog), you won't see anything.


These .nfsXXXX files are a normal part of NFS operation. I won't rehash what @Keith Thompson wrote, but one thing to do is not delete them right away, set up a cron job to remove them if they have not been accessed in some time:

find dir .name .nfs\* -atime +3 -delete

The previous answer is not enough. The problem under AIX is that a library can be still loaded in memory even if no more process is using it. In this case you will have the same problem to remove the library file on a nfs filesystem.

The only way i found so far is to launch the command "slibclean" with root user to unload currently unused but loaded libraries from memory and be able to delete the library file.


Another option is to delete the .nfsXXXX files from the server side.

  • would not that make client write/open request fail and still cause more problems? Jan 18, 2012 at 7:09
  • yes, it shall invalidate the open fds, but who cares? the files are gone from the namespace anyway.
    – yrk
    Jan 18, 2012 at 10:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .