gpt4 book ai didi

hadoop - 本地文件系统命令touch和touchz的区别?

转载 作者:可可西里 更新时间:2023-11-01 14:49:40 25 4
gpt4 key购买 nike

我是 Hadoop 的新手,开始使用一些命令,我​​正在尝试在 linux 终端中创建一个新文件。有什么区别

[prajyod@localhost ~]$touch file.txt

[prajyod@localhost ~]$hadoop fs -touch**z** file.txt.

为什么在本地文件系统中创建新文件使用 touch,为什么在 hadoop 文件系统中创建新文件 touchz被使用

最佳答案

实际上它们都做同样的事情,除了 touchz 被设置为创建文件夹的文件时间戳。来自touchz的源代码:

Creates a file of zero length at path with current time as the timestamp of that path. An error is returned if the file exists with non-zero length

关于hadoop - 本地文件系统命令touch和touchz的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27603270/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com