Find directories that are not used for 500 days

How to list the directories that are not acessed for more than 500 days?

i used find in the following way

find . -type d -atime +500 -exec du -sh {} \;

but it is listing all the sub direcories of the parent directories which satisfy above condiion.I would like to get just name of the parent directories(not subdirectories).their last acess time with size.

Thanks.

Use -maxdepth 1 with your find statement

--ahamed

1 Like