bash list all files in directory code example
Example 1: display all files in a directory linux
ls command list computer files in a directory in Unix OS with next structure:
ls [OPTION]... [FILE]...
Examples:
ls -l
ls -a /directory
Example 2: bash how to print the list of files in a directory
ls /path/to/directory/
ls /path/to/directory/ > output_file.txt
ls /path/to/directory/ | grep *.txt > output_file.txt
Example 3: bash list all files in directory and subdirectories
ls -R <file-or-directory-to-find>
ls -R *hotographi*