April 2015

Loop over files - bash one line

It’s simple: for i in *; do echo $i; done If you want to replace a certain text in all files with something new, use this: for i in *; do sed -i 's/original/new/g' $i; done where original is the original text and new is the new text. If you...