Skip to content

Commit

Permalink
TIL: aws s3 ls: sort by date
Browse files Browse the repository at this point in the history
  • Loading branch information
pew committed Dec 31, 2024
1 parent 6159f8f commit f068ea5
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions man/aws.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
---
date created: Friday, June 9th 2023, 11:30:38 am
date modified: Monday, May 20th 2024, 10:28:01 am
date modified: Tuesday, December 31st 2024, 10:58:30 am
tags:
- aws
---

# aws

## aws cli v2

some aws cli commands I'll probably forget about since I'm only using them once in a while

### fix pager view / output / annoyances
## fix pager view / output / annoyances

what the fork...? see [this pull request](https://github.com/aws/aws-cli/pull/4702#issue-344978525), do one of these things:

* add `cli_pager = cat` to `~/.aws/config` AND maybe even in `~/.aws/credentials` if you're using multiple profiles. somehow it doesn't work in the config file for me
* set the env var `AWS_PAGER=""`

## s3

### recursively copy files starting with a prefix

download only files starting with `2023`
Expand All @@ -26,20 +26,8 @@ download only files starting with `2023`
aws s3 cp s3://your-bucket-name/ ~/Downloads/ --recursive --exclude "*" --include "2023*"
```

## aws (aws-cli) v1

might work with v2, might not. don't know.
### sort `aws s3 ls` by date

### aws ssm

get something out of ssm:

```
aws ssm get-parameter --name DOCKER_ENV --query Parameter.Value --output text > test.env
```

put something in there (also, overwrite existing):

```
aws ssm put-parameter --overwrite --name DOCKER_ENV --type String --value "$(cat test.env)"
```shell
aws s3 ls s3://foobar/ --recursive | sort -k1,1 -k2,2
```

0 comments on commit f068ea5

Please sign in to comment.