touch、echo的使用
原创2026/3/5小于 1 分钟
touch
touch 命令在 Linux 操作系统中用于创建文件或修改文件的时间戳
如果指定的文件不存在,则会创建一个新的空白文件
创建名为 file.txt 的新文件
touch file.txt # 不存在则会新建更改 file.txt文件 的时间戳
touch file.txt ## file.txt 已经存在创建三个名为 file1.txt、file2.txt 和 file3.txt 的文件
touch file1.txt file2.txt file3.txtecho
echo 用于在终端上输出一些文本信息
在终端上输出字符串
echo "Hello,Linux!"输出到文件
echo "Hello, Linux!" > ./myfile.txt至此,本章节的学习就到此结束了,如有疑惑,可对接技术客服进行相关咨询。