I have file called -l
in my directory
now I tried to do
for i in *; do stat -c "%s %n" "$i"; done
it lists all files with sizes but in the middle of the output there is something like
395 koko.pub
stat: invalid option -- 'l'
Try 'stat --help' for more information.
2995974 list.txt
so it can not process -l
as normal filename, how do I get desired behavior from stat
?
for i in ./*
should also work – Darkhogg Dec 17 '15 at 12:21