Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have the following directories on the root of my server

  • htdocs
    • [site contents]
  • mike-eng
    • stage
  • old2
  • stats

I am trying to delete the "mike-eng" directory here.

Permissions on "mike-eng" and "stage" are 777. Neither directory is showing any files in my FTP client (Transmit), which shows hidden files in other directories. Also, the command line shows the directories as empty:

ftp> cd mike-eng

250 CWD command successful

ftp> ls

229 Entering Extended Passive Mode (|||29910|)

150 Opening ASCII mode data connection for file list

drwxrwxrwx 2 1191966 15000 4096 Jan 11 15:55 stage

226 Transfer complete

ftp> cd stage

250 CWD command successful

ftp> ls

229 Entering Extended Passive Mode (|||48904|)

150 Opening ASCII mode data connection for file list

226 Transfer complete

When I try to delete the "mike-eng" directory using Transmit, I get the following error:

stage: Directory not empty

Error -126: remote rmdir failed

When I connect using Terminal and try to delete the "mike-eng" directory from the command line, I get:

ftp> rm mike-eng

550 mike-eng: Directory not empty

If I navigate inside the "mike-eng" directory and try to delete the "stage" directory, I get:

ftp> rm stage

550 stage: Directory not empty

How can I delete this directory and its sub-directory?

share|improve this question

migrated from stackoverflow.com Jan 17 '12 at 7:56

This question came from our site for professional and enthusiast programmers.

3 Answers 3

There's probably a hidden file in mike-eng. Try

ftp> cd mike-eng
ftp> mdelete .*
ftp> cd ..
ftp> rmdir mike-eng
share|improve this answer
    
ftp> cd mike-eng 250 CWD command successful ftp> mdelete .* ftp> cd .. 250 CWD command successful ftp> ls 229 Entering Extended Passive Mode (|||8848|) 150 Opening ASCII mode data connection for file list -rw-r--r-- 1 1191966 15000 6819809280 Jan 6 16:43 backupfull.tar drwxr-xr-x 17 1191966 15000 4096 Jan 10 22:15 htdocs drwxrwxrwx 3 1191966 15020 4096 Jan 11 15:58 mike-eng drwxr-xr-x 12 1191966 15000 4096 Jul 5 2009 old2 drwxr-xr-x 2 1191966 15000 24576 Jan 16 10:24 stats 226 Transfer complete ftp> rmdir mike-eng 550 mike-eng: Directory not empty –  Mike Eng Jan 16 '12 at 21:05
    
@MikeEng: hmm, I guess the mdelete didn't catch everything. Can you try an ls .* in dir mike-eng? –  larsmans Jan 16 '12 at 22:56
    
ftp> cd mike-eng 250 CWD command successful ftp> ls .* 229 Entering Extended Passive Mode (|||46930|) 150 Opening ASCII mode data connection for file list 226 Transfer complete ftp> –  Mike Eng Jan 17 '12 at 1:30
up vote 1 down vote accepted

No explanation for the cause of this, but the only way I was able to delete the directory was using my host(Powweb)'s "file manager" in the control panel.

share|improve this answer
    
Same here. Uploaded file had some weird character in it, and FTP couldn't browse to it, rename it, etc. Host file manager worked. –  Lanny Jul 30 at 0:28

I just had the same problem. It seems it's not the server, but a bug in Transmit.

Here's the solution that worked with me:

  1. In Transmit's interface, open the directory that won't delete
  2. Once opened, right click inside the directory and click: “Refresh”. Some files will show up!
  3. Delete those files that came up and then now deleting the directory will work fine
  4. Repeat that for all directories that present that error
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.