473,508 Members | 2,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to delete a directory what ends in " ???

10 New Member
I have a nuisance directory full of stuff that I want to delete.

I am an absolute newbie. It is on a network storage device running embedded linux.

Directory name ends in " (a full/double quote) -- don't ask me how THAT happened...

when I try to "rm -rf" the thing, I get a > prompt because it is waiting for the close-quote...


Any tips???
Feb 11 '08 #1
17 2856
burro
10 New Member
The actual directory name is

iTunes Music b"


When I run

rm iTunes*

it returns

rm: cannot remove `iTunes Music b': No such file or directory


(sigh)
Feb 11 '08 #2
Laharl
849 Recognized Expert Contributor
You can use \" as a control character, or '"', that is, a double inside two single quotes.
Feb 11 '08 #3
burro
10 New Member
Thanks...

so I try

# rm iTunes' 'Music' 'b'"'

and I get

rm: cannot remove `iTunes Music b"': No such file or directory

???

Any other tips?

Many thanks...
Feb 11 '08 #4
sicarie
4,677 Recognized Expert Moderator Specialist
I have a few questions - are you in the immediate directory? (When you run the command (without the quotes) "ls" do you see that directory listed?), do you have permissions to delete the folder? (When you are in the directory that directory is contained in and you run (again, without the quotes) "ls -alh" are you the owner or does the directory have permissions for you to be able to modify that directory? and can you tab fill it? (When you type in most of the command and/or directory, the shell is usually (depending on the shell) smart enough to tabfill the rest of it, so you could, theoretically, type in "rm iTun" and hit tab, and have it fill in the rest for you, which would make sure not only that you could see it, but also that you were spelling it correctly.)
Feb 12 '08 #5
numberwhun
3,509 Recognized Expert Moderator Specialist
There are always little tricks to doing this in Unix, but one nice, easy way I have found, is to use something like winscp or an FTP program to connect to the machine, if you can, browse to the directory and either change the name or delete it. Simple, but not always possible.
Feb 12 '08 #6
burro
10 New Member
Not sure how to clarify...

I am telnet-ing into the embedded linux OS of a Maxtor Shared Storage Plus drive (NAS).

The drive cannot be seen via FTP (even when I install vsftpd), nor can it be mounted from my OS X v 10.4.11 Intel iMac (which should be possible).

I am using the openmss.org firmware, which has several keen tools like busybox, none of which I know how to use.

The most I have been able to do is to 777 all the directories and files, EXCEPT one set of files that might be corrupted in the directory I am trying to trash...

The only ways to "see" this drive are to telnet or to use the web-browser interface.

Until I 777'd everything, I could not create new users, but now at least I can do that...

Really -- please keep the tips coming -- I am nearly desperate to get this drive working!

Many thanks.
Feb 12 '08 #7
burro
10 New Member
Yes -- hwne I ls I see that directory listed...

but whenever I use the name, the " is read as an open quote, and I get a prompt looking for the rest of the phrase and a close quote.
Feb 12 '08 #8
burro
10 New Member
Tab complete *does* work... when I do that, I get this:

# ls
iTunes Music b"
# rm iTunes\ Music\ b"/
rm: cannot remove `iTunes Music b': No such file or directory
#
Feb 12 '08 #9
sicarie
4,677 Recognized Expert Moderator Specialist
Tab complete *does* work... when I do that, I get this:

# ls
iTunes Music b"
# rm iTunes\ Music\ b"/
rm: cannot remove `iTunes Music b': No such file or directory
#
Weird. From there, I'd try two things - first I would try escaping the " - it seems that's something that's not caught by the shell, so try:

# rm iTunes\ Music\ b\"

And then, if you own the box (which as you're able to 777 things, I'm guessing you do), either run that as sudo or root (preferably sudo).

Something you might want to check is if the directory is empty -

# rm iTunes\ Music\ b"/*

(there's a wildcard in there to get all the visible files), and then cd into it and do an

# ls -alh

just to make sure the only two files in there are "." and "..". If there is something else, (say a .iTunesList) or anything else that begins with a . you will not be able to delete the directory.
Feb 12 '08 #10
WinblowsME
58 New Member
How about listing the inode number of the folder (ls -li) and use find . -inum inode_num -exec rm -rf {} \; to delete the folder?
Feb 12 '08 #11
burro
10 New Member
# ls -alh
drwxrwxrwx 15 0 0 512 Feb 11 13:24 .
drwxrwxrwx 1 0 0 0 Dec 31 1999 ..
drwxrwxrwx 3 0 0 80 Feb 11 12:05 Public
drwxrwxrwx 2 0 0 48 Apr 14 2006 __bksts
drwxrwxrwx 3 0 0 72 Apr 14 2006 __bonjour
drwxrwxrwx 6 0 0 144 Apr 14 2006 __daap
drwxrwxrwx 2 0 0 48 Feb 11 11:51 __deleting
drwxrwxrwx 7 0 0 168 Jan 31 17:32 __drivers
drwxrwxrwx 5 0 0 120 Apr 2 2006 __mediabolic
drwxr-xr-x 7 0 0 168 Jul 23 2005 __opt
drwxrwxrwx 2 0 0 232 Nov 21 2005 __pdc
-rw-r--r-- 1 0 0 206 Feb 11 13:24 __share_Public_vars.txt
-rw-r--r-- 1 0 0 18 Feb 11 11:52 __share_list.txt
-rwxrwxrwx 1 0 0 1.0M Apr 2 2006 __shrStatus
-rwxrwxrwx 1 0 0 6 Apr 2 2006 __shrsem
drwxrwxrwx 4 0 0 96 Jan 31 17:32 __var
drwxrwxrwx 2 0 0 48 Feb 11 11:52 sharedmain
# cd Public
# ls -alh
drwxrwxrwx 3 0 0 80 Feb 11 12:05 .
drwxrwxrwx 15 0 0 512 Feb 11 13:24 ..
drwxrwxrwx 23 35000 0 728 Feb 11 12:05 iTunes Music b"
#
Feb 12 '08 #12
burro
10 New Member
Thanks for that tip about going by nodes -- not sure how to read your suggestion -- could you help me with my specific response to {ls -li}


# ls -li
61 drwxrwxrwx 23 35000 0 728 Feb 11 12:05 iTunes Music b"
#
Feb 12 '08 #13
sicarie
4,677 Recognized Expert Moderator Specialist
Did you try to do an ls -alh inside the iTunes Music b" folder?

My guess is there is either a hidden file or an existing file that hasn't been removed.
Feb 12 '08 #14
burro
10 New Member
I cannot cd into the iTunes folder... :-(


# cd iTunes\ Music\ b"/
iTunes Music b: bad directory
#
Feb 12 '08 #15
WinblowsME
58 New Member
Try the following code in the Public folder.

Expand|Select|Wrap|Line Numbers
  1. find . -inum 61 -exec rm -rf {} \;
Feb 13 '08 #16
burro
10 New Member
I am sorry to be such a new-dweeb... and I am VERY grateful for all this TLC from everyone...

here's what I get when I try the node method:

# find . -inum 61 -exec rm -rf {} \;
BusyBox v1.00 (2006.01.07-21:42+0000) multi-call binary

Usage: find [PATH...] [EXPRESSION]

#

(sigh)

I have no idea what that means.
Feb 13 '08 #17
Laharl
849 Recognized Expert Contributor
If you have the ability to use a GUI file browser (Nautilus under Gnome, Konqueror under KDE, dunno what under XFCE), you can probably do it that way. If you find you need root permissions to delete or see the directory, you can launch the browser from terminal with sudo.

Also, in your previous command (the cd), you have to escape the " with a \. Not a /, a \.
Feb 13 '08 #18

Sign in to post your reply or Sign up for a free account.

Similar topics

11
454
by: Viviana Vc | last post by:
Hi all, I would like to delete from a directory all the files that match: bar*.* I know that I could do for instance: system("del bar*.*"), but this will bring up the command prompt window and...
10
2124
by: solosnake | last post by:
Whilst browsing Flipcode I noticed this code: class CConsole: public I_TextOutput { public: ... void Release() { delete this; } ... };
4
9153
by: MLH | last post by:
Is it good programming practice to delete existing file before running Open "c:\MyFile.txt" For Output As #1 ??? IE, I already have a file c:\MyFile.txt on disk and I launch Open "c:\MyFile.txt"...
5
1833
by: dananrg | last post by:
In PythonWin, is there any way to bulk-delete all objects without using "del object" for each, and without having to exit out of PythonWin?
2
2020
by: Bob Tinsman | last post by:
This problem shows up in Firefox 1.5.0.1 and Rhino 1.6R2. I've found that if I have an XML node expression that ends in a filter, I can't use it with the delete operator. In the following...
5
2367
by: Olivier GIL | last post by:
Hello, The method Directory.Delete(path, true) of .NET 2.0 called from within a web app does not work correctly if the initial directory is not empty : all the files inside the root directory...
0
984
by: Terry Olsen | last post by:
I need to delete files from "C:\WINNT\Downloaded Program Files" I can delete them using Windows Explorer, but they do not appear in the command prompt directory listing. How can I delete these...
6
8211
Isomorphism
by: Isomorphism | last post by:
I have front end form, query, and report database that sits on a desktop(5 computers), and a table database that sits on a server. All 5 front ends are linked to the backend. Every once in a while...
30
3787
by: Medvedev | last post by:
i see serveral source codes , and i found they almost only use "new" and "delete" keywords to make they object. Why should i do that , and as i know the object is going to be destroy by itself at...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5635
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3191
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
426
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.