Linux宝典

更换yum源

阿里云所有的镜像源网址:https://developer.aliyun.com/mirror/
//查看cenos的发行版本
cat /etc/centos-release
//替换yum源文件,例如我发行版是8.0
wget -O /etc/yum.repos.d/CentOS-Base.repo 
https://mirrors.aliyun.com/repo/Centos-8.repo

安装网络工具

//安装一些网络工具(netstat)
yum install net-tools

网络工具使用

//netstat
//功能:主要用来查看机器网络信息
// -a 显示所有连线中的Socket -n 以ip和端口数字形式展示
netstat -an //以ip端口形式展示socket信息
netstat -an | grep "8080" // 8080端口的socket是否存在

文件工具使用

//find命令
//功能:文件查找
//find [路径][可选项][参数]
// -name 文件名搜索 -iname 文件名忽略大小写 -type 根据文件类型
// -size 根据文件大小
find ./ -name "a.txt" //查找文件名为a.txt
find ./ -iname "a.txt" //查找文件名为a/A.txt
find ./ -size +1M //查找超过1M大小文件

配置文件

//文件夹没颜色,编辑家目录的 .bashrc文件
alias ls='ls --color'

猜你喜欢

转载自blog.csdn.net/weixin_38312719/article/details/113655821