You are on page 1of 2

< MOST USEFUL HADOOP HDFS LINUX COMMANDS >

Sr.
Linex Hadoop Commands Command’s Specification
No.
1 hadoop fs or hdfs dfs This is the base command to interact with HDFS and perform various operations.
2 hadoop fs -ls or hdfs dfs -ls Lists the contents of a directory in HDFS.
3 hadoop fs -put or hdfs dfs -put Uploads files from the local file system to HDFS.
4 hadoop fs -get or hdfs dfs -get Downloads files from HDFS to the local file system.
5 hadoop fs -mkdir or hdfs dfs -mkdir Creates a directory in HDFS.
6 hadoop fs -rm or hdfs dfs -rm Removes a file from HDFS.
7 hadoop fs -rmdir or hdfs dfs -rmdir Removes a directory from HDFS.
8 hadoop fs -mv or hdfs dfs -mv Moves a file or directory within HDFS.
9 hadoop fs -cp or hdfs dfs -cp Copies files or directories within HDFS.
10 hadoop fs -cat or hdfs dfs -cat Displays the content of a file in the console.
11 hadoop fs -tail or hdfs dfs -tail Displays the last kilobyte of a file to the console.
12 hadoop fs -du or hdfs dfs -du Shows the amount of space used by files and directories in HDFS.
13 hadoop fs -chown or hdfs dfs -chown Changes the ownership of files or directories in HDFS.
14 hadoop fs -chmod or hdfs dfs -chmod Changes the permissions of files or directories in HDFS.
15 hadoop fs -chgrp or hdfs dfs -chgrp Changes the group ownership of files or directories in HDFS.
16 hadoop fs -setrep or hdfs dfs -setrep Sets the replication factor for a file in HDFS.
17 hadoop fs -getmerge or hdfs dfs -getmerge Concatenates files in HDFS to a local file.
18 hadoop fs -touchz or hdfs dfs -touchz Creates an empty file in HDFS.
19 Retrieves Access Control Lists (ACLs) for files and directories in HDFS. ACLs define permissions beyond
hadoop fs -getfacl or hdfs dfs -getfacl traditional Unix-style permissions.
20 hadoop fs -setfacl or hdfs dfs -setfacl Sets Access Control Lists (ACLs) for files and directories in HDFS.
21 hadoop fs -getfattr or hdfs dfs -getfattr Retrieves extended attributes for files and directories in HDFS.
22 hadoop fs -setfattr or hdfs dfs -setfattr Sets extended attributes for files and directories in HDFS.
23 hadoop fs -count or hdfs dfs -count Counts the number of directories, files, and bytes under the given paths in HDFS.
24 hadoop fs -tail or hdfs dfs -tail Displays the last kilobyte of a file in HDFS to the console.
25 hadoop fs -test or hdfs dfs -test Checks if a path exists or verifies if the user has the specified permissions in HDFS.
26 hadoop fs -expunge or hdfs dfs -expunge Empties the Trash in HDFS, permanently deleting files and directories.
27 hadoop fs -df or hdfs dfs -df Displays the amount of free and used space in the filesystem containing the specified file.
28 hadoop fs -touchz or hdfs dfs -touchz Creates an empty file in HDFS with a specified timestamp.
29 hadoop fs -getchecksum or hdfs dfs -
getchecksum Retrieves the checksum information of a file in HDFS.
30 hadoop fs -tail or hdfs dfs -tail Displays the contents of a file from the end without opening it entirely.
31 hadoop fs -stat or hdfs dfs -stat Displays the details of a file or directory, such as owner, group, permissions, size, and modification time.
32 hadoop fs -copyFromLocal or hdfs dfs -
copyFromLocal Copies files from the local file system to HDFS, similar to -put.
33 hadoop fs -copyToLocal or hdfs dfs -
copyToLocal Copies files from HDFS to the local file system, similar to -get.
34 hadoop fs -getmerge or hdfs dfs -getmerge Retrieves and merges the files in HDFS into a single local file.
35 hadoop fs -setrep or hdfs dfs -setrep Sets the replication factor for files and directories in HDFS.

You might also like