oh-my-zsh
如果用的Mac有必要試一試這個神器oh-my-zsh
zsh
遠(yuǎn)程
1、ssh -p 端口號 用戶名@服務(wù)器地址
- 用于遠(yuǎn)程ssh登錄
2、ping 遠(yuǎn)程主機(jī)ip或網(wǎng)址
通過發(fā)送數(shù)據(jù)包ping遠(yuǎn)程主機(jī)(服務(wù)器),常用與檢測網(wǎng)絡(luò)連接和服務(wù)器狀態(tài)。
3、ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
生成公鑰
監(jiān)控及日志
1、htop
實時顯示進(jìn)程狀態(tài)
htop實時顯示
2、
sudo service nginx restart
或systemctl restart nginx.service
重啟nginx服務(wù),sudo service php-fpm restart
重啟 php-fpm服務(wù),相關(guān)的的還有
systemctl start httpd.service
systemctl restart httpd.service
systemctl stop httpd.service
systemctl reload httpd.service
systemctl status httpd.service 查看該服務(wù)狀態(tài)
3、mysql -u root -p xxxxx
連接Mysql數(shù)據(jù)庫
4、tail -f xxx.log
實時監(jiān)視日志文件
5、less -Mp '2016-12-12' xxx.log
翻頁查看某一天的日志,
ctrl + F :向前移動一屏
ctrl + B :向后移動一屏
ctrl + D :向前移動半屏
ctrl + U :向后移動半屏
空格鍵 滾動一頁
回車鍵 滾動一行
端口占用
1、netstat -apn | grep LISTEN
查看目前端口監(jiān)聽情況,netstat -nlt|grep xxxx
查看某個端口號使用情況
2、ps -aux | grep -i xxx
查看某個進(jìn)程/程序的狀態(tài)
文件處理
1、ln -s xxxx xxxlink
建立軟鏈接
2、df -lh
磁盤使用情況,du -h
具體目錄使用情況
3、locate xxx
查找文件
4、tar -cvf xxx
壓縮,tar -tvf xxx.tar
查看壓縮文件,tar -xvf xxx.tar
解壓
命令行大全
常用命令行.png