bash: iterate over files in directory

This is a wiki page. Be bold and improve it!

If you have any questions about the content on this page, don't hesitate to open a new ticket and we'll do our best to assist you.

Here is a sample code:

#!/bin/bash
FILES=~/my_directory/*

for file in $FILES
do
  # Do something with your file $file
  cat $f
done