Skip to main content
deleted 9 characters in body
Source Link
Gilles 'SO- stop being evil'
  • 865.9k
  • 205
  • 1.8k
  • 2.3k

This one will list all files in <dir> with topmost being oldest modified

find <dir> -type f -print0 | xargs -print00 ls -ltr 

And with this the latest modified is topmost

find <dir> -type f -print0 | xargs -print0 ls -lt 

Note that this only works if the list of file names doesn't exceed the total command line length limit on your system.

This one will list all files in <dir> with topmost being oldest modified

find <dir> -type f -print0 | xargs -print0 ls -ltr 

And with this the latest modified is topmost

find <dir> -type f -print0 | xargs -print ls -lt 

Note that this only works if the list of file names doesn't exceed the total command line length limit on your system.

This one will list all files in <dir> with topmost being oldest modified

find <dir> -type f -print0 | xargs -0 ls -ltr 

And with this the latest modified is topmost

find <dir> -type f -print0 | xargs -0 ls -lt 

Note that this only works if the list of file names doesn't exceed the total command line length limit on your system.

added -print0 to cope with file names containing whitespace; added missing options to the first ls invocation; note about the command line length limit
Source Link
Gilles 'SO- stop being evil'
  • 865.9k
  • 205
  • 1.8k
  • 2.3k

This one will list all files in <dir> with topmost being oldest modified

find <dir> -type f -print0 | xargs -print0 ls -lltr 

And with this the latest modified is topmost

find <dir> -type f -print0 | xargs -print ls -lt 

Note that this only works if the list of file names doesn't exceed the total command line length limit on your system.

This one will list all files in <dir> with topmost being oldest modified

find <dir> -type f | xargs ls -l 

And with this the latest modified is topmost

find <dir> -type f | xargs ls -lt 

This one will list all files in <dir> with topmost being oldest modified

find <dir> -type f -print0 | xargs -print0 ls -ltr 

And with this the latest modified is topmost

find <dir> -type f -print0 | xargs -print ls -lt 

Note that this only works if the list of file names doesn't exceed the total command line length limit on your system.

Source Link
UnX
  • 861
  • 5
  • 8

This one will list all files in <dir> with topmost being oldest modified

find <dir> -type f | xargs ls -l 

And with this the latest modified is topmost

find <dir> -type f | xargs ls -lt