It depends on the cell; an amoeba for example clearly seems to know what's going on around it. A virus on the other hand, having no metabolism of its own clearly doesn't.