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,260 points
120 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?

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

answered Dec 6, 2018 in Big Data Hadoop by Deeraj
2,152 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
• 13,110 points
636 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,110 points
62 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,110 points
120 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,110 points
163 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
59 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
31 views