diff --git "a/\350\265\265\345\220\257\346\201\222/\347\233\270\345\257\271\350\267\257\345\212\262\345\222\214\347\273\235\345\257\271\350\267\257\345\212\262.txt" "b/\350\265\265\345\220\257\346\201\222/\347\233\270\345\257\271\350\267\257\345\212\262\345\222\214\347\273\235\345\257\271\350\267\257\345\212\262.txt" new file mode 100644 index 0000000000000000000000000000000000000000..a62c8b7465ce19641280440b7aefd60896ea89e6 --- /dev/null +++ "b/\350\265\265\345\220\257\346\201\222/\347\233\270\345\257\271\350\267\257\345\212\262\345\222\214\347\273\235\345\257\271\350\267\257\345\212\262.txt" @@ -0,0 +1,395 @@ +在家目录下建立文件exam.c,将文件exam.c拷贝到/tmp这个目录下,并改名为 shiyan.c + + ~~~ shell + su@hecs-169541:/tmp$ touch ./../home/su/exam.c + su@hecs-169541:/tmp$ cp ./../home/su/exam.c ./shiyan.c + + + ~~~ + + + +2. 在任何目录下回到用户主目录? + + ~~~ shell + su@hecs-169541:~$ cd ~ + + ~~~ + + + +3. 用长格式列出/tmp/test目录下所有的文件包括隐藏文件? + + ~~~ shell + su@hecs-169541:/tmp$ mkdir ./test + su@hecs-169541:/tmp$ ls -la ./test + + ~~~ + + + +4. /tmp/test2目录下,创建5个文件分别是 1.txt 2.txt 3.txt 4.txt 5.txt,压缩这5个文件,压缩包的名字是hailiang.tar + + ~~~ shell + su@hecs-169541:/tmp$ mkdir ./test2 + su@hecs-169541:/tmp$ touch ./test2/{1..5}.txt + su@hecs-169541:/tmp$ tar -cvzf ./test2/hailiang.tar ./test2/{1..5}.txt + + ~~~ + + + +5. 当前目录,建立文件 file1.txt 并更名为 file2.txt? + + ~~~ shell + su@hecs-169541:/tmp$ touch ./file1.txt + + ~~~ + + + +6. 当前目录,用vim建立文件bbbb.txt 并将用户名的加入其中保存退出? + + ~~~ shell + su@hecs-169541:/tmp$ mv ./file1.txt ./file2.txt + + ~~~ + + + +7. 将家目录中扩展名为txt、doc和bak的文件全部复制到/tmp/test目录中? + + ~~~ shell + su@hecs-169541:/tmp$ touch ./../home/su/1.txt ./../home/su/2.doc ./../home/su/3.bak + su@hecs-169541:/tmp$ cp ./../home/su/*.txt ./../home/su/*.doc ./../home/su/*.bak ./test + + + ~~~ + + + +8. 将文件file1.txt从当前目录移动到家目录的/docs中。 + + ~~~ shell + su@hecs-169541:/tmp$ touch ./file1.txt + su@hecs-169541:/tmp$ mv ./file1.txt ./../home/su/docs + + + ~~~ + + + +9. 复制文件file2.txt从当前目录到家目录/backup中。 + + ~~~ shell + su@hecs-169541:/tmp$ cp ./file2.txt ./../home/su/backup/ + + ~~~ + + + +10. 将家目录/docs中的所有文件和子目录移动到家目录/archive中。 + + ~~~ shell + su@hecs-169541:/tmp$ mv ./../home/su/docs/* ./../home/su/archive/ + + ~~~ + + + +11. 复制家目录/photos及其所有内容到家目录/backup中。 + + ~~~ shell + su@hecs-169541:/tmp$ cp -r ./../home/su/photos/ ./../home/su/backup/ + ~~~ + + + +12. 将文件家目录/docs/report.doc移动到家目录/papers中,并将其重命名为final_report.doc。 + + ~~~ shell + su@hecs-169541:/tmp$ mv ./../home/su/docs/report.doc ./../home/su/papers/final_report.doc + + ~~~ + + + +13. 在家目录/docs中创建一个名为notes.txt的空文件,并将其复制到目录家目录/backup中。 + + ~~~ shell + su@hecs-169541:/tmp$ touch ./../home/su/docs/notes.txt + su@hecs-169541:/tmp$ cp ./../home/su/docs/notes.txt ./../home/su/backup/ + + ~~~ + + + +14. 复制家目录/images中所有以.jpg结尾的文件到家目录/photos中。 + + ~~~ shell + su@hecs-169541:/tmp$ cp ./../home/su/images/*.jpg ./../home/su/photos/ + ~~~ + + + +15. 将文件家目录/docs/file1.txt和家目录/docs/file2.txt复制到家目录/backup中。 + + ~~~ shell + su@hecs-169541:/tmp$ cp ./../home/su/docs/file1.txt ./../home/su/file2.txt ./../home/su/backup/ + ~~~ + + + +16. 将家目录/docs中的所有.txt文件复制到家目录/text_files中。 + + ~~~ shell + su@hecs-169541:/tmp$ cp ./../home/su/docs/*.txt ./../home/su/text_files + ~~~ + + + +17. 将家目录/docs中的所有文件移动到家目录/temp中,并且如果文件已存在,则覆盖它们。 + + ~~~ shell + su@hecs-169541:/tmp$ mv -f ./../home/su/docs/* ./../home/su/temp + ~~~ + + + +18. 将家目录/docs中的所有文件移动到家目录/archive中,并且在移动时显示详细的移动信息。 + + ~~~ shell + su@hecs-169541:/tmp$ mv -v ./../home/su/docs/* ./../home/su/archive + ~~~ + + + +19. 复制家目录/docs中的所有子目录及其内容到家目录/backup中。 + + ~~~ shell + su@hecs-169541:/tmp$ cp -r ./../home/su/docs/ ./../home/su/backup + ~~~ + + + +20. 将家目录/docs中的所有文件和子目录移动到家目录/backup中,但排除文件名以"temp_"开头的文件。 + + ~~~ shell + su@hecs-169541:/tmp$ mv ./../home/su/docs/!(*temp_) ./../home/su/backup + ~~~ + + + +21. 将目录/docs/report.txt移动到家目录/archive中,但如果目标目录中已存在同名文件,则不直接覆盖,先备份同名文件为report.txt_bak。 + + ~~~ shell + su@hecs-169541:/tmp$ mv -bS _bak ./../home/su/docs/report.txt ./../home/su/archive + ~~~ + + + +22. 将家目录/docs中所有以.pdf结尾的文件复制到家目录/pdf_files中,并且如果目标目录中已存在同名文件,则忽略它们。 + + ~~~ shell + su@hecs-169541:/tmp$ cp -n ./../home/su/docs/*.pdf ./../home/su/pdf_files + ~~~ + + +\ No newline at end of file在家目录下建立文件exam.c,将文件exam.c拷贝到/tmp这个目录下,并改名为 shiyan.c + + ~~~ shell + su@hecs-169541:/tmp$ touch ./../home/su/exam.c + su@hecs-169541:/tmp$ cp ./../home/su/exam.c ./shiyan.c + + + ~~~ + + + +2. 在任何目录下回到用户主目录? + + ~~~ shell + su@hecs-169541:~$ cd ~ + + ~~~ + + + +3. 用长格式列出/tmp/test目录下所有的文件包括隐藏文件? + + ~~~ shell + su@hecs-169541:/tmp$ mkdir ./test + su@hecs-169541:/tmp$ ls -la ./test + + ~~~ + + + +4. /tmp/test2目录下,创建5个文件分别是 1.txt 2.txt 3.txt 4.txt 5.txt,压缩这5个文件,压缩包的名字是hailiang.tar + + ~~~ shell + su@hecs-169541:/tmp$ mkdir ./test2 + su@hecs-169541:/tmp$ touch ./test2/{1..5}.txt + su@hecs-169541:/tmp$ tar -cvzf ./test2/hailiang.tar ./test2/{1..5}.txt + + ~~~ + + + +5. 当前目录,建立文件 file1.txt 并更名为 file2.txt? + + ~~~ shell + su@hecs-169541:/tmp$ touch ./file1.txt + + ~~~ + + + +6. 当前目录,用vim建立文件bbbb.txt 并将用户名的加入其中保存退出? + + ~~~ shell + su@hecs-169541:/tmp$ mv ./file1.txt ./file2.txt + + ~~~ + + + +7. 将家目录中扩展名为txt、doc和bak的文件全部复制到/tmp/test目录中? + + ~~~ shell + su@hecs-169541:/tmp$ touch ./../home/su/1.txt ./../home/su/2.doc ./../home/su/3.bak + su@hecs-169541:/tmp$ cp ./../home/su/*.txt ./../home/su/*.doc ./../home/su/*.bak ./test + + + ~~~ + + + +8. 将文件file1.txt从当前目录移动到家目录的/docs中。 + + ~~~ shell + su@hecs-169541:/tmp$ touch ./file1.txt + su@hecs-169541:/tmp$ mv ./file1.txt ./../home/su/docs + + + ~~~ + + + +9. 复制文件file2.txt从当前目录到家目录/backup中。 + + ~~~ shell + su@hecs-169541:/tmp$ cp ./file2.txt ./../home/su/backup/ + + ~~~ + + + +10. 将家目录/docs中的所有文件和子目录移动到家目录/archive中。 + + ~~~ shell + su@hecs-169541:/tmp$ mv ./../home/su/docs/* ./../home/su/archive/ + + ~~~ + + + +11. 复制家目录/photos及其所有内容到家目录/backup中。 + + ~~~ shell + su@hecs-169541:/tmp$ cp -r ./../home/su/photos/ ./../home/su/backup/ + ~~~ + + + +12. 将文件家目录/docs/report.doc移动到家目录/papers中,并将其重命名为final_report.doc。 + + ~~~ shell + su@hecs-169541:/tmp$ mv ./../home/su/docs/report.doc ./../home/su/papers/final_report.doc + + ~~~ + + + +13. 在家目录/docs中创建一个名为notes.txt的空文件,并将其复制到目录家目录/backup中。 + + ~~~ shell + su@hecs-169541:/tmp$ touch ./../home/su/docs/notes.txt + su@hecs-169541:/tmp$ cp ./../home/su/docs/notes.txt ./../home/su/backup/ + + ~~~ + + + +14. 复制家目录/images中所有以.jpg结尾的文件到家目录/photos中。 + + ~~~ shell + su@hecs-169541:/tmp$ cp ./../home/su/images/*.jpg ./../home/su/photos/ + ~~~ + + + +15. 将文件家目录/docs/file1.txt和家目录/docs/file2.txt复制到家目录/backup中。 + + ~~~ shell + su@hecs-169541:/tmp$ cp ./../home/su/docs/file1.txt ./../home/su/file2.txt ./../home/su/backup/ + ~~~ + + + +16. 将家目录/docs中的所有.txt文件复制到家目录/text_files中。 + + ~~~ shell + su@hecs-169541:/tmp$ cp ./../home/su/docs/*.txt ./../home/su/text_files + ~~~ + + + +17. 将家目录/docs中的所有文件移动到家目录/temp中,并且如果文件已存在,则覆盖它们。 + + ~~~ shell + su@hecs-169541:/tmp$ mv -f ./../home/su/docs/* ./../home/su/temp + ~~~ + + + +18. 将家目录/docs中的所有文件移动到家目录/archive中,并且在移动时显示详细的移动信息。 + + ~~~ shell + su@hecs-169541:/tmp$ mv -v ./../home/su/docs/* ./../home/su/archive + ~~~ + + + +19. 复制家目录/docs中的所有子目录及其内容到家目录/backup中。 + + ~~~ shell + su@hecs-169541:/tmp$ cp -r ./../home/su/docs/ ./../home/su/backup + ~~~ + + + +20. 将家目录/docs中的所有文件和子目录移动到家目录/backup中,但排除文件名以"temp_"开头的文件。 + + ~~~ shell + su@hecs-169541:/tmp$ mv ./../home/su/docs/!(*temp_) ./../home/su/backup + ~~~ + + + +21. 将目录/docs/report.txt移动到家目录/archive中,但如果目标目录中已存在同名文件,则不直接覆盖,先备份同名文件为report.txt_bak。 + + ~~~ shell + su@hecs-169541:/tmp$ mv -bS _bak ./../home/su/docs/report.txt ./../home/su/archive + ~~~ + + + +22. 将家目录/docs中所有以.pdf结尾的文件复制到家目录/pdf_files中,并且如果目标目录中已存在同名文件,则忽略它们。 + + ~~~ shell + su@hecs-169541:/tmp$ cp -n ./../home/su/docs/*.pdf ./../home/su/pdf_files + ~~~ + + +\ No newline at end of file \ No newline at end of file