To get the full timestamp of a file, I can do:
$ ls -lT
However, when I try the following:
find . -ls -lT
I get an find: -lt: unknown primary or operator (using find . -ls works).
What would be the correct way to use the find + ls -lT command?
The find “-ls” option isn’t running ls and doesn’t accept all its arguments. That said, I don’t know why you want the -T argument, which is an obscure thing involving tab stops that I had to look up. But broadly, you just want to run a command (“ls -lT” in this case) on a bunch of files found by find. So any of the following should work:
find . -type f | xargs -n1 ls -lTorfind . -type f -exec ls -lT {} ';'orfor i in $(find . -type f); do ls -lT $i; done.Or, for the special case of ls that takes more than one command line argument, just
find . -type f | xargs ls -lT