#!/bin/bash # Directory containing your .wav files directory="~/Desktop/learn_punjab_book" # Create or empty the filelist.txt #> filelist.txt # Loop through .wav files and add to filelist.txt for file in "$directory"/*.wav; do echo "$file" >> filelist.txt done