LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-15-2010, 03:24 PM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,535

Rep: Reputation: 51
ls: making it read an option from a file.


Hi:

I want to use ls option --color = none. Is there a file where I can put this option to make ls read it each time ls is executed? Regards.
 
Old 11-15-2010, 03:32 PM   #2
tuxtutorials
Member
 
Registered: Dec 2008
Location: New York
Distribution: RedHat, Solaris
Posts: 68

Rep: Reputation: 16
Have you checked /etc/DIR_COLORS? The colors are stored in shell variable LS_COLORS
 
Old 11-15-2010, 03:39 PM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
On most systems the ls command is aliased to include a number of default options. For example on my OpenSuse box I have:
Code:
$ type ls
ls is aliased to `ls $LS_OPTIONS'
$ alias ls
alias ls='ls $LS_OPTIONS'
$ echo $LS_OPTIONS
-N --color=tty -T 0
so that you can simply change the alias or the value of the LS_OPTIONS environment variable. Put the new definitions in your $HOME/.bashrc and the trick is done.
 
Old 11-15-2010, 03:40 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,533

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Probably you have an alias set which activates colouring - try "alias" from a terminal.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making the - - prefix option required when installing an RPM package sandricky Linux - Software 3 02-09-2009 12:24 AM
Making TSO option persistent across reboot?? Brad.Scalio@noaa.gov Linux - Networking 2 09-17-2007 09:00 AM
making option changes only as root in firefox degraffenried13 Linux - General 1 07-31-2004 04:45 PM
Making a file Read-only Kujila Linux - Software 9 02-08-2004 12:16 AM
Making Ark and KDE file manager read ZIP files. xode Linux - Software 3 10-13-2003 03:12 PM


All times are GMT -5. The time now is 10:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration