How to list only filenames in a s3 directory using aws cli?

To list only filenames into your terminal:
Here is the trimming to output of aws cli s3 list
aws s3 ls s3://mybucketname/mydir/test/ |grep anyprefixyouhave | awk '{$1=$2=$3=""; print $0}' | sed 's/^[ \t]*//'

9 thoughts on “How to list only filenames in a s3 directory using aws cli?

  • November 10, 2018 at 11:00 pm
    Permalink

    of course like your web-site but you have to take a look at the spelling on quite a few of your posts. A number of them are rife with spelling problems and I find it very bothersome to inform the reality however I will definitely come again again.

    Reply
    • December 17, 2018 at 4:43 pm
      Permalink

      Thanks for letting us know. We will take that feedback and try to improve ourselves.
      I do appreciate it.

      Reply
  • April 11, 2019 at 5:56 pm
    Permalink

    Howdy! Quick question that’s entirely off topic. Do you
    know how to make your site mobile friendly? My web site looks weird when browsing from my iphone4.

    I’m trying to find a template or plugin that might be able to resolve this issue.

    If you have any suggestions, please share. Thank you!

    Reply
  • April 13, 2019 at 8:49 am
    Permalink

    Hi there, You’ve done an incredible job. I will definitely digg it and personally
    suggest to my friends. I’m confident they will be benefited
    from this site.

    Reply
  • April 20, 2019 at 5:10 am
    Permalink

    great points altogether, you just gained a new reader.

    What might you suggest in regards to your submit that you made some days ago?
    Any positive?

    Reply
  • April 21, 2019 at 4:20 am
    Permalink

    At this time it seems like Movable Type is the best blogging platform available
    right now. (from what I’ve read) Is that what you are using on your blog?

    Reply
  • April 22, 2019 at 7:40 am
    Permalink

    Simply desire to say your article is as surprising. The clearness in your post is just nice and i can assume you’re an expert
    on this subject. Well with your permission let me to grab your feed to keep updated with forthcoming post.
    Thanks a million and please carry on the gratifying work.

    Reply
  • May 23, 2019 at 12:45 pm
    Permalink

    My brother suggested I might like this web site.
    He was entirely right. This post truly made my day.
    You cann’t imagine simply how much time I had spent for this
    info! Thanks!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *