WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: getting LS_COLORS and or .dircolors to work with Tiny Core  (Read 1549 times)

Offline Rudock1

  • Jr. Member
  • **
  • Posts: 62
getting LS_COLORS and or .dircolors to work with Tiny Core
« on: January 30, 2017, 01:33:29 PM »
Hi all,

I have previously switched to using the GNU core utilities (coreutils.tcz).  I was wondering (after my many failed attempts) if anybody has successfully used either the LS_COLORS environment setting or the .dircolors configuration file.  I tried various edits to .profile, or .ashrc or .bashrc but I never found the right combination of tweaks to make them work.  I use both simple command line and X GUI (with its terminal apps).

If you have something, would you might sharing a few snippets or describing your solutions?  I'd appreciate it.

Thanks
Billy

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: getting LS_COLORS and or .dircolors to work with Tiny Core
« Reply #1 on: January 30, 2017, 02:20:08 PM »
I use aliases in  ~/.ashrc
Code: [Select]
if [ -e /usr/local/tce.installed/coreutils ]; then
alias vdir='vdir --color=auto --group-directories-first'
alias ls='ls -p --color=auto --group-directories-first'
else
alias ls='ls -p --color=auto'
fi
#alias ll='ls -l'
#alias la='ls -la'
alias l='ls -aCFh'
alias ll='ls -aFhlL'
alias la='ls -aFl'
alias dir='ls -acCFhl'
alias lr='ls -AFhlt | head'
Download a copy and keep it handy: Core book ;)

Offline Rudock1

  • Jr. Member
  • **
  • Posts: 62
Re: getting LS_COLORS and or .dircolors to work with Tiny Core
« Reply #2 on: January 30, 2017, 07:10:37 PM »
Thanks, Misalf, I appreciate the alias hints and will use two right away.

However, the part about LS_COLORS or .dircolors that intrigues me is the ability to set different colors for different file extensions types. I'm hoping to use separate colors for *.dep and *.tcz, for example.

Thx
Billy

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: getting LS_COLORS and or .dircolors to work with Tiny Core
« Reply #3 on: January 30, 2017, 07:54:49 PM »
Got it working like so:
Code: [Select]
dircolors --print-database > ~/.dircolors
Then, after editing  ~/.dircolors  (I added .tcz 00;36)
Code: [Select]
eval "$(dircolors ~/.dircolors)"

I guess the second command would go in  .ashrc , not sure.
Download a copy and keep it handy: Core book ;)