Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws s3 ls inconsistent file names with/without --recursive #604

Closed
asieira opened this issue Jan 23, 2014 · 10 comments
Closed

aws s3 ls inconsistent file names with/without --recursive #604

asieira opened this issue Jan 23, 2014 · 10 comments
Labels
closed-for-staleness feature-request A feature should be added or improved. s3

Comments

@asieira
Copy link
Contributor

asieira commented Jan 23, 2014

When aws s3 ls is executed on awscli/1.2.11 without --recursive, the resulting files and prefixes are listed as relative to the given path:

| => aws s3 ls s3://testbucket/dir1/dir2/dir3/
                           PRE dir4/
2013-09-09 20:33:25    2865280 file1

However, when --recursive is added to the same path, the resulting files are listed as the entire prefix (full path sans s3://<bucket name>):

| => aws s3 ls s3://testbucket/dir1/dir2/dir3/ --recursive
2013-09-09 20:33:25    2865280 dir1/dir2/dir3/file1
2013-09-09 20:33:26    5117249 dir1/dir2/dir3/dir4/file2

See, if the behavior was consistent and relative paths to the listed prefix were always used, the second output should have been as follows:

| => aws s3 ls s3://testbucket/dir1/dir2/dir3/ --recursive
2013-09-09 20:33:25    2865280 file1
2013-09-09 20:33:26    5117249 dir4/file2

Perhaps new options --relative and --absolute could be added to aws s3 ls to choose which behavior we want, or at the very least both are made to function in a similar fashion. I vote for relative paths on both cases.

@kyleknap kyleknap self-assigned this Nov 18, 2014
@jamesls jamesls added s3 feature-request A feature should be added or improved. and removed bug This issue is a bug. accepted labels Nov 18, 2014
@jamesls
Copy link
Member

jamesls commented Nov 18, 2014

Changing this to be a feature request for the --relative option. I think the default behavior has been around long enough and has some useful properties (having the full key name so it can be piped into other operations that require the full s3 key name).

@asieira
Copy link
Contributor Author

asieira commented Nov 18, 2014

👍

@nkadel-skyhook
Copy link

Document this in the "aws s3 ls" command, please, or ideally make it optional. It very frustrating to sync, and review, a complex filesystem and have to reparse the output for comparison between local and remote content. And it's more complex because of the undocumented stripping of the bucket name from the output.

@ASayre
Copy link
Contributor

ASayre commented Feb 6, 2018

Good Morning!

We're closing this issue here on GitHub, as part of our migration to UserVoice for feature requests involving the AWS CLI.

This will let us get the most important features to you, by making it easier to search for and show support for the features you care the most about, without diluting the conversation with bug reports.

As a quick UserVoice primer (if not already familiar): after an idea is posted, people can vote on the ideas, and the product team will be responding directly to the most popular suggestions.

We’ve imported existing feature requests from GitHub - Search for this issue there!

And don't worry, this issue will still exist on GitHub for posterity's sake. As it’s a text-only import of the original post into UserVoice, we’ll still be keeping in mind the comments and discussion that already exist here on the GitHub issue.

GitHub will remain the channel for reporting bugs.

Once again, this issue can now be found by searching for the title on: https://aws.uservoice.com/forums/598381-aws-command-line-interface

-The AWS SDKs & Tools Team

@ASayre ASayre closed this as completed Feb 6, 2018
@jamesls jamesls reopened this Apr 6, 2018
@jamesls
Copy link
Member

jamesls commented Apr 6, 2018

Based on community feedback, we have decided to return feature requests to GitHub issues.

@github-actions
Copy link

Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. Because it has been longer than one year since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment to prevent automatic closure, or if the issue is already closed, please feel free to reopen it.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Sep 18, 2020
@asieira
Copy link
Contributor Author

asieira commented Sep 18, 2020

This is still an issue in version 2.0.48, so IMHO this issue should not be deleted.

@github-actions github-actions bot removed the closing-soon This issue will automatically close in 4 days unless further comments are made. label Sep 18, 2020
@fatmanmclone90
Copy link

fatmanmclone90 commented Oct 28, 2020

Does anyone have a workaround for this? I need to find a file using a recursive ls and then download with cp

@stobrien89 stobrien89 added the needs-reproduction This issue needs reproduction. label Oct 22, 2021
@tim-finnigan
Copy link
Contributor

It looks like a PR was created for this and merged (#3641).

But I can also still reproduce this in v2:

image

It looks like somehow those changes did not actually get integrated into v2. We need more investigation into why this happened and decide where to go from there.

We also have #3645 open for consideration of an --absolute parameter. I think that request was created under the assumption that the PR mentioned above was integrated and a relative path would be returned by default when --recursive is used. At this point it might be best to maintain the current behavior by default but just add a --relative flag as originally requested here.

@tim-finnigan tim-finnigan removed the needs-reproduction This issue needs reproduction. label Oct 27, 2021
thoward-godaddy pushed a commit to thoward-godaddy/aws-cli that referenced this issue Feb 12, 2022
* fix: Functional tests must run on localhost to work in Windows (aws#552)

* fix: spacing typo in Log statement in start-lambda (aws#559)

* docs: Fix syntax highlighting in README.md (aws#561)

* docs: Change jest to mocha in Nodejs init README (aws#564)

* docs: Fix @mhart link in README (aws#562)

* docs(README): removed cloudtrail, added SNS to generate-event (aws#569)

* docs: Update repo name references (aws#577)

* feat(debugging): Fixing issues around debugging Golang functions. (aws#565)

* fix(init): Improve current init samples around docs and fixes (aws#558)

* docs(README): Update launch config to SAM CLI from SAM Local (aws#587)

* docs(README): Update sample code for calling Local Lambda Invoke (aws#584)

* refactor(init): renamed handler for camel case, moved callback call up (aws#586)

* chore: aws-lambda-java-core 1.1.0 -> 1.2.0 for java sam init (aws#578)

* feat(validate): Add profile and region options (aws#582)

Currently, `sam validate` requires AWS Creds (due to the SAM Translator).
This commits adds the ability to pass in the credientials through a profile
that is configured through `aws configure`.

* docs(README): Update README prerequisites to include awscli (aws#596)

* fix(start-lambda): Remove Content-Type Header check (aws#594)

* docs: Disambiguation "Amazon Kinesis" (aws#599)

* docs: Adding instructions for how to add pyenv to your PATH for Windows (aws#600)

* docs: Update README with small grammar fix (aws#601)

* fix: Update link in NodeJS package.json (aws#603)

* docs: Creating instructions for Windows users to install sam (aws#605)

* docs: Adding a note directing Windows users to use pipenv (aws#606)

* fix: Fix stringifying λ environment variables when using Python2 (aws#579)

* feat(generate-event): Added support for 50+ events (aws#612)

* feat(invoke): Add region parameter to all invoke related commands (aws#608)

* docs: Breaking up README into separate files to make it easier to read (aws#607)

* chore: Update JVM size params to match docker-lambda (aws#615)

* feat(invoke): Invoke Function Without Parameters through --no-event (aws#604)

* docs: Update advanced_usage.rst with clarification on --env-vars usage (aws#610)

* docs: Remove an extra word in the sam packaging command (aws#618)

* UX: Improves event names to reflect Lambda Event Sources (aws#619)

* docs: Fix git clone typo in installation docs (aws#630)

* docs(README): Callout go1.x runtime support (aws#631)

* docs(installation): Update sam --version command (aws#634)

* chore(0.6.0): SAM CLI Version bump (aws#635)
@github-actions
Copy link

Greetings! It looks like this issue hasn’t been active in longer than one year. We encourage you to check if this is still an issue in the latest release. In the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or upvote with a reaction on the initial post to prevent automatic closure. If the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-for-staleness feature-request A feature should be added or improved. s3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants