The following bash script converts all filenames within the /path/to/file/ directory that contain spaces to contain hyphens instead. For example, Screen Shot 2018 09 25.png becomes Screen-Shot-2018-09-25.png after running this script. for f in /path/to/file/*; do mv “$f” $(echo “$f” | tr ‘ ‘ ‘-‘) ; done In order to run this bash script, save…