You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Alexander Aristov <al...@gmail.com> on 2008/11/21 15:03:44 UTC

ls command output format

Hello

I wonder if hadoop shell command ls has changed output format

Trying hadoop-0.18.2 I got next output

[root]# hadoop fs -ls /
Found 2 items
drwxr-xr-x   - root supergroup          0 2008-11-21 08:08 /mnt
drwxr-xr-x   - root supergroup          0 2008-11-21 08:19 /repos


Though according to docs it should be that file name goes first.
http://hadoop.apache.org/core/docs/r0.18.2/hdfs_shell.html#ls

Usage: hadoop fs -ls <args>
For a file returns stat on the file with the following format:
filename <number of replicas> filesize modification_date modification_time
permissions userid groupid
For a directory it returns list of its direct children as in unix. A
directory is listed as:
dirname <dir> modification_time modification_time permissions userid groupid
Example:
hadoop fs -ls /user/hadoop/file1 /user/hadoop/file2 hdfs://
nn.example.com/user/hadoop/dir1 /nonexistentfile
Exit Code:
 Returns 0 on success and -1 on error.


I wouldn't notice the issue if I haven't had scripts which rely on the
formatting.

-- 
Best Regards
Alexander Aristov

Re: ls command output format

Posted by "Tsz Wo (Nicholas), Sze" <s2...@yahoo.com>.
Hi Alex,

Yes, the doc about ls is out-dated.  Thanks for pointing this out.  Would you mind to file a JIRA?

Nicholas Sze



----- Original Message ----
> From: Alexander Aristov <al...@gmail.com>
> To: core-user@hadoop.apache.org
> Sent: Friday, November 21, 2008 6:08:08 AM
> Subject: Re: ls command output format
> 
> Found out that output has been changed in 0.18
> 
> see HADOOP-2865 
> 
> Docs should be also then updated.
> 
> Alex
> 
> 2008/11/21 Alexander Aristov 
> 
> > Hello
> >
> > I wonder if hadoop shell command ls has changed output format
> >
> > Trying hadoop-0.18.2 I got next output
> >
> > [root]# hadoop fs -ls /
> > Found 2 items
> > drwxr-xr-x   - root supergroup          0 2008-11-21 08:08 /mnt
> > drwxr-xr-x   - root supergroup          0 2008-11-21 08:19 /repos
> >
> >
> > Though according to docs it should be that file name goes first.
> > http://hadoop.apache.org/core/docs/r0.18.2/hdfs_shell.html#ls
> >
> > Usage: hadoop fs -ls 
> > For a file returns stat on the file with the following format:
> > filename filesize modification_date modification_time
> > permissions userid groupid
> > For a directory it returns list of its direct children as in unix. A
> > directory is listed as:
> > dirname 
modification_time modification_time permissions userid
> > groupid
> > Example:
> > hadoop fs -ls /user/hadoop/file1 /user/hadoop/file2 hdfs://
> > nn.example.com/user/hadoop/dir1 /nonexistentfile
> > Exit Code:
> >  Returns 0 on success and -1 on error.
> >
> >
> > I wouldn't notice the issue if I haven't had scripts which rely on the
> > formatting.
> >
> > --
> > Best Regards
> > Alexander Aristov
> >
> 
> 
> 
> -- 
> Best Regards
> Alexander Aristov


Re: ls command output format

Posted by Alexander Aristov <al...@gmail.com>.
Found out that output has been changed in 0.18

see HADOOP-2865 <https://issues.apache.org/jira/browse/HADOOP-2865>

Docs should be also then updated.

Alex

2008/11/21 Alexander Aristov <al...@gmail.com>

> Hello
>
> I wonder if hadoop shell command ls has changed output format
>
> Trying hadoop-0.18.2 I got next output
>
> [root]# hadoop fs -ls /
> Found 2 items
> drwxr-xr-x   - root supergroup          0 2008-11-21 08:08 /mnt
> drwxr-xr-x   - root supergroup          0 2008-11-21 08:19 /repos
>
>
> Though according to docs it should be that file name goes first.
> http://hadoop.apache.org/core/docs/r0.18.2/hdfs_shell.html#ls
>
> Usage: hadoop fs -ls <args>
> For a file returns stat on the file with the following format:
> filename <number of replicas> filesize modification_date modification_time
> permissions userid groupid
> For a directory it returns list of its direct children as in unix. A
> directory is listed as:
> dirname <dir> modification_time modification_time permissions userid
> groupid
> Example:
> hadoop fs -ls /user/hadoop/file1 /user/hadoop/file2 hdfs://
> nn.example.com/user/hadoop/dir1 /nonexistentfile
> Exit Code:
>  Returns 0 on success and -1 on error.
>
>
> I wouldn't notice the issue if I haven't had scripts which rely on the
> formatting.
>
> --
> Best Regards
> Alexander Aristov
>



-- 
Best Regards
Alexander Aristov

Re: ls command output format

Posted by Allen Wittenauer <aw...@yahoo-inc.com>.


On 11/21/08 6:03 AM, "Alexander Aristov" <al...@gmail.com>
wrote:

> Trying hadoop-0.18.2 I got next output
> 
> [root]# hadoop fs -ls /
> Found 2 items
> drwxr-xr-x   - root supergroup          0 2008-11-21 08:08 /mnt
> drwxr-xr-x   - root supergroup          0 2008-11-21 08:19 /repos


... which reminds me.  I really wish ls didn't default to -l.