Path: ...!feeds.phibee-telecom.net!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Jolly Roger Newsgroups: comp.sys.mac.misc Subject: Re: Another question Re: Print (or export to a spreadsheet) all the information displayed when Finder is looking at a folder (OS X 10.13 High Sierra) Date: 4 May 2024 20:43:01 GMT Organization: People for the Ethical Treatment of Pirates Lines: 49 Message-ID: References: X-Trace: individual.net CgBLq4sC+c7OGopSUcCfjwC41BZFaPYlvuYTiNiR3VPrQtVgdr Cancel-Lock: sha1:pKis2omKeZ1Pp0xncUOABinpJwM= sha256:iuSa7R/KwCcGVnV1An4y+4wQgRfduRv3vkaajDdZEwE= Mail-Copies-To: nobody X-Face: _.g>n!a$f3/H3jA]>9pN55*5<`}Tud57>1Y%b|b-Y~()~\t,LZ3e up1/bO{=-) User-Agent: slrn/1.0.3 (Darwin) Bytes: 2823 On 2024-05-03, Dudley Brooks wrote: > I forgot to ask. Can I add something to your now-working line > > stat -f '%SN,%SB,%Sm' * > file_times.txt > > to reformat date and time? Either within the -f format description or > piping it to something else? > > On the internet I found this, supposedly to simply reformat date and > time, for everything, during a session: > > set timefmt "%Y-%m-%d %H:%M:%S" > > But it doesn't seem to be working either. I execute it, then do "date" > or "ls -l" or whatever ... and the date and time are still displayed in > the same format as ever. > > Thanks in advance. Create a plain text file named "lister.sh" with these contents: #!/usr/bin/env bash for file in ./*; do filename=`basename "$file"` created=`stat -f '%SB' "$filename"` modified=`stat -f '%Sm' "$filename"` created_s=`date -j -f "%b %d %H:%M:%S %Y" "$created" "+%F %H:%M:%S"` modified_s=`date -j -f "%b %d %H:%M:%S %Y" "$modified" "+%F %H:%M:%S"` echo "$filename,$created_s,$modified_s" done Make the script executable with this command in the same directory as the script: chmod +x lister.sh Run the script in a terminal window like so: ../lister.sh > file_times.csv -- E-mail sent to this address may be devoured by my ravenous SPAM filter. I often ignore posts from Google. Use a real news client instead. JR