幾個常用的伺服器命令

來源:互聯網
上載者:User

修改linux使用者名稱:
# usermod -l newuser olduser
# groupmod -n newgroup oldgroup

批量替換檔案內容
sed -i “s/iso-8859-1/utf-8/g” `grep 'iso-8859-1' -rl .`
sed -i 's/^M//g' ./jsdata.php
注意:這裡的“^M”要使用“CTRL-V CTRL-M”產生,而不是直接鍵入“^M”

批量壓縮檔
zip -r patch.zip -@< /home/test/up2.log

批量截取檔案
cat up.log | cut -c6- > up2.log

lsof -u www |wc -l
lsof -p 2984|wc -l

SERVER DO
查看當前的PHP FastCGI進程數是否夠用:
netstat -anpo | grep “php-fpm” | wc -l
netstat -np | grep 127.0.0.1:9000 |wc -l
kill -9 `ps aux | grep php-fpm | awk '{print $2}' | xargs`

編輯/etc/group 找到GROUP1那一行,刪除 A
或者用命令
#gpasswd -d A GROUP

查看oracle所屬的組
#groups oracle
建立使用者oracle 到主組oinstall,副組dba,主目錄/u01/oracle:
#useradd -g oinstall -G dba -d /u01/oracle oracle
如果oracle使用者已經存在則:
#usermod -g oinstall -G dba -d /u01/oracle oracle
查看使用者oracle的添加情況
# id oracle
把使用者shaoxc添加到組ryouka中:
#useradd -g ryouka shaoxc
if exist shaoxc,use
#usermod -g ryouka shaoxc
usermod -g 組名 使用者名稱:更改使用者所屬組,是覆蓋;
usermod -G 組名1[,組名2,……] 使用者名稱:添加使用者所屬組;
usermod -G zhaiyanbin,shiying,yuanjing,zhuna,shaoyuanhui,huangmin,jixiangfeng,jiangzongliang,zhaojunlei,zhuyu,yangguozhi www-data
改完許可權需要重啟nginx和phpfpm
usermod -G www bishenghua 將使用者bishenghua加到www組裡

ulimit -HSn 65535

掛載nfs:
mkdir /home/patch
mount -t nfs 10.11.83.223:/home/patch /home/patch 

查詢網域名稱的mx記錄:
單擊“開始”——”運行”  在顯示框中輸入“cmd”確定之後再依次輸入
“nslookup” ——斷行符號——set  type=mx——斷行符號,輸入要查詢的網域名稱,斷行符號即可查出網域名稱解析是否生效或是mx記錄指向了哪裡

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.