Ubuntu – How to make ls only display files

ls

I figure there has to be a way of making ls only display non-directories, but the man page doesn't make it obvious

Best Answer

ls -p | grep -v /

Using ls -p tells ls to append a slash to entries which are a directory, and using grep -v / tells grep to return only lines not containing a slash.