Operating System - HP-UX
1833770 Members
2664 Online
110063 Solutions
New Discussion

attempt to alias ls -a causes wierd symbols and lines to appear

 
SOLVED
Go to solution
Eric Bakken
Regular Advisor

attempt to alias ls -a causes wierd symbols and lines to appear

recently i wanted to alias ls -a and i dont remember what i did but the results were that when i enter an ls command, it lists the files but at the bottom of the list, lines and symbols appear and i have to open a new console for the letters to show up normal again...
4 REPLIES 4
Mel Burslan
Honored Contributor
Solution

Re: attempt to alias ls -a causes wierd symbols and lines to appear

more than likely, wherever you run the ls command, you had some filenames starting with . (dot) character, which were not listed with plain ls command but became visble thanks to -a switch and one or more of these files had some ANSI control characters in it telling the terminal to change its behavior.

It is nothing new, but I usually end up where you are when I accidentally cat a binary file assuming it is text. Terminal emulators usually come with something called "reset terminal" which effectively restarts the code without hampering your connection but with the default settings, i.e., no goobledy-gook characters.

I have gotten myself into situations, where even the reset terminal did not help. I had to abort the session with a kill signal from another session. It happens every once in a while.

________________________________
UNIX because I majored in cryptology...
Steven E. Protter
Exalted Contributor

Re: attempt to alias ls -a causes wierd symbols and lines to appear

ls -1 > file

edit the file with vi

while read -r filename
do
rm $filename
done < file

This will delete the crazy files you don't want.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Eric Bakken
Regular Advisor

Re: attempt to alias ls -a causes wierd symbols and lines to appear

I tried going and removing the alias but it still does that with any ls command....

and i'm not exactly sure on what you want me to do Steven, I would be content with just getting my regular ls back
Kofi ARTHIABAH
Honored Contributor

Re: attempt to alias ls -a causes wierd symbols and lines to appear

Hi Eric:

Try
unalias ls
which ls
whereis ls

then try:

/usr/bin/ls

if this works for you then you might want to alias your ls to /usr/bin/ls.

Good luck.
Kofi
nothing wrong with me that a few lines of code cannot fix!