提交 82e1d4a9 编写于 作者: F feilong

拆分Linux实战练习和复习习题

上级 12e26f04
......@@ -3,8 +3,14 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"命令"
]
],
"keywords_must": [["Linux", "命令"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:初识Linux
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2673),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下对登陆信息含义描述错误的是?
登陆信息:
```bash
# csdn @ edu in ~ [18:47:27]
$
```
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:初识Linux
* 通过实战练习,你已经掌握了相关知识,以下对登陆信息含义描述错误的是?
登陆信息:
```bash
# csdn @ edu in ~ [18:47:27]
$
```
## 答案
```bash
$: 命令提示符. 如果是root用户则提示符是¥;
```
## 选项
### A
```bash
$: 命令提示符. 如果是root用户则提示符是#;
```
### B
```bash
@: 分隔符.
```
### C
```bash
csdn: 表示当前的登陆用户,这里是使用csdn账户登陆.
```
### D
```bash
edu: 主机短名称
```
### E
```bash
~: 当前所在目录
```
### F
```bash
在Linux系统中, 最重要的就是命令, 而每个命令执行必然有两步: 输入和输出.
```
......@@ -3,8 +3,15 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"查看",
"文件"
]
],
"keywords_must": [["Linux", "查看", "文件"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:如何查看文件全部内容
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2682),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:如何查看文件全部内容
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:cat -n /etc/hosts
可以看到 hosts 文件中含有'127.0.0.1 localhost'这行
```
## 选项
### A
```bash
执行命令:cp /etc/hosts hosts
执行命令:cat hosts
可以看到 hosts 文件中含有'127.0.0.1 localhost'这行
```
### B
```bash
执行命令:cp /etc/hosts hosts
执行命令:cat -n hosts
可以看到 hosts 文件中含有'2 127.0.0.1 localhost'这行
```
### C
```bash
执行命令:cat /etc/hosts
可以看到 hosts 文件中含有'127.0.0.1 localhost'这行
```
......@@ -3,8 +3,16 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"长",
"文件",
"查看"
]
],
"keywords_must": [["Linux", "长", "文件", "查看"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:长内容的文件查看方式
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2683),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:长内容的文件查看方式
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
有一个程序从1开始一直往1.log文件里,每隔1秒按行插入序号到文件1.log
执行命令:`head -h 1.log`
那么可以看到屏幕每隔1秒会显示一行新的序号
```
## 选项
### A
```bash
执行命令:`head /etc/hosts` 可以查看文件的前10行文本
执行命令:`tail /etc/hosts` 可以查看文件的尾巴10行文本
```
### B
```bash
有一个程序从1开始一直往1.log文件里,每隔1秒按行写入序号
执行命令:`tail -f 1.log`
那么可以看到屏幕每隔1秒会显示一行新的序号
```
### C
```bash
执行命令:`tail /etc/hosts -n 2` 可以查看文件的尾巴2行文本
执行命令:`head /etc/hosts -n 2` 可以查看文件的前2行文本
```
......@@ -3,8 +3,15 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"vi",
"编辑"
]
],
"keywords_must": [["Linux", "vi", "编辑"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:使用vi简单的编辑文本
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2684),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:使用vi简单的编辑文本
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:`touch 1.txt`
使用 `vi 1.txt` 打开文本文件
输入`i`键进入编辑模式
输入文本:hello
`ESC`键退出编辑模式
输入冒号按键:`:`,切换到vi的命令输入区
输入命令:`q` 退出编辑器
此时,文件 1.txt 里含有文本"hello"
```
## 选项
### A
```bash
使用 vi 打开文本文件后,
需要输入`a`或者`i`键才能进入编辑模式,输入文本到编辑器中
```
### B
```bash
使用 vi 编辑文本后,ESC退出编辑模式,
然后按冒号进入命令区
然后执行`w`可以保存文本
然后执行`q`可以退出vi编辑器
```
### C
```bash
执行命令:`touch 1.txt`
使用 `vi 1.txt` 打开文本文件
输入`i`键进入编辑模式
输入文本:hello
`ESC`键退出编辑模式
输入冒号按键:`:`,切换到vi的命令输入区
输入命令:`wq` 退出编辑器
此时,文件 1.txt 里含有文本"hello"
```
......@@ -3,8 +3,15 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"查找",
"文件"
]
],
"keywords_must": [["Linux", "查找", "文件"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:查找文件
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2685),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:查找文件
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:`mkdir test`
执行命令:`cd test`
执行命令:`touch 1.txt`
执行命令:`mkdir test`
执行命令:`cd test`
执行命令:`touch 1.txt`
执行命令:`cd ..`
执行命令:`find test/ -name 1.txt -size 0M`
此时,会输出:
test/1.txt
```
## 选项
### A
```bash
执行命令:`mkdir test`
执行命令:`cd test`
执行命令:`touch 1.txt`
执行命令:`mkdir test`
执行命令:`cd test`
执行命令:`touch 1.txt`
执行命令:`cd ../../`
执行命令:`find test/ -name 1.txt -size 1M`
此时,会输出:
test/test/1.txt
test/1.txt
```
### B
```bash
执行命令:`mkdir test`
执行命令:`cd test`
执行命令:`touch 1.txt`
执行命令:`mkdir test`
执行命令:`cd test`
执行命令:`touch 1.txt`
执行命令:`cd ..`
执行命令:`find test/ -name 1.txt`
此时,会输出:
test/1.txt
```
### C
```bash
执行命令:`mkdir test`
执行命令:`cd test`
执行命令:`touch 1.txt`
执行命令:`mkdir test`
执行命令:`cd test`
执行命令:`touch 1.txt`
执行命令:`cd ../../`
执行命令:`find test/ -name 1.txt`
此时,会输出:
test/test/1.txt
test/1.txt
```
......@@ -3,8 +3,15 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"创建",
"快捷方式"
]
],
"keywords_must": [["Linux", "创建", "快捷方式"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:创建一个快捷方式
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2686),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:创建一个快捷方式
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:`touch 1.txt`
使用`vi 1.txt`编辑并输入"hello",然后保存退出
执行命令:`ln -s 1.txt 2.txt`
执行命令:`rm 1.txt`
执行命令:`cat 2.txt`
此时,输出:hello
```
## 选项
### A
```bash
执行命令:`touch 1.txt`
使用`vi 1.txt`编辑并输入"hello",然后保存退出
执行命令:`ln 1.txt 2.txt`
执行命令:`rm 1.txt`
执行命令:`cat 2.txt`
此时,输出:hello
```
### B
```bash
执行命令:`ln -s /usr /home/csdn/myusr`
执行命令:`rm /home/csdn/myusr`
执行命令:`ln -s /usr /home/csdn/myusr`
会在/home/csdn/目录下创建一个myusr的软链接
该软链接指向 /usr 目录
```
### C
```bash
执行命令:`ln -s /usr /home/csdn/myusr`
会在/home/csdn/目录下创建一个myusr的软链接
该软链接指向 /usr 目录
```
......@@ -3,8 +3,17 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [["Linux", "压缩", "文件"]],
"keywords_forbid": ["解压"]
"keywords_must": [
[
"Linux",
"压缩",
"文件"
]
],
"keywords_forbid": [
"解压"
]
}
\ No newline at end of file
# 实战:压缩一个文件
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2687),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:压缩一个文件
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:`touch 1.txt`
执行命令:`zip 1.txt`
此时,生产了一个`1.txt.zip`压缩包文件
```
## 选项
### A
```bash
执行命令:`touch 1.txt`
执行命令:`tar -cvzf 1.tar 1.txt`
此时,生产了一个`1.tar`压缩包文件
```
### B
```bash
执行命令:`touch 1.txt`
执行命令:`tar -cvzf 1.tar.gz 1.txt`
此时,生产了一个`1.tar.gz`压缩包文件
```
### C
```bash
执行命令:`touch 1.txt`
执行命令:`gzip 1.txt`
此时,生产了一个`1.txt.gz`压缩包文件
```
......@@ -3,8 +3,15 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"解压",
"文件"
]
],
"keywords_must": [["Linux", "解压", "文件"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:解压缩一个文件
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2688),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:解压缩一个文件
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:`touch 1.txt`
执行命令:`gunzip 1.txt`
执行命令:`gunzip -d 1.txt`
此时目录下:
* 不存在文件 1.txt.gz
* 存在文件 1.txt
```
## 选项
### A
```bash
执行命令:`touch 1.txt`
执行命令:`gzip 1.txt`
执行命令:`gunzip 1.txt`
此时目录下:
* 不存在文件 1.txt.gz
* 存在文件 1.txt
```
### B
```bash
执行命令:`touch 1.txt`
执行命令:`gzip 1.txt`
执行命令:`gzip -d 1.txt`
此时目录下:
* 不存在文件 1.txt.gz
* 存在文件 1.txt
```
### C
```bash
执行命令:`touch 1.txt`
执行命令:`gzip 1.txt`
此时目录下:
* 存在文件 1.txt.gz
* 不存在文件 1.txt
```
......@@ -3,8 +3,14 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"安装"
]
],
"keywords_must": [["Linux", "安装"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:在线安装软件
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2689),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:在线安装软件
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
在Windows系统上执行命令:`biergaici install tree`
然后执行:`tree /home`
可以输出 home/ 目录的目录树结构
```
## 选项
### A
```bash
Mac系统上如果预装了包管理命令`brew`
在Mac系统上执行命令:`sudo brew install tree`
然后执行:`tree home/`
可以输出 home/ 目录的目录树结构
```
### B
```bash
在Ubuntu系统上执行命令:`sudo apt-get install tree`
然后执行:`tree home/`
可以输出 home/ 目录的目录树结构
```
### C
```bash
在CentOS系统上执行命令:`sudo yum install tree`
然后执行:`tree /home`
可以输出 /home 目录的目录树结构
```
......@@ -3,8 +3,15 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"效率",
"技巧"
]
],
"keywords_must": [["Linux", "效率", "技巧"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:提升效率的一些技巧
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2690),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:提升效率的一些技巧
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
history命令就是查看当前用户下所以有历史执行命令。
因此在Linux下输入命令的时候,在命令行参数里直接指定密码是安全的行为。
```
## 选项
### A
```bash
上下翻页键可以直接回显最近执行的一条命令。
```
### B
```bash
history命令就是查看当前用户下所以有历史执行命令。
因此在Linux下输入命令的时候,在命令行参数里直接指定密码是不安全的行为。
```
### C
```bash
[tab]热键是Linux bash shell中最最常用的键了。
它具有补全命令和文件补全的功能。
```
......@@ -3,8 +3,14 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"基础命令"
]
],
"keywords_must": [["Linux", "基础命令"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:Linux基础命令汇总
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2691),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:Linux基础命令汇总
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
Linux 命令有一大类是用来变魔法的
例如:Anti-Apparition Charm,Beauty spell,Bedazzling Hex
```
## 选项
### A
```bash
Linux 命令有一大类是用来创建文件和文件夹的,
例如:touch, mkdir, ln
```
### B
```bash
Linux 命令有一大类是用来移动文件的,
例如:cp,mv
```
### C
```bash
Linux 命令有一大类是用来查看文件的,
例如:cat, head, tail
```
### D
```bash
Linux 命令有一大类是用来删除文件和文件夹的,
例如:rm, rmdir
```
### E
```bash
Linux 命令有一大类是用来编辑文件的,
例如:vi, vim
```
### F
```bash
Linux 每个平台都有对应包管理器,用来安装/卸载新包和命令,
例如:yum, apt-get
```
......@@ -3,8 +3,17 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [["Linux", "创建", "目录"]],
"keywords_forbid": ["删除"]
"keywords_must": [
[
"Linux",
"创建",
"目录"
]
],
"keywords_forbid": [
"删除"
]
}
\ No newline at end of file
# 实战:创建一个目录
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2674),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:创建一个目录
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
创建doc目录的命令是:`makedir doc`
```
## 选项
### A
```bash
在Linux下权限是极其严格的,如果不在home目录下,
是没有权限创建目录的.
```
### B
```bash
创建doc目录的命令是:`mkdir doc`
```
### C
```bash
切换当前目录到var目录的命令是: `cd /var`
```
......@@ -3,8 +3,14 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"入门"
]
],
"keywords_must": [["Linux", "入门"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:Linux入门总结
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2692),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:Linux入门总结
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
Linux Shell环境只能使用命令,不能编程
```
## 选项
### A
```bash
使用Linux命令还可以对系统和系统日志进行维护
```
### B
```bash
使用Linux命令还可以对磁盘管理
```
### C
```bash
Linux命令还可以对用户文件系统进行权限管理
```
......@@ -4,10 +4,31 @@
"安装Ubuntu",
"安装CentOS"
],
"keywords_must": [["Ubuntu", "操作系统", "安装"], ["CentOS", "操作系统", "安装"], ["Debian", "操作系统", "安装"], ["RedHat", "操作系统", "安装"]],
"keywords_must": [
[
"Ubuntu",
"操作系统",
"安装"
],
[
"CentOS",
"操作系统",
"安装"
],
[
"Debian",
"操作系统",
"安装"
],
[
"RedHat",
"操作系统",
"安装"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json"
]
}
\ No newline at end of file
......@@ -3,8 +3,17 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [["Linux", "创建", "文件"]],
"keywords_forbid": ["删除"]
"keywords_must": [
[
"Linux",
"创建",
"文件"
]
],
"keywords_forbid": [
"删除"
]
}
\ No newline at end of file
# 实战:创建一个空白文件
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2675),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:创建一个空白文件
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
如果文件 `hello.txt` 已存在
命令 `touch hello.txt` 会创建一个空白的`hello.txt`文件
并且覆盖了原来的`hello.txt`文件
```
## 选项
### A
```bash
如果 cd /home/csdn/doc 失败,会提示:
cd: no such file or directory: /home/csdn/doc
此时可以先 cd /home/csdn
再执行 mkdir doc 先创建目录
```
### B
```bash
命令 `touch` 用来创建一个空白文件,但如果文件已存在,则会更新时间.
```
### C
```bash
如果文件 `hello.txt` 不存在
命令 `touch hello.txt` 会创建一个空白的`hello.txt`文件
```
......@@ -3,8 +3,14 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"路径"
]
],
"keywords_must": [["Linux", "路径"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:认识路径的概念
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2676),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:认识路径的概念
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
假设当前在 /home/csdn/doc 目录
命令 `cd .` 可以进入 /home/csdn 目录
```
## 选项
### A
```bash
在对 Linux 目录操作过程中
可以使用 pwd 命令查看当前所处目录的绝对路径
```
### B
```bash
假设目录 /home/csdn/doc 存在
命令 `cd /home/csdn/doc` 可以从任何位置切换到doc目录
```
### C
```bash
假设当前在 /home/csdn/doc 目录
命令 `cd ..` 可以进入 /home/csdn 目录
```
......@@ -3,8 +3,15 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"删除",
"文件"
]
],
"keywords_must": [["Linux", "删除", "文件"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:删除一个文件
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2677),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:删除一个文件
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:`touch test1.txt`
执行命令:`touch test2.txt`
接着执行命令:`rm test2.txt`
此时,文件`test1.txt`已经被删除
```
## 选项
### A
```bash
执行命令:`touch test.txt`
接着执行命令:`rm test.txt`
此时,文件`test.txt`已经被删除
```
### B
```bash
执行命令:`touch test.txt`
接着执行命令:`rm test.txt`
接着执行命令:`touch test.txt`
此时,文件`test.txt`存在
```
### C
```bash
执行命令:`touch test1.txt`
执行命令:`touch test2.txt`
接着执行命令:`rm test1.txt`
此时,文件`test2.txt`存在
```
......@@ -3,8 +3,17 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [["Linux", "删除", "目录"]],
"keywords_forbid": ["创建"]
"keywords_must": [
[
"Linux",
"删除",
"目录"
]
],
"keywords_forbid": [
"创建"
]
}
\ No newline at end of file
# 实战:删除目录
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2678),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:删除目录
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:`mkdir test`
执行命令:`rm -f test`
则目录 test 先被创建,接着被删除
```
## 选项
### A
```bash
执行命令:`mkdir test`
执行命令:`rmdir test`
则目录 test 先被创建,接着被删除
```
### B
```bash
执行命令:`mkdir test`
执行命令:`rm -d test`
则目录 test 先被创建,接着被删除
```
### C
```bash
命令 `rmdir` 和 命令 `rm -d` 都可以用来删除目录
```
......@@ -3,8 +3,20 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"复制",
"目录"
],
[
"Linux",
"复制",
"文件"
]
],
"keywords_must": [["Linux", "复制", "目录"], ["Linux", "复制", "文件"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:复制目录和文件
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2679),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:复制目录和文件
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:mkdir test
执行命令:cd test
执行命令:touch 1.txt
执行命令:cd ..
执行命令:cp test test2
此时,存在文件 test2/1.txt
```
## 选项
### A
```bash
执行命令:mkdir test
执行命令:cd test
执行命令:touch 1.txt
执行命令:cd ..
执行命令:cp -r test test2
此时,存在文件 test2/1.txt
```
### B
```bash
执行命令:touch 1.txt
执行命令:cp 1.txt 2.txt
此时,存在文件 2.txt
```
### C
```bash
执行命令:touch 1.txt
执行命令:cp -r 1.txt 3.txt
此时,存在文件 3.txt
```
......@@ -3,8 +3,20 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"移动",
"目录"
],
[
"Linux",
"移动",
"文件"
]
],
"keywords_must": [["Linux", "移动", "目录"], ["Linux", "移动", "文件"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:移动目录和文件
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2680),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:移动目录和文件
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:cd /home/csdn
执行命令:mkdir test
执行命令:mv test test3
此时,文件夹 /home/csdn/test/ 存在
```
## 选项
### A
```bash
执行命令:cd /home/csdn
执行命令:touch 1.txt
执行命令:mkdir test
执行命令:mv 1.txt test/
此时,存在文件 /home/csdn/test/1.txt
```
### B
```bash
执行命令:cd /home/csdn
执行命令:touch 1.txt
执行命令:mkdir test
执行命令:mv 1.txt test/
此时,文件 /home/csdn/1.txt 已不存在
```
### C
```bash
执行命令:cd /home/csdn
执行命令:mkdir test
执行命令:mv test test3
此时,文件夹 /home/csdn/test3/ 存在
```
......@@ -3,8 +3,20 @@
"keywords": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
],
"keywords_must": [
[
"Linux",
"重命名",
"目录"
],
[
"Linux",
"重命名",
"文件"
]
],
"keywords_must": [["Linux", "重命名", "目录"], ["Linux", "重命名", "文件"]],
"keywords_forbid": []
}
\ No newline at end of file
# 实战:重命名目录和文件
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36675?targetLesson=2681),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
提示:`rename` 命令支持通配符方式批量重命名,下面的选项需要你在实战环境中自己做额外测试。
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:重命名目录和文件
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
提示:`rename` 命令支持通配符方式批量重命名,下面的选项需要你在实战环境中自己做额外测试。
## 答案
```bash
执行命令:`touch a_01.txt`
执行命令:`touch a_02.txt`
执行命令:`rename a b`
此时目录下存在两个文件`b_01.txt``b_02.txt`
```
## 选项
### A
```bash
使用 `mv a b` 重命名文件a为b
实际上就是在当前目录下移动文件a到b
```
### B
```bash
使用 `mv A B` 重命名文件夹A为B
实际上就是在当前目录下移动文件夹A到B
```
### C
```bash
执行命令:`touch a_01.txt`
执行命令:`touch a_02.txt`
执行命令:`rename a b *`
此时目录下存在两个文件`b_01.txt``b_02.txt`
```
{
"node_id": "gml-107df6e5ed9b4bef8b035e0649b2449e",
"keywords": [],
"keywords_must": [["Linux", "新增", "用户"], ["Linux", "添加", "用户"]],
"keywords_must": [
[
"Linux",
"新增",
"用户"
],
[
"Linux",
"添加",
"用户"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:新增用户
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2693),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:新增用户
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:`useradd blue`
此时创建了一个用户,用户名为 blue
并且在 /home 目录下创建了一个用户目录 /home/blue
```
## 选项
### A
```bash
执行命令:`sudo useradd blue -d /home/red`
此时创建了一个用户,用户名为 blue
并且在 /home 目录下创建了一个用户目录 /home/red
```
### B
```bash
执行命令:`sudo useradd red -d /home/red`
此时创建了一个用户,用户名为 red
并且在 /home 目录下创建了一个用户目录 /home/red
```
### C
```bash
执行命令:`sudo useradd blue`
此时创建了一个用户,用户名为 blue
并且在 /home 目录下创建了一个用户目录 /home/blue
```
{
"node_id": "gml-326862a132ac4b548b70e5766a71c1ae",
"keywords": [],
"keywords_must": [["Linux", "修改", "文件", "权限"]],
"keywords_must": [
[
"Linux",
"修改",
"文件",
"权限"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:修改文件权限
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2702),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:修改文件权限
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
Code文件的权限为:`drwxrwxr--`
则权限数字为:772
```
## 选项
### A
```bash
Code文件的权限为:`drwxrwx---`
则权限数字为:770
```
### B
```bash
执行命令:`chmod 777 Code`
则Code文件的权限为:`drwxrwxrwx`
```
### C
```bash
执行命令:`chmod 757 Code`
则Code文件的权限为:`drwxr-xrwx`
```
{
"node_id": "gml-e4d153da66c945df9c07dc52e5a05598",
"keywords": [],
"keywords_must": [["Linux", "修改", "文件", "所有者"], ["Linux", "更改", "文件", "所有者"], ["Linux", "改变", "文件", "所有者"]],
"keywords_must": [
[
"Linux",
"修改",
"文件",
"所有者"
],
[
"Linux",
"更改",
"文件",
"所有者"
],
[
"Linux",
"改变",
"文件",
"所有者"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:修改文件所有者
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2703),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:修改文件所有者
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:sudo chmod csdn /tmp/yum.log
执行命令:ll /tmp/yum.log
输出:-rw------- 1 csdn root 0 5月 4 2020 /tmp/yum.log
表示文件 yum.log 已授权给用户 csdn
```
## 选项
### A
```bash
通过命令chown,可以将一个文件授权给多个用户
```
### B
```bash
chown 是 change owner 的缩写
```
### C
```bash
执行命令:sudo chown csdn /tmp/yum.log
执行命令:ll /tmp/yum.log
输出:-rw------- 1 csdn root 0 5月 4 2020 /tmp/yum.log
表示文件 yum.log 已授权给用户 csdn
```
{
"node_id": "gml-30df84c89e2e4846aee3b9f07a48fb9a",
"keywords": [],
"keywords_must": [["Linux", "修改", "文件", "组"]],
"keywords_must": [
[
"Linux",
"修改",
"文件",
"组"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:修改文件所在组
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2704),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:修改文件所在组
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:sudo chown csdn /tmp/yum.log
执行命令:sudo chgroup csdn /tmp/yum.log
执行命令:ll /tmp/yum.log
输出:-rw------- 1 csdn csdn 0 5月 4 2020 /tmp/yum.log
表示文件 yum.log 已授权给用户 csdn 授权给用户组 csdn
```
## 选项
### A
```bash
chown chgrp 可以组合使用
```
### B
```bash
chgrp 是 change group 的缩写
```
### C
```bash
执行命令:sudo chown csdn /tmp/yum.log
执行命令:sudo chgrp csdn /tmp/yum.log
执行命令:ll /tmp/yum.log
输出:-rw------- 1 csdn csdn 0 5月 4 2020 /tmp/yum.log
表示文件 yum.log 已授权给用户 csdn 授权给用户组 csdn
```
{
"node_id": "gml-6530732255a141b69a712f52cd695bb5",
"keywords": [],
"keywords_must": [["Linux", "命令"]],
"keywords_must": [
[
"Linux",
"命令"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:Linux实战,谁是第一美女
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2705),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:Linux实战,谁是第一美女
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
一个用户只能属于一个组
```
## 选项
### A
```bash
一个文件可以分别针对当前用户,用户组,其他用户设置权限
```
### B
```bash
一个组可以包含多个用户
```
### C
```bash
一个用户可以属于多个组
```
{
"node_id": "gml-be2d934d6b074cdfb013188d8bbcee3a",
"keywords": [],
"keywords_must": [["Linux", "查看", "进程"]],
"keywords_must": [
[
"Linux",
"查看",
"进程"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:查看系统进程
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2706),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:查看系统进程
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
`ps aux` 看不到进程的内存和CPU占用信息
```
## 选项
### A
```bash
`ps aux` 可以查看进程PID信息
进程编号(PID)1 被分配给启动过程中执行的第一个进程,PID 1 之后的每一个进程都是它的子孙。 PID 1 进程是初始化进程,在大多数新版本的 Linux 中,它只是一个指向 systemd 程序的符号链接。
```
### B
```bash
`ps aux`中 aux参数的含义
a 显示现行终端机下的所有程序,包括其他用户的程序
u 以用户为主的格式来显示程序状况。
x 显示所有程序,不以终端机来区分。
```
### C
```bash
可以通过`ps aux`查看系统进程信息。
```
{
"node_id": "gml-664426ba00d54e809da78070856cedd9",
"keywords": [],
"keywords_must": [["Linux", "监控", "进程"]],
"keywords_must": [
[
"Linux",
"监控",
"进程"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:实时监控进程运行
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2707),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:实时监控进程运行
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
通过`top`命令可以查看端口占用
```
## 选项
### A
```bash
通过`top`或者`htop`可以查看进程和内存占用
```
### B
```bash
通过命令:`sudo yum install htop`
可以安装一个更强大的进程监控命令`htop`
```
### C
```bash
`top` 命令可以实时监控系统的进程信息
```
{
"node_id": "gml-222d86f8aece49718f0e8f2bcbb6047c",
"keywords": [],
"keywords_must": [["Linux", "定时任务"]],
"keywords_must": [
[
"Linux",
"定时任务"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:定时任务
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2708),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:定时任务
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
定时任务表达式:*/1 * * * *
表示每隔1小时执行任务
```
## 选项
### A
```bash
crontab status 可以查看定时任务状态
```
### B
```bash
crontab -l 可以查看定时任务列表
```
### C
```bash
sudo crontab -e 可以创建定时任务文件
```
{
"node_id": "gml-b8b1192175914cd0913e106705c07c13",
"keywords": [],
"keywords_must": [["Linux", "设置", "密码"]],
"keywords_must": [
[
"Linux",
"设置",
"密码"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:给账户设置密码
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2694),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:给账户设置密码
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:`sudo passwd edu`
可以为edu用户配置密码
从安全角度来说应该输入8位以下纯数字密码。
```
## 选项
### A
```bash
执行命令:`sudo passwd`
可以为当前用户配置密码
从安全角度来说应该输入8位以上包含字母数字下划线的密码。
```
### B
```bash
执行命令:`sudo passwd root`
可以为root用户配置密码
从安全角度来说应该输入8位以上包含字母数字下划线的密码。
```
### C
```bash
执行命令:`sudo passwd edu`
可以为edu用户配置密码
从安全角度来说应该输入8位以上包含字母数字下划线的密码。
```
{
"node_id": "gml-8b4ccd76282143a69e656f2142435c0f",
"keywords": [],
"keywords_must": [["Linux", "切换", "用户"]],
"keywords_must": [
[
"Linux",
"切换",
"用户"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:切换用户
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2695),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:切换用户
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2695),完成实战练习后请点击【`检测任务`】按钮。
## 答案
```bash
输入命令:`whoisyourdaddy`
可以查看当前用户是从哪个用户切换过来的。
```
## 选项
### A
```bash
执行命令:`su - edu`
输入密码登陆到edu用户
再次执行命令:`su - edu`
输入密码登陆到edu用户
执行命令:`exit`
执行命令:`exit`
此时,回到了最开始的登陆用户
```
### B
```bash
输入命令:`whoami`
可以查看当前用户名
```
### C
```bash
执行命令:`su - edu`
输入edu账户的密码
此时进入了 edu 账户
```
{
"node_id": "gml-f4db21b22cc64300a378f195d2358379",
"keywords": [],
"keywords_must": [["Linux", "删除", "用户"]],
"keywords_must": [
[
"Linux",
"删除",
"用户"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:删除用户
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2696),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:删除用户
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
用户可以随意删除,例如应该经常删除root用户,保证系统干净
```
## 选项
### A
```bash
不建议手工用vi删除用户
```
### B
```bash
使用vi编辑这些文件可以删除用户 edu
* 用户基本信息:存储在 /etc/passwd 文件中
* 用户密码信息:存储在 /etc/shadow 文件中
* 用户群组基本信息:存储在 /etc/group 文件中
* 用户群组信息信息:存储在 /etc/gshadow 文件中
* 主目录默认位于 /home/edu
```
### C
```bash
执行命令:`sudo userdel -r edu`
可以删除用户 edu
```
{
"node_id": "gml-5830d451d5f140a9bbb6aba2ef760459",
"keywords": [],
"keywords_must": [["Linux", "uid"], ["Linux", "gid"]],
"keywords_must": [
[
"Linux",
"uid"
],
[
"Linux",
"gid"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:显示用户UID和GID
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2697),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:显示用户UID和GID
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
一个用户只能属于一个组
```
## 选项
### A
```bash
uid=1000(csdn) gid=1000(csdn) groups=1000(csdn)
uid表示用户id
gid表示用户的初始组id
groups表示用户所在的组
```
### B
```bash
执行命令:`id csdn`
可以查看csdn用户的id信息
```
### C
```bash
执行命令:`id`
可以查看当前用户的id信息
```
{
"node_id": "gml-88ec027b007f4c9fb7df2b622c4f7b5a",
"keywords": [],
"keywords_must": [["Linux", "新增", "用户组"]],
"keywords_must": [
[
"Linux",
"新增",
"用户组"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:新增用户组
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2698),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:新增用户组
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:`groupadd test`
执行命令:`tail -n 1 /etc/group`
可以查看刚创建的组 test 的信息
```
## 选项
### A
```bash
执行命令:`cat /etc/group`
可以查看所有用户组的id信息
```
### B
```bash
执行命令:`sudo groupadd test`
使用vi编辑器打开/etc/group,删除最后一行test用户信息
再次执行:`sudo groupadd test`
执行命令:`tail -n 1 /etc/group`
可以查看到组 test 的信息
```
### C
```bash
执行命令:`sudo groupadd test`
执行命令:`tail -n 1 /etc/group`
可以查看刚创建的组 test 的信息
```
{
"node_id": "gml-b1826b136ef44c87b503777ce185b355",
"keywords": [],
"keywords_must": [["Linux", "删除", "用户组"]],
"keywords_must": [
[
"Linux",
"删除",
"用户组"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:删除用户组
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2699),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:删除用户组
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
执行命令:`sudo groupadd test`
执行命令:`groupdel test`
此时,用户组 test 已经被删除
```
## 选项
### A
```bash
执行命令:`sudo groupdel root`
这个命令会失败,不能删除主用户组
```
### B
```bash
执行命令:`sudo groupadd test`
执行命令:`tail -n 1 /etc/group`
记住此时 test 用户组的信息
执行命令:`sudo groupdel test`
执行命令:`sudo groupadd test`
执行命令:`tail -n 1 /etc/group`
记住此时 test 用户组的信息
两次查看 test 用户组的信息一致
```
### C
```bash
执行命令:`sudo groupadd test`
执行命令:`sudo groupdel test`
此时,用户组 test 已经被删除
```
{
"node_id": "gml-f6582cee0184478c9610f15aac86d62f",
"keywords": [],
"keywords_must": [["Linux", "加入", "用户组"], ["Linux", "移除", "用户组"], ["Linux", "添加", "用户组"], ["Linux", "删除", "用户组"]],
"keywords_must": [
[
"Linux",
"加入",
"用户组"
],
[
"Linux",
"移除",
"用户组"
],
[
"Linux",
"添加",
"用户组"
],
[
"Linux",
"删除",
"用户组"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:把用户加入和移除用户组
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2700),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:把用户加入和移除用户组
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
## 答案
```bash
假设用户 csdn 的id信息如下:
uid=1000(csdn) gid=1000(csdn) groups=1000(csdn)
假设存在用户组 test
执行命令:`sudo gpasswd -a csdn test`
执行命令:`sudo groupdel test`
执行命令:`sudo groupadd test`
执行命令:`id csdn`
输出:
uid=1000(csdn) gid=1000(csdn) groups=1000(csdn),1002(test)
```
## 选项
### A
```bash
假设用户 csdn 的id信息如下:
uid=1000(csdn) gid=1000(csdn) groups=1000(csdn)
假设存在用户组 test
执行命令:`sudo gpasswd -a csdn test`
执行命令:`sudo groupdel test`
执行命令:`sudo groupadd test`
执行命令:`id csdn`
输出:
uid=1000(csdn) gid=1000(csdn) groups=1000(csdn)
```
### B
```bash
假设用户 csdn 的id信息如下:
uid=1000(csdn) gid=1000(csdn) groups=1000(csdn)
假设存在用户组 test
执行命令:`sudo gpasswd -a csdn test`
执行命令:`sudo groupdel test`
执行命令:`id csdn`
输出:
uid=1000(csdn) gid=1000(csdn) groups=1000(csdn)
```
### C
```bash
假设用户 csdn 的id信息如下:
uid=1000(csdn) gid=1000(csdn) groups=1000(csdn)
假设存在用户组 test
执行命令:`sudo gpasswd -a csdn test`
执行命令:`id csdn`
输出:
uid=1000(csdn) gid=1000(csdn) groups=1000(csdn),1002(test)
```
{
"node_id": "gml-a4f88e4e308541e4a7db5927297bb923",
"keywords": [],
"keywords_must": [["Linux", "文件", "权限"]],
"keywords_must": [
[
"Linux",
"文件",
"权限"
]
],
"keywords_forbid": [],
"children": [],
"export": [
"exercise_01.json"
"exercise_01.json",
"exercise_02.json"
]
}
\ No newline at end of file
# 实战:文件权限的基本介绍
* 请在线上Linux环境里完成[Linux实战任务](https://edu.csdn.net/lab/36676?targetLesson=2701),完成实战练习后请点击【`检测任务`】按钮。
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
执行命令:`ls -l`
输出:
```bash
drwxr-xr-x 2 csdn csdn 4096 8月 3 17:49 Code
```
## 答案
......
{
"type": "code_options",
"author": "csdn.net",
"source": "exercise_02.md",
"notebook_enable": false,
"depends": []
}
\ No newline at end of file
# 复习:文件权限的基本介绍
* 通过实战练习,你已经掌握了相关知识,以下描述错误的是?
执行命令:`ls -l`
输出:
```bash
drwxr-xr-x 2 csdn csdn 4096 8月 3 17:49 Code
```
## 答案
```bash
其他用户对该文件有写权限
```
## 选项
### A
```bash
csdn 表示所有者
```
### B
```bash
2 表示链接数
```
### C
```bash
drwxr-xr-x 表示文件类型和权限
按顺序其中:
* d: 表示文件类型
* 第一个rwx: 表示拥有者权限
* 接着的r-x: 表示所属用户组权限
* 接着的r-x: 表示其他用户权限
```
### D
```bash
4096 表示文件大小
```
......@@ -1241,6 +1241,15 @@
"keywords_must": [],
"keywords_forbid": []
}
},
{
"xxxx": {
"node_id": "gml-16cce2ff86174d19acd8de0f8740eeaf",
"keywords": [],
"children": [],
"keywords_must": [],
"keywords_forbid": []
}
}
],
"keywords_must": [],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册