What is the difference between local file system commands touch and touchz

0 votes

 I am new to Hadoop and starting working on few commands and I am trying to create a new file in linux terminal. What is the difference between

[edureka@localhost ~]$touch file.txt

and

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

Why in a local file system for creating a new file touch is used and why in the Hadoop file system for creating a new file touchz is used

Aug 14, 2018 in Big Data Hadoop by Neha
• 6,300 points
933 views

1 answer to this question.

0 votes

Actually they both do the same except touchz is setting to a file timestamp of the folder where is created. From the source code of 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

Both can be used for creating files. However, touch can be also used to update the modification date (timestamp) of a file.

If you also wish to update the timestamp of a file on Hadoop, you can use setTimes.

answered Aug 14, 2018 by Frankie
• 9,810 points

Related Questions In Big Data Hadoop

0 votes
10 answers

What is the difference between Mongodb and Hadoop?

MongoDB is a NoSQL database, whereas Hadoop is ...READ MORE

answered Jun 20, 2018 in Big Data Hadoop by jenny_code
8,240 views
0 votes
1 answer
0 votes
1 answer
0 votes
2 answers
+1 vote
2 answers

What does hadoop fs -du command gives as output?

du command is used for to see ...READ MORE

answered Jul 23, 2019 in Big Data Hadoop by Lokesh Singh
3,670 views
0 votes
1 answer

How can I write text in HDFS using CMD?

Hadoop put & appendToFile only reads standard ...READ MORE

answered Apr 27, 2018 in Big Data Hadoop by Shubham
• 13,480 points
487 views
0 votes
1 answer

What is the command to find the free space in HDFS?

You can use dfsadmin which runs a ...READ MORE

answered Apr 29, 2018 in Big Data Hadoop by Shubham
• 13,480 points
943 views
0 votes
1 answer

How to find the used cache in HDFS

hdfs dfsadmin -report This command tells fs ...READ MORE

answered May 4, 2018 in Big Data Hadoop by Shubham
• 13,480 points
1,063 views
0 votes
1 answer

What is the difference between a Big Data Warehouse and a traditional Data Warehouse?

Hadoop is similar in architecture to MPP data ...READ MORE

answered Aug 9, 2018 in Big Data Hadoop by Frankie
• 9,810 points
500 views
0 votes
1 answer

What is the difference between a Big Data Warehouse and a traditional Data Warehouse

Hadoop is similar in architecture to MPP data ...READ MORE

answered Aug 9, 2018 in Big Data Hadoop by Frankie
• 9,810 points
213 views