0

I am new using linux.

I have a folder with many sub-folders and sub-sub-folders. All batch files have the same name --> R_batch_1_1.bash

Usually I use: sbatch R_batch_1_1.bash to run one by one.

Does anyone know how to execute all batch files in the folder and sub-folders at once?

1 Answer 1

1
find /your/folder -type f -name "*.bash" -exec "{}" \;
1
  • I tried and I got some errors over other files, it may be something related with the directory? mkdir: cannot create directory '/scratch': Permission denied ./b_model/R_batch_1_1.bash: line 15: cd: /scratch/miguel/: No such file or directory cp: cannot stat '/leave_one_set.R': No such file or directory cp: cannot stat '/run_dmu4.sh': No such file or directory cp: cannot create regular file '/R.Rout': Permission denied mkdir: cannot create directory '/scratch': Permission denied
    – marb_021
    Aug 16, 2020 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.