replace underscore with space bash code example Example: replace filename space with underscore bash for file in *; do mv "$file" `echo $file | tr ' ' '_'` ; done