一尘不染

'bash -c'是做什么的?

linux

我遵循了以下教程: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,但没有在里面找到它。


阅读 576

收藏
2020-06-03

共1个答案

一尘不染

引用自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

2020-06-03