2

commands ls and ls -C seem to produce the same results - display by columns.

Is there any difference?

Andrejs
  • 141

2 Answers2

10

Referring to info coreutils 'ls invocation':

-C' --format=vertical'

List files in columns, sorted vertically. This is the default for ls if standard output is a terminal. It is always the default for the dir program. GNU ls uses variable width columns to display as many files as possible in the fewest lines.

TL;DR: no, no difference - that's default.

0

read the output of alias your ls command is in probably doing ls -CF. It may be set in your bash_rc file too. so ls -F will also give the same output.

but you could change it, in which case, you might want it. OR you could use it in a script, and maybe you want that style of output.

j0h
  • 15,365