Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-10971

Add -C flag to make `hadoop fs -ls` print filenames only

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3.0
    • 2.8.0, 3.0.0-alpha1
    • fs
    • None
    • Reviewed

    Description

      It would be useful to have a flag that made hadoop fs -ls only print filenames, instead of full stat info. The "-C" flag from GNU ls is the closest analog to this behavior that I've found, so I propose that as the flag.

      Per this stackoverflow answer, I've reluctantly added a hadoop-ls-C wrapper that expands to hadoop fs -ls "$@" | sed 1d | perl -wlne'print +(split " ",$_,8)[7]' to a few projects I've worked on, and it would obviously be nice to have hadoop save me (and others) from such hackery.

      Attachments

        1. HADOOP-10971.001.patch
          6 kB
          Kengo Seki
        2. HADOOP-10971.002.patch
          6 kB
          Kengo Seki
        3. HADOOP-10971.003.patch
          12 kB
          Kengo Seki
        4. HADOOP-10971.004.patch
          14 kB
          Kengo Seki
        5. HADOOP-10971.005.patch
          13 kB
          Kengo Seki

        Issue Links

          Activity

            People

              sekikn Kengo Seki
              rdub Ryan Williams
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: