Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support How to delete all the files which are more than 3 weeks old in a particular directory.Thnx in advanc Post 302371408 by rajsharma on Saturday 14th of November 2009 03:08:23 PM
Old 11-14-2009
How to delete all the files which are more than 3 weeks old in a particular directory.Thnx in advanc

Quote:
Originally Posted by Neo
  1. You may post emergency work-related questions in this forum. To post in this forum you will need to use your Bits. All questions answered on a "best effort" basis.
    Smilie
  2. New members may not have enough Bits to post in the emergency forum. No problem. You can post in the other forums, but please do not demand a quick reply, as some folks do.
  3. If you are new, and do not have enough Bits, to post in this forum, you are free to contact any forum member and ask them for some of their Bits. They can give them to you, or they can sell them to you, that is strictly between you and the other forum member.
  4. In addition, be careful, because if you break the rules, you can lose your Bits and maybe your wits!
  5. Remember, our Bits virtual currency can be freely traded by all members. So, if you work for a company and need priority replies, try to acquire some. Buy them from other members! Win them (or lose them!) in the Bits Club.
  6. Please note you can reply to or edit your thread at any time. The forum admins and moderators reserve the right to close any thread.
  7. Also, note that this is a new, experimental forum. Expect the guidelines to change over time. New threads posted to this forum will (more than likely) be moved to the relevant forum after your question is answered. Again, all questions answered on a "best effort" basis.
  8. In addition, users who reply to questions in this forum receive 1000 Bits per reply, which is much higher than the standard posting credits.
This User Gave Thanks to rajsharma For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete Some Old files from Particular Directory

Hi Team, I am new to scripting. I want to create a script, which needs to keep only 5 days directories and want to remove the old directory from a particular directory. Can Somebody help me with starting this script. All my directories will be created in the name <YYYYMMDD>. Thanks... (2 Replies)
Discussion started by: siva80_cit
2 Replies

2. Shell Programming and Scripting

delete all but one files in a directory

what`s the script to do that? assuming my text file is "test.txt" (10 Replies)
Discussion started by: finalight
10 Replies

3. Shell Programming and Scripting

Delete the files older than 3 weeks in a particular directory.

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

4. Shell Programming and Scripting

Delete all files if another files in the same directory has a matching occurence of a specific word

Hello, I have several files in a specific directory. A specific string in one file can occur in another files. If this string is in other files. Then all the files in which this string occured should be deleted and only 1 file should remain with the string. Example. file1 ShortName "Blue... (2 Replies)
Discussion started by: premier_de
2 Replies

5. UNIX for Dummies Questions & Answers

Cannot delete files and directory

hello i am trying to delete some files and also some directories. However, despite having the required permissions (i m the owner), Permission is being denied. I also tried to delete using find and inode number, but again Permission was denied. :wall: I am new to unix so please dumb down... (8 Replies)
Discussion started by: curiosity
8 Replies

6. Shell Programming and Scripting

Delete multiple folders in a directory which are two weeks old

I need help. I have to delete multiple directories inside a directory that are two weeks old. Example: Today is July 09, 2012 Folder1 > folder1 (created June 4, 2012) -- should be deleted > folder2 (created June 2, 2012) -- should be deleted > folder3 (created... (4 Replies)
Discussion started by: jasperux
4 Replies

7. Shell Programming and Scripting

Move log files with date and delete older than 3 weeks

I have written a script which generate one logfile on every sunday and thursday I want to move the older log files into /tmp directory befor generating new one so i used mv command like mv usr/sbin/appl/logfile.txt usr/sbin/appl/tmp 2) But when i move this file to /tmp it will... (1 Reply)
Discussion started by: Nakul_sh
1 Replies

8. Shell Programming and Scripting

Delete all files if another files in the same directory has a matching occurrence of a specific word

he following are the files available in my directory RSK_123_20141113_031500.txt RSK_123_20141113_081500.txt RSK_126_20141113_041500.txt RSK_126_20141113_081800.txt RSK_128_20141113_091600.txt Here, "RSK" is file prefix and 123 is a code name and rest is just timestamp of the file when its... (7 Replies)
Discussion started by: kridhick
7 Replies

9. Shell Programming and Scripting

List 2 weeks older file on specific directory

Ive been a vocal of FIND command even before. Command below doesnt really give me the file that is older than two weeks.. Is there a script that will list me the log files that i want like for this date December 10, 2014, it shud list me the date between November 26, 2014 and below. When i run... (6 Replies)
Discussion started by: kenshinhimura
6 Replies

10. Shell Programming and Scripting

Script needed to delete to the list of files in a directory based on last created & delete them

Hi My directory structure is as below. dir1, dir2, dir3 I have the list of files to be deleted in the below path as below. /staging/retain_for_2years/Cleanup/log $ ls -lrt total 0 drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2 drwxr-xr-x 2 root ... (2 Replies)
Discussion started by: prasadn
2 Replies
All times are GMT -4. The time now is 04:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy