Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
How to execute multiple executables with a pattern in linux

I am on Ubuntu 14.04. Lets say there are a few executables.

ATest, BTest, CTest, random1, random2

I want to execute everything that ends with "Test", but I do not know beforehand exactly how many executable fits this criteria

./*Test

only ends up executing the ATest

but something like

ls *Test

works perfectly showing only the files ending with Test.

What is the correct shell command to execute multiple executables with a pattern without knowing how much files matches this pattern?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

You can use a short script to accomplish this:

#!/bin/bash
for f in *Test
do
 "./$f"
done

Or, even as a one-liner:

for f in *Test; do "./$f"; done
over 4 years ago · Santiago Trujillo Report

0

find . -name \*Test -exec  ./{} \;

EDIT: This will also search all subdirectories. To only search current directory:

find . -maxdepth 1 -name \*Test -exec  ./{} \;
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!