11

I just copied a directory from a USB flash drive. I copied it from an NTFS drive and so all the files had execute permission.

I executed chmod -x * to undo the execute permission. Despite that, all the directories are showing with green background, which is normally only for executable files.

What could be the reason?

Attached image: output of "ls -al"

7
  • A directory that isn't executable can't have its contents listed properly - this probably isn't what you want. Commented Sep 25, 2014 at 8:12
  • can you cd to those dir as normal user ? I guess no, x is needed for that. Commented Sep 25, 2014 at 8:13
  • @Archemar - I can cd to those commands, but when i do, . and .. show up with green background as well. Commented Sep 25, 2014 at 8:16
  • @MichaelHomer - I have gone through it, and in my case there are no special permission associated either. Also, I went through the answers on that question and my query is not satisfied. Commented Sep 25, 2014 at 8:16
  • Try reading the first (accepted) answer in the duplicate: "Blue text with green background indicates that a directory is writable by others apart from the owning user and group, and does not have the sticky bit set". That is exactly what you have. Commented Sep 25, 2014 at 8:18

1 Answer 1

17

A green background means that the directory has write permission for others, not that it is traversible. Remove these privileges instead:

chmod o-rw * 
2
  • 1
    Thanks, that worked! Can you please elaborate your answer a bit? I didn't quite understand the reason. Commented Sep 25, 2014 at 8:17
  • 1
    Each file or directory has three classes of access control: "user", "group", and "others" (which matches anyone who's not the owner of the file or a member of the group); each one can have a read/write/execute privileges. Directories which are writable by "others" appear (by default) on a green background. Commented Sep 25, 2014 at 8:22

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.