我正在尝试配置和使用Laravel php框架..
我正在关注此Tutorial进行安装和配置。
此时我读到了:
$ chmod -R 0777 app/storage
// This is simply setting your environment - bootstrap/start.php
$ find -name 'bootstrap/start.php' -print -exec sed -i 's/your-machine-name/localhost/g' {} \; # add machine-name to local env, for instance "localhost"
// MAC OSX FRIENDLY VERSION: find bootstrap -name 'start.php' -exec sed -i '' -e 's/your-machine-name/localhost/g' {} \;
我是mac OSx用户,我不理解这个命令:
find bootstrap -name 'start.php' -exec sed -i '' -e 's/your-machine-name/localhost/g' {} \;
这是什么?
我该怎么办?
答案 0 :(得分:1)
它似乎在引导程序目录中查找名为“start.php”的文件。对于匹配文件,它会将'your-machine-name'替换为'localhost'。要打破它:
find
- 执行find命令bootstrap
- 要搜索的文件夹-name 'start.php'
- 搜索名为“start.php”的文件-exec
- 对于与上述匹配项匹配的每个文件,执行以下命令:sed -i '' -e
- 搜索并替换以下字符串:(-i
就地修改文件,-e
允许多次搜索/替换,如果需要)'s/your-machine-name/localhost/g'
- 在整个文件中将'your-machine-name'替换为'localhost'{} \;
- 结束搜索