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,140 points
88 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,570 points

Related Questions In Big Data Hadoop

0 votes
10 answers

What is the difference between Mongodb and Hadoop?

Apart from the similarity that they are ...READ MORE

answered Dec 6, 2018 in Big Data Hadoop by Deeraj
1,813 views
0 votes
1 answer
0 votes
1 answer
0 votes
2 answers
0 votes
1 answer

What does hadoop fs -du command gives as output?

The first value is the size of ...READ MORE

answered Apr 27, 2018 in Big Data Hadoop by Shubham
• 12,110 points
504 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
• 12,110 points
37 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
• 12,110 points
75 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
• 12,110 points
118 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,570 points
43 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,570 points
23 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.