Linux Command Line of Note

Linux Command Line of Note
Linux Command Line of Note
  • yum
  • apache2
yum

centos的yum是个python脚本,关联着许多python库,BandwagonHost vps上的centos6默认python2.6,一些软件需要2.7以上,更新到了2.7,yum可能就不能用了,需要修改yum的执行脚本,第一行/usr/bin/python换成/usr/bin/python2.6

yum erase php-mysql
yum install php-mysqlnd
reference
reference2
reference3

apache2

sites-available contains the apache config files for each of your sites.

a2ensite site.mysite.com  

To enable the site. Once the site is enabled, a symlink to the config file is placed in the sites-enabled directory, indicating that the site is enabled.
reference

Apt

apt list --installed

Crontab

定时任务 cron -e
30 21 * * * /usr/local/etc/rc.d/lighttpd restart
上面的例子表示每晚的21:30重启apache。 service crond start|status|stop #CentOS

pidof

pidof 太死板,必须知道进程的名字 pidof httpd/apache2/crond
pgrep 模糊查询pid pgrep ng/http/cron/

Git Submoudle

git rm -f lib/submodule-lib/

git submodule add -f ssh://your repo/submodule-lib.git lib/submodule-lib

git submodule sync --recursive

git submodule update --recursive --remote

Related Article