Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find * in file name

Status
Not open for further replies.

kozlow

MIS
Mar 3, 2003
326
US
Is there a way to find all files that have an * in the filename. Never heard of anyone using a wild card in a filename, but one of my users installed an application that did so.. Now looking to find them all and rename the files...

I tried
find / -name *"*"*
find / -name *'*'*
find / -name *\**
 
OOOPPPSSSS....
Figured it out:

find / | grep "*" > /tmp/asteric.file
while read ASTERIC
do
POUND=`echo $ASTERIC | sed "s/\*/\#/"`
echo $ASTERIC to $POUND
mv $ASTERIC $POUND
done < /tmp/asteric.file
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top