Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
|
11-20-2007, 12:05 PM
|
#1
|
LQ Newbie
Registered: Aug 2005
Posts: 22
Rep:
|
"more" command
hi,
i've used linux before so i know how to use some commands like the "more" command.
when i use it in linux, the first page of the file i view looks fine. but when i press space bar to view the next page, all of the text gets highlighted. pressing space to get to the end of the file does not change anything- the rest of the file is all highlighted. pressing "q" to prematurely quit does not remove the highlighting either.
to make matters worse, when i get back to the command line, everything is still highlighted. so even when i do a "ls" command, the listing of files/directories is all in this highlight.
i don't recall this being the behavior of the "more" command in my home distro. so i don't expect it to be the case here at work either. can someone please help me here? is there an env variable that's not set correctly or something else?
the following is additional info, though some of it may not be necessary.
1] this linux distro is red hat, though i'm not sure which version. i think it is fairly new.
2] using the "less" command instead of "more" does not change anything.
3] my definition of "highlight" is, say when i login i have a white background with black text in my xterm. when i do a "more" command, text gets highlighted such that ALL text is now white immersed in a black background!
4] one way to reverse the effects of this highlight, besides logging out and logging back in, is to "vi" a file. once in the file, the highlighting disappears. i can immediately exit the file and everything appears to have returned to normal....that is until the next time i do a "more" on a file.
can someone help me out here?
thanks, edward
Last edited by esl537; 11-20-2007 at 12:10 PM.
Reason: spelling errors
|
|
|
11-20-2007, 12:34 PM
|
#2
|
LQ Guru
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,354
|
I think that the problem may be in which terminal emulator you are using. Try changing your terminal to xterm and see if the problem goes away. Enter these commands before going through the "less", "more", and "vi" test again.
echo $TERM
TERM=xterm
export TERM
----------------
Steve Stites
|
|
|
11-20-2007, 01:02 PM
|
#3
|
LQ Newbie
Registered: Aug 2005
Posts: 22
Original Poster
Rep:
|
hi,
thanks for responding.
i checked the TERM var with the echo command and i got back that xterm was the setting. but i went through with the commands suggested anyways.
i came across a problem when i tried doing the second command. i looked around at how to give the command so that i wouldn't get an error and found i had to do: setenv TERM xterm
i also ran across a problem with the export command. a search suggested that to use the export command, i have to be in the "bash" shell. i did an echo $SHELL and found that i am using the "tcsh" shell.
i suppose getting an error on the second command above should have hinted that there might be a shell discrepancy.
anyways, given that i am in the tcsh shell, do you (or anyone else reading this) have any suggestions on what to do? maybe a different command for export?
thanks, edward
--------------------------
Quote:
Originally Posted by jailbait
I think that the problem may be in which terminal emulator you are using. Try changing your terminal to xterm and see if the problem goes away. Enter these commands before going through the "less", "more", and "vi" test again.
echo $TERM
TERM=xterm
export TERM
----------------
Steve Stites
|
|
|
|
11-20-2007, 03:10 PM
|
#4
|
LQ Guru
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,354
|
"i suppose getting an error on the second command above should have hinted that there might be a shell discrepancy."
"anyways, given that i am in the tcsh shell, do you (or anyone else reading this) have any suggestions on what to do? maybe a different command for export?"
I don't know anything about tcsh. I used google to find out that Red Hat has created their own unique shell with tcsh. I think that bash using xterm will work the way that you want but I don't know what combination will work correctly with tcsh.
----------------
Steve Stites
|
|
|
11-20-2007, 04:04 PM
|
#5
|
LQ Newbie
Registered: Aug 2005
Posts: 22
Original Poster
Rep:
|
i don't think this is shell related. i changed my shell to bash and confirmed it by checking the $SHELL variable. and yet, i still have the same problem.
so then i went back and did the 3 steps:
echo $TERM
TERM=xterm
export TERM
and i still got the same "highlighting" problem.
are there any other suggestions?
thanks, edward
[QUOTE=jailbait;2965696
I don't know anything about tcsh. I used google to find out that Red Hat has created their own unique shell with tcsh. I think that bash using xterm will work the way that you want but I don't know what combination will work correctly with tcsh.
----------------
Steve Stites[/QUOTE]
|
|
|
11-20-2007, 04:29 PM
|
#6
|
Member
Registered: Nov 2007
Location: Vinsobres - Drome - France
Distribution: SuSE Linux 11.3
Posts: 152
Rep:
|
Try on full text screen
Hi,
There are many reasons to your problem.
First of all: which distro do you use ?
On Ubuntu I met some strange things I never meet on other disros.
Do you use alias command ?
type "alias" in your shell and you 'll see alias in use
Did you try under a full text environment not a terminal under graphical display ?
Do you try "more" on several files or only on 1 file ?
Fantasio
|
|
|
11-20-2007, 04:34 PM
|
#7
|
Member
Registered: Nov 2007
Location: Vinsobres - Drome - France
Distribution: SuSE Linux 11.3
Posts: 152
Rep:
|
To discard a shell, try with an other one , such as bash by calling the shell on the command line ...
/tmp> /bin/bash
me@localhost:/tmp> exit
/tmp>
Type exit to leave launched subshell.
|
|
|
11-20-2007, 04:42 PM
|
#8
|
LQ Newbie
Registered: Aug 2005
Posts: 22
Original Poster
Rep:
|
hi
thanks for writing
the distro is red hat.
i do not alias "more" to anything.
i have tried "more" on several files and they are all the same.
any other suggestions would be appreciated.
thanks, edward
Quote:
Originally Posted by Fantasio
Hi,
There are many reasons to your problem.
First of all: which distro do you use ?
On Ubuntu I met some strange things I never meet on other disros.
Do you use alias command ?
type "alias" in your shell and you 'll see alias in use
Did you try under a full text environment not a terminal under graphical display ?
Do you try "more" on several files or only on 1 file ?
Fantasio
|
|
|
|
11-20-2007, 04:43 PM
|
#9
|
LQ Newbie
Registered: Aug 2005
Posts: 22
Original Poster
Rep:
|
thanks for this information. it will be useful in the future.
however, i do not think this is a shell problem.
any other suggestions would be appreciated.
thanks, edward
Quote:
Originally Posted by Fantasio
To discard a shell, try with an other one , such as bash by calling the shell on the command line ...
/tmp> /bin/bash
me@localhost:/tmp> exit
/tmp>
Type exit to leave launched subshell.
|
|
|
|
11-20-2007, 06:33 PM
|
#10
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,397
|
Once the term def gets confused, changing the shell doesn't necessarily fix it.
Either change your shell entry to /bin/bash in the /etc/passwd file and logout/in or create a new user with bash as their /etc/passwd setting and login as them.
|
|
|
11-21-2007, 03:16 AM
|
#11
|
Member
Registered: Nov 2007
Location: Vinsobres - Drome - France
Distribution: SuSE Linux 11.3
Posts: 152
Rep:
|
Change your shell
If you change the shell in "/etc/passwd", you change it permanently.
It's not the best way to discard a shell.
Therefore, it's probably due to a TERM bug.
How can you test it ? It's quite easy ...
export TERM=vt400
Xterm version ?
Distribution full name ? RedHat Fedora Core 6 ?
Do you take a look on redhat support regarding to your version ?
|
|
|
11-21-2007, 10:42 AM
|
#12
|
LQ Newbie
Registered: Aug 2005
Posts: 22
Original Poster
Rep:
|
actually, i did not do it the way suggested by the other responder. i changed it through our company's IT dept. at our company, we have two choices- either to use tcsh or bash as the default shell. (though this does not prevent us from invoking othershells as suggested.)
anyways, i changed to bash such that now when i login, it is a bash shell by default.
but this aside, the shell has nothing to do with this problem. i'm quite certain it is a terminal problem. is it possible that even though the TERM var is xterm, that in reality, it isn't xterm? or maybe it is some screwed up version of xterm emulation?
does anyone else have any other suggestions?
thanks, edward
Quote:
Originally Posted by chrism01
Once the term def gets confused, changing the shell doesn't necessarily fix it.
Either change your shell entry to /bin/bash in the /etc/passwd file and logout/in or create a new user with bash as their /etc/passwd setting and login as them.
|
|
|
|
11-21-2007, 11:22 AM
|
#13
|
LQ Newbie
Registered: Aug 2005
Posts: 22
Original Poster
Rep:
|
the system is using redhat fedora core 2.
this definitely a TERM bug.
Quote:
Originally Posted by Fantasio
If you change the shell in "/etc/passwd", you change it permanently.
It's not the best way to discard a shell.
Therefore, it's probably due to a TERM bug.
How can you test it ? It's quite easy ...
export TERM=vt400
Xterm version ?
Distribution full name ? RedHat Fedora Core 6 ?
Do you take a look on redhat support regarding to your version ?
|
|
|
|
11-22-2007, 06:00 AM
|
#14
|
Member
Registered: Nov 2007
Distribution: Fedora, CentOS,
Posts: 72
Rep:
|
Quote:
Originally Posted by esl537
the system is using redhat fedora core 2.
this definitely a TERM bug.
|
You probably should check ~/.bashrc where probably it is set what your envirement should be like, or as I see you are only a user so maybe you should check with your sysadmin, it (the envirement) could be set on /etc/bashrc as well.
|
|
|
11-22-2007, 12:35 PM
|
#15
|
Member
Registered: Nov 2007
Location: Vinsobres - Drome - France
Distribution: SuSE Linux 11.3
Posts: 152
Rep:
|
on peut imaginer un problème réseau, une carte qui déconne ou un switch qui défaille
|
|
|
All times are GMT -5. The time now is 04:58 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|