在/opt/hello 目錄下創建 world.txt
使用命令:touch 文件名
touch world.txt
----------------------------------------
touch “摸”。touch[文件名],就是摸一下文件,如果文件不存在,就建立新文件。
如果存在,就改變文件訪問時間atime等時間戳信息。
創建文件也可以用echo
如:echo>/data/hello.txt 或 >/data/hello.txt 也可以創建文件。
當然很有很多可以間接創建文件的命令,如 vi ?cat 等
只不過touch是專業的。