3

Somehow this folder got created when i was logged in via sftp.

"Sep 19 18:50 "

I tried to delete it via sftp.

Tried to SSH in and delete with rm -rf as root

Error:  rm /home/user/Downloads/manual/Sep 19 18:50  : no such file or directory

If i ls -al it shows it there.

root@ndsdsd:/home/user/Downloads/manual# ls -al
total 32
drwxrwxr-x 3 keelan keelan  4096 Sep 19 18:50
drwxrwxr-x 3 keelan keelan 12288 Sep 20 07:56 .
drwxr-xr-x 8 keelan keelan 16384 Sep 19 23:11 ..

  • 1
    Note that @Mat's way requires that you be able to log in and run programs (usually this means, log in with ssh and get a shell prompt). You cannot run echo Sep* | hexdump -C via sftp itself. – Eliah Kagan Sep 20 '14 at 13:42
  • root@ds3dfe:/home/user/Downloads/manual# echo Sep* | hexdump -C 00000000 53 65 70 2a 0a |Sep*.| 00000005 – Keelan Sep 20 '14 at 15:39
5

I don't think you really have a file called Sep 19 18:50.

I made an new folder tmp, then made a single file foo in that folder. Then I sftp'd in, cd'd to tmp, and ran ls -l:

drwxrwxr-x    2 ek       ek           4096 Sep 19 19:39 .
drwxr-xr-x   30 ek       ek           4096 Sep 19 19:39 ..
-rw-rw-r--    1 ek       ek              0 Sep 19 19:39 foo

You'll notice that all entries show a date and time. That's not part of their name, it's just the time they're marked as having last been modified.

The name is to the right of that, separated by a space. Thus there are three entries:

  • foo, the file I created.

  • .., which represents the parent directory (i.e., the folder one up):

    sftp> pwd
    Remote working directory: /home/ek/tmp
    sftp> cd ..
    sftp> pwd
    Remote working directory: /home/ek
    

    (Except when you're in /. There's nothing above / in the directory tree. Then--and only then--.. represents the same directory as ..)

  • ., which represents the current directory (i.e., the directory you're in now).

    sftp> cd tmp
    sftp> pwd
    Remote working directory: /home/ek/tmp
    sftp> cd .
    sftp> pwd
    Remote working directory: /home/ek/tmp
    

ls only shows the . and .. entries when the -a flag is supplied (or when you explicitly give their names, or a pattern that matches them, after ls on the command line). This is true both of the ls command in sftp and the ls command issued on a full login session with a regular shell prompt.

  • 1
    Image FTP shows it as a folder. Can't delete it via ftp. – Keelan Sep 20 '14 at 2:40
  • 7
    @Keelan I wonder if that's a bug in your graphical sftp client. (Which GUI client is that?) It is odd, after all, that the file's reported name is the exact date and time, down to the minute, of its own timestamp. In any case, drwxr-xr-x 8 keelan keelan 16384 Sep 19 18:50 .. is not reporting a file named Sep 19 18:50, but instead one named ... Is that line the full output of ls -al in that directory, when run in the command-line sftp client? Do you have access to ssh in and get a shell? If so, that would provide more powerful mechanisms for checking the directory's contents. – Eliah Kagan Sep 20 '14 at 9:00
  • Filezilla, I tried a different ftp client and the directory is called:" 18:50 " without the Sep. I have SSh access. Full output: drwxrwxr-x 3 keelan keelan 4096 Sep 19 18:50 drwxrwxr-x 3 keelan keelan 12288 Sep 20 07:56 . drwxr-xr-x 8 keelan keelan 16384 Sep 19 23:11 .. – Keelan Sep 20 '14 at 15:34
3

You are misinterpreting the output of ls. The actual directory name is .. and it is a special directory used to navigate through the file-system (like when you type cd .. to go one level up). Every sub-directory has one. Sep 19 18:50 is just the creation date of the directory.

1

I think it's due to the spaces try this:

sudo rm -rf "/home/user/Downloads/manual/Sep 19 18:50"
  • I thought this too, this doesn't work unfortunately. – Keelan Sep 20 '14 at 2:42
  • 1
    what if you remove sudo rm -rf /home/user/Downloads/manual/ then sudo mkdir /home/user/Downloads/manual/ – meda Sep 20 '14 at 3:08
  • Error: Directory /home/keelan/Downloads/manual/Sep 19 18:50 : no such file or directory Error: Failed to retrieve directory listing – Keelan Sep 20 '14 at 15:37
  • Wtf doesnt make sense – meda Sep 20 '14 at 17:24
1

I believe that's an empty folder. the .. part actually means that you can go " up a step" in the file tree if you type cd ..

  • That is the problem i am trying to delete this empty folder however i cannot. It shows it in LS -al and shows it in FTP but i cannot remove it. – Keelan Sep 20 '14 at 2:43
1
root@dsadwsd:/home/user/Downloads/manual# ls -al
total 32
drwxrwxr-x 3 keelan keelan  4096 Sep 19 18:50
drwxrwxr-x 3 keelan keelan 12288 Sep 20 07:56 .
drwxr-xr-x 8 keelan keelan 16384 Sep 19 23:11 ..

When i highlighted:

drwxrwxr-x 3 keelan keelan  4096 Sep 19 18:50

There was a space at the end. So i did:

root@dsadwsd:/home/user/Downloads/manual# rm -rf " "

This removed the folder. Strange how the folder name wouldn't just be blank (space) but instead took the folder creation date.

I can now replicate this by creating a new folder via sftp with a space as the name, it changes the folder name to the creation date.

Thanks for the help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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