Implementation of basic Hadoop commands
In This Article, we'll discuss Implementation of basic Hadoop commands
start-all.sh: Used to start Hadoop daemons all at once. Issuing it on the master machine will start the daemons on all the nodes of a
jps(Java Virtual Machine Process Status Tool): JPS is a command is used to check all the Hadoop daemons like NameNode, DataNode, ResourceManager, NodeManager etc. which are running on the machine.
hadoop version: This command is use to check the version of Hadoop in which you are currently working.
Syntax: hadoop version
Java -version: This command is use to check the java version in which you are currently
Syntax: java version
mkdir:This command is use to make directories.
Syntax: hdfs dfs -mkdir [-p] <paths>
Now to check whether your directory created at the remote location or not you need to go to browser and type
gedit: It is the default text editor of the GNOME desktop environment. One of the neatest features of this program is that it supports tabs, so you can edit multiple
put: This command is used to copy files from the local file system to the HDFS filesystem. . That is this command is use to upload file in directory which is created on remote
hdfs dfs -put <localsrc> <destination>
After that you need to check that your file shown at the remote location in that which you created prior.
cat: HDFS Command that reads a file on HDFS and prints the content of that file to the standard output.
hdfs dfs -cat URI [URI ...]
expunge: HDFS Command that makes the trash empty.
hdfs dfs –expunge
rm: Used to stop hadoop daemons all at once. Issuing it on the master machine will stop the daemons on all the nodes of a cluster.
hdfs dfs -rm /[dirname]/[filename]
cp: This command is use to copy data from one source directory to another.
hdfs dfs -cp [source] [destination]
tail: This command is used to show the last 1KB of the file.
hdfs dfs –touchz /directory/filename
mv: This command is similar to the UNIX mv command, and it is used for moving a file from one directory to another directory within the HDFS file system.
hdfs dfs -mv /[source_dir_name]/[file_name]/[destination_dir name]
stop-all.sh: Used to stop hadoop daemons all at once. Issuing it on the master machine will stop the daemons on all the nodes of a cluster.