I'm used to commands supporting multiple filename arguments if possible, but unlink doesn't:

%> unlink a b
unlink: extra operand `b'
Try `unlink --help' for more information.

I ended up using a for loop. Is there a technical reason why unlink only takes one filename?

1 Answer 1


unlink(1) is an intentionally simplified variant of rm(1).

I'm not certain why it was created, but it's probably due to the fact that under the hood, rm(1) is implemented in terms of the unlink(2) system call. Therefore, I assume the reason for unlink(1) is to provide a more direct path to the system call. Someone doubtless came up with a use case where rm(1) did the wrong thing and decided the best way to fix it was to provide this direct path.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .