Is there any way to make my PC hibernate when I press the power button? By power button I meant my CPU's power button. Obviously when I press this button somewhere some signal is sent which I don't know about since I am new to Linux. Can it be intercepted to enable my PC to hibernate?
How do I hibernate my PC when I press the power button
linux;hibernate
You probably (could) use acpid (check via ps aux | grep acpid).  Then have a look at this article in the ArchWiki explaining how to use pm-utils to extend acpid to easily achieve whatever effect you'd like when some hardware button is pressed.If, however, you use GNOME, there other (also GUI) ways, see this comprehensive thread on askubuntu.com