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 give incorrect formatting? Just in case, I use bash under Ubuntu. Thank.
-Lbreaks into lines; echoIt doesn’t separate its output by line, but by space, therefore it executes one ls -land formats all columns as a group.
-L
echo
ls -l
-n ; -L -0 (, ), ls -l run, .
-n
-0
POSIX :
-Lnumber . , . , , <blank>; <blank> .-n, . ( ).
number . , . , , <blank>; <blank> .
number
<blank>
, . ( ).
( ). echo * , xargs -L 1 ls ls .
echo *
xargs -L 1
ls
( , ls -l index.html*, , , .)
ls -l index.html*