In linux, how can I remove all the files in a directory except the files that are actually symlinks to files in other directories?
Using find command:
find /path/to/dir -type f -delete
-type f will ensure you only delete files not symlinks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With