Thursday, July 17, 2014

How to run a command on a subgroup of files within the folder

To access files that end with bb.bed.cut that are located in the same folder (and not to use other files in that folder) and to run a command on them e.g. print their names with _tabsep extension, run this code:

for f in $(find . -name \*bb.bed.cut\*)
do
echo "$f"_tabsep;
done

No comments:

Post a Comment