Answering such questions isn't a problem, it's in no way prohibited. General consensus on StackExchange sites like this is that you have to show at least some effort before asking a question. But a completely new user may not have any clue whatsoever for what to google, what terms to search for, or not even be aware of existence of the common *nix tools that we use on daily basis. In such case, writing an answer will benefit everybody trying to learn, not just this one user.
To some extend there is a bit of a bias towards new users with low rep amount, I believe. Generally, a user with some stable amount of reputation can be trusted that they've pulled enough hair out of their head while trying to solve the problem and came here to ask.
In the end, writing good answers that add value is always good. If it's a duplicate ( which likely it is, since a lot of such questions are about basic stuff) you can always vote to close. If without examples from OP there's no clarity as to what they actually want, vote to close as unclear. If none of those categories fit, you're always free to consider answering.
Of course, the slightly different case is students and homework. On one hand, you can take a hard stance and deny answering. After all, students should be doing their own homework, but at the same time you don't have to give an answer that does everything for the user. Once of the things I do is provide suggestions/hints that may lead the user in the right direction, just like how a tutor or teacher would.
I want to know what is preferred guideline for such questions. Is it okay to answer them? Vote to close such questions?
I think I've answered that already. If it fits into closable categories, sure - vote to close. Providing answers that are useful, is always ok. Waiting for OP to edit their post is always good - that's what that edit button is for. And in general, there is no "one-size-fits-all" rule. Look at the specific case and decide whether or not it would be more valuable/useful to answer, or let the person ponder it on their own ( or try to ask elsewhere). It's all about communication with OP.