TIL - 2023-04-14 // Loop over files in the current directory in the Bash command line
Write a single line for loop to access all files in the current directory using the Bash command line
To access all files in the current directory use *
with a simple for loop structure.
for FILE in *; do echo $FILE; done
do
echo $i
done
To write this as a single line on the command line separate the lines by semicolons.
for FILE in *; do echo $FILE; done