Friday, July 11, 2014

How to manipulate with multiple files in Unix

If you want to apply certain Unix command on each file present in your folder,
type:

for filename in *; do <command> ${filename}; done

e.g.
for filename in *; do echo ${filename}; done

This example will print the names of the files in terminal.

No comments:

Post a Comment