
実現したいこと
- WSL上で実行可能ファイルであっても拡張子ごとに色分けしてlsコマンドで表示したい。
質問
WSLでubuntuを使っているのですが、/mnt 以下のファイルは全て実行可能ファイルとして全て緑で表示されてしまいます。ファイル数が多くとても見ずらいため、実行可能ファイルであっても拡張子ごとに色分けして表示させたいです。どのようにしたらよいでしょうか。
以下に貼り付けたdircolorsの最も下にある”EXEC”のオプションが実行可能ファイルの色を決めていると思うのですが、このオプションを付けてもつけなくても色が統一されてしまいます。
ホーム上にあるdircolors
TERM Eterm TERM ansi TERM color-xterm TERM con132x25 TERM con132x30 TERM con132x43 TERM con132x60 TERM con80x25 TERM con80x28 TERM con80x30 TERM con80x43 TERM con80x50 TERM con80x60 TERM cons25 TERM console TERM cygwin TERM dtterm TERM eterm-color TERM gnome TERM gnome-256color TERM jfbterm TERM konsole TERM kterm TERM linux TERM linux-c TERM mach-color TERM mlterm TERM putty TERM rxvt TERM rxvt-256color TERM rxvt-cygwin TERM rxvt-cygwin-native TERM rxvt-unicode TERM rxvt-unicode-256color TERM rxvt-unicode256 TERM screen TERM screen-256color TERM screen-256color-bce TERM screen-bce TERM screen-w TERM screen.rxvt TERM screen.linux TERM terminator TERM vt100 TERM xterm TERM xterm-16color TERM xterm-256color TERM xterm-88color TERM xterm-color TERM xterm-debian # Below are the color init strings for the basic file types. A color init # string consists of one or more of the following numeric codes: # Attribute codes: # 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed # Text color codes: # 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white # Background color codes: # 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white #NORMAL 00 # no color code at all #FILE 00 # regular file: use no color at all RESET 0 # reset to "normal" color DIR 38;5;111;01 # directory LINK 01;36 # symbolic link. (If you set this to 'target' instead of a # numerical value, the color is as for the file pointed to.) MULTIHARDLINK 00 # regular file with more than one link FIFO 40;33 # pipe SOCK 01;35 # socket DOOR 01;35 # door BLK 40;33;01 # block device driver CHR 40;33;01 # character device driver ORPHAN 40;31;01 # symlink to nonexistent file, or non-stat'able file SETUID 37;41 # file that is setuid (u+s) SETGID 30;43 # file that is setgid (g+s) CAPABILITY 30;41 # file with capability STICKY_OTHER_WRITABLE 30;42 # dir that is sticky and other-writable (+t,o+w) #OTHER_WRITABLE 34;42 # dir that is other-writable (o+w) and not sticky OTHER_WRITABLE 38;5;117;01 # dir that is other-writable (o+w) and not sticky STICKY 37;44 # dir with the sticky bit set (+t) and not other-writable # EXEC 38;5;144 # This is for files with execute permission: # 以下拡張子の色設定 .txt 38;5;208 等... : : :

lsのソースdebを取ってきて、思う存分書き換えてあげてください。
