ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
The garbage you see are color escape codes, for colorizing the output in your terminal. This is often set up by making `ls` an alias to `ls --color=something`, in either /etc/profile or ~/.profile or ~/.bash_profile or one of the other similar profile files.
Here's an example from my machine, where my `ls` command is aliased:
Code:
sasha@reactor: alias
alias Eterm='/home/sasha/.wrapper-scripts/eterm-wrapper.sh'
alias d='dir'
alias dir='/bin/ls $LS_OPTIONS --format=vertical'
alias eterm='/home/sasha/.wrapper-scripts/eterm-wrapper.sh'
alias ls='/bin/ls $LS_OPTIONS'
alias mc='. /usr/share/mc/bin/mc-wrapper.sh'
alias mv='mv -bv'
alias nano='nano -m'
alias rxvt='/home/sasha/.wrapper-scripts/rxvt-wrapper.sh'
alias spkg='/usr/bin/src2pkg -Q -A -C -VV -W -R -a=x86_64 -p=/usr -f="-O2 -fPIC -Wall -mtune=native -march=native -pipe -fomit-frame-pointer"'
alias spkh='/usr/bin/src2pkg --help'
alias v='vdir'
alias vdir='/bin/ls $LS_OPTIONS --format=long'
alias xterm='/home/sasha/.wrapper-scripts/xterm-wrapper.sh'
sasha@reactor: echo $LS_OPTIONS
-F -b -T 0 --color=auto
sasha@reactor:
No, it's not a bug. It's a feature! It's an option of `ls` that's being put to use, probably set up by you (perhaps unknowingly) or your OS by default, or by your sysadmin if that's not you. Your OS wants you to have colored ls.
Read the `ls` man page, and the `bash` man page to read about aliases (or whatever shell you use, if not bash).
Comment out the entry in the .profile or /etc/profile or whatever file it is, where the alias is set, if you prefer not to have it turned on.
No, it's not a bug. It's a feature! It's an option of `ls` that's being put to use, probably set up by you (perhaps unknowingly) or your OS by default, or by your sysadmin if that's not you. Your OS wants you to have colored ls.
Read the `ls` man page, and the `bash` man page to read about aliases (or whatever shell you use, if not bash).
Comment out the entry in the .profile or /etc/profile or whatever file it is, where the alias is set, if you prefer not to have it turned on.
You're absolutely right. I set this manually in my .bashrc.user
Quote:
# set colors for ls
alias ls='ls --color'
LS_COLORS='di=34:fi=0:ln=35i=5:so=5:bd=5:cd=5r=31:mi=0:ex=32'
export LS_COLORS
I change the ls alias to "alias ls='ls --color-tty'" and the problem is solved.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.