Kitz Forum
Computer Software => Linux => Topic started by: tickmike on February 14, 2018, 11:14:22 AM
-
If I put
ls /*
Why is some of the readout flashing ?. :hmm: in /sbin
eg /sbin udev-add-printer this bit is in red and flashing on and off at one second.
-
I guess it depends how ls is set up on your system. Some distros alias common commands to a preset version of the command. You could try "man ls".
[Edit] Also try "alias" which will tell you if your ls is an aliased version.
-
From googling try running this:
eval $(echo "no:global default;fi:normal file;di:directory;ln:symbolic link;pi:named pipe;so:socket;do:door;bd:block device;cd:character device;or:orphan symlink;mi:missing file;su:set uid;sg:set gid;tw:sticky other writable;ow:other writable;st:sticky;ex:executable;"|sed -e 's/:/="/g; s/\;/"\n/g') {
IFS=:
for i in $LS_COLORS
do
echo -e "\e[${i#*=}m$( x=${i%=*}; [ "${!x}" ] && echo "${!x}" || echo "$x" )\e[m"
done
}
Edit: also found this: http://linux-sxs.org/housekeeping/lscolors.html
-
Certainly on my openSUSE Tumbleweed system nothing flashes, although the text is all colours of the rainbow ;)
Stuart
-
I shall make a guess that the file name, udev-add-printer, in the /sbin/ directory is a broken symbolic link. I.e. the target file, to which udev-add-printer is a symbolic link, does not exist within the file system.
-
Here is an example which, I hope, will show what is happening --
$ cd /tmp
$ > phoo-phile
$ cd ~
$ ln -s /tmp/phoo-phile foo-file
$ ls -l
$ cd /tmp
$ ls -l
$ rm phoo-phile
$ cd ~
$ ls -l
-
ls on most systems is an alias to ls --color=auto
You can avoid the alias by quoting.
'ls' /*
The OP's problem is that ls is trying to display different colours for different file types: directories, executables, etc. The escape codes (sometimes known as ANSI codes) are incorrect for the terminal being used. The code being used for, say, green turns out to be the code for blink. The mapping is an enormous tangle involving the LS_COLORS and TERM environment variables and either terminfo or termcap. Let me offer what may be a simple solution, if it works.
export TERM=xterm
-
Thanks all, interesting :D