Skip to content
Advertisement

How to list files recursively with complete path, size, last accessed date and last modified date?

It can be using find, ls or stat

find /opt/sas/data/vaa_oadm/sasdata -type f -name '*.sas7bdat'

Expected output:

/path/of/file/file1.sas7bdat 10GB 10Jan2020 01Jan2019
/path/of/file/on/server/file2.sas7bdat 10MB 15Jan2020 08Dec2019

Advertisement

Answer

You can try this :

find /opt/sas/data/vaa_oadm/sasdata -type f -name '*.sas7bdat' -printf "%p %kKB %Ad%Ab%AY %Td%Tb%TYn"

Size is in K-bytes

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement