Linux file permission "/rwx------". What does the slash mean and how can I access my files?

6

1

I have a problem with a directory. If I run a ls -la I get following output:

/rwx------    7 1000     1000          4.0k Mar  1 09:11 Folder Name

It is supposed to be a folder. What does the slash mean in the permissions? I expected a d since it is a folder.

I have this problem on my QNAP Nas. uname -a shows Linux Q 3.19.8 #1 SMP Mon Feb 13 05:20:15 CST 2017 x86_64 unknown

I cannot access the folder or set other permissions / owners.

chown admin:administrators Folder\ Name -> chown: Folder Name: No such file or directory

chmod 777 Folder\ Name -> chmod: Folder Name: No such file or directory

cd Folder\ Name -> -sh: cd: Folder Name: No such file or directory

mv Folder\ Name other_name -> mv: unable to rename Folder Name: No such file or directory

--- Background:

I copied this folder via rsync from an ubuntu to my nas using:

rsync -ahhve "ssh" /home/foo/bar/ admin@10.0.0.1:"/share/homes/username/Folder\ Name"

Thank you for reading this question and I am happy for any help.

cPu

Posted 2017-03-01T11:33:23.740

Reputation: 63

Can you see its attributes with stat *? – dirkt – 2017-03-01T15:38:22.413

Gordon Davisson provided the solution in an answer beneath. I got it working by a workaround: I opened the webinterface in my QNAP and used the File Station to rename the folder. After renaming, it had the d in the permissions list and I could access it. – cPu – 2017-03-02T20:37:41.283

Answers

10

This is a guess, but... I suspect there's a carriage return at the end of the folder's name. Depending on the exact ls command you're using, it may be putting / at the end of the folder name but the carriage return makes that show up at the beginning of the line, overwriting the d that'd normally be there. Try listing it with ls -l | cat -vet, which will translate normally-invisible characters into visible ones. If I'm right, it'll show up as something like:

$ ls -l | cat -vet
drwx------    7 1000     1000          4.0k Mar  1 09:11 Folder Name^M$

(where the ^M represents the carriage return, and the $ is the end of line marker.)

If I'm right you can fix it by renaming and using bash's tab completion to get the name right. Type in something like mv Folder<tab> and it should fill in the rest of the name including nonprinting characters; then enter a new (corrected) name for it and you should be ok.

Gordon Davisson

Posted 2017-03-01T11:33:23.740

Reputation: 28 538

Thank you very much! This is the solution. Good job!

I used <tab> for bash completion in the first place, but I had this folder already without the invisible tab and thats why I could not see it. – cPu – 2017-03-02T20:33:09.380

1ls -lb should work as well. – kasperd – 2017-03-25T16:37:54.580