tldr-pages/tldr

Let's document: HDFS

Open

#15,619 opened on Jan 27, 2025

View on GitHub
 (1 comment) (1 reaction) (0 assignees)Shell (2,507 forks)batch import
help wantedlet's documentnew command

Repository metrics

Stars
 (30,937 stars)
PR merge metrics
 (Avg merge 7d 5h) (321 merged PRs in 30d)

Description

Command description

The HDFS command allows users to interact with the Hadoop Distributed File System (HDFS) via a command-line interface. It provides operations to manage files and directories, such as listing, uploading, downloading, and modifying data stored in HDFS.

Documentation

https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/HDFSCommands.html

Platform

Common

VCS repository link (e.g. GitHub, GitLab)

No response

Additional information

No response

Commands

  • hdfs dfs -ls [directory] – List directory contents.
  • hdfs dfs -mkdir [directory] – Create a new directory.
  • hdfs dfs -put [local_path] [hdfs_path] – Upload files to HDFS.
  • hdfs dfs -get [hdfs_path] [local_path] – Download files from HDFS.
  • hdfs dfs -rm [hdfs_path] – Remove a file.
  • hdfs dfs -rmdir [directory] – Remove an empty directory.
  • hdfs dfs -cat [file_path] – Display file contents.
  • hdfs dfs -copyFromLocal [local_path] [hdfs_path] – Copy local files to HDFS.
  • hdfs dfs -copyToLocal [hdfs_path] [local_path] – Copy files from HDFS to local.
  • hdfs dfs -du [directory] – Show disk usage.
  • hdfs dfs -chmod [mode] [path] – Change file permissions.
  • hdfs dfs -chown [user:group] [path] – Change ownership.
  • hdfs dfs -moveFromLocal [local_path] [hdfs_path] – Move files to HDFS.
  • hdfs dfs -df – Report HDFS disk capacity.

Contributor guide