How much of linux do i really need to know for HackTheBox or OSCP?

Overthewire’s Bandit is recommended of course.

More of linux is understood by basically playing with it. Understanding things like dir structure, file permissions, commands etc.

Privesc is a completely different topic and can be studied by reading and watching material on linux privesc methods.