From bb0ce1e3596dcee0f46a4ac7eb7feced332f1c74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=9D=B0?= <11785149+denglingyan@user.noreply.gitee.com> Date: Wed, 15 May 2024 05:45:44 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=E6=96=B0=E5=BB=BA=2004=20=E9=99=88?= =?UTF-8?q?=E6=9D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "04 \351\231\210\346\235\260/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "04 \351\231\210\346\235\260/.keep" diff --git "a/04 \351\231\210\346\235\260/.keep" "b/04 \351\231\210\346\235\260/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From 3f07c51f5e1b58a006ac998975b4e81dbc78ab2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=9D=B0?= <11785149+denglingyan@user.noreply.gitee.com> Date: Fri, 17 May 2024 04:36:26 +0000 Subject: [PATCH 2/4] =?UTF-8?q?linux=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈杰 <11785149+denglingyan@user.noreply.gitee.com> --- ...20240515 \345\210\235\350\257\206Liunx.md" | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 "04 \351\231\210\346\235\260/20240515 \345\210\235\350\257\206Liunx.md" diff --git "a/04 \351\231\210\346\235\260/20240515 \345\210\235\350\257\206Liunx.md" "b/04 \351\231\210\346\235\260/20240515 \345\210\235\350\257\206Liunx.md" new file mode 100644 index 0000000..76a94e6 --- /dev/null +++ "b/04 \351\231\210\346\235\260/20240515 \345\210\235\350\257\206Liunx.md" @@ -0,0 +1,47 @@ +## Liunx + +``` +一种操作系统内核,有centos,debian,redhat等。 +``` + +## 命令 + +### 查看ip地址 + +```js +ip addr show +``` + +### ssh + +```js +apt-get install ssh + +apt-get install vim + +vim /etc/ssh/sshd_config + +port 21 打开端口 + +permitrootlogin yes 启用root登录 + +passwordauthentication yes 验证密码 + +permitemptypasswords no 禁止使用空密码登录 + +/etc/init.d/ssh restart +``` + +### sudo + +``` +su root 更换给root模式 + +apt-get install sudo + +sudo vim /etc/sudoers + +root all=(all:all) all + +用户名 all=(all:all) all 添加用户名 +``` \ No newline at end of file -- Gitee From d76dce4e13fa85afc99f1f3ac0a9cb6019e927b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=9D=B0?= <11785149+denglingyan@user.noreply.gitee.com> Date: Sun, 19 May 2024 15:58:52 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=E5=91=BD=E4=BB=A4=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈杰 <11785149+denglingyan@user.noreply.gitee.com> --- ...20240516 Liunx\347\233\256\345\275\225.md" | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 "04 \351\231\210\346\235\260/20240516 Liunx\347\233\256\345\275\225.md" diff --git "a/04 \351\231\210\346\235\260/20240516 Liunx\347\233\256\345\275\225.md" "b/04 \351\231\210\346\235\260/20240516 Liunx\347\233\256\345\275\225.md" new file mode 100644 index 0000000..d0b9398 --- /dev/null +++ "b/04 \351\231\210\346\235\260/20240516 Liunx\347\233\256\345\275\225.md" @@ -0,0 +1,62 @@ +# 笔记 + +常见的执行Linux命令的格式: 命令名(command) 选项(options) 参数(arguments) +命令名:表达的是想要做的事情,例如创建用户、查看文件、重启系统等操作。 +选项:用于对命令进行调整 +参数:一般指要处理的文件、目录、用户等资源名称。 + +Linux命令参数的长格式与短格式 +长格式(完整指令):man --help +短格式(缩写):man -h +``` + +### 目录命令 + +``` +/ 是指根目录:就是所有目录最顶层的目录 +./ 表示当前目录: +./ 一般需要和其他文件夹或者文件结合使用,指代当前目录下的东西 +cd ./文件夹 切换到当前目录的某个文件夹 +.. 表示上级目录: +cd .. 切换到上级目录 +cd ../文件夹 切换到上级目录中的某个文件夹 +``` + +### 常用命令 + +``` +cat(concatenate):它的主要作用是用于查看和连接文件。 +语法:cat [选项] [文件] +ls(list directory contents):用于显示指定工作目录下之内容(列出目前工作目录所含的文件及子目录) +语法:ls [-alrtAFR] [name...] +ls / (以下是/根目录所有目录) +bin dev lib media net root srv upload www +boot etc lib64 misc opt sbin sys usr +home lost+found mnt proc selinux tmp var +ls /bin 则显示bin目录下所有文件目录 + +mv(move file):用来为文件或目录改名、或将文件或目录移入其它位置。 +语法:mv [options] source(源文件或目录) dest(目标文件或目录) +``` + +### 按键和它的作用 + +``` + 按键 作用 +空格键 向下翻一页 +PaGe down 向下翻一页 +PaGe up 向上翻一页 +home 直接前往首页 +end 直接前往尾页 + / 从上至下搜索某个关键词 + ? 从下至上搜索某个关键词 + n 定位到下一个搜索到的关键词 + N 定位到上一个搜索到的关键词 + q 退出帮助文档 + +双击Tab键能够实现对命令、参数戒文件的内容补全; +Ctrl+C:强行结束 +Ctrl+D:结束键盘输入 +Ctrl+l:清屏 + +``` \ No newline at end of file -- Gitee From 1d89d12f7cf1661bcfda851143c9a421ab388a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=9D=B0?= <11785149+denglingyan@user.noreply.gitee.com> Date: Tue, 21 May 2024 05:14:09 +0000 Subject: [PATCH 4/4] 04 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 陈杰 <11785149+denglingyan@user.noreply.gitee.com> --- ...0240520 Linux \344\275\234\344\270\232.md" | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 "04 \351\231\210\346\235\260/20240520 Linux \344\275\234\344\270\232.md" diff --git "a/04 \351\231\210\346\235\260/20240520 Linux \344\275\234\344\270\232.md" "b/04 \351\231\210\346\235\260/20240520 Linux \344\275\234\344\270\232.md" new file mode 100644 index 0000000..cb3f24a --- /dev/null +++ "b/04 \351\231\210\346\235\260/20240520 Linux \344\275\234\344\270\232.md" @@ -0,0 +1,60 @@ + +1. sudo adduser xx + 密码: + 相关网站 https://blog.csdn.net/Dontla/article/details/128723451 + 把用户添加进去组名 + sudo usermod -aG 组名 新用户名 + 相关网站 https://www.quanxiaoha.com/linux-command/linux-create-user.html +2. 以刚建的用户登录,操作以下 + +给用户权限 +visudo +或者vi /etc/sudoers +把用户名添加进去 (格式:ALL=(ALL:ALL) ALL) + +然后重新启动服务器一下 + +su xx + +1. 使用命令,在自己的家目录,以以下层次依次建立文件夹 + 1. 国家 + 1. 省份 + 1. 市 + 1. 县(区) + 1. 镇(街道) + 1. 村(小区) + 1. 姓名 +2. 在姓名文件夹,建立一个自己的学号姓名文件 +3. 在这个文件中,写一篇不少于400字的日记 + +cd /home/ 进去到家 + +mkdir /中国/福建省/泉州市/丰泽区/宏路街道/新华村/陈杰/ -p + +在自己文件夹创建一个txt +cd /中国/福建省/福州市/福清区/宏路街道/新华村/陈杰/ +touch 04陈杰.txt 创建 +vim 04陈杰.txt 编辑内容 +命令搜索来自https://zhuanlan.zhihu.com/p/684208153 + +1. 最后,将国家这个文件夹打包,同时练习怎么解压 + +2. 打包 + 先下载zip + sudo apt install zip + 打包到中国目录 + zip -r china.zip /中国/ + 解压 + unzip 打包名称.zip + +3. 使用命令将这个压缩包下载到本地电脑(不能用shell里自带的下载功能) + +sudo apt-get install lrzsz + +sz china.zip + + + +1. 相关命令百度预习 +2. 命令参考 https://www.linuxcool.com/ +3. 相关过程,做成笔记 \ No newline at end of file -- Gitee