LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 11-20-2007, 12:05 PM   #1
esl537
LQ Newbie
 
Registered: Aug 2005
Posts: 22

Rep: Reputation: 15
"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
 
Old 11-20-2007, 12:34 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,354

Rep: Reputation: 553Reputation: 553Reputation: 553Reputation: 553Reputation: 553Reputation: 553
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
 
Old 11-20-2007, 01:02 PM   #3
esl537
LQ Newbie
 
Registered: Aug 2005
Posts: 22

Original Poster
Rep: Reputation: 15
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 View Post
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
 
Old 11-20-2007, 03:10 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,354

Rep: Reputation: 553Reputation: 553Reputation: 553Reputation: 553Reputation: 553Reputation: 553
"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
 
Old 11-20-2007, 04:04 PM   #5
esl537
LQ Newbie
 
Registered: Aug 2005
Posts: 22

Original Poster
Rep: Reputation: 15
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]
 
Old 11-20-2007, 04:29 PM   #6
Fantasio
Member
 
Registered: Nov 2007
Location: Vinsobres - Drome - France
Distribution: SuSE Linux 11.3
Posts: 152

Rep: Reputation: 19
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
 
Old 11-20-2007, 04:34 PM   #7
Fantasio
Member
 
Registered: Nov 2007
Location: Vinsobres - Drome - France
Distribution: SuSE Linux 11.3
Posts: 152

Rep: Reputation: 19
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.
 
Old 11-20-2007, 04:42 PM   #8
esl537
LQ Newbie
 
Registered: Aug 2005
Posts: 22

Original Poster
Rep: Reputation: 15
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 View Post
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
 
Old 11-20-2007, 04:43 PM   #9
esl537
LQ Newbie
 
Registered: Aug 2005
Posts: 22

Original Poster
Rep: Reputation: 15
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 View Post
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.
 
Old 11-20-2007, 06:33 PM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,397

Rep: Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777Reputation: 2777
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.
 
Old 11-21-2007, 03:16 AM   #11
Fantasio
Member
 
Registered: Nov 2007
Location: Vinsobres - Drome - France
Distribution: SuSE Linux 11.3
Posts: 152

Rep: Reputation: 19
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 ?
 
Old 11-21-2007, 10:42 AM   #12
esl537
LQ Newbie
 
Registered: Aug 2005
Posts: 22

Original Poster
Rep: Reputation: 15
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 View Post
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.
 
Old 11-21-2007, 11:22 AM   #13
esl537
LQ Newbie
 
Registered: Aug 2005
Posts: 22

Original Poster
Rep: Reputation: 15
the system is using redhat fedora core 2.

this definitely a TERM bug.


Quote:
Originally Posted by Fantasio View Post
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 ?
 
Old 11-22-2007, 06:00 AM   #14
DinoFly
Member
 
Registered: Nov 2007
Distribution: Fedora, CentOS,
Posts: 72

Rep: Reputation: Disabled
Quote:
Originally Posted by esl537 View Post
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.
 
Old 11-22-2007, 12:35 PM   #15
Fantasio
Member
 
Registered: Nov 2007
Location: Vinsobres - Drome - France
Distribution: SuSE Linux 11.3
Posts: 152

Rep: Reputation: 19
on peut imaginer un problème réseau, une carte qui déconne ou un switch qui défaille
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
C Drive "/dev/hda1" accidently used in dd command at "of=" switch M D Linux - Software 4 04-26-2007 08:56 AM
"list dynamic dependency" of an executable using command other than "ldd" Amrita@3086 Solaris / OpenSolaris 3 04-04-2007 04:56 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM
"segmentation error" when issuing "useradd" command through terminal with RH 9.0 kaihuang Linux - General 0 10-21-2003 11:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration