-ls和HDFS DFS -LS之间的差异

发布于 2025-02-05 13:10:32 字数 1565 浏览 3 评论 0 原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沉默的熊 2025-02-12 13:10:36

LS 就像Windows中的 dir 。它向您显示特定文件夹的内容。
HDFS是Hadoop分布式文件系统。 的示例中

在您
您的文件不在您的HDF中。
如果这样做:

hdfs dfs -ls

不应该有titles.csv文件。实际上,您已经在第一张图片中完成了此操作。根本没有文件(也许有隐形文件除外)。

如果您这样做:

hdfs dfs -ls titles.csv

输出将是:“没有这样的文件或目录”
您应该只使用:

cat -n /tmp/titles.csv

进一步信息:

https://man7.org /linux/man-pages/man1/ls.1.html

https://hadoop.apache.org/docs/r2.7.0/hadoop-project-dist/hadoop-common/FileSystemShell.html#ls

ls is like dir in windows. It shows you the content of a specific folder.
hdfs is Hadoop Distributed File System. In your example the output is like a ls -l

For your 2nd question:
Your file isn't in your hdfs.
If you do this:

hdfs dfs -ls

There shouldn't be a titles.csv file. In fact, you have done this in your first picture. There are no files at all (except maybe there are invisible files).

If you do this:

hdfs dfs -ls titles.csv

The output would be: "No such file or directory"
You should use just:

cat -n /tmp/titles.csv

For Further informationen:

https://man7.org/linux/man-pages/man1/ls.1.html

https://hadoop.apache.org/docs/r2.7.0/hadoop-project-dist/hadoop-common/FileSystemShell.html#ls

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文