在手册页中它说:
-C list entries by columns
ls
但是,我真的无法注意到or的输出之间有任何区别ls -C
,有人可以向我解释一下吗?
答案1
添加@muru 在评论中所说的话;看一下info coreutils ls
`-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.
我认为这意味着-C
专门针对您重定向或管道输出并希望保留列的情况而存在。否则,ls -1
当 ls 检测到它没有显示到终端时,将切换到。