Sponsored Content
Top Forums Shell Programming and Scripting Use “tail -f” to monitor and report, but the top line should be always fixed on the screen. Post 302763803 by df3c on Wednesday 30th of January 2013 12:41:17 PM
Old 01-30-2013
Oracle Use “tail -f” to monitor and report, but the top line should be always fixed on the screen.

Title: Use “tail -f” to monitor and report, but the top line should be always fixed on the screen.
Hi, dear Unix experts,

I am trying to find a Unix command (or scripting) on how to continuously display a text file of its last several lines of contents. But during this displaying, I want some of the top lines are always displayed on the screen top when the scrolling contents reach the screen top.

To make a simple, a text file “test001.log” is in its running process with the ending lines adding.
Code:
tab1	tab2	tab3	tab4	tab5
0.9	5.0	17.7	9.7	19.9
0.6	9.1	4.3	0.6	41.9
0.0	2.8	14.9	5.0	5.6
0.2	5.8	62.4	17.3	41.5
0.6	8.0	74.9	0.7	19.4
0.7	4.3	48.1	2.8	30.3
0.0	5.3	0.3	16.4	42.8
0.2	7.8	70.8	11.6	10.8
0.6	7.5	89.4	19.7	34.9
0.4	2.5	88.5	0.1	22.7
0.4	1.1	41.3	8.4	18.6

Say, I want to use some commands like “tail –f”, but it will show a total number of 10 lines. The top line (possibly several lines in the middle) always shows “tab1 tab2 tab3 tab4 tab5”. The rest 9 lines show the last latest updated 9 lines. Such scrolling should not exceed outside my Unix screen shell.

I’ve tried to search such function in many websites, but haven’t found useful information. I would think this function is very useful. But can I do it?Smilie

Thanks in advance.

Moderator's Comments:
Mod Comment Please use code tags next time for your code and data.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Looking for monitor/top

I'm new to SUN (SunOS 5.8) and I can't find any monitoring tools to check cpu, memory, disk ... performance. Previously on unix servers I have used 'top' & 'monitor' but these commands are not on the box on in the man pages. Anyone suggest equivalent commands? (1 Reply)
Discussion started by: pavelmac
1 Replies

2. Shell Programming and Scripting

Bash tail monitor log file

Hi there, I have a problem here that involves bash script since I was noob in that field. Recently, I have to monitor data involve in logs so I just run command tail -f for the monitoring. The logs was generate every hour so I need to quickly change my logs every time the new hour hits according... (2 Replies)
Discussion started by: kriezo
2 Replies

3. What is on Your Mind?

Can you use a gps touch screen for a monitor?

I have been looking for a monitor wich i can hold in my hands comfortably and just sit back and relax with it doing my computer work on it via touch screen. Is it possible since the gps has usb to control my pc wich it? and view my desktop? If not does anyone know of a monitor that would work. Im... (3 Replies)
Discussion started by: FaoX666
3 Replies

4. Shell Programming and Scripting

How to print string on screen according the fixed length?

Problem: entry_name="joke:hello:yellow:blue:default" print("%d %-12s\t%-10s\t%-5s\n", $i, $entry_name....); I just want to print the output like this index entry value .... 1 joke:hello:y 0 123 567 ellow:blue:d ... (1 Reply)
Discussion started by: a2156z
1 Replies

5. Shell Programming and Scripting

tail command not show on screen

Hi, I'm moniroting duplicate text with unix command (tail -f trace75747 | grep 'duplicate'), but it showed many lines then it stop show trace information although trace information in this file trace75747 always got. What should I do? I look forward to hearing from you. THANKS! (10 Replies)
Discussion started by: seyha_moth
10 Replies

6. Shell Programming and Scripting

How do I get my script to monitor a new file using tail?

Hi, I have a script which basically watches a log file for new lines using tail, then takes action based on what is logged. I wrote a script to do this for me and its working great, my only problem is that once per week, this log file is archived to another directory, and a new log is created.... (4 Replies)
Discussion started by: lstorm2003
4 Replies

7. Shell Programming and Scripting

Script to Monitor a Process with Top.

Hi, I have written a script to monitor a Process with the help of top command. This is my script. ====================== #!/bin/sh DATE=`date +%Y%m%d%H%M%S` HOME=/home/xmp/testing/xmp_report RADIUS_PID=`xms -xmp sh pr | grep "RADIUS.iamsp02ldv" |awk '{ print $3 }'` PSE_PID=`xms -xmp sh... (5 Replies)
Discussion started by: Siddheshk
5 Replies

8. Red Hat

command line tool to disable screen lock and/or screen saver

Hi, I have a simple question : how to disable screen lock and/or sreen saver with command line with RHEL5.4 ? (1 Reply)
Discussion started by: albator1932
1 Replies

9. War Stories

One time I fixed an LCD monitor with a folded piece of paper

Some of the colors weren't working on the Monitor. I found pressing around the plastic border of the screen brought them back. I opened the monitor casing and used the folded paper to put pressure against the LCD panel and housing. Wah Lah. More of a bend than a hack I guess. (2 Replies)
Discussion started by: herot
2 Replies

10. Red Hat

Screen Resolution on External Monitor from RHEL 6.3

Hey everyone, I have a KVM or External monitor (19" Dell) that I am trying to hook up to a laptop running RHEL 6.3 (via VGA which is the only option). When I connect it, and go to System->Preferences->Display, the max resolution option it provides me for these external devices is 1280x1024. ... (2 Replies)
Discussion started by: rchaud10
2 Replies
MORE(1)                                                            User Commands                                                           MORE(1)

NAME
more - file perusal filter for crt viewing SYNOPSIS
more [options] file... DESCRIPTION
more is a filter for paging through text one screenful at a time. This version is especially primitive. Users should realize that less(1) provides more(1) emulation plus extensive enhancements. OPTIONS
Options are also taken from the environment variable MORE (make sure to precede them with a dash (-)) but command-line options will over- ride those. -d Prompt with "[Press space to continue, 'q' to quit.]", and display "[Press 'h' for instructions.]" instead of ringing the bell when an illegal key is pressed. -l Do not pause after any line containing a ^L (form feed). -f Count logical lines, rather than screen lines (i.e., long lines are not folded). -p Do not scroll. Instead, clear the whole screen and then display the text. Notice that this option is switched on automatically if the executable is named page. -c Do not scroll. Instead, paint each screen from the top, clearing the remainder of each line as it is displayed. -s Squeeze multiple blank lines into one. -u Suppress underlining. -number The screen size to use, in number of lines. +number Start displaying each file at line number. +/string The string to be searched in each file before starting to display it. --help Display help text and exit. -V, --version Display version information and exit. COMMANDS
Interactive commands for more are based on vi(1). Some commands may be preceded by a decimal number, called k in the descriptions below. In the following descriptions, ^X means control-X. h or ? Help; display a summary of these commands. If you forget all other commands, remember this one. SPACE Display next k lines of text. Defaults to current screen size. z Display next k lines of text. Defaults to current screen size. Argument becomes new default. RETURN Display next k lines of text. Defaults to 1. Argument becomes new default. d or ^D Scroll k lines. Default is current scroll size, initially 11. Argument becomes new default. q or Q or INTERRUPT Exit. s Skip forward k lines of text. Defaults to 1. f Skip forward k screenfuls of text. Defaults to 1. b or ^B Skip backwards k screenfuls of text. Defaults to 1. Only works with files, not pipes. ' Go to the place where the last search started. = Display current line number. /pattern Search for kth occurrence of regular expression. Defaults to 1. n Search for kth occurrence of last regular expression. Defaults to 1. !command or :!command Execute command in a subshell. v Start up an editor at current line. The editor is taken from the environment variable VISUAL if defined, or EDITOR if VISUAL is not defined, or defaults to vi if neither VISUAL nor EDITOR is defined. ^L Redraw screen. :n Go to kth next file. Defaults to 1. :p Go to kth previous file. Defaults to 1. :f Display current file name and line number. . Repeat previous command. ENVIRONMENT
The more command respects the following environment variables, if they exist: MORE This variable may be set with favored options to more. SHELL Current shell in use (normally set by the shell at login time). TERM The terminal type used by more to get the terminal characteristics necessary to manipulate the screen. VISUAL The editor the user prefers. Invoked when command key v is pressed. EDITOR The editor of choice when VISUAL is not specified. SEE ALSO
less(1), vi(1) AUTHORS
Eric Shienbrood, UC Berkeley Modified by Geoff Peck, UCB to add underlining, single spacing Modified by John Foderaro, UCB to add -c and MORE environment variable HISTORY
The more command appeared in 3.0BSD. This man page documents more version 5.19 (Berkeley 6/29/88), which is currently in use in the Linux community. Documentation was produced using several other versions of the man page, and extensive inspection of the source code. AVAILABILITY
The more command is part of the util-linux package and is available from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util- linux/>. util-linux February 2014 MORE(1)
All times are GMT -4. The time now is 02:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy