LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-05-2017, 02:43 AM   #1
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,068

Rep: Reputation: 148Reputation: 148
setting LS_OPTIONS?


I want to alias ls, aliased (default) in /etc/profile.d/coreutils-dircolors.sh, /etc/profile.d/coreutils-dircolors.csh. After editing, then for one ls type, I get error below.

Code:
d@cosmos:~$ ls -w --width=0
/bin/ls: invalid line width: ‘--width=0’
If you weren't sure, it's valid, below ('man ls.')

Code:
-w, --width=COLS
              set output width to COLS.  0 means no limit
The error happened even after moving /etc/profile.d/coreutils-dircolors* to /root, then using 'upgradepkg --reinstall' for coreutils, rebooting. Now I see others extended LS_OPTIONS in /etc/profile, but is there a way I can fix ls (even modify options) without reinstalling?

Last edited by dchmelik; 10-05-2017 at 02:55 AM.
 
Old 10-05-2017, 02:52 AM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,233

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Quote:
ls -w --width=0
You don't need both -w and --width=0. Try ls --width=0, works for me on 14.2 64 bit Slackware.

You can also use the syntax 'ls -w 0' ( without the quotes ). I played with the width up to 200 in increments of 20. Works like a charm.

Last edited by camorri; 10-05-2017 at 02:57 AM.
 
1 members found this post helpful.
Old 10-05-2017, 02:58 AM   #3
dchmelik
Senior Member
 
Registered: Nov 2008
Location: USA
Distribution: Slackware, FreeBSD, Illumos, NetBSD, DragonflyBSD, Plan9, Inferno, OpenBSD, FreeDOS, HURD
Posts: 1,068

Original Poster
Rep: Reputation: 148Reputation: 148
Okay, so it was a syntax error; I guess I didn't corrupt the files. But for the rest of the topic, is it okay to edit those files, or is there a better way to set LS_OPTIONS in /etc/profile and/or .bashrc?
 
Old 10-05-2017, 03:14 AM   #4
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,233

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Quote:
is it okay to edit those files, or is there a better way to set LS_OPTIONS in /etc/profile and/or .bashrc?
I have alias(s) in both areas. They are both conf plain text files, so I see no reason not to edit them, it is your system to do with as you see fit. I think it just depends what you want to accomplish which file best suits your need.
 
1 members found this post helpful.
Old 10-05-2017, 11:51 AM   #5
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by dchmelik View Post
is it okay to edit those files, or is there a better way to set LS_OPTIONS in /etc/profile and/or .bashrc?
It's absolutely ok to modify those files. I added --group-directories-first to the OPTIONS variable at the top of my coreutils-dircolors.sh file, which is then used in LS_OPTIONS further down.

However, these should only be modified if you want it to affect all users on the system (which isn't a big deal if it's just you on the system). If you want to make changes for just your user, you should use a ~/.bashrc or ~/.profile. Any aliases you set in those will override the ones set in coreutils-dircolors.sh

Just remember that stuff in /etc/ is system-wide. If you want it on a per-user basis, use your ~/.bashrc or ~/.profile
 
1 members found this post helpful.
  


Reply



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
The LS_OPTIONS variable. stf92 Slackware 6 06-01-2013 01:34 PM
[SOLVED] Changing LS_OPTIONS alias in Opensuse 11.4 corp769 SUSE / openSUSE 2 10-06-2011 05:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:38 PM.

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
Open Source Consulting | Domain Registration