Search code examples
linuxsftpputtyfile-transferaccess-rights

Linux: Nonexistent Directory Exists Bug after failed SFTP attempt?


So, I've been administrating a personal game server in Linux so far (bear in mind, I don't possess the physical server - I have shell access, including root). I am relatively inexperienced with remote Linux administration. I made an attempt to transfer a directory titled 'mods' to this server which contains several other directories and files. I have successfully SFTP'd into this server before and transferred files before, but this time for whatever reasons transfers were failing and so I stopped the transfers.

Upon refreshing the directory, in FileZilla, I see a new folder with the name ". Yes, just ". Deleting or attempting to modify this directory doesn't work even for root user. Linux says it doesn't exist or this happens...

Error

And also attempting to transfer files via SFTP now results in errors such as,

Error: Directory no such file or directory

Error: mkdir 'remote server directory': received failure with description 'Failure'

Error: get attrs for 'remote directory path'/'file name': no such file or directory

where 'remote server directory' or 'remote director path'/'file name' are names of the things to be transferred.

Any idea what's going on?


Solution

  • Linux shell uses quotes "some filename" to surround command line parameters (similar to MS Windows). If a file name actually contains " as a character, you need to escape it:

    ~/example$ dir
    ~/example$ mkdir mods
    ~/example$ mkdir '"' # whoops!
    ~/example$ dir
    "  mods
    ~/example$ rmdir \" # escape it
    ~/example$ dir
    mods
    ~/example$ rmdir '"' # or wrap in single quotes