Strange directory name, shown with a backslash

10,134

Solution 1

Your directory name ends with a space (probably a regular space, but it could be some other blank character like an unbreakable space). Depending on what options you passed to ls, the \ either is in the file name or indicates that the next character is to be interpreted literally as part of the file name.

You'll want to rename the directory:

mv /development\  /development

(note the two consecutive spaces: the first is part of the file name and quoted by the preceding backslash, and the second space separates the two arguments). Or

mv '/development ' /development

If there is already a directory called /development, move the files from the /development ​ directory to /development then remove the badly-named directory (rmdir '/development '). Watch out for conflicts (files existing in both).

Once you've settled the naming issue, take care of other things such as ownership.

Solution 2

Your directory name seems to have a space in it.

You can either use quotes:

chown -R zugul "/development /"

Or you can use escape characters:

chown -R zugul /development\ /
Share:
10,134

Related videos on Youtube

wjandrea
Author by

wjandrea

By day: tech support. By night: Python student, folk singer, exotic soda collector. Je parle un peu de français. He/him My profile picture is the flag of Nova Scotia but with Saint Andrew's Cross (which is also used by the Russian Navy) replaced with the flag of Ukraine. Нет войне.

Updated on September 18, 2022

Comments

  • wjandrea
    wjandrea almost 2 years

    I have copied and pasted a directory of files into another.

    The result is now this one development\ /

    I do not know what that means? Linux does not even recognize it as a directory now.

    Also the owner of this directory is wrong. But when I try to do this chown -R zugul /development, the result is: chown: cannot access `/development': No such file or directory

    Looks like something went wrong when I have pasted the copied directory. How can I fix this issue?

    • Admin
      Admin over 12 years
      i think the \ is escaping a space. try enclosing the path in double quotes and adding a space
  • Vamshi G
    Vamshi G over 12 years
    ok but how do I fix the space issue? I cannot even see it the folder live. It fires a 404 error..
  • Admin
    Admin over 12 years
    ok but how do I fix the space issue? I cannot even see it the folder live. It fires a 404 error..
  • Blender
    Blender over 12 years
    mv "/development " "/development". Or you can add %20 to your URL: foo.com/development%20
  • Admin
    Admin over 12 years
    See the edit to the answer. I think you have confused things a little bit. It seems you are mixing the UNIX/Linux shell with Web Access. So you might want to clarify the issue before continuing.