Полномочия Joomla файлов/папок в Ubuntu

Рекомендуемый способ установить файлы и полномочия папок в joomla корневом каталоге следующий (с help.ubuntu веб-сайта)

cd /var/www/joomla/
sudo find . -type f -exec chmod 644 {} \;
sudo find . -type d -exec chmod 755 {} \;

Кто-либо может объяснить цель {} и \в двух chmod операторах выше?

1
задан 5 June 2014 в 14:41

1 ответ

find управляйте возвращает список файлов, и -exec параметр выполняет на каждом перечисленном файле команду chmod 644. Скобки позволяют пользователю указывать, где в команде используется перечисленное имя файла...

\; привык к указанному конец команды (в этом случае, конец chmod команда)

посмотрите man find:

   -exec command ;
      Execute  command;  true  if 0 status is returned.  All following
      arguments to find are taken to be arguments to the command until
      an  argument  consisting of ';' is encountered.  The string '{}'
      is replaced by the current file name being processed  everywhere
      it occurs in the arguments to the command, not just in arguments
      where it is alone, as in some versions of find.  Both  of  these
      constructions might need to be escaped (with a '\') or quoted to
      protect them from expansion by the shell.  See the EXAMPLES sec-
      tion  for examples of the use of the '-exec' option.  The speci-
      fied command is run once for each matched file.  The command  is
      executed  in  the  starting  directory.    There are unavoidable
      security problems surrounding  use  of  the  -exec  option;  you
      should use the -execdir option instead.

http://unixhelp.ed.ac.uk/CGI/man-cgi?find

0
ответ дан 24 December 2019 в 04:49

Другие вопросы по тегам:

Похожие вопросы: