Hadoop
Hadoop
hdfs dfs -put <local_path> Uploads a file from the local Ensure the HDFS destination
<hdfs_path> filesystem to HDFS. directory exists.
hdfs dfs -get <hdfs_file> Downloads a file from HDFS Local destination must exist and
<local_path> to the local system. be writable.
hdfs dfs -mv <src> Moves (renames) a file or Works like cp , but removes the
<dest> directory in HDFS. original file after moving.
Recursively deletes a
Use with caution; deletes
hdfs dfs -rm -r <dir> directory along with its
everything inside the directory.
contents.
Displays disk usage statistics Shows size in bytes for each file
hdfs dfs -du <path> for files and directories in and directory within the specified
HDFS. path.
Displays the total size of the Summarizes the total size instead
hdfs dfs -du -s <path>
specified file or directory. of listing individual files.
hadoop commands 1
Displays disk usage statistics Converts sizes into KB, MB, GB,
hdfs dfs -du -h <path>
in a human-readable format. etc., for better readability.
hdfs dfs -chown <user> Changes the owner of a file Only the superuser can change
<path> or directory in HDFS. ownership.
hdfs dfs -chown
Changes both the owner and If only <user> is specified, the
<user>:<group>
<path> group of a file/directory. group remains unchanged.
hadoop commands 2
Immediately empties the
Requires superuser or
hdfs dfs -expunge -immediate trash without waiting for the
appropriate permissions.
regular cleanup cycle.
hadoop commands 3
Checks if the given path Returns 0 if file, 1
hdfs dfs -test -f
is a file otherwise
https://chatgpt.com/share/67d97934-ef90-8002-80f4-0410c7555df0
https://chatgpt.com/share/67d97934-ef90-8002-80f4-0410c7555df0
hadoop commands 4