Calculations to convert path to local commands