Teleporting type command doesn't work with @e

Whenever I type /tp @e[type=anything] @p it teleport all entities nearby and all my named entities, even though I've specified to teleport all cows, or minecart with chests, or whatever I put under type. Is there any way to fix this or use a different command?

Edit:
I was using the auto fill options and I used the command that I wrote specifically i.e. /tp @e[type=!minecraft:cow] @p , but it does it for anything I try. I am using vanilla 1.14.4.


Solution 1:

You are using the ! which means not. You are selecting everything that is not a cow. Get rid of the ! and it should work.