I have seen many websites using category list in the search box. It's really useless for me to choose the category and then to search the keyword. Is this search type really user-friendly?
I agree with you. I haven't done or seen any usability tests, but I always advise against expecting users to pre-select anything in a search. Providing just a search box, then letting users filter the results seems a better solution.
For one thing, you're asking the user to switch to the mouse and click a couple times to pick a category. Then there's the chance that they've selected badly and the results won't include what they're looking for. For another, I'd rather see too many search results than too few. It's better to scroll through a list and find what you're looking for than to have that thing filtered out prematurely.
Not sure what you mean by user-friendly but this feature is in no way a burden to the user. Using it is completely optional in both examples you have given as they have to be explicitly activated by the user.
These features are similar to Google's Advanced Search and they are meant to give additional power to users who want to obtain very specific search results. A feature doesn't fail to be user-friendly because it isn't found to be useful or isn't used.
I've used Amazon's categories before especially when I'm exploring their catalogue of products. I actually prefer Amazon's implementation to Drive's because having the filters available on the search results page means that users can narrow their results both before and after their search.