3 ms·
Any POSIX system has an easy way to remove a file with a malformed/hostile name. Determine the inode number with "ls -li", then remove it with "find . -inum #
by chasil 5y ago
Any POSIX system has an easy way to remove a file with a malformed/hostile name.
Determine the inode number with "ls -li", then remove it with "find . -inum # -delete" to remove it.
The GNU stat utility makes finding the inode slightly easier. This method is preferable when there is any doubt of wildcard expansion.
- scbrg 5y agoUnless I'm mistaken, POSIX find does not have -delete
- chasil 5y agoAlas, you are right, my mistake. It doesn't have inum either. Those GNUisms do creep in. https://pubs.opengroup.org/onlinepubs/9699919799/utilities/find.html https://pubs.opengroup.org/onlinepubs/9699919799/utilities/f...
- cogburnd02 5y agoGNU ls also has options to automatically add quoting to its output.
- 10000truths 5y agoIt might not be in the standard, but pretty much every implementation that I know of supports it - GNU, BSD, Solaris, even busybox and toybox.