I would like to delete the symlink along with the source directory.
For example –
ls -lrt
testsymlink -> /user/temp/testdir
I would like to remove both testsymlink and /user/temp/testdir. Consider that I know the only the symlink name.
Any utility with python will do great.
You can use the result of
os.path.realpathto detect and delete the symlink target. Example: