linux copy directory

Some times I can’t remember how to copy the whole directory on centos, here is the code

cp -arf /home/test/*  /home2/test
#-a     Same as -dR --preserve=ALL
#-R, -r, --recursive    Copy directories recursively.
#-f    force overwrite
#-p    Same as --preserve=mode,ownership,timestamps
#-d    Same as --no-dereference --preserve=links.
#--no-dereference    Never follow symbolic links in SOURCE.

php linux函数收集

  // list函数
$my_array = array("Dog","Cat","Horse");
list($a, $b, $c) = $my_array;
echo "I have several animals, a $a, a $b and a $c.";
//报错 监控 
tail -f /var/log/httpd/error_log	
tail -f /var/log/httpd/access_log | grep test.php 
// cd/cp
cd /var/www/html/tmp/
cp /var/www/html/tmp/test.php /var/www/html/
// 定时任务
crontab -e
*/5 * * * * php /var/www/html/xx.php 定时任务:表示每隔5分钟运行一次xx.php(*号代表的意思是分钟、小时,一个月份中的第几日,月份,一个星期中的第几天) 
// 直接运行php
php /var/www/html/test.php