Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

154
Vistas
count the number of files copied recursively using aws cli commands

Could someone help me with the command to count the number of files only copied from one parent object to another parent object. For example

1. src/folder1/some1.txt    
2. src/folder1/folder1_1/some1.txt
3. src/folder2/folder2_1/some2.txt
4. src/folder4/folder4_2/some3.txt
5. src/folder4/folder4_1/some4.txt

copy over them to dest folder

So, when I do

aws s3 cp s3://src/* s3://dest/ --recursive

I need a count of the number of files copied.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Lets say we have mp3 files in a S3 bucket with the following path: bucket-name/path/to/files Then the cmd aws s3 ls bucket-name/path/to/files --recursive | grep 'mp3' | wc -l will output the count of all mp3 files in that path even if they are present within directories.

over 4 years ago · Santiago Trujillo Denunciar

0

The simplest way I can think of is to rely on the fact that cp -v prints each file that it copies in a format like `source' -> `dest':

cp --recursive --verbose s3://src/* s3://dest/ | grep -F '->' | wc -l

grep will output something for each line where -> is found, and wc will count the lines, which will give you the total number of copies made.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda