i need to store directory information in a way that i can parse as json.
when i do ls -m it gives me comma separated values but no user/group/size info.
bash-3.2$ ls -mp
100CANON/, 2009-11-27_1540.swf, 2009-11-27_1546.swf, 2009-11-27_1551.swf, 2009-11-30_0149.png, 429355_1.sql,
429355_1.sql.zip, About Stacks.pdf, Acrobat.com.app/
ls -l is problematic to parse.
is there anyway you know that I can get ls -l info as comma(or anything) separated values?
ls is designed to be human readable, and you can get the same data from a syscall.
– Tom O'Connor Jan 09 '10 at 10:30stat (2)and its siblings, so in a programming context you would usually prefer the the direct call rather than invoking a command line tool to convert the data to text which you then have to parse back to data. So, if this is a programming question, then SO would have been a better choice. – dmckee --- ex-moderator kitten Jan 09 '10 at 23:38