Posts

Showing posts from September, 2015

How to run all scripts in a directory on Linux

How to run all scripts in a directory on Linux Posted on   November 5, 2013   by   Dan Nanni 2 Comments Question:   I have a bunch of scripts in a directory. I want to automatically run all the scripts in the directory, regardless of how many these are. If you want to   run all scripts or executable binaries in a particular directory , you can use a command line utility called   run-parts . This tool can automatically discover multiple scripts or programs in a directory, and run them all. You can use   run-parts   command in the following format. $ run-parts [options] Scripts found in a directory will be run one by one in a lexically sorted order.   run-parts   will execute all the scripts whose names consist of alphanumeric letters, underscores and hyphens. For example, to run all scripts in the current directory: $ run-parts . Optionally, you can run only those scripts whose names are matched with a regular expression. For that, use "--regex" option.