2489 articles

Delete lines with sed command

Sed Command to Delete Lines: Sed command can be used to delete or remove specific lines which matches a given pattern or in a particular position in a file. Here we will see how to delete lines using sed command with various examples.

More ~

How to Check if a File or Directory Exists in Bash

Many times when writing Shell scripts, you may find yourself in a situation where you need to perform an action based on whether a file exists or not.

In Bash, you can use the test command to check whether a file exists and determine the type of the file.

The test command takes one of the following syntax forms:

test EXPRESSION
[ EXPRESSION ]
[[ EXPRESSION ]]
More ~

是时间将CentOS8 升级为CentOS Stream了

CentOS8 的生命周期到2021年12月31日截止,CentOS7是到2024年6月30日。还有使用CentOS8的注意了,官方可能不再更新,需要将系统升级到CentOS Stream.

升级也很简单:

dnf swap centos-linux-repos centos-stream-repos
dnf distro-sync

附 CentOS Stream 下截地址:

http://mirrors.cqu.edu.cn/CentOS/8-stream/isos/x86_64/
http://mirrors.aliyun.com/centos/8-stream/isos/x86_64/
http://mirrors.neusoft.edu.cn/centos/8-stream/isos/x86_64/
http://mirrors.163.com/centos/8-stream/isos/x86_64/
http://mirrors.tuna.tsinghua.edu.cn/centos/8-stream/isos/x86_64/
http://mirrors.ustc.edu.cn/centos/8-stream/isos/x86_64/
http://ftp.sjtu.edu.cn/centos/8-stream/isos/x86_64/
http://mirrors.nju.edu.cn/centos/8-stream/isos/x86_64/
http://mirrors.bfsu.edu.cn/centos/8-stream/isos/x86_64/

More ~