新增:《解决 CentOS 8 执行 yum install 报 Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist 的问题》

This commit is contained in:
2022-11-06 20:38:08 +08:00
parent b68ebe213e
commit f8a373de15
6 changed files with 124 additions and 4 deletions

View File

@@ -426,6 +426,14 @@ mkdir -p 目录路径
rm -rf 文件名/目录名
```
如果想删除指定目录下除某个文件及某个目录之外的所有文件,可以试试通配符匹配:
```shell
# 但使用前先记得开启通配符功能,可以通过 shopt -s 查看是否开启了on 表示已经开启
# shopt -s extglob
rm -rf !(target_file|target_dir)
```
### 复制文件或目录
```shell

View File

@@ -264,3 +264,40 @@ docker version
docker info
```
## docker-compose命令
### 启动并后台运行所有的服务
```shell
docker-compose up -d
```
### 停止并删除容器、网络、卷、镜像
```shell
docker-compose down
```
### 列出项目中目前的所有容器
```shell
docker-compose ps
```
### 停止容器
```shell
docker-compose stop 容器名
```
### 启动容器
```shell
docker-compose start 容器名
```
### 修改 yml 文件后,重新启动并后台运行
```shell
docker-compose up --force-recreate -d
```

View File

@@ -21,13 +21,13 @@ tags:
1. 软件更新
```shell
yum update
yum -y update
```
2. 安装 yum-utils
```shell
yum install -y yum-utils device-mapper-persistent-data lvm2
yum -y install yum-utils device-mapper-persistent-data lvm2
```
3. 设置 yum 软件源