Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Deleting multiple directories inside multiple directories Post 302583530 by kkouraus1 on Tuesday 20th of December 2011 03:22:08 PM
Old 12-20-2011
Thank you for the quick response.
I tried the first one.
It seemed to do something. But did not see the results. The directories are still there.
So, here is another explanation of the request:

I cd to a directory ksk
in there, there are directories - 40001, 40005, 60012, etc (117 of them)
in each of the above there is a directory 01
in each 01 there are directories 001, 002, etc.

I need to keep the 40001/01 structure.
I need to delete all of 001's - 00x BUT I need to keep 002's.

So, that is the time consuming part.. Going in to each and deleted everything around 002, and then coming out and into the next.

Sorry to be such a novice.

Thanks,
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

moving directories to new directories on multiple servers

Hi - I am new to unix scripts...I need to move several directories on multiple servers to new directories. (0 Replies)
Discussion started by: mackdaddy07
0 Replies

2. Shell Programming and Scripting

Using ls on multiple directories

Hi, I am using ls command as below to get the list of *.edi files from 2 different subdirectories as1 & as2: /ntekupal/test$ ls ./as1/*.edi ./as2/*.edi It is giving me list of edi files in these folders as below : ./as1/6df667.edi ./as2/823ssd3.edi Now my requirement is to just... (8 Replies)
Discussion started by: ntekupal
8 Replies

3. UNIX for Dummies Questions & Answers

Using ls on multiple directories

Hi, I am using ls command as below to get the list of *.edi files from 2 different subdirectories as1 & as2: /ntekupal/test$ ls ./as1/*.edi ./as2/*.edi It is giving me list of edi files in these folders as below : ./as1/6df667.edi ./as2/823ssd3.edi Now my requirement is to just get... (3 Replies)
Discussion started by: ntekupal
3 Replies

4. Shell Programming and Scripting

check if multiple directories exist else create missing directories

Hi , I 'm trying to check if multiple directories exist on a server, if not create the missing ones and print " creating missing directory. how to write this in a simple script, I have made my code complex if ; then taskStatus="Schema extract directory exists, checking if SQL,Count and... (7 Replies)
Discussion started by: ramky79
7 Replies

5. UNIX for Dummies Questions & Answers

Multiple search in multiple directories

Hi, I am facing the below problem I have a list of number to be searched(around 1000) files resideing in multiple directories as i dont know where it resides in. for example search string is like (abc)123456 please help. very urgent Thanks a lot Uma (3 Replies)
Discussion started by: umapearl
3 Replies

6. Shell Programming and Scripting

Creation of multiple directories

I have a folder structure like the below /test/test1/test2/app /test/test3/app /test/test4/test5/app .. I need to create a new folder under "app" in all the above listed directory structure at one shot by the name "subapp" . How can we acheive this using a script . New to unix... (4 Replies)
Discussion started by: rajeshnatarajan
4 Replies

7. Shell Programming and Scripting

FTP multiple files from multiple directories

I have multiple files that starts as TRADE_LOG spread across multiple folders in the given structure.. ./dir1/1/TRADE_LOG*.gz ./dir2/10/TRADE_LOG*.gz ./dir11/12/TRADE_LOG*.gz ./dir12/13/TRADE_LOG*.gz when I do ftp uisng mput from the "." dir I am getting the below given error mput... (1 Reply)
Discussion started by: prasperl
1 Replies

8. Shell Programming and Scripting

searching different multiple directories

Suppose I have 5 different directories in some path .Is it possible to search 5 different directories using find command in one single command line. I mean something like this:- find path -type d -name dirname1 dirname2 .......... pls help (2 Replies)
Discussion started by: maitree
2 Replies

9. Shell Programming and Scripting

perform 3 awk commands to multiple files in multiple directories

Hi, I have a directory /home/datasets/ which contains a bunch (720) of subdirectories called hour_1/ hour_2/ etc..etc.. in each of these there is a single text file called (hour_1.txt in hour_1/ , hour_2.txt for hour_2/ etc..etc..) and i would like to do some text processing in them. Each of... (20 Replies)
Discussion started by: amarn
20 Replies

10. Shell Programming and Scripting

Looping for multiple directories

Hi experts, I am totally stuck with this. I run a looping "for" command for multiple directories, manually, I have done this : vfor dir in A B; do cp -p $dir/X.txt X-${dir}.txt done where A and B is directory name. However, I need to run for many directories. So I have tried this :... (7 Replies)
Discussion started by: guns
7 Replies
DH_USRLOCAL(1)							     Debhelper							    DH_USRLOCAL(1)

NAME
       dh_usrlocal - migrate usr/local directories to maintainer scripts

SYNOPSIS
       dh_usrlocal [debhelperoptions] [-n]

DESCRIPTION
       dh_usrlocal is a debhelper program that can be used for building packages that will provide a subdirectory in /usr/local when installed.

       It finds subdirectories of usr/local in the package build directory, and removes them, replacing them with maintainer script snippets
       (unless -n is used) to create the directories at install time, and remove them when the package is removed, in a manner compliant with
       Debian policy. These snippets are inserted into the maintainer scripts by dh_installdeb. See dh_installdeb(1) for an explanation of
       debhelper maintainer script snippets.

       When the Rules-Requires-Root field is not (effectively) binary-targets, the directories in /usr/local will have ownership root:staff and
       the mode will be 02775.	These values have been chosen to comply with the recommendations of the Debian policy for directories in
       /usr/local.

       When Rules-Requires-Root has an effective value of binary-targets, the owners, groups and permissions will be preserved with one exception.
       If the directory is owned by root:root, then ownership will be reset to root:staff and mode will be reset to 02775. This is useful, since
       that is the group and mode policy recommends for directories in /usr/local.

OPTIONS
       -n, --no-scripts
	   Do not modify postinst/prerm scripts.

NOTES
       Note that this command is not idempotent. dh_prep(1) should be called between invocations of this command. Otherwise, it may cause multiple
       instances of the same text to be added to maintainer scripts.

CONFORMS TO
       Debian policy, version 2.2

SEE ALSO
       debhelper(7)

       This program is a part of debhelper.

AUTHOR
       Andrew Stribblehill <ads@debian.org>

11.1.6ubuntu2							    2018-05-10							    DH_USRLOCAL(1)
All times are GMT -4. The time now is 08:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy