Fixed chmod syntax for linux systems

Previous chmod syntax only works on osx. The new syntax should work on linux systems (tested on CentOS).