跳至主要內容

touch、echo的使用

刘春龙原创...小于 1 分钟LinxuUbuntu教程文档

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.txt

echo

echo 用于在终端上输出一些文本信息

在终端上输出字符串
echo "Hello,Linux!"
输出到文件
echo "Hello, Linux!" > ./myfile.txt
上次编辑于:
贡献者: 刘春龙
评论
  • 按正序
  • 按倒序
  • 按热度
Powered by Waline v2.15.7