This command will find the files log, out and txt file as in this example which is older than n days which is defined in parameter -mtime and print the absolute path of the files found.
find `pwd` -maxdepth 1 -mtime +n -type f \( -name "*.log*" -o -name "*.out*" -o -name "*.txt" \)
Examples:
Find and print absolute path of the files which are 7 days or 30 days old
find `pwd` -maxdepth 1 -mtime +7 -type f \( -name "*.log*" -o -name "*.out*" -o -name "*.txt" \)
find `pwd` -maxdepth 1 -mtime +n -type f \( -name "*.log*" -o -name "*.out*" -o -name "*.txt" \)
Examples:
Find and print absolute path of the files which are 7 days or 30 days old
find `pwd` -maxdepth 1 -mtime +7 -type f \( -name "*.log*" -o -name "*.out*" -o -name "*.txt" \)
find `pwd` -maxdepth 1 -mtime +30 -type f \( -name "*.log*" -o -name "*.out*" -o -name "*.txt" \)
We can play with -mtime parameter to get other desired result
We can play with -mtime parameter to get other desired result