How do I change the bg color of chmod 777 directories in tcsh?

7,284

Solution 1

I take it that this is output from ls, rather than tab-completion of shells? (I know at least one shell which can colourise shell tab-completions but you don't say, so I'll assume ls).

Use $LS_COLORS, often initialised via the dircolors(1) command. dircolors -p to see the defaults, take the output from the two systems and diff.

Drop the desired config into ~/.dircolors and then:

set d=$HOME/.dircolors
if ( -r $d ) eval `dircolors -c $d`

[modified from the info docs for dircolors invocation, in the coreutils package]

Solution 2

I would suggest changing both sticky-world-write and just regular sticky (its only purpose is world-write, right? usually at least) to the same value, namely ...37;44 which is white on a blue background. Much less annoying than the typical black on yellow which always calls for your attention and there is nothing suspicious going on.

Much less annoyed now (I tended and still tend to remove the o-w from everything I can find just so it doesn't show up that way with ls ;-). At least now if it is supposed to be world writeable, I can give it sticky as well, and then it will be fine.

dircolors -c .dircolors results in a setenv LS_COLORS '...' which is for c-shell. For bourne-shell (bash), you have to use dircolors -b.

Solution 3

Easy way

Just put

LS_COLORS="$LS_COLORS:ow=103;30;01"

at end of your .bashrc and reload (source ~/.bashrc) or logout and login.

Share:
7,284

Related videos on Youtube

notbrain
Author by

notbrain

Software architect, maker of things. FPV multirotor aerial video enthusiast. All of my code and snippets in questions/answers are WTFPL unless otherwise noted. "No plan survives first contact with implementation."

Updated on September 17, 2022

Comments

  • notbrain
    notbrain almost 2 years

    On my MacBook Pro, I have iTerm and use the (black background) Pastel color set. World writable directories show up with a yellow background behind grey text. This I can live with, since the grey is dark enough to still be visible when surrounded by the muted yellow color.

    But when I connect to my company's Slackware servers (via ssh and tcsh as my shell on the remote side), 777 directories show up as solid blocks of light green, as both bg and text color are identical (or close enough to make the text impossible to read).

    How do I change the color used for the backgrounds of world-readable (777) directories?

    Thanks!

    -Brian

  • Dennis Williamson
    Dennis Williamson almost 14 years
    To reproduce the gray on yellow, you'll probably want ow=103;30;01