From 3a88d5bd5acdd6c3414a940d2be5bb226fafc61c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E9=94=90?= <12075075+feng-rui2570878950@user.noreply.gitee.com> Date: Wed, 15 May 2024 15:50:12 +0000 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 Signed-off-by: 冯锐 <12075075+feng-rui2570878950@user.noreply.gitee.com> --- .../\345\210\235\350\257\206Linux.md" | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 "34 \345\206\257\351\224\220/\345\210\235\350\257\206Linux.md" diff --git "a/34 \345\206\257\351\224\220/\345\210\235\350\257\206Linux.md" "b/34 \345\206\257\351\224\220/\345\210\235\350\257\206Linux.md" new file mode 100644 index 0000000..bf9c387 --- /dev/null +++ "b/34 \345\206\257\351\224\220/\345\210\235\350\257\206Linux.md" @@ -0,0 +1,33 @@ +# Linux + +Linux是一套免费使用和自由传播的类Unix操作系统,是一个多用户、多任务、支持多线程和多CPU的操作系统 + +有centos,debian,redhat等 + +### 命令: + +查看IP:IP address show + +更新软件库:apt-get update + +apt-get install net-tools + +安装vim编辑器,默认的是vi编辑器 apt-get install vim : vi 文件名,变成vim 文件名 + +安装ssh:apt-get install ssh + +vim /etc/ssh/sshd_cofnig :修改/etc/ssh/sshd.config 文件 + +开22端口:prot 22 + +允许root登录为yes:PermitRootLogin yes + +启用密码验证功能 :PasswordAuthentication yes + +不允许空密码登录:PermitEmptyPassword no + +// 用sudo 命令,但这个默认是没安装。自己安装 apt-get isntall sudo + +su root 更换给root模式 + +sudo vim /etc/sudoers \ No newline at end of file -- Gitee From 9d869e91bb8c141cc37b3997efe1a4ca075ae50f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E9=94=90?= <12075075+feng-rui2570878950@user.noreply.gitee.com> Date: Mon, 20 May 2024 15:21:13 +0000 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 Signed-off-by: 冯锐 <12075075+feng-rui2570878950@user.noreply.gitee.com> --- ...13\347\274\251\350\247\243\345\216\213.md" | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 "34 \345\206\257\351\224\220/\345\216\213\347\274\251\350\247\243\345\216\213.md" diff --git "a/34 \345\206\257\351\224\220/\345\216\213\347\274\251\350\247\243\345\216\213.md" "b/34 \345\206\257\351\224\220/\345\216\213\347\274\251\350\247\243\345\216\213.md" new file mode 100644 index 0000000..c7649b7 --- /dev/null +++ "b/34 \345\206\257\351\224\220/\345\216\213\347\274\251\350\247\243\345\216\213.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 From f10b8d829d2891ec7c6d85ef35b808bf3076cd15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=AF=E9=94=90?= <12075075+feng-rui2570878950@user.noreply.gitee.com> Date: Wed, 22 May 2024 15:34:35 +0000 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 Signed-off-by: 冯锐 <12075075+feng-rui2570878950@user.noreply.gitee.com> --- ...07\344\273\266\347\256\241\347\220\206.md" | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 "34 \345\206\257\351\224\220/\346\226\207\344\273\266\345\244\271\345\217\212\346\226\207\344\273\266\347\256\241\347\220\206.md" diff --git "a/34 \345\206\257\351\224\220/\346\226\207\344\273\266\345\244\271\345\217\212\346\226\207\344\273\266\347\256\241\347\220\206.md" "b/34 \345\206\257\351\224\220/\346\226\207\344\273\266\345\244\271\345\217\212\346\226\207\344\273\266\347\256\241\347\220\206.md" new file mode 100644 index 0000000..6f5e401 --- /dev/null +++ "b/34 \345\206\257\351\224\220/\346\226\207\344\273\266\345\244\271\345\217\212\346\226\207\344\273\266\347\256\241\347\220\206.md" @@ -0,0 +1,87 @@ +### 综合练习题:大学生生活场景中的文件夹和文件管理 + +假设你是一名大学生,现在面临着整理学习资料和课程作业的任务。请按照以下要求完成相关的文件夹和文件管理操作: + +1. 在你的个人文档目录下创建一个名为`学习资料`的文件夹,并进入该文件夹。 + + ``` + cd /home + cd lx555 + mkdir 学习资料 + ``` + +2. 在`学习资料`文件夹中创建一个名为`计算机科学`的文件夹。 + + ``` + cd 学习资料 + mkdir 计算机科学 + ``` + +3. 在`计算机科学`文件夹中创建两个子文件夹,分别命名为`课程资料`和`编程项目`。 + + ``` + cd 计算机科学 + mkdir 课程资料 编程项目 + ``` + +4. 将你最近的一门计算机科学课程的课件文件(假设文件名为`CS101_第一讲.pdf`)放入`课程资料`文件夹。 + + ``` + 断开连接 + exit + 在本地传输文件 + cd C:\Users\a'a'a\Desktop + scp cs101_第一讲.pdf lx555@1.94.110.252:/home/lx555/学习资料/计算机科学/课程资料 + ``` + +5. 在`编程项目`文件夹中创建一个名为`Java项目`的文件夹。 + + ``` + cd 编程项目 + mkdir java项目 + ``` + +6. 在`Java项目`文件夹中创建两个空文件,分别命名为`主程序.java`和`工具类.java`。 + + ``` + cd java项目 + touch 主程序.java 工具类.java + ``` + +7. 复制`主程序.java`并命名为`备份_主程序.java`。 + + ``` + cp 主程序.java 备份_主程序.java + ``` + +8. 创建一个名为`Python项目`的文件夹,并将`工具类.java`移动到`Python项目`文件夹中。 + + ``` + cd ../ + mkdir Python项目 + mv /home/lx555/学习资料/计算机科学/编程项目/java项目/工具类.java /home/lx555/学习资料/计算机科学/编程项目/Python项目/ + ``` + +9. 列出`计算机科学`文件夹中所有文件和文件夹的内容。 + + ``` + ls -l + ``` + +10. 删除`编程项目`文件夹及其包含的所有内容。 + + ``` + rm -r 编程项目 + ``` + +11. 重命名`Python项目`为`数据分析项目`。 + + ``` + mv Python项目 数据分析项目 + ``` + +12. 最后,列出当前所在目录的路径。 + + ``` + pwd + ``` \ No newline at end of file -- Gitee