I am trying to get the files older than a number of days and list them in descending order based on their size with all their information (size, full path etc – something similar that is provided by ls
).
While I am able to locate files older with:
find . -mtime +10
I am not able to list of the desired information.
Best Answer
Provided that your file paths do not contain newline characters:
See
find
manual, sectionActions
.%s
File's size in bytes.%n
Number of hard links to file.%m
File's permission bits (in octal).%u
File's user name, or numeric user ID if the user has no name.%g
File's group name, or numeric group ID if the group has no name.%t
File's last modification time in the format returned by the Cctime
function.%p
File's name.%l
Object of symbolic link (empty string if file is not a symbolic link).BTW: Note that POSIX
find
manual doesn't specify most of the above actions.