Minify and Compress CSS & Javascript Files At a Linux/Unix Shell Prompt

Originally published at:

How do I minify and compress CSS & JS files on Linux or Unix-like system using shell prompt on my server? How can I minify JavaScripts and stylesheets at shell prompt so they can download faster over the Internet without using any online tools?