06-27-2001
Find wildcard .shtml files in wildcard directories and removing them- How's it done?
I'm trying to figure out how to build a small shell script that will find old .shtml files in every /tgp/ directory on the server and delete them if they are older than 10 days...
The structure of the paths are like this:
/home/domains/www.domain2.com/tgp/
/home/domains/www.domain3.com/tgp/
/home/domains/www.domain4.com/tgp/
/home/domains/www.domain5.com/tgp/
So I've got 220 domains on this one box and in each of those domains I've got a directory called /tgp/ ...in /tgp/ directory I have hundreds of old .shtml files that I need to delete.
If I use this command will it work or will it cause any damage?
find /tgp -mtime +10 -name "*.shtml" -exec rm
If this is not the best way to do this, which way should I handle this and what command could take care of this?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Can we copy a file to multiple directories using a single command line , i tried with * didnt work for me
cp /tmp/a.kool /tmp/folder/*/keys/
I am tryn to copy a.kool file to all keys folder in /tmp folder. is something i am missing ? (4 Replies)
Discussion started by: logic0
4 Replies
2. Shell Programming and Scripting
I have the following requirement.
PATHA =/opr/itr/
PATHB=/etc/data/
FILENAME=*abc*
file name is wild carded as there could be many files with name abc anywhere
I tried mv $PATHA/$FILENAME $PATHB
and I got a error that /etc/data/ can not be created
Could any one please help.
... (1 Reply)
Discussion started by: onlyjayaram
1 Replies
3. Shell Programming and Scripting
The following command works fine in my cshell script:
set Deliverables = `find . -name "eliverables" -print`
The following command does not work:
set LASFiles = `find . -name "*." -print`
In the first example, when tested in an if statement, the script will continue whether a... (3 Replies)
Discussion started by: phudgens
3 Replies
4. Solaris
Hi,
Under my parent diectory I have directory named "Response" in many of its subfolders. I am interested to see all files with extention .pro in Response Directory. I am giving following command -
find . -name "Response" -type d | xargs -i ls -lrt {}/*.pro
but it is not giving result.
... (3 Replies)
Discussion started by: sanjay1979
3 Replies
5. UNIX for Dummies Questions & Answers
I have the following snippet to concatenate about a hundred csv-files:
for file in *csv; do cat $file >> newfile; done
This line works, but before I was experimenting with the following line, which is more intuitive and is a tad more robust:
for file in *.csv; do cat $file >> newfile; done
Can... (2 Replies)
Discussion started by: figaro
2 Replies
6. Shell Programming and Scripting
Hi i have a requirement to search for all files in a directory.
the files will start as file1_*,file2_*,file3_*
where the wild card character is a timestamp. so on a particular day i may get files like
file1_1103120042
file1_1102010345
file2_1101093423
file3_1103120042... (3 Replies)
Discussion started by: Sgiri1
3 Replies
7. Shell Programming and Scripting
Hi
I am having a csv file in which lots of data are available wherein i need to find a particular kind of data and replace it with null value.
here is the sample data..
I need to find the string starting with 404-064- and up to the first space i have to remove the data and keep the... (4 Replies)
Discussion started by: aemunathan
4 Replies
8. Shell Programming and Scripting
I have a script to fix permissions which is made up of blocks like:
FS_ROOT=/home/shared/Photos
FS_EXCLUDE=( \( -path */.webviews -o -path */.thumbnails \) -prune -o )
find $FS_ROOT ${FS_EXCLUDE} -type d -not -perm 2770 -exec chmod 2770 "{}" \;
That fragment works as expected, but no matter... (3 Replies)
Discussion started by: mij
3 Replies
9. Shell Programming and Scripting
I want to look if there is any file inside a specific directory which was modified before 2 days.
I wrote the find command, but the problem is there is one directory and that is a random directory generated by unix, so not sure on how to code for that on the find command.
find... (5 Replies)
Discussion started by: srini0603
5 Replies
10. UNIX for Beginners Questions & Answers
HI there,
I am trying to find and replace with wildcard with
data
chr1 69511 69511 A G 1/1:0,34:791,78,0:78:34 0/1:55,60:1130,0,1513:99:116 1/1:0,28:630,63,0:63:28 0/1:0,34:626,57,0:57:34
To this
chr1 69511 69511 A G homo hetero homo hetero
Where I find and replace 0/1 with... (3 Replies)
Discussion started by: daashti
3 Replies
LEARN ABOUT X11R4
asadmin-list-domains
asadmin-list-domains(1AS) User Commands asadmin-list-domains(1AS)
NAME
asadmin-list-domains, list-domains - lists the domains in the given domains directory
SYNOPSIS
list-domains [--domaindir install_dir/domains] [--terse=false] [--echo=false]
list-domains lists the domains in the given domains directory. This command is supported in local mode only.
OPTIONS
--domaindir directory where the domains are located. If specified, path must be accessible in the filesystem. If not specified,
the domains in the default install_dir/domains directory are listed.
--terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well-
formatted data for consumption by a script.
--echo setting to true will echo the command line statement on the standard output.
Example 1: Using list-domains
asadmin> list-domains
List of domains:
domain1 running
samples not running
Where: the domain1 and samples are listed and their status printed.
EXIT STATUS
0 command executed successfully
1 error in executing the command
asadmin-create-domain(1AS), asadmin-delete-domain(1AS), asadmin-start-domain(1AS), asadmin-stop-domain(1AS)
J2EE 1.4 SDK March 2004 asadmin-list-domains(1AS)