I'm using gfind
running on MacOS, to find text files.
I am trying to see the filenames only and the birthdate of my gfind
results, and then sorting them by date, and paging them. Is this achievable?
For the moment I am trying gfind . -name "*.txt" -printf "%f \t\t %Bc\n"
But the results are the following:
todo.txt Fri Mar 4 17:47:41 2022
99AC1EF5-6BE3-556B-8254-84A8764819E0.txt Fri Mar 4 17:49:08 2022
chrome_shutdown_ms.txt Fri Mar 4 17:48:07 2022
index.txt Fri Mar 4 17:48:05 2022
index.txt Fri Mar 4 17:48:05 2022
index.txt Fri Mar 4 17:48:06 2022
index.txt Fri Mar 4 17:47:46 2022
index.txt Fri Mar 4 17:48:01 2022
index.txt Fri Mar 4 17:48:01 2022
index.txt Fri Mar 4 17:48:05 2022
index.txt Fri Mar 4 17:48:05 2022
index.txt Fri Mar 4 17:48:06 2022
index.txt Fri Mar 4 17:48:06 2022
index.txt Fri Mar 4 17:47:46 2022
index.txt Fri Mar 4 17:48:06 2022
LICENSE.txt Fri Mar 4 17:48:07 2022
english_wikipedia.txt Fri Mar 4 17:48:07 2022
female_names.txt Fri Mar 4 17:48:07 2022
male_names.txt Fri Mar 4 17:48:07 2022
Is there a way to tabulate the output in order to show some consistency as to what it looks like ? I would like to only show the filenames and the birthdate in a more elegant way.
Thanks a lot in advance!
gfind . -name '*.txt' -printf '%f|%Bc\n' | column -t -s '|'
(|
is any character not present in any filename). – Kusalananda Oct 14 '22 at 05:42bash
manual, look for the section called "QUOTING". The$'...'
quoting is described a bit down there. The "ANSI C" quoting$'...'
in thezsh
shell is more or less the same as inbash
but the manual is harder to read. See also various post on this site: https://unix.stackexchange.com/search?q=%22ansi+c%22+quoting+ Possibly a good start: Which shells support ANSI-C quoting? e.g. $'string' – Kusalananda Oct 14 '22 at 06:01