Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Find wildcard .shtml files in wildcard directories and removing them- How's it done? Post 3233 by Neo on Wednesday 27th of June 2001 09:06:26 AM
Old 06-27-2001
You are on the right track. However two things:


(1) Suggest you use the <B>-regex</B> switch of find for pattern matches (and not the -name switch with wildcards). That is how I do it, using regular expressions.

(2) Suggest you execute/test your <B>-exec</B> switch with mv (move) to a temporary directory before executing rm (remove) to insure things work as planned Smilie This is always a good practice, regardless of the level of skill and confidence. Moving files to a temporary directory before deleting has a lot of benefits, most of all, you will not ruin your day with a typo or other mistake!!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

copying to multiple directories using wildcard

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

move files using wildcard

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

Wildcard in Cshell find command

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

Problem in using wildcard characters in xargs with find

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

Concatenation of multiple files with wildcard

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

WildCard serach for files in a directory

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

Find replace a particular string of data with wildcard

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

Passing wildcard parameters to find via a variable

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

find command with wildcard directory

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

Find and replace with wildcard

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
pam_krb5_storetmp(8)					   System Administrator's Manual				      pam_krb5_storetmp(8)

NAME
/lib64/security/pam_krb5/pam_krb5_storetmp - Temporary file helper SYNOPSIS
pam_krb5_storetmp pattern [uid] [gid] DESCRIPTION
The pam_krb5.so module uses pam_krb5_storetmp to create and remove temporary files. It is not intended for any other use. ARGUMENTS
pattern A filename pattern of the form /tmp/fooXXXXXX. A temporary file will be created using mkstemp(3) and any data provided to standard input will be piped to the file. Upon reading an end-of-file, the helper will print the name of the created file. If the pattern does not end with the distinctive patterh XXXXXX, then the file is simply deleted. uid An optional numeric UID which the helper will attempt to switch to before creating the file. The helper continues in its task if the attempt fails. gid An optional numeric GID which the helper will attempt to switch to before creating the file. The helper continues in its task if the attempt fails. FILES
/lib64/security/pam_krb5.so SEE ALSO
mkstemp(3) pam_krb5(5) pam_krb5(8) BUGS
Probably, but let's hope not. If you find any, please file them in the bug database at http://bugzilla.redhat.com/ against the "pam_krb5" component. AUTHOR
Nalin Dahyabhai <nalin@redhat.com> openSUSE 2005/10/05 pam_krb5_storetmp(8)
All times are GMT -4. The time now is 09:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy