Sponsored Content
Full Discussion: Removing older version files
Top Forums Shell Programming and Scripting Removing older version files Post 302766629 by Arun Mishra on Tuesday 5th of February 2013 05:30:19 AM
Old 02-05-2013
Removing older version files

Hi,

I have a direcory as mentioned below:
/development/arun/cycdt/
unser the above i have directories
/2013
/2012
/2011
......
.....
/2000
I need to write a script which can delete the nth version of the directories.
as in if n=10 then the script should arrange the directories in descending creation order and delete all the directories apart from the recent 10 directories

Any help appreciated!!!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

removing files after 6 hours or older

What is the command to remove files that are generated 6 hours or older? The find and remove tells only how to remove if the file is one day old or more. Appreciate quick reply. Thanks (3 Replies)
Discussion started by: gthokala
3 Replies

2. UNIX for Advanced & Expert Users

Need older version of System Firmware for 7026-H80

Hi all, I have an H80 that I'm migrating to 5.3 and prior to doing so it needed the firmware upgraded. I don't have copies of the old firmware that was on it since I was not the one who installed it and there were no copies to be found on the server itself. I installed the latest version and... (4 Replies)
Discussion started by: howardle
4 Replies

3. UNIX for Dummies Questions & Answers

Removing files older than 7 days

Script help, I need to delete files that are older than 7 days. I do that automatically but I know that a cron job can do the job for me. Any help is greatly appreciated, as you can see, I am a DOS or WINDOWS guy. Little on UNIX. Thanks (3 Replies)
Discussion started by: texasoeb
3 Replies

4. UNIX for Dummies Questions & Answers

.profile has been replaced and need to get the older version

Hi All, .profile has been replaced with a new one. I need to know the variables used in the older version of .profile. I have a session opened using the old .profile. Is there a way that I can get the exact file. I had some luck by using set command. But is there any way that I can get the... (5 Replies)
Discussion started by: shash
5 Replies

5. Shell Programming and Scripting

Removing files older than one week in a directory

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

6. UNIX for Advanced & Expert Users

removing files older than n days

Hi, on AIX 6.1, is there any commande line to remove the files older than n days in a directory ? Thanks. (2 Replies)
Discussion started by: big123456
2 Replies

7. Shell Programming and Scripting

For loop in older version of ksh

When I am trying to use below code of for loop on older version of ksh it not working,and I just want to use only FOR loop ----------------- for i in (1..5) do echo $i done ----------------- please suggest.it really stoping me. FYI: i want to do this only by for loop (2 Replies)
Discussion started by: RahulJoshi
2 Replies

8. Ubuntu

Installation of older version of rsyslog

Hi, I am trying to downgrade the version of rsyslog to the older version (i.e) and when i issue the below command to check the packages i dont see the required package (i.e) and when i try to install it is complaining about package not found. Please advise on how to install the... (1 Reply)
Discussion started by: prash358
1 Replies

9. Debian

Which older version and variant ISO image should I use?

Which older version and variant of Debian Linux ISO image should I use? I attempted to install two versions of Debian Linux Operating System onto my older full tower computer. First version, V8.5.0, Amd64, xfce, 32Bit. Second version V7.11.0, i386, 32Bit. When trying to install... (1 Reply)
Discussion started by: Jefferyab6
1 Replies

10. UNIX for Beginners Questions & Answers

How to install older package version on Ubuntu 18.04?

Hello, I'm running Ubuntu 18.04 and I would like to install libboost-python version 1.46. Currently I have installed version 1.65: wakatana@local-machine:~$ dpkg -l | grep libboost-python ii libboost-python-dev 1.65.1.0ubuntu1 amd64 ... (1 Reply)
Discussion started by: wakatana
1 Replies
FINDTAGS(1p)						User Contributed Perl Documentation					      FINDTAGS(1p)

NAME
findtags - find tags in Interchange catalogs and directories SYNOPSIS
findtags -a -d lib/UI findtags -a -d lib/UI -t -u findtags -a -u -t DESCRIPTION
Find tags in Interchange catalogs and directories -- intended to develop a list for TagInclude. WARNING: This is not 100%, for developing tag names from Variable definitions and other sources can fool it. If you include all directories, make sure you don't include documentation files or the usertags themselves. With the standard distribution, this should find just about all tags needed: findtags -a -d lib/UI To develop a TagInclude statement which excludes unused tags, try: findtags -a -d lib/UI -t -u If you don't want to use the UI, then do: findtags -a -u -t OPTIONS
-a Look in all catalogs. -c CAT Only look in catalog CAT. -d DIR1 DIR2 .... Look in given directories. -f FILE Use alternate interchange.cfg file FILE. -h Display help. -n Don't report system tags. -t Output suitable for TagInclude directive. -u Report unseen tags. -v Slightly verbose, report directories scanned. -x DIR1 DIR2 .... Exclude given directories from scanning. Default is session and tmp. perl v5.14.2 2012-01-23 FINDTAGS(1p)
All times are GMT -4. The time now is 07:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy