03-21-2009
am using SUNOS 5.8
still i did not get any result...
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How do you move (mv) files to a backup directory from a particular directory when the files are
older the 24hrs copied from a batch script run every 24 hrs.
Would you use find or some kind of timestamp.timestamp="$(date +'%m%d%I%M')" (2 Replies)
Discussion started by: amceyeson
2 Replies
2. Shell Programming and Scripting
I need to find files that have the ending of .out and that are older than 20 days. However, I cannot use find as I do not want to search in the directories that are underneath the directory that I am searching in.
How can this be done?? Find returns files that I do not want. (2 Replies)
Discussion started by: halo98
2 Replies
3. Shell Programming and Scripting
I need to write a script to find files older than 2 hours in set of direcotries and list them ina mail. I know find command ti list files greater/lesser than days but i need to do it for hours. Any input. (6 Replies)
Discussion started by: Presanna
6 Replies
4. Shell Programming and Scripting
Hi,
I need a shell script to remove the files older than a week in a directoy and if necessary to zip the files. (2 Replies)
Discussion started by: sudhakaryadav
2 Replies
5. Shell Programming and Scripting
Hi, Friends,
I am writing a script to delete all the files which are there for more than 3 weeks.
I have tried this :
find /home/appl/backup -type f -mtime +21 -exec rm -f {} \;
But i am not sure if it deletes only the files in specified directory or all the directorinies in the provieded... (3 Replies)
Discussion started by: rajsharma
3 Replies
6. Shell Programming and Scripting
Hi,
I need a script that can search a word "Error" in last 10 Hrs generated logs in /log/App1 and /log/App2 folder..
Note these directories have massive log files ...actually our application generate 100 Log files of size 2MB in just a min so script must be fast enough to cater this I... (9 Replies)
Discussion started by: Mujtaba khan
9 Replies
7. Shell Programming and Scripting
I have to retain only 1 day files in my system an I have to delete all the other files which are older than 24 hrs. Please let me know the option I have to give in the find -mtime command. (3 Replies)
Discussion started by: rajesh8s
3 Replies
8. Shell Programming and Scripting
Hi All
I want to remove the files with name like data*.csv from the directory older than 10 days.
If there is no files exists to remove older than 10 days, It should not do anything.
Thanks
Jo (9 Replies)
Discussion started by: rajeshjohney
9 Replies
9. Shell Programming and Scripting
I have a qnap TS259 that is running ubuntu. Have successfully setup back scripts that are initiated by cron.
I would like to create a couple scrypts that would operate on the recycle bins for both drives. Just want to be able to run the script manually that would walk through both directories... (13 Replies)
Discussion started by: mackconsult
13 Replies
10. UNIX for Beginners Questions & Answers
A process xyz is running and creating file1, file2, file3, .... filen. how do i know if the process has stopped and createtime of the last file (filen) is older than 5 minutes?
OS is AIX (3 Replies)
Discussion started by: malaika
3 Replies
FIND(1) General Commands Manual FIND(1)
NAME
find - find files meeting a given condition
SYNOPSIS
find directory expression
EXAMPLES
find / -name a.out -print
# Print all a.out paths
find /usr/ast ! -newer f -ok rm {} ;
# Ask before removing
find /usr -size +20 -exec mv {} /big ;
# move files > 20 blks
find / -name a.out -o -name '*.o' -exec rm {};
# 2 conds
DESCRIPTION
Find descends the file tree starting at the given directory checking each file in that directory and its subdirectories against a predi-
cate. If the predicate is true, an action is taken. The predicates may be connected by -a (Boolean and), -o (Boolean or) and ! (Boolean
negation). Each predicate is true under the conditions specified below. The integer n may also be +n to mean any value greater than n, -n
to mean any value less than n, or just n for exactly n.
-name s true if current filename is s (include shell wild cards)
-size n true if file size is n blocks
-inum n true if the current file's i-node number is n
-mtime ntrue if modification time relative to today (in days) is n
-links ntrue if the number of links to the file is n
-newer ftrue if the file is newer than f
-perm n true if the file's permission bits = n (n is in octal)
-user u true if the uid = u (a numerical value, not a login name)
-group gtrue if the gid = g (a numerical value, not a group name)
-type x where x is bcdfug (block, char, dir, regular file, setuid, setgid)
-xdev do not cross devices to search mounted file systems
Following the expression can be one of the following, telling what to do when a file is found:
-print print the file name on standard output
-exec execute a MINIX command, {} stands for the file name
-ok prompts before executing the command
SEE ALSO
test(1), xargs(1).
FIND(1)