站长资讯网
最全最丰富的资讯网站

linux常用命令最新汇总!

本文给大家总结介绍linux的常用命令,有需要的朋友可以收藏哦~

linux常用命令

#链接远程服务器 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
登录后复制

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 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
登录后复制

推荐学习:《Linux视频教程》

赞(0)
分享到: 更多 (0)