Register
It is currently Thu Feb 22, 2018 10:32 am

Linux, colors in bash shell


All times are UTC


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 PostPosted: Tue Apr 19, 2011 8:53 pm   
Site Admin
User avatar

Joined: Thu Apr 17, 2003 3:44 am
Posts: 12300
Location: Iowa
http://linux-sxs.org/housekeeping/lscolors.html
Quote:
COLORS-Lscolors

From: Bartman

Here is an easy way to set different colours for different kinds of files when using the ls command.

Add the following lines to the bottom of your ~/.bashrc file -

alias ls='ls --color'
LS_COLORS='di=1:fi=0:ln=31:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=35:*.rpm=90'
export LS_COLORS

The first line makes ls use the --color parameter by default, which tells ls to display files in different colours based on the setting of the LS_COLORS variable.

The second line is the tricky one, and what I have worked out so far has been by trial and error. The parameters (di, fi, etc.) refer to different Linux file types. I have worked them out as shown

di = directory
fi = file
ln = symbolic link
pi = fifo file
so = socket file
bd = block (buffered) special file
cd = character (unbuffered) special file
or = symbolic link pointing to a non-existent file (orphan)
mi = non-existent file pointed to by a symbolic link (visible when you type ls -l)
ex = file which is executable (ie. has 'x' set in permissions).


pretty cool...read more at the above link. Hadn't ever did this this way before myself...

_________________

Zbook (Laptop)- Mint 18 64-bit - I7-4800mq - 32GB ram
Phantom (Desktop)- Mint 64-bit - i7-5770 - 32GB ram
Nas4Free (NAS) - 6X3TB File Server.
Sky (HP BladeCenter) - 16 blades - 536 GB ram-G7/G6/G5 blades.


Top
 Profile WWW  
 PostPosted: Tue Apr 19, 2011 10:04 pm   
Sr. Member

Joined: Sun Dec 12, 2004 6:08 am
Posts: 1200
Location: Cupertino, CA
That seems pretty handy. I've been carrying around my .bashrc and .dircolors files since I first started using Gentoo ages ago, but it's kind of messy.


Top
 Profile  
 PostPosted: Tue Apr 19, 2011 11:19 pm   
Linux Guru
User avatar

Joined: Sat Apr 03, 2004 12:39 am
Posts: 12346
Location: Clinton Township, Michigan
This is the kind of stuff to store in a "place in the Cloud", then you can retrieve it no matter where you happen to be at the time, as long as you are connected to a public network.

_________________
Brian Masinick
Distros: MX-16, antiX, Debian


Top
 Profile WWW YIM  
 PostPosted: Wed Apr 20, 2011 1:28 pm   
Site Admin
User avatar

Joined: Thu Apr 17, 2003 3:44 am
Posts: 12300
Location: Iowa
usalug has always been ,my "cloud storage" :)

_________________

Zbook (Laptop)- Mint 18 64-bit - I7-4800mq - 32GB ram
Phantom (Desktop)- Mint 64-bit - i7-5770 - 32GB ram
Nas4Free (NAS) - 6X3TB File Server.
Sky (HP BladeCenter) - 16 blades - 536 GB ram-G7/G6/G5 blades.


Top
 Profile WWW  
 PostPosted: Wed Apr 20, 2011 3:24 pm   
Linux Guru
User avatar

Joined: Sat Apr 03, 2004 12:39 am
Posts: 12346
Location: Clinton Township, Michigan
crouse wrote:
usalug has always been ,my "cloud storage" :)


I use USALUG and a variety of forum sites for a significant percentage of my Cloud storage too! :-)

_________________
Brian Masinick
Distros: MX-16, antiX, Debian


Top
 Profile WWW YIM  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


Powered by phpBB © 2012 phpBB Group
© 2003 - 2012 USA LINUX USERS GROUP