How to get the list of files in a directory in a shell script?

search_dir=/the/path/to/base/dir/
for entry in "$search_dir"/*
do
  echo "$entry"
done

Leave a Comment