Commands Cheat Sheet

Try DrDroid: AI Agent for Debugging

80+ monitoring tool integrations
Long term memory about your stack
Locally run Mac App available

Thankyou for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.

Thank you for your submission

We have sent the cheatsheet on your email!
Oops! Something went wrong while submitting the form.
Read more
Time to stop copy pasting your errors onto Google!

Connection

hadoop fs -ls
List files and directories in HDFS

hdfs dfs -ls
Alternative syntax to list files and directories

hdfs getconf -confKey
Get configuration information

File Operations

hadoop fs -put
Upload files from local to HDFS

hadoop fs -get
Download files from HDFS to local

hadoop fs -cp
Copy files within HDFS

hadoop fs -mv
Move files within HDFS

hadoop fs -rm
Delete a file from HDFS

hadoop fs -rm -r
Delete a directory recursively

hadoop fs -mkdir
Create a directory in HDFS

hadoop fs -cat
View file content

hadoop fs -tail
View the last part of a file

hadoop fs -touchz
Create an empty file

File System Status

hadoop fs -df -h
Show disk usage with human-readable format

hadoop fs -du -h
Show disk usage for specified files/directories

hadoop fs -count
Count files in directory

hadoop fsck
Check HDFS file system health

hdfs dfsadmin -report
Get overall HDFS status

hdfs dfsadmin -safemode enter|leave|get|wait
Manage safe mode

Permissions & Ownership

hadoop fs -chmod
Change file permissions

hadoop fs -chown :
Change file ownership

hadoop fs -chgrp
Change file group

Quotas & Snapshots

hdfs dfsadmin -setQuota
Set file count quota

hdfs dfsadmin -setSpaceQuota
Set space quota

hdfs dfsadmin -clrQuota
Clear file count quota

hdfs dfsadmin -clrSpaceQuota
Clear space quota

hdfs dfs -createSnapshot
Create snapshot

hdfs dfs -deleteSnapshot
Delete snapshot

Cluster Management

hdfs haadmin -getServiceState
Get HA state of namenode

hdfs haadmin -failover
Initiate failover

hadoop job -list
List running jobs

hadoop job -kill
Kill a running job