Tuesday, March 16, 2021

rename files within a directory one by one, using for loop and mv


for f in dir/*; do
    mv -- "$f" "$fSuffix" 
done 
So all the files in the dir/ will be renamed:
file1.txt --> file1.txtSuffix
file2.png --> file2.pngSuffix

Copy s3 files selected by dates

 $ aws s3 ls s3://<bucket-name> --recursive | awk '/^2018-11-06/{system("aws s3 cp s3://<bucket-name>/$4 .") }'

my-alpine and docker-compose.yml

 ``` version: '1' services:     man:       build: .       image: my-alpine:latest   ```  Dockerfile: ``` FROM alpine:latest ENV PYTH...