close

放一些有時候會用到的Linux指令,因為很菜,放的都只是基本的指令…

 

# 上傳或下載檔案:(下載只要反過來就好了)
scp xxx.log user@xx.xx.xx.xx:/home/log/xxx.log

# SCP with port
scp -P 4005 php.ini user@xx.xx.xx.xx:/home/php/lib/php.ini

# 登入別台Server不用打密碼:先產生Key,然後將id_dsa.pub的內容copy到server的authorized_keys裡
ssh-keygen -t dsa(rsa)

# 同步目錄:
rsync -rltvp --delete -e "ssh -p 5000 -l root" xx.xx.xx.xx:/home/www/ /home/www/

# 在別台Server上執行指令並存在某個檔案:
ssh user@xx.xx.xx.xx ls -al >> list.log

# 強制刪檔案及目錄:
rm -rf xxx

# Parse Squid的access log,看那個檔案被Access最多次
cat /home/logs/squid/access.log-20081202 | awk '{print $7}' | sort -r | uniq -c | sort -r | more
arrow
arrow
    全站熱搜

    Ching-Wei 發表在 痞客邦 留言(0) 人氣()