2

I changed ownership of a folder to provide restricted access to some users (it previously was only visible to root) and after that, all files are now one color (bright green) and directories are blue. Logging out and back in with root, and altering the /etc/profile or .bashrc or .profile does not help. Strangely, all other directories on the hard drive have the normal default colors assigned to file types (in my scheme, image files are magenta, compressed archives are red, executables in bright green, etc...).

Changing ownership back to just root didn't resolve it.

Does anyone know what to make of this? How could one directory have different color settings for file types when the bash profile of the user (root) has a single default ls alias (ls --color=auto)

I am not a linux wiz (clearly), so I may be missing something obvious. And yes, I know, I should not be logging in as root, and I usually use another username. But I would appreciate any help here, as I have run out of ideas.

Update:

changing permissions for a given file in this directory (removing executable rights for a .png file) does not change the color...

Here is the output of echo $LS COLORS:

root@lplough-ubuntu:~$ echo $LS_COLORS
rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.as![enter image description here][1]f=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:

ls -l:

image

  • 1
    Look at the output of ls -l to see what permissions the directories and files actually have. – peterph Dec 16 '14 at 17:38
  • And if that doesn't explain it, post the output of echo $LS_COLORS and at least some of the ls -l output. – cjm Dec 16 '14 at 17:40
3

The most likely scenario is that you accidentally gave all files in the directory execute permission.

  • Ok. Is it as simple is removing all execution permissions? I'm not sure I want to do that for all files.... – user95146 Dec 16 '14 at 17:40
  • If you have executables set to display bright green, then files with executable permission will display as bright green, regardless of whether they can actually be executed without error. To remove that highlighting, you'd need to fix their permissions. – cjm Dec 16 '14 at 17:42
  • removing executable permissions does not change the color of a few test files... – user95146 Dec 16 '14 at 17:56
  • 1
    According to the LS_COLORS you posted, the only bright green files should be executables. Post some ls -l output. – cjm Dec 16 '14 at 18:05
  • Thanks cjm. I just removed x rights and that restored the expected color. I suppose I will need to go through each file and remove executable rights...of course, some files I want to have x rights, so that will be a manual process. – user95146 Dec 16 '14 at 18:43

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.