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.
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?
Thanks in advance.
Moderator's Comments:
Please use code tags next time for your code and data.
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT NETBSD
curses_insdelln
CURSES_INSDEL(3) BSD Library Functions Manual CURSES_INSDEL(3)NAME
curses_insdelln, insdelln, winsdelln -- curses insert or delete lines routines
LIBRARY
Curses Library (libcurses, -lcurses)
SYNOPSIS
#include <curses.h>
int
insdelln(int n);
int
winsdelln(WINDOW *win, int n);
DESCRIPTION
These functions insert or delete lines on stdscr or on the specified window.
If insdelln() is called with a positive number in n, then the specified number of lines are inserted before the current line on stdscr. The
last n lines of the screen are no longer displayed. If n is negative, then n lines are deleted from stdscr, starting at the current line.
The last n lines of stdscr are cleared.
The winsdelln() function is the same as the insdelln() function, excepting that lines are inserted or deleted from the window specified by
win.
If a scrolling region has been set with the setscrreg() or wsetscrreg() functions and the current cursor position is inside the scrolling
region, then only the lines from the current line to the bottom of the scrolling region are affected.
RETURN VALUES
Functions returning pointers will return NULL if an error is detected. The functions that return an int will return one of the following
values:
OK The function completed successfully.
ERR An error occurred in the function.
SEE ALSO curses_deleteln(3), curses_insertln(3), curses_scroll(3)STANDARDS
The NetBSD Curses library complies with the X/Open Curses specification, part of the Single Unix Specification.
HISTORY
The Curses package appeared in 4.0BSD.
BSD August 12, 2002 BSD