Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

ls vs. ls -C difference

Writer Olivia Zamora

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

Is there any difference?

2 Answers

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.

6

read the output of aliasyour 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.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy