The ls command lists files and directories within the file system, and
Displays a list of a directory's files and subdirectories.
If you want, you can make the ls command display contents of subdirectories asĀ ...
The dir command displays a list of files and subdirectories in a directory.
By default, the sorted order is alphabetical in ascending order. If the optionalĀ ...
but (at least in Ubuntu) ls -r performs a reverse listing, not a recursive listing.
You could get all the files in an array, and then get the desired one: files=( /path/to/folder/*. tar.gz ). Getting the first file:
/W Wide List format, sorted horizontally.
Use an embedded find. The outer find locates all directories and executes an inner find which shows just the files you want in that directory:
The file system is made up of a root directory that contains sub-directories titled