How to get the list of files in a directory in a shell script? October 7, 2022 by Tarik search_dir=/the/path/to/base/dir/ for entry in "$search_dir"/* do echo "$entry" done