Ubuntu – How to exclude directories when listing files

lsshellUbuntu

How do I exclude directories when listing files in the current directory?

ls .

^ will include directories in the listing.

Best Answer

Try this one:

find . -maxdepth 1 -not -type d