How to store directory files listing into an array? March 21, 2023 by Tarik I’d use files=(*) And then if you need data about the file, such as size, use the stat command on each file.