Say a is a symbolic link to b. I am looking for a simple command to remove both a and b at once that does not require me to know about b.
Tell me more
×
Unix & Linux Stack Exchange is a question and answer site for
users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.
|
|
|
My current solution is
But maybe there's something easier? |
|||||||
|
|
Some systems will dereference the symlink when you add a trailing slash (at least if the symlink points to a directory):
The POSIX standard has changed a bit (see Pathname Resolution in IEEE Std 1003.1, 2004 Edition vs. IEEE Std 1003.1-2008), but it seems like the behavior for a pathname with a trailing slash and a final pathname components that is a symlink is (mostly) the same: the symlink is resolved. Not all systems implement this behavior though (see comment by Gilles). |
|||||
|