Compare commits
10 Commits
7821286a32
...
23debe9e3e
Author | SHA1 | Date |
---|---|---|
cxykevin | 23debe9e3e | |
cxykevin | f130412a68 | |
ZXL-Q | b98c1dfe48 | |
cxykevin | bf97681426 | |
cxykevin | 9ff0486af2 | |
cxykevin | ec4acd4c53 | |
cxykevin | aa56159da1 | |
Hmtsai | 2946efac53 | |
cxykevin | 8b6163d7f0 | |
cxykevin | e9c7946c84 |
|
@ -0,0 +1,4 @@
|
||||||
|
book
|
||||||
|
node
|
||||||
|
study-area-home-action-deps
|
||||||
|
study-area-action-deps
|
|
@ -0,0 +1,3 @@
|
||||||
|
[submodule "theme"]
|
||||||
|
path = theme
|
||||||
|
url = https://git.hmtsai.cn/study-area-cn/theme
|
|
@ -0,0 +1,201 @@
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright 2010 The Rust Project Developers
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
|
@ -0,0 +1,4 @@
|
||||||
|
Copyright (C) 2024 Study Area Team
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@ -0,0 +1,25 @@
|
||||||
|
# 学习Linux
|
||||||
|
|
||||||
|
### URL : [learn.study-area.org.cn](https://learn.study-area.org.cn)
|
||||||
|
|
||||||
|
## 概述
|
||||||
|
|
||||||
|
Study Area CN 第三大章 “学习Linux” 仓库
|
||||||
|
|
||||||
|
采用mdbook开发,编译请预先安装Rust环境。
|
||||||
|
|
||||||
|
## 位置
|
||||||
|
|
||||||
|
- [ ] 前言
|
||||||
|
|
||||||
|
- [ ] 学习电脑
|
||||||
|
|
||||||
|
- [X] 学习Linux
|
||||||
|
|
||||||
|
- [ ] 学习网络
|
||||||
|
|
||||||
|
## 如何帮助开发?
|
||||||
|
|
||||||
|
如果您想要协助我们的开发,请参阅[百科](https://git.hmtsai.cn/study-area-cn/study-area-cn/wiki)
|
||||||
|
|
||||||
|
如果你对本项目做出了贡献,就请在`/src/contributors.md`中写上你的名字吧!
|
|
@ -0,0 +1,25 @@
|
||||||
|
[book]
|
||||||
|
authors = ["Study Area CN Team"]
|
||||||
|
language = "zh-cn"
|
||||||
|
multilingual = false
|
||||||
|
src = "src"
|
||||||
|
title = "学习电脑 - Study Area CN"
|
||||||
|
|
||||||
|
[output.html]
|
||||||
|
additional-css = [
|
||||||
|
"theme/css/icons.css",
|
||||||
|
"theme/css/mdui.css",
|
||||||
|
"theme/css/highlight.min.css",
|
||||||
|
"theme/css/page.css",
|
||||||
|
"theme/css/font.css",
|
||||||
|
"theme/font/icons.woff2",
|
||||||
|
"theme/font/noto.otf",
|
||||||
|
"theme/font/sourcecodepro.woff2",
|
||||||
|
]
|
||||||
|
additional-js = [
|
||||||
|
"theme/js/mdui.global.js",
|
||||||
|
"theme/js/highlight.min.js",
|
||||||
|
"theme/js/mathjax.js",
|
||||||
|
"theme/js/tocrender.js",
|
||||||
|
"theme/js/page.js",
|
||||||
|
]
|
|
@ -49,20 +49,20 @@ sudo tar -zcvf etc_backup.gz etc
|
||||||
|
|
||||||
## `rsync`命令
|
## `rsync`命令
|
||||||
|
|
||||||
在之前的章节中,我们创建了一个新的虚拟磁盘。现在,让我们挂载它到`/backup`进行备份。
|
在之前的章节中,我们创建了一个新的虚拟磁盘。现在,让我们挂载它到`/mnt/backup`进行备份。
|
||||||
|
|
||||||
|
> 如果你完成了之前的课后作业,那么sdb上应该有唯一的一个xfs分区占满了整个磁盘。如果你已经持久挂载了磁盘,本步骤可以跳过。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo mkdir /backup
|
sudo mkdir /mnt/backup
|
||||||
sudo mount /dev/sdb1 /backup
|
sudo mount /dev/sdb1 /mnt/backup
|
||||||
sudo mkdir /backup/etc
|
sudo mkdir /mnt/backup/etc
|
||||||
```
|
```
|
||||||
|
|
||||||
> 如果你完成了所有的课后作业,那么sdb上应该有唯一的一个xfs分区占满了整个磁盘。
|
|
||||||
|
|
||||||
现在,我们使用`rsync`命令,将虚拟磁盘中的文件复制到新的虚拟磁盘上。
|
现在,我们使用`rsync`命令,将虚拟磁盘中的文件复制到新的虚拟磁盘上。
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo rsync -avz /etc /backup/etc
|
sudo rsync -avz /etc /mnt/backup/etc
|
||||||
```
|
```
|
||||||
|
|
||||||
`rsync`命令的参数如下:
|
`rsync`命令的参数如下:
|
||||||
|
@ -71,8 +71,9 @@ sudo rsync -avz /etc /backup/etc
|
||||||
- `-v`:显示详细输出。
|
- `-v`:显示详细输出。
|
||||||
- `-z`:压缩传输的数据。
|
- `-z`:压缩传输的数据。
|
||||||
- `/etc`:源文件。
|
- `/etc`:源文件。
|
||||||
- `/backup/etc`:目标文件。
|
- `/mnt/backup/etc`:目标文件。
|
||||||
|
|
||||||
`rsync`命令会自动判断源文件和目标文件是否相同,如果相同,则不会进行复制。如果不同,则会复制不同的文件。
|
`rsync`命令会自动判断源文件和目标文件是否相同,如果相同,则不会进行复制。如果不同,则会复制不同的文件。
|
||||||
|
|
||||||
> `rsync`命令是一个非常强大的命令,它不仅可以进行文件复制,还可以进行文件的同步、文件的删除等操作。如果你需要备份大量的文件,那么`rsync`命令是一个非常好的选择。
|
> `rsync`命令是一个非常强大的命令,它不仅可以进行文件复制,还可以联网进行文件的同步、文件的删除等操作。如果你需要备份大量的文件,那么`rsync`命令是一个非常好的选择。
|
||||||
|
|
||||||
|
|
|
@ -1,54 +1,54 @@
|
||||||
# 在 VMWare Workstation 上安装
|
# 在 VMWare Workstation 上安装
|
||||||
|
|
||||||
> 上级目录:[Rocky Linux 初见](../rocky_first_met.md)
|
> 上级目录:[Rocky Linux 初见](./install_rocky_linux_intro.md)
|
||||||
|
|
||||||
在进行安装前我们需要去下载一份 Rocky Linux 的镜像,在[Rocky Linux 初见](./install_rocky_linux_intro.md)中有说明,此处不再赘述。
|
在进行安装前我们需要去下载一份 Rocky Linux 的镜像,在[Rocky Linux 初见](./install_rocky_linux_intro.md)中有说明,此处不再赘述。
|
||||||
|
|
||||||
## 下载并安装 VMWare Workstation Pro
|
## 下载并安装 VMWare Workstation Pro
|
||||||
|
|
||||||
假设说你要安装 Linux 的话,你需要一个虚拟机软件,本部分将使用 VMWare Workstation Pro,一款十分优秀的跨平台虚拟机软件.
|
假设说你要安装 Linux 的话,你需要一个虚拟机软件,本部分将使用 VMWare Workstation Pro,一款十分优秀的跨平台虚拟机软件。
|
||||||
|
|
||||||
假如说你已经安装过了,你完全可以跳过这一段.
|
假如说你已经安装过了,你完全可以跳过这一段。
|
||||||
|
|
||||||
> 这里可能有朋友问,VMWare Workstation Pro不是付费的吗?你这样难道想让我们去用盗版?
|
> 这里可能有朋友问,VMWare Workstation Pro不是付费的吗?你这样难道想让我们去用盗版?
|
||||||
>
|
>
|
||||||
> 这点不用担心,因为在 VMware 被博通 Broadcom 收购了之后,博通就宣布 VMWare WorkStation Pro 的 17.5.2 版本对个人用户免费 ~~(什么资本家大发慈悲)~~,所以盗版的事情各位大可不必担心.
|
> 这点不用担心,因为在 VMware 被博通 Broadcom 收购了之后,博通就宣布 VMWare WorkStation Pro 的 17.5.2 版本对个人用户免费 ~~(什么资本家大发慈悲)~~,所以盗版的事情各位大可不必担心。
|
||||||
|
|
||||||
原本你应该去注册一个博通的账号并且去到 Broadcom Support Portal 搞一大堆麻烦事情,但是我相信各位的精力是有限的,所以说这里直接贴出提取到的下载链接`https://softwareupdate.vmware.com/cds/vmw-desktop/ws/17.5.2/23775571/windows/core/VMware-workstation-17.5.2-23775571.exe.tar`
|
原本你应该去注册一个博通的账号并且去到 Broadcom Support Portal 搞一大堆麻烦事情,但是我相信各位的精力是有限的,所以说这里直接贴出提取到的下载链接`https://softwareupdate.vmware.com/cds/vmw-desktop/ws/17.5.2/23775571/windows/core/VMware-workstation-17.5.2-23775571.exe.tar`
|
||||||
|
|
||||||
在您下载下来之后是一个 tar 文件,如果说您的电脑没有可以解压这种格式的软件,那请您去下载一个名为 7-Zip 的软件`https://7-zip.org/a/7z2407.exe`然后安装,记得关联格式.
|
在你下载下来之后是一个 tar 文件,如果说你的电脑没有可以解压这种格式的软件,那请你去下载一个名为 7-Zip 的软件 `https://7-zip.org/a/7z2407.exe` 然后安装,记得关联格式。
|
||||||
|
|
||||||
在解压出来之后,我们就可以运行安装程序,先 Next,同意完协议并 Next 后记得勾选一下`安装键盘驱动`(如下图)
|
在解压出来之后,我们就可以运行安装程序,先 Next,同意完协议并 Next 后记得勾选一下 `安装键盘驱动`(如下图)
|
||||||
|
|
||||||
![Keybord Driver](./assets/2.4.vmware.1.png)
|
![Keybord Driver](./assets/2.4.vmware.1.png)
|
||||||
|
|
||||||
然后就可以一路 Next 下去了,安装完成后会有一次重启,在重启完毕后,我们该启动 VMWare WorkStation Pro,进行下一步安装了.
|
然后就可以一路 Next 下去了,安装完成后会有一次重启,在重启完毕后,我们该启动 VMWare WorkStation Pro,进行下一步安装了。
|
||||||
|
|
||||||
> 假如说这里有朋友发现 VMWare WorkStation Pro 的页面是英文的,打开 VMWare WorkStation Pro 的`快捷方式`,在目标后面添加一个" --locale zh_CN"之后重启 VMWare WorkStation Pro 就好了.
|
> 假如说这里有朋友发现 VMWare WorkStation Pro 的页面是英文的,打开 VMWare WorkStation Pro 的`快捷方式`,在目标后面添加一个 ` --locale zh_CN`之后重启 VMWare WorkStation Pro 就好了。
|
||||||
|
|
||||||
## 新建虚拟机
|
## 新建虚拟机
|
||||||
|
|
||||||
很好,现在您已经拥有了一个趁手的工具,那就该干点什么,也就是注入灵魂——操作系统了
|
软件我们有了,接下来我们要给虚拟机注入灵魂——操作系统了。
|
||||||
|
|
||||||
不过在开始安装系统前,我们需要新建一个`虚拟机`.
|
不过在开始安装系统前,我们需要新建一个 `虚拟机`。
|
||||||
|
|
||||||
启动软件后,我们会看到像这样的页面:
|
启动软件后,我们会看到像这样的页面:
|
||||||
|
|
||||||
![Home Page](./assets/2.4.vmware.2.png)
|
![Home Page](./assets/2.4.vmware.2.png)
|
||||||
|
|
||||||
然后点击 `创建新的虚拟机` ,您会看到这样的界面:
|
然后点击 `创建新的虚拟机`,你会看到这样的界面:
|
||||||
|
|
||||||
![New VM Page](./assets/2.4.vmware.3.png)
|
![New VM Page](./assets/2.4.vmware.3.png)
|
||||||
|
|
||||||
保持典型不变,点击下一步,点击`安装程序光盘映像文件(iso)(M)`,然后点击浏览,找到你镜像下载到的位置,选中镜像,然后打开:
|
保持典型不变,点击下一步,点击 `安装程序光盘映像文件(iso)(M)`,然后点击浏览,找到你镜像下载到的位置,选中镜像,然后打开:
|
||||||
|
|
||||||
![Choose ISO Img](./assets/2.4.vmware.3.png)
|
![Choose ISO Img](./assets/2.4.vmware.3.png)
|
||||||
|
|
||||||
接着点击下一步,填写`虚拟机的名字`还有`虚拟机的安装位置`(这一步记得选一个剩余空间比较大的分区)
|
接着点击下一步,填写 `虚拟机的名字` 还有 `虚拟机的安装位置`(这一步记得选一个剩余空间比较大的分区)
|
||||||
|
|
||||||
![Set VM](./assets/2.4.vmware.5.png)
|
![Set VM](./assets/2.4.vmware.5.png)
|
||||||
|
|
||||||
现在开始设置`虚拟磁盘`,这相当于您电脑的储存空间,这里直接引用隔壁 VBox 安装的话:
|
现在开始设置 `虚拟磁盘`,这相当于你电脑的储存空间,这里直接引用隔壁 VBox 安装的话:
|
||||||
|
|
||||||
如果你的磁盘空间足够,那么你开多少都行,一般开 40GB 就够了。
|
如果你的磁盘空间足够,那么你开多少都行,一般开 40GB 就够了。
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
|
|
||||||
![Set Virtual Disk](./assets/2.4.vmware.6.png)
|
![Set Virtual Disk](./assets/2.4.vmware.6.png)
|
||||||
|
|
||||||
然后我们就来到了配置设置页面,现在点击`自定义硬件`,还是引用 Vbox 安装的话:
|
然后我们就来到了配置设置页面,现在点击`自定义硬件`,还是引用 Vbox 安装的话:
|
||||||
|
|
||||||
我们可以根据需要填写`内存大小`和`处理器`(处理器核心数)。如果你还不知道这两个是什么意思,请回看上一大章节。
|
我们可以根据需要填写`内存大小`和`处理器`(处理器核心数)。如果你还不知道这两个是什么意思,请回看上一大章节。
|
||||||
|
|
||||||
|
@ -72,36 +72,36 @@
|
||||||
这时你填写 `4096MB`(6GB) 即可。
|
这时你填写 `4096MB`(6GB) 即可。
|
||||||
一般来说,分配实体机内存的一半即可。
|
一般来说,分配实体机内存的一半即可。
|
||||||
|
|
||||||
CPU数通常只需要填你的CPU核心数的一半就可以了。现在的电脑至少2核起步。
|
CPU数通常只需要填你的CPU核心数的一半就可以了。现在的电脑至少 2 核起步。
|
||||||
如果你在使用13代或以上的Intel酷睿,那么你填写你的大核心(P核)的数量就行。
|
如果你在使用 13 代或以上的 Intel 酷睿,那么你填写你的大核心(P核)的数量就行。
|
||||||
(截至本篇编写时Intel最新的酷睿还是13代,2024.6)
|
(截至本篇编写时 Intel 最新的酷睿还是 13 代,2024.6)
|
||||||
```
|
```
|
||||||
|
|
||||||
对于写者来说,设置完之后的页面如下:
|
对于写者来说,设置完之后的页面如下:
|
||||||
|
|
||||||
![VM Settings](./assets/2.4.vmware.7.png)
|
![VM Settings](./assets/2.4.vmware.7.png)
|
||||||
|
|
||||||
最后关闭设置页面,点击`完成`,虚拟机就大功告成了!(如果你勾选了`创建后启动此虚拟机`那么则会自动启动)
|
最后关闭设置页面,点击`完成`,虚拟机就大功告成了!(如果你勾选了 `创建后启动此虚拟机` 那么则会自动启动)
|
||||||
|
|
||||||
## 启动虚拟机
|
## 启动虚拟机
|
||||||
|
|
||||||
假如说您在上一部勾选了`创建后启动此虚拟机`的话,您的虚拟机应该现在已经启动了,但是以防万一,这里还是讲解一下如何在 VMWare WorkStation Pro 里启动虚拟机:
|
假如说你在上一部勾选了 `创建后启动此虚拟机` 的话,你的虚拟机应该现在已经启动了,但是以防万一,这里还是讲解一下如何在 VMWare WorkStation Pro 里启动虚拟机:
|
||||||
|
|
||||||
第一步,选中`虚拟机`:
|
第一步,选中`虚拟机`:
|
||||||
|
|
||||||
![Select VM](./assets/2.4.vmware.8.png)
|
![Select VM](./assets/2.4.vmware.8.png)
|
||||||
|
|
||||||
第二步,点击`开启此虚拟机`:
|
第二步,点击`开启此虚拟机`:
|
||||||
|
|
||||||
![Start VM](./assets/2.4.vmware.9.png)
|
![Start VM](./assets/2.4.vmware.9.png)
|
||||||
|
|
||||||
等一会后,会出现一个类似这样的页面,这里直接选中第一项然后回车就可以了:
|
等一会后,会出现一个类似这样的页面,这里直接选中第一项然后回车就可以了:
|
||||||
|
|
||||||
![Boot](./assets/2.4.vmware.10.png)
|
![Boot](./assets/2.4.vmware.10.png)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
接下来请继续阅读[安装 Rocky Linux](./install_rocky_linux.md)进行安装.
|
接下来请继续阅读[安装 Rocky Linux](./install_rocky_linux.md)进行安装。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
@ -1 +1,179 @@
|
||||||
# 学习 Shell
|
# 学习 Shell。
|
||||||
|
|
||||||
|
## 概念
|
||||||
|
|
||||||
|
Shell(也称为壳)在计算机中指“为用户提供用户界面”的软件,通常指的是命令行界面的解析器。一般来说,这个词是指操作系统中提供访问内核所提供之服务的程序。Shell也用于泛指所有为用户提供操作界面的程序,也就是程序和用户交互的层面。因此与之相对的是内核(英语:Kernel),内核不提供和用户的交互功能。[1]
|
||||||
|
|
||||||
|
但是,在 Linux 中,我们通常所讲的 Shell 是指命令行解释器,它为用户提供了一个向 Linux 内核发送请求以便运行程序的界面系统级程序,用户可以用 Shell 来启动、挂起、停止甚至是编写一些程序来实现自动化的功能。
|
||||||
|
|
||||||
|
Shell 也指代一种命令语言,由这种语言编写的脚本称为 Shell Script。
|
||||||
|
|
||||||
|
Shell 命令语言的标准为参考 AT&T 的 ksh 和 GNU 计划的 Bourne Again Shell (bash) 制定的 The Open Group Base Specifications Issue 6 中的 [2.Shell Command Language](https://pubs.opengroup.org/onlinepubs/9690949599/utilities/xcu_chap02.html)。
|
||||||
|
|
||||||
|
本章我们将学习 Shell 的基本使用。
|
||||||
|
|
||||||
|
## 快捷键
|
||||||
|
|
||||||
|
Shell 也有快捷键?是的。大多数 Shell 都支持以下的快捷键:
|
||||||
|
|
||||||
|
- `C-C`:终止当前进程。
|
||||||
|
- `C-Z`:暂停当前进程。
|
||||||
|
- `C-D`:退出当前Shell(实际上是发送一个 `EOF` 文件结束字符)。
|
||||||
|
- `C-L`:清屏。
|
||||||
|
|
||||||
|
> 其中 `C-C` 和 `C-D` 是十分重要的两个快捷键,十分常用。
|
||||||
|
|
||||||
|
在 Bash 中,还有一些特殊的快捷键,它们继承自 GNU Emacs 编辑器,用于快速移动光标以及编辑文本:
|
||||||
|
|
||||||
|
- `C-A`:移动光标到行首。
|
||||||
|
- `C-E`:移动光标到行尾。
|
||||||
|
- `C-B`:向左移动光标。
|
||||||
|
- `C-F`:向右移动光标。
|
||||||
|
- `C-K`:删除从光标位置到行尾的文本。
|
||||||
|
- `C-U`:删除从光标位置到行首的文本。
|
||||||
|
- `C-W`:删除光标左侧的单词。
|
||||||
|
- `C-Y`:粘贴之前删除的文本。
|
||||||
|
|
||||||
|
> 这部分只需要了解即可
|
||||||
|
|
||||||
|
## 命令
|
||||||
|
|
||||||
|
命令分为内部命令和外部命令,内部命令是 Shell 自带的命令,外部命令是 Shell 外部的可执行程序。
|
||||||
|
|
||||||
|
一条 Shell 的指令的标准格式为:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
command [options] [arguments]
|
||||||
|
```
|
||||||
|
|
||||||
|
其中,`command` 是命令的名称,`options` 是命令的选项,`arguments` 是命令的参数。
|
||||||
|
|
||||||
|
它的格式不一定必须遵守,但是通常遵守这个格式会带来更好的可读性(用什么工具采用什么方式对什么文件做什么)。
|
||||||
|
|
||||||
|
但是,有一个例外,就是指定输出,这时,我们推荐將指定输出的选项以及参数放在文件明后面。
|
||||||
|
|
||||||
|
例如,`ls` 命令用于列出当前目录下的文件和文件夹,它的选项可以是 `-l`、`-a` 等,参数可以是文件名或目录名。
|
||||||
|
|
||||||
|
## 变量
|
||||||
|
|
||||||
|
Shell 中的变量分为环境变量和用户变量,环境变量是Shell启动时自动设置的变量,用户变量是用户自定义的变量。
|
||||||
|
|
||||||
|
用户变量可以通过 `export` 命令设置为临时环境变量,例如:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export GREET="Hello, World!"
|
||||||
|
```
|
||||||
|
|
||||||
|
然后我们在这个 Shell 里启动一个新的 Shell,仍然可以在环境中找到这个变量。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
bash -c 'echo $GREET'
|
||||||
|
```
|
||||||
|
|
||||||
|
> `export` 声明的变量只在当前环境下有效,如果你开启了个新的终端或者重启,那么这个环境就无效了
|
||||||
|
|
||||||
|
用户变量可以通过 `declare` 命令声明,例如:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
declare USER_GREET="Hello, Shell"
|
||||||
|
```
|
||||||
|
|
||||||
|
变量可以通过 `${}` 或 `$` 符号来引用,例如:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
echo ${GREET}
|
||||||
|
echo $USER_GREET
|
||||||
|
```
|
||||||
|
|
||||||
|
> 当变量的前后有别的内容紧挨着,那么只能使用 `${}`。
|
||||||
|
|
||||||
|
## 特殊的环境变量
|
||||||
|
|
||||||
|
Shell 中有一些特殊的环境变量,它们在 Shell 启动时自动设置,例如:
|
||||||
|
|
||||||
|
- `$HOME`:当前用户的主目录。
|
||||||
|
- `$PATH`:可执行文件的搜索路径。
|
||||||
|
- `$SHELL`:当前Shell的名称。
|
||||||
|
- `$PWD`:当前工作目录。
|
||||||
|
- `$USER`:当前用户的用户名。
|
||||||
|
|
||||||
|
其中最重要也是最常用的就是 PATH,它决定了Shell在执行命令时搜索可执行文件的路径。当我们发现明明安装了某个软件但是找不到可执行文件的时候应该首先检查 PATH 的设置。如果你熟悉 Windows,你会发现 Windows 的 PATH 是一串由分号分隔的路径。而 Linux 下的路径使用的是 `:` 冒号分隔。
|
||||||
|
|
||||||
|
> 在 Windows 中的 PATH 中有一条路径是 `.` 就是当前目录,而 Linux 中默认是不会搜索当前目录的。如果你在当前目录有一个 `run.sh`,那么你必须要使用 `./run.sh` 才能执行。
|
||||||
|
|
||||||
|
## 管道
|
||||||
|
|
||||||
|
Shell 中的管道是链接两个命令的方式,管道遵守下面的格式。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
command1 | command2
|
||||||
|
```
|
||||||
|
|
||||||
|
`command1` 的输出将会作为 `command2` 的输入提供,例如:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ls -a | grep "test"
|
||||||
|
```
|
||||||
|
|
||||||
|
这个命令将会列出当前目录下的所有文件,然后使用 `grep` 命令过滤出文件名包含"test"的文件。
|
||||||
|
|
||||||
|
## 输出重定向
|
||||||
|
|
||||||
|
Shell 中的重定向是改变命令的输出地点的方式,重定向遵守下面的格式。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
command > file
|
||||||
|
```
|
||||||
|
|
||||||
|
`command` 的输出将会被重定向到 `file` 中,例如:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ls -a > files.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
这个命令将会列出当前目录下的所有文件,然后使用 `>` 符号将输出重定向到 `files.txt` 中。
|
||||||
|
|
||||||
|
## 输入重定向
|
||||||
|
|
||||||
|
Shell 中的输入重定向是改变命令的输入地点的方式,输入重定向遵守下面的格式。
|
||||||
|
|
||||||
|
```bash
|
||||||
|
command < file
|
||||||
|
```
|
||||||
|
|
||||||
|
`command` 的输入将会被重定向到 `file` 中,例如:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cat < files.txt
|
||||||
|
```
|
||||||
|
|
||||||
|
这个命令将会读取 `files.txt` 中的内容,然后使用 `cat` 命令输出到标准输出中。
|
||||||
|
|
||||||
|
## 将命令的输出作为参数
|
||||||
|
|
||||||
|
让我们想像这个场景:有一个文件有一个文件名列表,我们想要获取这些文件的详细信息,这怎么实现呢?
|
||||||
|
|
||||||
|
运算符 `$()` 可以将命令的输出作为参数,它的标准格式如下:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
command1 $(command2)
|
||||||
|
```
|
||||||
|
|
||||||
|
`command2` 的输出将会作为 `command1` 的参数。
|
||||||
|
|
||||||
|
实现前文的场景所需的命令如下:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ls -l $(cat files.txt)
|
||||||
|
```
|
||||||
|
|
||||||
|
这个命令将会读取 `files.txt` 中的文件名列表,然后使用 `ls -l` 命令获取这些文件的详细信息。
|
||||||
|
|
||||||
|
## 课后作业
|
||||||
|
|
||||||
|
1. 使用 Shell 的输出重定向功能,在主目录中创建一个保存了主目录中所有文件列表的文件,命名为 `files.txt`
|
||||||
|
2. 使用 `cat` 读取所有文件的内容。
|
||||||
|
|
||||||
|
## 参考
|
||||||
|
|
||||||
|
- [Shell - 维基百科,自由的百科全书](https://zh.wikipedia.org/wiki/Shell)
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 88620df768ceba8c459da0e614d00db79c78a49a
|
Loading…
Reference in New Issue