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

189
Vistas
Running a shell command and saving the response to a variable

I have a bunch of directories, named like this:

  • 5553_DirHere
  • 5554_DirHere
  • 5555_DirHere

How can I run a shell command, to find all directories with the name "5554"?

The shell script would be something like:

find /mnt/Desktop -type d -name "5554*"

Then save the output to a variable

This is what I have tried:

const getDownloadPath = name => {
const folderDir = 5554;
  exec('find /mnt/Desktop -type d -name ${folderDir}*', function(err, stdout, stderr)
 {
 if(err) console.error(stderr);
 const singleFolder = stdout;
 });
   return `${config.path}/${stdout}`;
 };
};
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

'Find' command can be slow when searching larger directories. I used file-system, which works perfectly.

about 4 years ago · Juan Pablo Isaza 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