Run the Hadoop fs-ls command to display local Directory issues Problem reason: The default path for HDFS is not specified in the Hadoop configuration file Solution: There are two ways 1. Access Hadoop
There was a problem with Hadoop Fs-ls because of the violent shutdown:The cause of the problem is the following red box inside the thing, I thought that download a Conf.cloudera.yarn file from another node can solve the problem, found no Ah, then deleted.From another node SCP come over this file.Workaround:Scp-r/etc/hadoop
.
Example:
Hadoop FS-Get/user/hadoop/file localfile
Hadoop FS-Get HDFS: // host: Port/user/hadoop/file localfile
Return Value:
0 is returned for success, and-1 is returned for failure.
Getmerge
Usage:
Hadoop FS: The widest range of users can operate any file system.
Hadoop DFS and HDFs dfs: only HDFs file system related (including operations with local FS) can be manipulated, the former has been deprecated, generally using the latter.
The following reference from StackOverflow
Following are the three commands whic
http://blog.csdn.net/pipisorry/article/details/51340838the difference between ' Hadoop DFS ' and ' Hadoop FS 'While exploring HDFs, I came across these II syntaxes for querying HDFs:> Hadoop DFS> Hadoop FSWhy we have both different syntaxes for a common purposeWhy are there
Suppose you have a/user/hadoop/output directory on your HDFS cluster
There is the result of the job execution (multiple files are composed) part-000000,part-000001,part-000002
And then you want to put all the files together. You can use the command: Hadoop fs-getmerge/user/hado
The Hadoop Ls command adds the limit parameter on the number of display items.Preface
In hadoop's FsShell command, it is estimated that many people commonly use commands such as hadoop fs-ls
. ADDNL is optional and is used to specify that a newline character be added at the end of each file.
Ls
How to use: Hadoop fs-ls
If it is a file, the file information is returned in the following format:
File name If it is a directory, it returns a list of its immediate subfolders, as in Unix. The information for
Hadoop FS: Use the widest range of surfaces to manipulate any file system.Hadoop DFS and HDFs DFS: can only operate on HDFs file system-related (including operations with local FS), which is already deprecated, typically using the latter.The following reference is from StackOverflowFollowing is the three commands which appears same but has minute differences
Hadoop FS: Use the widest range of surfaces to manipulate any file system.Hadoop DFS and HDFs DFS: can only operate on HDFs file system-related (including operations with local FS), which is already deprecated, typically using the latter.The following reference is from StackOverflowFollowing is the three commands which appears same but has minute differences
Hadoop uses HDFs to store HBase's data, and we can view the size of the HDFS using the following command. Hadoop fsck Hadoop fs-dus Hadoop fs-count-q
The above
in Unix. The directory returns information for the list as follows:Directory name Example:Hadoop fs-ls/user/hadoop/file1/user/hadoop/file2 Hdfs://host:port/user/hadoop/dir1/nonexistentfilereturn value:Successful return 0, Failure returns-1.14:lsrHow to use:
a source directory and a target file as input, and connects all files in the source directory to the local destination file. ADDNL is optional and is used to specify that a newline character be added at the end of each file. ls
How to use: Hadoop fs-ls
If it is a file, the file information is returned in the fol
FS Shell
Cat
Chgrp
chmod
Chown
Copyfromlocal
Copytolocal
Cp
Du
Dus
Expunge
Get
Getmerge
Ls
Lsr
Mkdir
Movefromlocal
Mv
Put
Rm
RMr
Setrep
Stat
Tail
Test
Text
Touchz
FS ShellThe call file system (
Original address: http://hadoop.apache.org/docs/r1.0.4/cn/hdfs_shell.html
FS Shell
Cat
Chgrp
chmod
Chown
Copyfromlocal
Copytolocal
Cp
Du
Dus
Expunge
Get
Getmerge
Ls
Lsr
Mkdir
Movefromlocal
Mv
Put
Rm
RMr
Setrep
Stat
Tail
Test
Text
Touchz
/hadoop/dir1/nonexistentfilereturn value:Successful return 0, Failure returns-1.LsrHow to use: Hadoop FS-LSR the recursive version of the LS command. Similar to the Ls-r in Unix . MkdirHow to use:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.