Nov 16, 2011
jason

Simple ls command to list only files

I’ve been looking for ls option to hide directory. After a few googling, most people suggested quite complicated commands. Finally, I’ve found the really very simple command for this simple task from Devshed forums.

Here it is. You just need to ignore “/” from ls output.

ls | grep -v "/"

Source : Devshed forums

Leave a comment