From 37a64a222153a143587afc9d6be4723cea21fdd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BF=8A=E8=B1=AA?= <3228734291@qq.com> Date: Wed, 15 May 2024 10:11:47 +0000 Subject: [PATCH 1/6] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=E5=BC=A0=E4=BF=8A?= =?UTF-8?q?=E8=B1=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\345\274\240\344\277\212\350\261\252/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\345\274\240\344\277\212\350\261\252/.keep" diff --git "a/\345\274\240\344\277\212\350\261\252/.keep" "b/\345\274\240\344\277\212\350\261\252/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From b2b4e9d011b0a28459710fc289688b312d4d6230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BF=8A=E8=B1=AA?= <3228734291@qq.com> Date: Wed, 15 May 2024 10:11:53 +0000 Subject: [PATCH 2/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20?= =?UTF-8?q?=E5=BC=A0=E4=BF=8A=E8=B1=AA/.keep?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\345\274\240\344\277\212\350\261\252/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 "\345\274\240\344\277\212\350\261\252/.keep" diff --git "a/\345\274\240\344\277\212\350\261\252/.keep" "b/\345\274\240\344\277\212\350\261\252/.keep" deleted file mode 100644 index e69de29..0000000 -- Gitee From fa612d8136bfc85bc1e2ea0962363959b9c4797a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BF=8A=E8=B1=AA?= <3228734291@qq.com> Date: Wed, 15 May 2024 13:42:39 +0000 Subject: [PATCH 3/6] =?UTF-8?q?=E6=96=B0=E5=BB=BA=20=E5=BC=A0=E4=BF=8A?= =?UTF-8?q?=E8=B1=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\345\274\240\344\277\212\350\261\252/.keep" | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 "\345\274\240\344\277\212\350\261\252/.keep" diff --git "a/\345\274\240\344\277\212\350\261\252/.keep" "b/\345\274\240\344\277\212\350\261\252/.keep" new file mode 100644 index 0000000..e69de29 -- Gitee From ef3d8a04116a4b0696fbbb84ebdb763f92135ee5 Mon Sep 17 00:00:00 2001 From: zjh <3228734291@qq.com> Date: Wed, 15 May 2024 21:11:18 +0800 Subject: [PATCH 4/6] ceshi --- .../\346\265\213\350\257\225.md" | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename "\345\274\240\344\277\212\350\261\252/.keep" => "\345\274\240\344\277\212\350\261\252/\346\265\213\350\257\225.md" (100%) diff --git "a/\345\274\240\344\277\212\350\261\252/.keep" "b/\345\274\240\344\277\212\350\261\252/\346\265\213\350\257\225.md" similarity index 100% rename from "\345\274\240\344\277\212\350\261\252/.keep" rename to "\345\274\240\344\277\212\350\261\252/\346\265\213\350\257\225.md" -- Gitee From 71c612a16384fa3f3b03faadb2c7b35547bd1dd4 Mon Sep 17 00:00:00 2001 From: zjh <3228734291@qq.com> Date: Tue, 21 May 2024 12:30:30 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...13\347\274\251\350\247\243\345\216\213.md" | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 "\345\274\240\344\277\212\350\261\252/\345\216\213\347\274\251\350\247\243\345\216\213.md" diff --git "a/\345\274\240\344\277\212\350\261\252/\345\216\213\347\274\251\350\247\243\345\216\213.md" "b/\345\274\240\344\277\212\350\261\252/\345\216\213\347\274\251\350\247\243\345\216\213.md" new file mode 100644 index 0000000..3d92758 --- /dev/null +++ "b/\345\274\240\344\277\212\350\261\252/\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 5331ade4eee3957706bd6e2c1c99af1f671ca4cb Mon Sep 17 00:00:00 2001 From: zjh <3228734291@qq.com> Date: Wed, 22 May 2024 23:43:56 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...07\344\273\266\347\256\241\347\220\206.md" | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 "\345\274\240\344\277\212\350\261\252/\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/\345\274\240\344\277\212\350\261\252/\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/\345\274\240\344\277\212\350\261\252/\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..e1d412e --- /dev/null +++ "b/\345\274\240\344\277\212\350\261\252/\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