11
May

Fixing ‘rm: cannot remove’ or ‘rm: cannot lstat’ Error Messages

If you happen to come across an error message such as the following, chances are that your filesystem has become corrupted somehow and all it really needs is some good ‘ol T.L.C. with fsck -f.

rm: cannot lstat `filename': Permission denied
rm: cannot remove `filename': Stale NFS file handle

The other time I’ve seen similar messages has been when I try to delete a file that I had forgotten was open in the background. After running jobs, I can double check that the file isn’t in use.

One last trick is to make sure that the directory that you’re working under actually still exists. Try to cd to it again using an absolute path.

Feel free to donate if this post prevented any headaches! Another way to show your appreciation is to take a gander at these relative ads that you may be interested in:


There's 0 Comment So Far

Share your thoughts, leave a comment!