#!/usr/bin/env bash # Rename a whole directory of files to strings listed in a text file. j=1 for i in *; do mv "$i" "$(sed -n "$j"p ../fileNames.txt)"; j=$((j=j+1)); done