---
title: "Hadoop File System Commands: ls Command Output Analysis"  
description: "In my previous post, I have explained various Hadoop file system commands, in which I also explained about the “ls command”. I have written the syntax"  
author: "David Miller"  
published: 2016-05-05  
updated: 2018-03-14  
canonical: https://www.mindstick.com/blog/11064/hadoop-file-system-commands-ls-command-output-analysis  
category: "hadoop"  
tags: ["bigdata", "hadoop", "software development"]  
reading_time: 3 minutes  

---

# Hadoop File System Commands: ls Command Output Analysis

In my previous post, I have explained various [Hadoop file system commands](https://www.mindstick.com/Articles/12039/managing-files-with-hadoop-file-system-commands), in which I also explained about the “ls command”. I have written the syntax and also [describe](https://www.mindstick.com/interview/12752/what-is-ddms-describe-some-of-its-capabilities) it is used to get the HDFS file listing:\

(From the previous post: Managing files with Hadoop File System Commands)

##### ls command :

Run the ls command to get an HDFS file listing:

$ hadoop hdfs dfs -ls .

Found 2 items drwxr-xr-x - [mindstick](https://yourviews.mindstick.com/view/84668/how-mindstick-is-used-for-marketing-purposes) supergroup 0 2016-05-03 12:25 /user/mindstick -rw-r--r-- 1 mindstick supergroup 118 2016-05-03 12:15 /user/mindstick/data.txt

But here, if we carefully observe the last two lines of the output (which I didn’t explain in my previous post):

**drwxr-xr-x - mindstick supergroup 0 2016-05-03 12:25/user/mindstick** **-rw-r--r-- 1 mindstick supergroup 118 2016-05-03 12:15 /user/mindstick/data.txt**

So, here we see and dig deep into the details of what this big [expression](https://www.mindstick.com/articles/1861/sqlite-expressions) is trying to explain about the files.

For the ease of our comfort, we break down the file listing column-wise as in the following list:

##### Column 1:

It shows the file mode (**“d” for [directory](https://www.mindstick.com/forum/226/how-to-get-application-directory-using-c-sharp-csharp) and “–” for [normal file](https://answers.mindstick.com/qa/93905/how-to-fetch-information-from-a-normal-file-with-ajax), followed by the permissions**). The three [permission](https://www.mindstick.com/forum/159434/linux-service-permission-denied-error-adjust-permissions) types — read (r), write (w), and execute (x) — are the same as we find on Linux- and Unix-based systems. The execute permission for a file is ignored because we cannot execute a file on HDFS. The permissions are grouped by owner, group, and public (everyone else).

##### Column 2:

It shows the [replication](https://www.mindstick.com/interview/320/what-is-the-purpose-of-replication) factor for files. (**The concept of replication doesn’t apply to directories.**) The blocks that make up a file in HDFS are replicated to ensure [fault tolerance](https://www.mindstick.com/forum/158644/discuss-the-concept-of-fault-tolerance-and-resilience-in-microservices). The replication factor, or the number of replicas that are kept for a specific file, is configurable. We can specify the replication factor when the file is created or later, via our application.

##### Columns 3 and 4:

It shows the file **owner and group**. Supergroup is the name of the group of superusers, and a superuser is the user with the same [identity](https://www.mindstick.com/articles/13090/icon-the-identity-of-your-brand) as the NameNode process. If we start the NameNode, we are the superuser for now. This is a special group – regular users will have their user-ids belong to a group without special characteristics — a group that’s simply defined by a Hadoop administrator.

##### Column 5:

It shows the size of the file, in bytes, or 0 if it’s a directory.

##### Columns 6 and 7:

It show the **date and time of the last modification**, respectively.

##### Column 8:

It shows the **unqualified name** (meaning that the scheme name isn’t specified) of the file or directory.

---

Original Source: https://www.mindstick.com/blog/11064/hadoop-file-system-commands-ls-command-output-analysis

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
