Why are some people mean nice?

I'm not really sure how to describe it but y'know those people who do mildly mean things to others like swear/insult them or slightly push and shove them but they're actually really nice? They just first appear like they don't like you and they might act aggressive around you but you know they don't really mean it and it's just the way they act with people? I know several people who are like this and I kinda just want to understand them more.