linux 常用命令

CPU 飙升排查

top
ps -mp pid -O THREAD,tid,time

常用命令

#链接远程服务器
ssh root@47.xxx.xxx.46

#从服务器上下载文件到本地
scp root@47.xxx.xxx.46:/www/wwwroot/xxxx.zip /Users/xxxx/work/

#上传

scp xxx.log root@192.168.0.1:/tmp/ 


#启动服务
php artisan serve --port=80

#后台运行
nohup ./bin/elasticsearch &
fg 退出到终端(ctrl+c后可结束进程)

docker常用命令

#删除所有的镜像
docker rmi -f $(docker images -aq)
#删除所有的容器
docker rm -f $(docker ps -aq)

#拉取镜像
docker pull 2233466866/lnmp
#启动容器
docker run -dit \
-p 80:80 \
-p 443:443 \
-p 3306:3306 \
-p 9000:9000 \
-v /Users/missapp/work/project/docker/www:/www \
-v /Users/missapp/work/project/docker/mysql:/data/mysql \
--privileged=true \
--name=lnmp \
2233466866/lnmp
#查看容器
docker images
# 进入容器,容器名称与上一步保持一致
docker exec -it lnmp /bin/bash

linux常用命令

#tail 从文件尾部开始读
tail -f test.php 
#从文件头部读
head 
#读取整个文件
cat     
#分页读
more 
#可控分页
less     
#搜索关键字
grep  
grep "111"  test.php         
grep  -n  "111"  test.php  
grep  -n  "111"  test.php |wc -l             
ps -ef |grep ssh
netstat -anpl |grep 'http'
netstat -apn|grep 8077
#查找文件
find      
#统计个数
wc 
lsof -i:80

php -i |grep ini

netstat -lptn
netstat -lntp | grep 9200
ss -ntlp

#查看占用端口
netstat -tunlp

#查看ip
ifconfig
ip addr

#绝对定位找到你的php.ini
php -i|grep php.ini


history 查看运行的命令记录
ping xxx.com
telnet 192.168.0.1 80

#重启服务
systemctl restart nginx
systemctl restart php-fpm.service

#更改目录权限
chmod -R 777 ./xxxx
#更改所属组
chown -R www:www ./xxx
#服务器负载
du -sh ./*
服务器硬件资源信息
内存:free -m 
硬盘:df -h
负载:w/top
#解压
tar -zcvf 压缩文件名 .tar.gz 被压缩文件名
tar -zxvf 压缩文件名.tar.gz
tar     -tf  xxx.tar 解压文件
tar    -tvf xxx.tar    解压文件并展示信息
zip -r  xx.zip ./xxx 压缩 unzip xx.zip 解压
#修改防火墙配置文件    
vi /etc/sysconfig/iptables
#重启防火墙使配置生效
service iptables restart

xshell文件传输命令

#yum安装lrzsz工具
yum -y install lrzsz
#查看是否安装成功
rpm -qa|grep lrzsz
#上传文件
rz
# 下载
sz

Linux进程管理命令:nohup、&、jobs、fg、bg、ps、kill

本作品采用《CC 协议》,转载必须注明作者和本文链接
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!