SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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?
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.