Kitz Forum

Computer Software => Linux => Topic started by: tickmike on February 14, 2018, 11:14:22 AM

Title: Terminal Output !.
Post 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.
Title: Re: Terminal Output !.
Post by: roseway on February 14, 2018, 12:57:16 PM
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.
Title: Re: Terminal Output !.
Post by: jelv on February 14, 2018, 04:11:10 PM
From googling try running this:

Code: [Select]
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
Title: Re: Terminal Output !.
Post by: broadstairs on February 14, 2018, 04:21:59 PM
Certainly on my openSUSE Tumbleweed system nothing flashes, although the text is all colours of the rainbow  ;)

Stuart
Title: Re: Terminal Output !.
Post by: burakkucat on February 14, 2018, 05:37:37 PM
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.
Title: Re: Terminal Output !.
Post by: burakkucat on February 14, 2018, 10:08:20 PM
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
Title: Re: Terminal Output !.
Post by: petef on February 15, 2018, 04:12:58 PM
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

Title: Re: Terminal Output !.
Post by: tickmike on February 16, 2018, 12:57:54 AM
Thanks all, interesting  :D