How to remove 15days back old files


 
Thread Tools Search this Thread
Contact Us Post Here to Contact Site Administrators and Moderators How to remove 15days back old files
# 1  
Old 05-08-2006
Power How to remove 15days back old files

Hi Experts,

I want to delete the log files which is created 15 days back.
1st I want to view the files and later I want to delete viewed files
I have tried with following command but its not working.

find . -name '*.log' -mtime +15 -exec ls -ltr {} \;

This is showing the list which shows not only 15 days back files , its showing
other than that also. What mistake I have done.
Can anybody help me.

Thanks & Regards,
Vidya
# 2  
Old 05-08-2006
The "-mtime +15" expresssion shows files modified 15 days ago OR MORE. Remove the sign from the number for exactly 15 days ago as in:

find . -name '*.log' -mtime 15 -exec ls -ltr {} \;

There might also be some confusion with the atime, mtime, and ctime if the above command doesn't filter out your unwanted files.

Best of luck.
# 3  
Old 05-18-2006
transfer of Unix to another hard drive Ver. 3.2

I running out of space on my hard drive, I need to transfer the os to another HD or delete some files too try to free space. what commands can I use to do this and to delete some files.

Andrew
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Back up log files using tar

Hi, I need some help writing a perl script to tar all log file to a directory and then delete the log files. Can some one please help me on this? I m Not very good with perl scripting... Thanks KK (4 Replies)
Discussion started by: karthikk0508
4 Replies

2. Shell Programming and Scripting

AIX: Find a process older than 15days

Hi All, My application has specific processes when the developers start using respective GUI . I would like to find related process on server side that is older than 15 days for my application. I am using AIX 6.0. Could you please help with the command on how to find the older process? ... (5 Replies)
Discussion started by: chandu123
5 Replies

3. Linux

Logrotate every 15days

Hi all, I have been asked to configure logrotate for a perticular log file for every 15 days. I do not find options other than weekly or monthly.Need you expertise on the same:confused: (0 Replies)
Discussion started by: iron_michael86
0 Replies

4. UNIX for Advanced & Expert Users

Back up of recent modified files

Hi, I want to identify the files that are recently modified or with in a specified period (15 Days) in UNIX box. After identifying the files should be transferred to windows machine through FTP. The files should be overwritten in windows if it is already available. Please help... (1 Reply)
Discussion started by: lathish
1 Replies

5. UNIX for Dummies Questions & Answers

how to get my files back..

hi all using unix (hp-ux) i created patches Directory under /tmp ... inside the /tmp, i fired these commands: # mv patch_file1 /patches # mv patch_file2 /patches there was no error then i realized that this command will move the files to patches Dir on the root which was NOT... (2 Replies)
Discussion started by: neemoze
2 Replies

6. Shell Programming and Scripting

Back up of multiple data files

I have filesi in a direcotry that start with different names but have dates in the format 01212006. Along with these files there are also files with different dates. What i want to do is copy all the files that have 01212006 in them to 01072007 and move the old files to different directory. ... (1 Reply)
Discussion started by: dsravan
1 Replies

7. UNIX for Dummies Questions & Answers

Bring back removed files

Dear People I have removed some of my files and directories( by using rm and rmdir commands) by mistake. I wish to bring them back. How is it possible?( I am using solaris 2.6) best regards Reza Nazarian:( (2 Replies)
Discussion started by: Reza Nazarian
2 Replies
Login or Register to Ask a Question