1:创建目录test:
·使用两种方式在test目录中创建文本文件text1.txt,text2.txt
(1):第一种方式:touch
[root@localhost ~]# mkdir test
[root@localhost ~]# cd test/
[root@localhost test]# touch text1.txt
[root@localhost test]# ls
text1.txt
[root@localhost test]#
(2):第二种方式:vim / vi
[root@localhost ~]# mkdir test
[root@localhost ~]# cd test/
[root@localhost test]# vim text2.txt
[root@localhost test]# ls
text2.txt
[root@localhost test]#
·使用vim在文件text1.txt中写入
Welcome to my Linux.
You are the best.
This is my first file to create on linux.

新文件:
[root@localhost test]# ls
new_test1.txt text1.txt text2.txt
[root@localhost test]# cat new
本文介绍了Linux基础操作,包括创建目录test及其子目录,使用touch和vim创建并编辑文本文件,文件拷贝、软硬链接的区别,以及文件删除。同时,讲解了如何使用echo命令结合管道将内容输出到文件,以及cat、more、less、head和tail命令对文件内容的查看方式。
最低0.47元/天 解锁文章
4529

被折叠的 条评论
为什么被折叠?



