Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a list of file names in different lines

Tags:

unix

ls

ls -1

That is a number, not small L.


ls -1. From the help:

-1 list one file per line

Works on cygwin and FreeBSD, so it's probably not too GNU-specific.


solution without pipe-ing :-)

 ls --format single-column

Note that the long options are only supported on the GNU coreutils where BSD ls only supports the short arguments -1


Perhaps:

ls | awk '{print $NF}'

ls | cat ... or possibly, ls -1


Use sed command to list single columns

ls -l | sed 's/\(^[^0-9].\*[0-9]\*:[0-9]\*\) \(.*\)/\2/'

Try this:

$ ls | xargs -n num

Here num is number of columns you want to list in.