bash iterate over list of files 1

bash iterate over list of files

FILES="/path/to/files*"
for FILE in $FILES ; do echo $FILE ; done

Here is what the above code is Doing:
1. We’re defining a variable called FILES and setting it equal to the path to the files we want to rename.
2. We’re using a for loop to iterate through each file in the FILES variable.
3. We’re printing the name of each file to the terminal so we can see what we’re working with.

Similar Posts