![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| tail display ....in perl | zedex | Shell Programming and Scripting | 2 | 01-15-2008 07:10 AM |
| how to display line number for tail -f | iengca | UNIX for Dummies Questions & Answers | 4 | 12-13-2007 05:46 AM |
| MatLab alike software in Fedora | MULTIVERSE | Linux | 1 | 09-14-2007 05:22 AM |
| Display Directory Size - DF? | t4st33@mac.com | UNIX for Dummies Questions & Answers | 3 | 01-10-2007 11:12 PM |
| Constantly updating log files (tail -f? grep? awk?) | nortonloaf | UNIX for Dummies Questions & Answers | 0 | 12-03-2006 08:20 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
The system I work on, produces several kinds of status-files in a single directory. I would like to be able to see the files as they are added to this directory.
I was wondering if it would be possible to get a "tail -f" alike view of the ls-command, in such a way that a newly added file is automagically added at the bottom. The way we do it now, is with the command below, which we need to execute manually (which imho is not handy): ls -l -rt|tail -20 (to view 20 last files) And we do more "in depth" searches inside these files with: ls -l -rt tail `grep -l searchstring *` But it would be wonderful to just see the list "grow" since this way, it is much easier to recognize errormessages since these errormessages are fixed size, 645 bytes and easy to spot. We use SunOS 5.7 with Bash 2.01. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Linux provides a utility called "watch" which you could use to do this. Something like:
watch "ls -lrt | tail -5" would give you a constantly updated list of the 5 most recently updated files. Unfortunately, I dont think this utility is included with Solaris. It is part of the procps package on Linux. You could try downloading it (http://procps.sourceforge.net/) and compiling for your architecture. |
|
#3
|
|||
|
|||
|
I do remember watch now! Have not used it in quite some time. I run mostly FreeBSD, OpenBSD and Solaris nowadays and didn't even miss it (until now!)...
Quote:
Quote:
Getting permission to install additional software on it would require a lot of people to agree with it and I don't think that will happen in the near future. Thanks for the reply! |
|
#4
|
||||
|
||||
|
A simple shell script alternative would be something like:
Code:
#!/bin/sh
while (true)
do
ls -lrt | tail -5
sleep 5
clear
done
|
|
#5
|
|||
|
|||
|
This works great!
Thanks a lot! |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|