In shell scripting how to find 14 days older than files and directory in a accountI need to list them with their memory spaceex:0 ./.vxz.tmp658 ./.zshrc6 ./dummy.txt2.1K ./ss1s:489K ./sss.txt154K ./ced.txt406 ./test.csv
List files with memory space older than 14 days
shell script
To find files in the current directory that are more than 14 days old and list their sizes (in kilobytes) and their names, use:find . -maxdepth 1 -mtime +14  -printf '%k %p\n'How it worksfind .Start looking for files in the current directory.-maxdepth 1Look only in the current directory rather than recursively looking into subdirectories.-mtime +14Look for files that are more than 14 days old.  Note that, because of the way that find rounds off days to an integer, more than 14 days means at least 15 days.  See man find for details on how find does the round-off.-printf '%k %p\n'For each file found, print the size in kB and the name.VariationIf you want to look only for regular files (no directory, block devices, etc.), then add -type f as follows:find . -maxdepth 1 -type f -mtime +14  -printf '%k %p\n'