I know du -sh
in common Linux filesystems. But how to do that with HDFS?
相关问题
- How to access the camera from my Windows Phone 8 a
- Spark on Yarn Container Failure
- softlinks atime and mtime modification
- Get unexpanded argument from bash command line
- Include and Execute EXE in C# Command Line App
相关文章
- Java写文件至HDFS失败
- mapreduce count example
- Compile and build with single command line Java (L
- How to update command line output?
- How to execute another python script from your scr
- Directory.CreateDirectory Latency Issue?
- Could you give me any clue Why 'Cannot call me
- How can i list only the folders in zip archive in
Prior to 0.20.203, and officially deprecated in 2.6.0:
Since
0.20.203(dead link) 1.0.4 and still compatible through 2.6.0:You can also run
hadoop fs -help
for more info and specifics.When trying to calculate the total of a particular group of files within a directory the
-s
option does not work (in Hadoop 2.7.1). For example:Directory structure:
Assume each file is 1 KB in size. You can summarize the entire directory with:
However, if I want the sum of all files containing "count" the command falls short.
To get around this I usually pass the output through awk.
Extending to Matt D and others answers, the command can be till Apache Hadoop 3.0.0
The du returns three columns with the following format:
Example command:
Exit Code: Returns 0 on success and -1 on error.
source: Apache doc
With this you will get size in GB
% of used space on Hadoop cluster
sudo -u hdfs hadoop fs –df
Capacity under specific folder:
sudo -u hdfs hadoop fs -du -h /user
hadoop fs -du -s -h /path/to/dir
displays a directory's size in readable form.