[go: up one dir, main page]

0% found this document useful (0 votes)
13 views3 pages

Hdfs Commands

The document provides a series of commands for managing files and directories in HDFS, including creating directories, copying files, viewing data, counting files, and removing files or directories. It also includes instructions for accessing the nano editor to create or edit files and commands for checking file sizes and help documentation. Additionally, it covers moving and copying files within HDFS.

Uploaded by

cipoda2336
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views3 pages

Hdfs Commands

The document provides a series of commands for managing files and directories in HDFS, including creating directories, copying files, viewing data, counting files, and removing files or directories. It also includes instructions for accessing the nano editor to create or edit files and commands for checking file sizes and help documentation. Additionally, it covers moving and copying files within HDFS.

Uploaded by

cipoda2336
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

write the data

1. create a folder in hdfs

hdfs dfs -mkdir /name/<path-of-dir>

2. copy data from local to hdfs

hdfs dfs -put <local-dir-path> <hdfs-path>

hdfs dfs -copyFromLocal <local-dir-path> <hdfs-path>

3. if you want to see the data

hdfs dfs -cat <file-path>

4. if i want to count the file in hdfs

Hdfs dfs -count <file_dir>

accessing the nano editor


nano <file_name>
insert
<file-name>
ctrl+o
enter
ctrl+x
5. Getting a file from the directory or getting a file
from hdfs to local

Hdfs dfs -get <dir_name>

6. For remove the file from the directory use

Hdfs dfs -rm <file or dir name>

7. Remove the entire directory

Hdfs dfs -rmr <dir_path> #deprecated in latest version

Hdfs dfs -rm -r <dir_path>

8. Checking for file size

Hdfs dfs -du -s <file_path>

9. For checking all the commands and description


write

Hdfs dfs -help

10. Copy something with in hdfs to hdfs so use -cp

Hdfs dfs -cp <hdfs_dir1> <hdfs_dir2>


11. Move from one directory to another directory
with in hdfs

Hdfs dfs -mv <hdfs_dir1> <hdfs_dir2>

12. Create a file in hdfs

Hdfs dfs -touchz <file_name>

You might also like