Problem deleting files

Paul Schmehl paul.schmehl at gmail.com
Sun Jul 1 19:13:34 UTC 2018


I have a problem with a directory full of files that I can't seem to delete.

rm * returns argument list too long. So does file *

find . -type f -exec rm [] \; returns rm: []: No such file or directory 
over and over again.

ls | wc -l shows there's files there.
ls | wc -l
5023368

And ls -l actually lists the files:
-rw-------  1 root  wheel    134 Jun  7  2015 
sess_19n679i71prvju8nuqsvd727o4

If I try to delete that specific filename, it seems to work. (Running rm 
twice returns no such file the second time.) Yet the file count remains the 
same.

I also tried rm -fr | ls -l | awk '{print $9}', which returned a list of 
filenames but didn't delete any of them.

Nothing I've tried to delete these files seems to work. What can I do to 
get rid of these files?

Paul Schmehl
Independent Researcher


More information about the freebsd-questions mailing list