Print All Files in Folder and SubFolders

terminal

I had 5 folders each with a couple of files (2-3).

I wanted to print all of them in one shot. I found ways to do it in Linux but I couldn't get them to work here.

The two alternatives I found for Linux were:

find -type f -print0 | xargs -0 ls -t

find . -type f -printf "%T@ %p\n" | sort -nr | cut -d\ -f2-

How do I accomplish this on a Mac?

I'd prefer not downloading any package for this and to accomplish this solely through terminal.

Best Answer

An easy way to get the same result is

find . -type f

which basically is identical to

find . -type f -print0 | xargs -0 -n 1 ls