How to edit txt file inside the HDFS in terminal? How to edit txt file inside the HDFS in terminal? hadoop hadoop

How to edit txt file inside the HDFS in terminal?


You cannot edit files, which all are already in HDFS. It will not support. HDFS works on "Write once, read many". So if you want to edit a file, make changes in your local copy then move it to HDFS.


Currently as explained by @BruceWayne, its not possible. It would be very difficult to edit the files stored in hdfs because all the files are distributed in hdfs and it would be very difficult to edit in the terminal using hdfs commands. Currently these are supported as terminal commands.

You can edit them by locating the data location of each datanode in the cluster.But that would be troublesome.

Moreover you can install HUE. With HUE you can edit the files in hdfs using web UI.


You can not edit files in HDFS, as it works on the principle of Write once, Read Many.But now a day, we can edit file using Hue file browser in cloudera.