Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > Command for deleting Windows junk files from a directory?

Command for deleting Windows junk files from a directory?
Thread Tools
Professional Poster
Join Date: Jun 2003
Status: Offline
Reply With Quote
Jan 24, 2005, 10:06 AM
 
I'm moving a few thousand images file off a Windows 2000 system onto a Mac. When opened in Finder, I see three files for each image:

image.jpg
image.jpg:?Q301sldxJoudresxAaaqpcawXc:$DATA
image.jpg:{4c8cc155-6c1e-11d1-8e41-00c04fb9386d}:$DATA

(the strings after the imagename.jpg: appear to be identical for every image)

I'm assuming that the additional two files are something to do with Window's file permissions (or something). I don't need them.

Going into a Finder window to delete them is painfully slow, so how do I delete them in Terminal?

Doing a
"rm *:$DATA"
just returns
"DATA: undefined variable".


10.2.8 running tcsh. Relative Terminal newbie.

Thanks guys.
     
Senior User
Join Date: Nov 2001
Location: State of Denial
Status: Offline
Reply With Quote
Jan 24, 2005, 06:50 PM
 
Try

rm *:\$DATA

(note backslash).
[Wevah setPostCount:[Wevah postCount] + 1];
     
Mac Elite
Join Date: Sep 2001
Location: Chico, CA and Carlsbad, CA.
Status: Offline
Reply With Quote
Jan 24, 2005, 09:55 PM
 
Originally posted by Sherwin:
Doing a
"rm *:$DATA"
just returns
"DATA: undefined variable".
Ahh, the command you issued is telling the shell to look for a variable called "DATA" (the dollar sign tells the shell that whatever follows is the name of a variable), and since you don't have one, it errors. You can either use single quotes or escape the dollar sign like Wevah suggested above. As a general rule, double quotes are really only good for escaping simple characters like spaces.

I'm not sure of the specifics of single and double quotes and their strictness, but single quotes are pretty good for escaping mostly everything.
(Last edited by [APi]TheMan; Jan 24, 2005 at 10:20 PM. )
"In Nomine Patris, Et Fili, Et Spiritus Sancti"

     
Junior Member
Join Date: May 2004
Status: Offline
Reply With Quote
Jan 24, 2005, 11:03 PM
 
I'm not sure of the specifics of single and double quotes and their strictness, but single quotes are pretty good for escaping mostly everything.
As I understand it single and double quotes are basically the same only the double (partial) quotes expand variable names and allow for certain escape characters ( $, ` (backquote), and \ (backslash)). single (full) quotes give you EXACTLY what is between the quotes. ie.
Code:
> echo "$TERM" xterm-color
and with single quotes
Code:
> echo '$TERM' $TERM
more info @ http://www.tldp.org/LDP/abs/html/quoting.html
(Last edited by leira; Jan 25, 2005 at 12:22 AM. )
     
Sherwin  (op)
Professional Poster
Join Date: Jun 2003
Status: Offline
Reply With Quote
Jan 25, 2005, 07:14 AM
 
Originally posted by Wevah:
Try

rm *: \$DATA

(note backslash).
This worked - thanks!

Originally posted by [APi]TheMan:
You can either use single quotes or escape the dollar sign like Wevah suggested above. As a general rule, double quotes are really only good for escaping simple characters like spaces.
Possible to use wildcards within those quotes or does it just escape the * too?

(edit: sorry, leira has just answered this!)

Thanks for the help guys.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:13 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2