HDFS Forum

Howto show hidden file or directory?

  • #56849
    Tri Nguyen


    Using HDP 2.1.2 I have created a snapshot by:

    hdfs dfsadmin -allowSnapshot /user/myTestDir1
    hdfs dfs -createSnapshot /user/myTestDir1
    Console Output: Created snapshot /user/myTestDir1/.snapshot/s20140704-101231.886

    Let’s say I forgot later that /user/myTestDir1 contains snapshots. I would like to list the entire content of that path, including hidden files or folders, by using:

    hdfs dfs -ls /user/myTestDir1

    But the hidden directory .snapshot is not visible. To see it’s content I must explicitly specify the path of the hidden directory

    hdfs dfs -ls /user/myTestDir1/.snapshot/

    QUESTION: Can you please suggest a way to list hidden file / directory in HDFS?
    Thanks in advance for any help

to create new topics or reply. | New User Registration

  • Author
  • #56850
    Tri Nguyen

    I wonder how to edit my previous post. The choice of snapshot in the example might be misleading as the command “hdfs lsSnapshottableDir” would show all the snapshottable paths.

    My question was generic and not really related to snapshot. I would like to know if there is a way to list hidden files or directories (having a dot prefixing the name).

    Thanks and can you please also show me how to edit my own posts?

You must be to reply to this topic. | Create Account

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.