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
2,148 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,830 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
11,381 views
0 votes
1 answer
0 votes
1 answer
0 votes
2 answers

What is the difference between the Smart Data Access of SAP HANA and SAP HANA Vora?

Hadoop: Used to store Big Data in ...READ MORE

answered Jun 21, 2018 in Big Data Hadoop by kurt_cobain
• 9,390 points
1,109 views
+1 vote
2 answers

What does hadoop fs -du command gives as output?

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

answered Jul 24, 2019 in Big Data Hadoop by Lokesh Singh
5,499 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,490 points
1,799 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,490 points
1,871 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,490 points
2,057 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 10, 2018 in Big Data Hadoop by Frankie
• 9,830 points
1,172 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 10, 2018 in Big Data Hadoop by Frankie
• 9,830 points
503 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP