Consider the following:
$ echo index.html* | xargs -L 1 ls -l
-rw-r--r-- 1 zeki zeki 17198 2011-05-03 23:18 index.html
-rw-r--r-- 1 zeki zeki 17198 2011-05-03 23:20 index.html.1
-rw-r--r-- 1 zeki zeki 17198 2011-05-03 23:21 index.html.2
-rw-r--r-- 1 zeki zeki 146589 2011-05-05 12:29 index.html.3
$ echo index.html* | xargs -n 1 ls -l
-rw-r--r-- 1 zeki zeki 17198 2011-05-03 23:18 index.html
-rw-r--r-- 1 zeki zeki 17198 2011-05-03 23:20 index.html.1
-rw-r--r-- 1 zeki zeki 17198 2011-05-03 23:21 index.html.2
-rw-r--r-- 1 zeki zeki 146589 2011-05-05 12:29 index.html.3
Why does the -n option yield an incorrect formatting? Just in case, I’m using bash under Ubuntu. Thanks.
-Lsplits by lines;echodoesn’t separate its output by lines but by spaces, so a singlels -lis run and that formats all the columns as a group.-nsplits by parameters; in the absence of-Lor-0, the separator is whitespace (possibly modified by quoting), so each filename gets its ownls -lrun and there is no way for the independent runs to coordinate column widths.