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

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

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: fs
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      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

              • Assignee:
                sekikn Kengo Seki
                Reporter:
                rdub Ryan Williams
              • Votes:
                1 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: