Apply serveral Opering System Commands to Ray.

Please review the code.
Thanks.