scp 用于兩臺(tái)linux計(jì)算機(jī)數(shù)據(jù)傳輸
如:scp -r root@192.168.1.2:/home/hzy/ ./
scp -r /home/hzy/ root@192.168.1.2:/home/hzy
chmod 權(quán)限修改 chmod +x xxx.sh
service network restart 重啟網(wǎng)絡(luò)(centos&&redhat 6)
ntpdate ntp1.aliyun.com 同步阿里云服務(wù)器時(shí)間
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 修改時(shí)區(qū)
cat /etc/redhat-release 查看版本信息
whereis servername 查看yum安裝位置
用tar備份
tar cvpzf `date +%F`.backup.tgz / --exclude=/proc --exclude=/lost+found --exclude=/`date +%F`.backup.tgz --exclude=/mut --exclude=/sys
高壓縮比的
tar cvpjf `date +%F`.backup.tar.bz2 / --exclude=/proc --exclude=/lost+found --exclude=/`date +%F`.backup.tar.bz2 --exclude=/mut --exclude=/sys
解壓恢復(fù)
tar xvpfz `date +%F`.backup.tgz -C /
tar xvpfj `date +%F`.backup.tar.bz2 -C /