TracyTiger wrote:You may want to go back to basics...
To be honest, no.
...check what is actually executing.
But for you I make an attempt.
which -a ls
alias
whereis ls
For me there is only 1 ls executable on the system the rest are symbolic links. But perhaps another
ls file snuck onto your system.
Please note, my computers are not sluts, nor I am slovently, so nothing can creep in. I hope it's not something like Ebola. But I thank you for your worry. For your reassurance:
A normal user on an xfce4-terminal:
Code: Select all
westms[~]$ which ls
/usr/bin/ls
westms[~]$
westms[~]$ whereis ls
ls: /bin/ls /usr/bin/ls /usr/X11R6/bin/ls /usr/bin/X11/ls /usr/X11/bin/ls /usr/man/man1/ls.1.gz /usr/share/man/man1/ls.1.gz /usr/X11/man/man1/ls.1.gz
westms[~]$
westms[~]$ file /bin/ls /usr/bin/ls /usr/X11R6/bin/ls /usr/bin/X11/ls /usr/X11/bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), stripped
/usr/bin/ls: symbolic link to `../../bin/ls'
/usr/X11R6/bin/ls: symbolic link to `../../bin/ls'
/usr/bin/X11/ls: symbolic link to `../../bin/ls'
/usr/X11/bin/ls: symbolic link to `../../bin/ls'
westms[~]$
westms[~]$ alias
alias ap='apropos'
alias la='ls -al'
alias ll='ls -l'
alias ls='ls --color=auto'
alias sipa='publicip.rb -i'
westms[~]$
westms[~]$ env | grep LS_OPTIONS
LS_OPTIONS=-F -b -T 0 --color=auto
westms[~]$
User root on an xfce4-terminal:
Code: Select all
westms[~]$ su
Passwort:
root[westms]# cd
root[~]#
root[~]# which ls
/bin/ls
root[~]#
root[~]# whereis ls
ls: /bin/ls /usr/bin/ls /usr/X11R6/bin/ls /usr/bin/X11/ls /usr/X11/bin/ls /usr/man/man1/ls.1.gz /usr/share/man/man1/ls.1.gz /usr/X11/man/man1/ls.1.gz
root[~]#
root[~]# file /bin/ls /usr/bin/ls /usr/X11R6/bin/ls /usr/bin/X11/ls /usr/X11/bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), stripped
/usr/bin/ls: symbolic link to `../../bin/ls'
/usr/X11R6/bin/ls: symbolic link to `../../bin/ls'
/usr/bin/X11/ls: symbolic link to `../../bin/ls'
/usr/X11/bin/ls: symbolic link to `../../bin/ls'
root[~]# alias
root[~]#
root[~]# env | grep LS_OPTIONS
root[~]#
A good nose you have. No LS_OPTIONS for user root on an xfce4-terminal. But I did not remove it.
Gives a bad output on an xfce4-terminal.
root[~]# ls --color=auto
Gives a correct output on an xfce4-terminal!
env | grep LS_OPTIONS (on a tty as root gives)
LS_OPTIONS=-F -b -T 0 --color=auto
ls -C on a tty gives a correct output.
ls -C on a tty from within a bash script gives a bad output.
(man ls says "-C list entries by columns")
The collected output on a tty from a bash script, owner root :
Code: Select all
which ls >>/tmp/on_a_tty.txt
/usr/bin/ls
whereis ls >>/tmp/on_a_tty.txt
ls: /bin/ls /usr/bin/ls /usr/X11R6/bin/ls /usr/bin/X11/ls /usr/X11/bin/ls /usr/man/man1/ls.1.gz /usr/share/man/man1/ls.1.gz /usr/X11/man/man1/ls.1.gz
file /bin/ls /usr/bin/ls /usr/X11R6/bin/ls /usr/bin/X11/ls /usr/X11/bin/ls >>/tmp/on_a_tty.txt
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), stripped
/usr/bin/ls: symbolic link to `../../bin/ls'
/usr/X11R6/bin/ls: symbolic link to `../../bin/ls'
/usr/bin/X11/ls: symbolic link to `../../bin/ls'
/usr/X11/bin/ls: symbolic link to `../../bin/ls'
alias >>/tmp/on_a_tty.txt
env | grep LS_OPTIONS >>/tmp/on_a_tty.txt
LS_OPTIONS=-F -b -T 0 --color=auto
ls -C /etc >>/tmp/on_a_tty.txt
ConsoleKit group polkit-1
DIR_COLORS group- ppp
HOSTNAME gshadow printcap
ImageMagick-6 gshadow- profile
UPower gtk-2.0 profile.d
X11 gtk-3.0 protocols
a2ps-site.cfg hardwareclock radiusclient
[rest skiped]
The script itself::
Code: Select all
#/bin/bash
cd /etc >/tmp/on_a_tty.txt
printf "%s\n" 'which ls >>/tmp/on_a_tty.txt' >>/tmp/on_a_tty.txt
which ls >>/tmp/on_a_tty.txt
printf "%s\n" 'whereis ls >>/tmp/on_a_tty.txt' >>/tmp/on_a_tty.txt
whereis ls >>/tmp/on_a_tty.txt
printf "%s\n" 'file /bin/ls /usr/bin/ls /usr/X11R6/bin/ls /usr/bin/X11/ls /usr/X11/bin/ls >>/tmp/on_a_tty.txt' >>/tmp/on_a_tty.txt
file /bin/ls /usr/bin/ls /usr/X11R6/bin/ls /usr/bin/X11/ls /usr/X11/bin/ls >>/tmp/on_a_tty.txt
printf "%s\n" 'alias >>/tmp/on_a_tty.txt' >>/tmp/on_a_tty.txt
alias >>/tmp/on_a_tty.txt
printf "%s\n" 'env | grep LS_OPTIONS >>/tmp/on_a_tty.txt' >>/tmp/on_a_tty.txt
env | grep LS_OPTIONS >>/tmp/on_a_tty.txt
printf "%s\n" 'ls -C /etc >>/tmp/on_a_tty.txt' >>/tmp/on_a_tty.txt
ls -C /etc >>/tmp/on_a_tty.txt
There is an alias for ls however which uses the $LS_OPTIONS variable.
env | grep LS_OPTIONS
For me this shows a tab setting of 0 (-T 0). Perhaps it's different for root on your system.
LS_OPTIONS=-F -b -T 0 --color=auto
Remember that the environmental variables can vary greatly depending upon how you run a program as an other user. (e.g. "sudo su" versus "sudo su -")
Please look in the listings above.
EDIT: In bash "type ls" will show which ls command will execute, an alias or an executable file. "type -a ls" will show all possibilities. Other operating systems used to give you this information as part of the which command.
On an xfce4-terminal:
Code: Select all
root[etc]# type ls
ls is hashed (/bin/ls)
root[etc]# type -a ls
ls ist /bin/ls
ls ist /usr/bin/ls
root[etc]#
On a tty:
Code: Select all
# type ls
ls ist ein Alias von `/bin/ls $LS_OPTIONS'.
#
# type -a ls
ls ist ein Alias von `/bin/ls $LS_OPTIONS'.
ls ist /usr/bin/ls
ls ist /bin/ls
#
# env | grep LS_OPTIONS
LS_OPTIONS=-F -b -T 0 --color=auto
I wonder if it's possible for a setting in $LS_COLORS to cause this? This can be tested by clearing $LS_COLORS.
Correction:
I answerd with a wrong information. Correct is:
$LS_COLORS is always empty on an xfce4-terminal, whether a normal user or user root. $LS_COLORS is always filled with a long text string on a tty, whether a normal user or user root.
The bash login shell on a tty works different than the skipt computing bash on a tty and the bash login shell on a tty works different than the bash login shell on an xfce4-terminal.
Are your configuration files restored from a backup after a fresh installation on a clean disk? Are the configuration files new from the automatic installation and configuration work? Or did you install over an older installation? My configuration files are not from a backup. Its all Salix home made.
Added:
Meanwhile, I have gained the impression that it is related to the tab width. Command ls uses space characters to fill small gaps intervals between columns. It uses tabs and spaces if the free space is larger. Maybe ls uses a different tab width, than the termnals. From where ls gets the tab size to use?