Solved 'rm dir' "No such file or directory"

I tried to remove a directory late last night but I get "No such file or directory" even though ls shows it.
Code:
drwxr-xr-x    4  doc  wheel    512 Nov 4 00:03 freebsd

I am guessing that appeared when I tried to do a git commit from here
git clone https://github.com/claudiay/freesbd.git
but git says that the directory is not a git directory. I have no .git directories anywhere so I'm confused about that. (It was late and I shouldn't have been experimenting.)

So now I try to remove it rm -rf freebsd but it says not found. So I don't know what to do. I don't care about the contents.
 
Hmm, the git repository should have created a folder called freesbd, and a quick look around the project doesn't show any obvious reason why you'd have a freebsd directory.

On a hunch, what happens if you run the following inside the parent directory
Code:
ls -1 | tr " " "."
 
This is part of it. Don't know if that says enough:
Code:
000000c0 6e 74 73 0a 63 6f 6e 76 65 72 74 2e 73 68 0a 64 |nts.convert.sh.d|
000000d0 63 6f 6c 6f 72 73 0a 64 6f 63 73 0a 65 61 67 6c |colors.docs.eagl|
000000e0 65 0a 66 6f 6e 74 63 6f 6e 66 69 67 0a 66 72 65 |e.fontconfig.fre|
000000f0 65 73 62 64 0a 67 65 74 74 69 6e 67 0a 67 6f 0a |esbd.getting.go.|

Hmm, the git repository should have created a folder called freesbd
Yes. That's why I'm hesitant to blame git. However, when I first tried that clone, I typed freebsd thinking that's what it was.
 
Ok, I'm getting confused now.
The git project is named freesbd (note the misspelling). This is the same as the website the original project is hosted on (freesbd.org). I assume they chose that as they wanted a domain similar to freebsd.org (not sure exactly why really but anyway).

In your original post, you show the directory being called freebsd, but in this output it is freesbd...

Edit: misspelling of misspelling - lol
 
I originally did the git clone as freebsd, missing the fact that it was typed as freesbd. I redid the clone as freesbd, decided I didn't want to mess with it for some reason. I remember seeing the contents in some directory but don't recall which one cause I was pretty exhausted when I was doing this. Then I noticed the freebsd directory and tried to rm that, wondering where it came from.
 
Maybe git created an empty freebsd directory when you first tried to clone using the wrong repository name.
This still doesn't clear up why you seem to have a freebsd directory in post #1, but by post #5 you have no freebsd directory, but do have a freesbd one?
 
....And I'm still confused. If this output below came from the parent directory, it is telling me that you do not have a freebsd directory. You have one called freesbd.
000000c0 6e 74 73 0a 63 6f 6e 76 65 72 74 2e 73 68 0a 64 |nts.convert.sh.d|
000000d0 63 6f 6c 6f 72 73 0a 64 6f 63 73 0a 65 61 67 6c |colors.docs.eagl|
000000e0 65 0a 66 6f 6e 74 63 6f 6e 66 69 67 0a 66 72 65 |e.fontconfig.fre|
000000f0 65 73 62 64 0a 67 65 74 74 69 6e 67 0a 67 6f 0a |esbd.getting.go.|
Just for the sake of it, can you show normal ls -l output, same as the output from your first post, inside the parent directory, so we can see a clear confirmation of what directories you currently have at this point in time.
 
You would never run to such problems if you used file name completion such as rm -r free<tab> and you'd get the file/directory name automatically filled in.
 
You posted ls of that directory that means that it was OK to access it one way or the other. In case of non-printing characters (oh boy you can have fun with that) you could check the inum:

# ls -id freebsd or even better, if you are not sure you could:
Code:
# find . -type d -xdev -name \*free\* -exec ls -id {} \;
5343 ./freebsd
#
And then simply remove it using inode #:

Code:
find . -type d -xdev -inum 5343
find . -type d -xdev -inum 5343 -exec rm -rf {} \;
Test the inode and then remove.
 
Back
Top