Linux笔记

Linux笔记

2020.06.11

1. linux的常用命令

linux常用命令 (3y)

2. 删除以.xxx结尾的文件

在这里插入图片描述

2020.06.17

解决apt-get下载速度慢

①. 先安装wget命令及备份原文件:

//安装wget命令
yum install -y wget 

//对CentOS-Base.repo备份
 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

②. 下载新的CentOS-Base.repo 到/etc/yum.repos.d/

CentOS 6:
阿里源:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
163源:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo

CentOS 7:
阿里源:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
163源:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

③. 下载完成后,修改源文件连接为https

vim /etc/yum.repos.d/CentOS-Base.repo,将里面所有的http修改为https

④. 最后清理升级并重新生成缓存

yum clean all && yum makecache

批量替换

2.1 将文件1.txt内的文字“garden”替换成“mirGarden”

 //sed -i 很简单
 sed -i "s/garden/mirGarden/g" 1.txt

2.2 将当前目录下的所有文件内的“garden”替换成“mirGarden”

//其实也就是ls出多个文件名而已
sed -i "s/garden/mirGarden/g" `ls` 

2020.06.21

java -version 出现pick up JAVA_OPTIONS

vim /etc/profile //配置环境变量
在里面添加 unset _JAVA__OPTIONS
source /etc/profile //使配置生效

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值