DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 1st April 2011
divadgnol67 divadgnol67 is offline
Fdisk Soldier
 
Join Date: Jul 2009
Posts: 67
Thanked 4 Times in 2 Posts
Default deleting a file or directory

This is not an openbsd question per se. But I am unable to delete the following directory > "Pink_Floyd-Wish_You_Were_Here_(Japan,_TOCP-65560)"

I alwas get the following error > "syntax error: `(' unexpected"

I know this must be a complete newb problem but I swear I'm not a complete newb. If the answer requires further study of a man page or understanding of syntax please point me in the right direction.

Thanks,

divadgnol67
Reply With Quote
  #2   (View Single Post)  
Old 1st April 2011
divadgnol67 divadgnol67 is offline
Fdisk Soldier
 
Join Date: Jul 2009
Posts: 67
Thanked 4 Times in 2 Posts
Default

Obvoiusly quotes are not part of directory name. I am able to access files inside of directory via mp3blaster
Reply With Quote
  #3   (View Single Post)  
Old 1st April 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,708
Thanked 214 Times in 189 Posts
Default

You cannot delete this because the file name includes shell special characters, such as "(" and ")".

You should be able to delete by tab completion, if the shell you are using has the feature (and the default ksh should have it), or escape them manually with a backslash "\" character, or by surrounding the filename with quote characters (").

Have you tried just using tab completion? e.g.:
$ rm -rf Pink {press your tab key after typing the first part of the directory name}
Some special names, such as those that begin with a special character like "+" can also be deleted by leading the filename with the directory. For example, to delete a file called +CONTENTS in the current directory, you can do so by issuing:
$ rm ./+CONTENTS
So in this case, you might try:
$ rm -rf ./Pink {tab completion}
Reply With Quote
  #4   (View Single Post)  
Old 1st April 2011
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

If there is no other directory that starts with "Pink", just rm -rf Pink*
Reply With Quote
  #5   (View Single Post)  
Old 1st April 2011
divadgnol67 divadgnol67 is offline
Fdisk Soldier
 
Join Date: Jul 2009
Posts: 67
Thanked 4 Times in 2 Posts
Default

That worked....Thank you both very much. What documentation can I study up on to get a better understanding of special shell characters. Is there a man page for me to read. Thanks again, really.
Reply With Quote
  #6   (View Single Post)  
Old 1st April 2011
divadgnol67 divadgnol67 is offline
Fdisk Soldier
 
Join Date: Jul 2009
Posts: 67
Thanked 4 Times in 2 Posts
Default

One day I hope to able to contribute back and help someone like myself. You both have helped me several times in the past to gaining a better understanding of unix and openbsd.
Reply With Quote
  #7   (View Single Post)  
Old 1st April 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,708
Thanked 214 Times in 189 Posts
Default

The man page for the shell you are using is a great place to start. e.g.: for ksh, use the "man ksh" command, then use the search feature ("/<keyword>") to find what you're looking for.

In this case, try /Command syntax
Reply With Quote
  #8   (View Single Post)  
Old 1st April 2011
divadgnol67 divadgnol67 is offline
Fdisk Soldier
 
Join Date: Jul 2009
Posts: 67
Thanked 4 Times in 2 Posts
Default

Will do, thanks.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting 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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Archiving a log file to a directory with the date incorporated in the new name J65nko Programming 1 6th February 2010 03:02 AM
PHP read file contents - Maximum file size cksraj Programming 1 21st September 2009 11:38 AM
strange "~" directory in home directory gosha OpenBSD General 5 23rd February 2009 06:12 PM
Deleting lines with certain letters/keywords. bigb89 Programming 4 12th November 2008 11:59 PM
Jails - mount: /usr/home: No such file or directory chris FreeBSD General 6 6th August 2008 10:47 PM


All times are GMT. The time now is 04:30 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick