Sponsored Content
Full Discussion: Removing old folders
Top Forums UNIX for Dummies Questions & Answers Removing old folders Post 302070779 by DeepakXavier on Friday 7th of April 2006 10:59:00 AM
Old 04-07-2006
Removing old folders

All

Please help me to remove old files. For example

/usr/exp/ - inside this

Apr 02 - dir02
Apr 03 - dir03
Apr 04 - dir04
Apr 05 - dir05
Apr 06 - dir06
Apr 07 - dir07
Apr 03 - file03

I want to delete all the folders 2 days before created.Not the fil03 even though it is 2 days old.

Please help me to write shell script. Iam working in AIX.

Thanx in advance

Regards
Deepak Xavier
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Removing empty folders using the "find" command

Hi I'm trying to remove empty sub-folders from 1 main folder using the find method, but the "- empty" parameter isn't recognized by my Unix version. Any idea how to implement such thing? Thanks. (3 Replies)
Discussion started by: biot
3 Replies

2. UNIX for Dummies Questions & Answers

Removing empty folders using 'find'

Hey there! I try to use 'find' to remove empty directories like this: find . -depth -type d -empty -exec rm -rf {} ';' It works just fine, but there are some directories i want to exclude. So i tried to do sth like this: find . -depth -type d -empty -exec grep -v "not this one please" -exec... (5 Replies)
Discussion started by: deTTo
5 Replies

3. Shell Programming and Scripting

Help needed removing two top level folders from path

Hi, I am trying to use either awk or sed to drop the first two folders in a path. So if I had path /folder1/folder2/folder3/folder4.... I need to drop folder1&2, so the new path would be /folder3/folder4... If folder1 and folder2 were the same all the time, this would be easy. But... (4 Replies)
Discussion started by: robertinohio
4 Replies

4. Red Hat

how to remove inner files without removing child folders

Hi, I want to write a command to remove all the files from a folder and inner child folder without removing the child folders of parent folder. like I have folder like this... folder a/b/c file a/test.sql file a/b/test2.txt file a/b/c/temp.jpeg now I want to remove all... (2 Replies)
Discussion started by: mkashif
2 Replies

5. Shell Programming and Scripting

how to remove inner files without removing child folders

Hi, I want to write a command to remove all the files from a folder and inner child folder without removing the child folders of parent folder. like I have folder like this... Code: folder a/b/c file a/test.sql file a/b/test2.txt file a/b/c/temp.jpeg now I want to remove... (5 Replies)
Discussion started by: mkashif
5 Replies

6. UNIX for Dummies Questions & Answers

Removing empty folders

Hello, I have a folder that contains all my music. Recently, I started using a different media player, and I let it manage my music folder. It has sorted all my music neatly in folders by artist and album. However, all the old folders that the songs used to be in are still there, yet they are... (2 Replies)
Discussion started by: emveedee
2 Replies

7. UNIX for Dummies Questions & Answers

Removing Extra Folders From a TAR

I use an extremely simple TAR function for files at work and I have a question about cleaning them up. My command is TAR -cvf ExampleTarName.tar then the folder I wish to TAR. When my TAR finishes and I double click it to check it unarchived beautifully (I don't do this with every file, duh)... (5 Replies)
Discussion started by: Dogtown24
5 Replies

8. Shell Programming and Scripting

Removing folders with specific name/part

Hi, I need a way to remove all folders that contain "Quick" in their names in a directory called /var/tmp... However all attemps I have tried won't work. :wall: I so far tried find /var/tmp -type d -name "Quick" | sudo xargs rm -rf find . -name "Quicklook" -exec rm -rf {} \; find .... (2 Replies)
Discussion started by: pasc
2 Replies

9. Shell Programming and Scripting

Removing folders - hierarchical stored

my data files are stored in such way like year->month->day-> data files, my requirement is to find out number of days of files from today to the starting day of storig files. root directory = work/user/year->month->day-> data files structure is as follows 2013->05->as of today there are 01... (7 Replies)
Discussion started by: princetd001
7 Replies

10. Shell Programming and Scripting

Recursivly rename folders removing characters as required

HI guys here's hoping some on pout the can help I have a large library of epub and mobi file creates some what by calibre. Output of tree listing below I would like to recursively rename the directories removing the brackets and numbers I have been scratching my head over... (4 Replies)
Discussion started by: dunryc
4 Replies
rem_drv(1M)                                                                                                                            rem_drv(1M)

NAME
rem_drv - remove a device driver from the system SYNOPSIS
rem_drv [-b basedir] device_driver The rem_drv command informs the system that the device driver device_driver is no longer valid. If possible, rem_drv unloads device_driver from memory. rem_drv also updates the system driver configuration files. If rem_drv has been executed, the next time the system is rebooted it automatically performs a reconfiguration boot (see kernel(1M)). The following options are supported: -b basedir Sets the path to the root directory of the diskless client. Used on the server to execute rem_drv for a client. The client machine must be rebooted to unload the driver. Note - The root file system of any non-global zones must not be referenced with the -b option. Doing so might damage the global zone's file system, might compromise the security of the global zone, and might damage the non-global zone's file system. See zones(5). Example 1: Removing the sd Driver The following example removes the sd driver from use: example% rem_drv sd Example 2: Removing a Diskless Client The following example removes the driver from the sun1 diskless client. The driver is not uninstalled or unloaded until the client machine is rebooted. example% rem_drv -b /export/root/sun1 sd Note the caveat on the use of the -b option in the description of that option, above. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ add_drv(1M), kernel(1M), update_drv(1M), attributes(5), devfs(7FS) 6 Apr 2005 rem_drv(1M)
All times are GMT -4. The time now is 01:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy