I found the following sentence in a video. I would really appreciate it if someone could explain why they have used "for" at the end of the sentence. I mean, according to my knowledge, regardless of the existence of "for" the meaning of the sentence remains intact. Furthermore, could someone please let me know the grammar points associated with this as well. This is mainly attributed to the fact that if I knew the name of the grammar related to this, I could search it on the internet and find more articles to learn about this more.

How long have you been doing that for?

dileepaHow long have you been doing that for?

The 'for' is unnecessary. It's related to this:

I have been doing that for several years.
For how long have you been doing that?

Putting a preposition at the end instead of at the beginning of a sentence or clause or phrase is called 'stranding'.

However, there are cases where the preposition itself is not needed or where it may even be incorrect or non-standard.

You might find something online if you try searching "preposition stranding".



Thank you very much for the answer.