Invalid Filenames

Hello; I have inadvertenly created a file named "something.py". When I try to delete it, using sudo, I can't. When I do a dir I see it. When I try to delete it the system says it does not exits. Can someone advise me as how to get rid of this ghost file?

Run this command to confirm it actually exists. I assume it's somewhere under your user's home directory, but you can change that accordingly (if you are not sure, it probably is so try this command first).

find $HOME -type f -name *something.py*

If it doesn't return anything, it's either in some other location in your system or it's already deleted. If you get a result, it will provide the exact location in the file system so you can issue a rm <path_to_file> command.

If none of this works please share screenshots and what steps have you taken to create the file as well as attempts to delete it.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.