0

I want to display all directories in my current directory recursively, but I also want to display the full date and time (even after 6 months). Considering I am using a Mac I had to use the FreeBSD format for this, which amounts to:

ls -aldFT ./*/*/*/*

I want to do unlimited recursive though, but I seem to be unable to use -R in combination with the FT parameter? Or am I missing something obvious here?

2 Answers 2

2

You can use zsh globstar feature-

ls -aldFT **/*

in ksh you have to turn on the feature

set -G
ls -aldFT **/*

if you have installed bash 4 then

shopt -s globstar
ls -aldFT **/*

or you could do use find with stat

find . -exec  stat -f '%Sp %4l   %10Su   %8Sg %12z  %22Sm   %N' {} +
0
1

That certainly helped a lot, thanks! What I needed in the end was:

find . -type d -exec  stat -f '%22Sm   %N' {} +

What does the 22Sm mean though? I dont notice much difference if I change that number in there.

Ps. I went for that solution mainly because:

ls -aldFT **/* 

just resulted in Argument list too long, which is really annoying after updating bash to 4.0 to use this at all :)

1
  • The 22 is padding for the column, the S displays the m (modification time) as a string.
    – fd0
    Jun 30, 2018 at 15:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .