a is a symbolic link to
b. I am looking for a simple command to remove both
b at once that does not require me to know about
Some systems will dereference the symlink when you add a trailing slash (at least if the symlink points to a directory):
mkdir -p b/c && touch b/c/foo && ln -s b/c a rm -rf a/ && rm -f a # removed "b/c" and "a"
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).