我遵循以下教程:http://davidtsadler.com/archives/2012/06/03/how-to-install-magento-on-ubuntu/
在某些时候它告诉我执行以下命令:
sudo bash -c "cat >> /etc/apache2/sites-available/magento-store.com <<EOF
<VirtualHost *:80>
ServerName localhost.magento-store.com
ServerAlias www.localhost.magento-store.com
DocumentRoot /home/dev/public_html/magento-store.com/public
LogLevel warn
ErrorLog /home/dev/public_html/magento-store.com/log/error.log
CustomLog /home/dev/public_html/magento-store.com/log/access.log combined
</VirtualHost>
EOF"
这个命令做了什么,我怎样才能取消它?
我重新启动了计算机,它似乎仍在运行。我查看了.bashrc
和.profile
,但是里面没有找到。
最佳答案
引用 man bash
:
-c string If the -c option is present, then commands are read from string.
If there are arguments after the string, they are assigned to the positional parameters, starting with $0.
您引用的命令会将 heredoc 中的文本(即 VirtualHost
标记中的文本)追加到文件 /etc/apache2/sites-available/magento-store.com
.
关于linux - 'bash -c' 有什么作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20858381/