Difference between “./” and “sh” in UNIX

前端 未结 4 1057
鱼传尺愫
鱼传尺愫 2021-01-30 18:07

Sometimes i see that few scripts are executed through \"sh\" command and sometimes through \"./\" command.I am not able to understand the exact difference between them.Please he

4条回答
  •  盖世英雄少女心
    2021-01-30 18:17

    when your file is not executable you can't run using ./file_name.sh normally you can run by sh file_name.sh if you change your file to executable chmod a+x file_name.sh you can run your file by ./file_name.sh

提交回复
热议问题