samedi 29 novembre 2014

Export file names of a directory to csv


I have a question regarding exporting folder names to a csv file. I have read already many entries in the web to such topics but on nearly all the topic was about exporting filenames and size and dates etc.


Not only the folder names of a directory. I also tried to modify such a proposed solution but it does not work.


I tried:



ls -la | while read attr numitems owner group size date name
do
echo ${name} >> output.csv
done


But as i ran the script i only get error:



': not a valid identifieread: `name


I'am using RedHat Linux.


Can somebody help me with the problem?



Aucun commentaire:

Enregistrer un commentaire