Linux中写脚本,运行前需要转换成可执行文件。 例如: 写一个名为filename.sh的shell脚本。 运行脚本前,用命令: chmod +x filename.sh 然后就发现filename.sh变成了绿色的可执行文件。