Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 032856F99 for ; Mon, 13 Jun 2011 13:52:15 +0000 (UTC) Received: (qmail 81512 invoked by uid 500); 13 Jun 2011 13:52:14 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 81482 invoked by uid 500); 13 Jun 2011 13:52:14 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 81469 invoked by uid 99); 13 Jun 2011 13:52:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jun 2011 13:52:14 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Jun 2011 13:52:12 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 8DFF5417A10 for ; Mon, 13 Jun 2011 13:51:51 +0000 (UTC) Date: Mon, 13 Jun 2011 13:51:51 +0000 (UTC) From: "Daryn Sharp (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: <369269424.2551.1307973111578.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <5577157.35481287784221738.JavaMail.jira@thor> Subject: [jira] [Commented] (HDFS-1475) Want a -d flag in hadoop dfs -ls : Do not expand directories MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HDFS-1475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13048563#comment-13048563 ] Daryn Sharp commented on HDFS-1475: ----------------------------------- I have no problem marking it incompatible, but I guess I'm unclear on what constitutes an incompatible change. The patch doesn't alter any of the pre-existing behavior -- it just adds another option. Are enhancements considered incompatible? BTW, the test failed because the corresponding hadoop jira is not integrated. > Want a -d flag in hadoop dfs -ls : Do not expand directories > ------------------------------------------------------------ > > Key: HDFS-1475 > URL: https://issues.apache.org/jira/browse/HDFS-1475 > Project: Hadoop HDFS > Issue Type: Improvement > Components: hdfs client > Affects Versions: 0.23.0 > Environment: any > Reporter: Greg Connor > Assignee: Daryn Sharp > Priority: Minor > Attachments: HDFS-1475.patch > > > I would really love it if dfs -ls had a -d flag, like unix ls -d, which would list the directories matching the name or pattern but *not* their contents. > Current behavior is to expand every matching dir and list its contents, which is awkward if I just want to see the matching dirs themselves (and their permissions). Worse, if a directory exists but is empty, -ls simply returns no output at all, which is unhelpful. > So far we have used some ugly workarounds to this in various scripts, such as > -ls /path/to |grep dir # wasteful, and problematic if "dir" is a substring of the path > -stat /path/to/dir "Exists" # stat has no way to get back the full path, sadly > -count /path/to/dir # works but is probably overkill. > Really there is no reliable replacement for ls -d -- the above hacks will work but only for certain isolated contexts. (I'm not a java programmer, or else I would probably submit a patch for this, or make my own jar file to do this since I need it a lot.) -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira