1826312 Members
4357 Online
109692 Solutions
New Discussion

awk/bash script help

 
Jake Greenburg
New Member

awk/bash script help

Need help with this one...

I need to write a script that will search a directory (I will be using it to search a home directory, but general would probably be nice) that you entered on the command line and any sub directors for temp files/directories matching these criteria:

Temp file and temp directory names will begin with a comma (,).
Temp files that have not been modified in five days or more
only users with user ids greater than or equal to 500 will be checked for temp files and directories.

Could anyone give me some help on this one? I'm totally lost and pretty bummed about it...
1 REPLY 1
Peter Godron
Honored Contributor

Re: awk/bash script help

Jake,
welcome to your first posting in the ITRC Forums !
Something along:
find . -xdev -name ",*" -user +499 -mtime +4
should get you started.

"man find" for more details on the find command.

The above statement looks in the current directory (.) and subdirectories for files starting with "," and a userid of 500 or greater and a modify time of more than 5 days.

Finally can you also read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#28