From b33ec41c6716af00507afa442c88741af7748d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BC=BA?= <3108497868@qq.com> Date: Wed, 15 May 2024 22:29:56 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../\350\256\244\350\257\206linux.md" | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 "45\347\216\213\345\274\272/\350\256\244\350\257\206linux.md" diff --git "a/45\347\216\213\345\274\272/\350\256\244\350\257\206linux.md" "b/45\347\216\213\345\274\272/\350\256\244\350\257\206linux.md" new file mode 100644 index 0000000..bec4dda --- /dev/null +++ "b/45\347\216\213\345\274\272/\350\256\244\350\257\206linux.md" @@ -0,0 +1,29 @@ +# Liunx + +一种操作系统内核,有centos,debian,redhat等。 + +## 命令 + +### 查看ip地址 + +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 +``` \ No newline at end of file -- Gitee From 504acf15688acaff423d59533c9574fe47245b0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BC=BA?= <3108497868@qq.com> Date: Sun, 19 May 2024 21:28:01 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ssh\350\277\236\346\216\245.md" | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 "45\347\216\213\345\274\272/ssh\350\277\236\346\216\245.md" diff --git "a/45\347\216\213\345\274\272/ssh\350\277\236\346\216\245.md" "b/45\347\216\213\345\274\272/ssh\350\277\236\346\216\245.md" new file mode 100644 index 0000000..68adb2d --- /dev/null +++ "b/45\347\216\213\345\274\272/ssh\350\277\236\346\216\245.md" @@ -0,0 +1,33 @@ +# Linux + +Linux是一套免费使用和自由传播的类Unix操作系统,是一个多用户、多任务、支持多线程和多CPU的操作系统 + +有centos,debian,redhat等 + +# 安装必要组件 + +```java +IP address show //查看IP地址等信息 +apt-get install net-tools //安装net-tools组件包 +apt-get install vim // vim编辑器 +apt-get update // 更新软件库 +apt-get install ssh // 安装ssh,默认情况下,只有普通用户才可以登录这个服务器 +``` + +# 修改ssh文件 + +```java +vim /etc/ssh/sshd_cofnig //进入并修改ssh配置文件 +--------------------------------------------------------------------------------------- +//更改以下3行命令 +port:22 //开启端口22 +PermitRootLogin yes //打开root用户登入 +PasswordAuthentication yes //打开密码验证 +PermitEmptyPassword no //不允许空密码登录 +//修改完成按Esc键在按:wq保存退出 +--------------------------------------------------------------------------------------- +// 用sudo 命令,但这个默认是没安装。自己安装 apt-get isntall sudo +sudo systemctl restart ssh //重启SSH服务,是root用户可以去掉sudo +su root 更换给root模式 +``` + -- Gitee From d495fe989343c234225719a4423223d4bc2ce9ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BC=BA?= <3108497868@qq.com> Date: Tue, 21 May 2024 12:14:49 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...43\345\216\213\345\221\275\344\273\244.md" | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 "45\347\216\213\345\274\272/\345\216\213\347\274\251\350\247\243\345\216\213\345\221\275\344\273\244.md" diff --git "a/45\347\216\213\345\274\272/\345\216\213\347\274\251\350\247\243\345\216\213\345\221\275\344\273\244.md" "b/45\347\216\213\345\274\272/\345\216\213\347\274\251\350\247\243\345\216\213\345\221\275\344\273\244.md" new file mode 100644 index 0000000..3d92758 --- /dev/null +++ "b/45\347\216\213\345\274\272/\345\216\213\347\274\251\350\247\243\345\216\213\345\221\275\344\273\244.md" @@ -0,0 +1,82 @@ +# tar命令 + +tar [-c -v -x -f -z -C] 参数1 参数2 ... 参数N + +```java +-c,创建压缩文件,用于压缩模式 +-v,显示压缩,解压过程,用于查看进度 +-x,解压模式 +-f,要创建的文件,或要解压的文件,-f选项必须在所有选项中位置处于最后一个 +-z,gzip模式,不使用-z就是普通的tarball格式 +-C,选择解压的目的地,用于解压模式 +``` + +## tar压缩 + +tar的常用组合为: + +tar -cvf test.tar 1.txt 2.txt 3.txt + +将1.txt 2.txt 3.txt 压缩到test.tar文件内 + +tar -zcvf test.tar.ge 1.txt 2.txt 3.txt + +将1.txt 2.txt 3.txt 压缩到test.tar.gz 文件内,使用gzip模式 + +## tar解压 + +常用的tar解压组合有 + +tar -xvf test.tar + +解压test.tar,将文件解压至当前目录 + +tar -xvf test.tar -C /home + +解压test.tar,将文件解压至指定目录(/home) + +tar -zxvf test.tar.gz -C /home + +以Gzip模式解压test.tar.gz,将文件解压至指定目录(home) + +注意: + +-z 选择如果使用的话,一般处于选项位的第一个 + +-f选项,必须在选项位最后一个 + +-C选项单独使用,和解压所需的其他参数分开 + +# zip命令压缩文件 + +可以使用zip命令,压缩文件为zip压缩包 + +语法:zip[-r] 参数1...参数N + +-r,被压缩的包含文件夹的是时候,需要使用-r选项,和rm,cp等命令的-r效果一致 + +示例: + +zip test.zip a.txt b.txt c.txt + +将a.txt b.txt c.txt 压缩到test.zip文件内 + +zip -r test.zip test 中国 a.txt + +将test,中国俩个文件夹和a.txt文件,压缩到test.zip文件内 + +## unzip命令解压文件 + +使用unzip命令,可以方便的解压zip压缩包 + +语法unzip [-d] 参数 + +-d,指定要解压去的位置,同tar的-C选项 + +参数,被解压的zip压缩包文件 + +示例: + +unzip test.zip,将test.zip解压到当前目录 + +unzip.test.zip -d /home,将test.zip解压到指定文件夹内(/home) \ No newline at end of file -- Gitee