I figure there has to be a way of making ls only display non-directories, but the man page doesn't make it obvious
ls -lAh | grep -v '^d'
This method lists in
-lLong list format
-ADisplays almost all (show hidden files but don't show
-hHuman readable file sizes
-vDon't show matching records
^d- Those start with letter d (for directory) i.e
drwxrwxr-x <some file details> <foldername>
If you don't want to type every time, you may make it into an alias for your bash/shell profile.
I saw in your( @thinksinbinary ) comment on the answer by @thomasrutter , that you wanted to be able to print them in reverse order and in columns. You probably have already figured it out or moved on, but here it is:
ls -pr | grep -v / | column
- -p adds the forward slash ('/') to the directory names
- -r reverses the order of output
- -v lets grep do an inverse search to print everything except the directories (everything that doesn't have the '/' that -p put there)
- "column puts it in columns" - Captain Obvious
ls -F | grep -v /
Above command displays files, But it includes symlinks, pipes, etc. If you want to eliminate them too, you can use one of the flags mentioned below.
ls -F appends symbols to filenames. These symbols show useful information about files.
@means symbolic link (or that the file has extended attributes).
|means named pipe.
ls -F | grep -Ev '/|@|*|=|>|\|'
Above command displays only files.