Remove directory tree without following symlinks

Paul Rubin no.email at nospam.invalid
Sat Apr 23 04:13:58 EDT 2016


Steven D'Aprano <steve at pearwood.info> writes:
> I want to remove a directory, including all files and subdirectories under
> it, but without following symlinks. I want the symlinks to be deleted, not
> the files pointed to by those symlinks.

rm -r shouldn't follow symlinks like you mention.



More information about the Python-list mailing list