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???
17 2854
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)
You can use \" as a control character, or '"', that is, a double inside two single quotes.
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...
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.)
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.
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.
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.
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
#
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.
How about listing the inode number of the folder (ls -li) and use find . -inum inode_num -exec rm -rf {} \; to delete the folder?
# 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"
#
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"
#
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.
I cannot cd into the iTunes folder... :-(
# cd iTunes\ Music\ b"/
iTunes Music b: bad directory
#
Try the following code in the Public folder. - find . -inum 61 -exec rm -rf {} \;
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.
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 \.
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
by: solosnake |
last post by:
Whilst browsing Flipcode I noticed this code:
class CConsole: public I_TextOutput
{
public:
...
void Release() { delete this; }
...
};
|
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"...
|
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?
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
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...
|
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,...
| |