Sep 13, 2018

How to show only regular files in a directory excluding subdirectories

find . -maxdepth 1 -type f -printf '%f\n'
Or

for f in *; do [[ -d "$f" ]] || ls -- "$f"; done