10-15-2008
Tail command in one line
HI i have to copy the last 5000 lines form a log file and copy the same in the same file .overwriting the same log file.
ex: tail -5000 testfile1 > testfile2
cat testfile2
mv tesftfile2 testfile1
will produce the correct result.but i want to have this done in one line????
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi ,
I have found a interesting thing about tail command:
when I tried to use 'tail -1 *' to look at every file with the current derectory, I only got one line of result of one file.
But if I use 'head -1 *', I would get multiple lines.
Is there a way to do get multiple lines with 'tail -1 *'... (3 Replies)
Discussion started by: whatisthis
3 Replies
2. Shell Programming and Scripting
I was wondering how can I do this
I have file myfile.txt
wc -l is: 5 000 000
I have to remove first 1 000 000 lines from header..
I tryed with tail -4000000 myfile.txt>newfile.txt
but it does not work...
any help?? (2 Replies)
Discussion started by: amon
2 Replies
3. Shell Programming and Scripting
I am new to UNIX......I have one file which contains thousnads of records with header and tailer.
Header
Record 1
Record 2
....
....
Last Record
Trailer
I want to concatenate Header and Trailer in the first line....now the output should look like this:
Header: Header value, Trailer:... (2 Replies)
Discussion started by: 33junaid
2 Replies
4. UNIX for Dummies Questions & Answers
Hi,
Just wonder if there is any quick way to display line number when monitoring a log file with tail -f? (4 Replies)
Discussion started by: iengca
4 Replies
5. Shell Programming and Scripting
Hi ,
1)i want to display specific line number using tail command.
e.g. display 10 line from end.
Please help...
2)Want to display line 10 to 15 (from end)using tail command) (2 Replies)
Discussion started by: vivek1489
2 Replies
6. Shell Programming and Scripting
Hello Guys,
I have created function which is as follow:
tail -f filename |grep "Key word"
output from this command
19-11-2011 21:09:15,234 - INFO Numbement - error number:result = :11
19-11-2011 21:09:15,286 - INFO Numbement - error number:result = :11
19-11-2011 21:09:15,523 - INFO... (5 Replies)
Discussion started by: ooilinlove
5 Replies
7. Shell Programming and Scripting
Hi,
I want to read a live log file line by line and considering those line which are newly added to file
Below code I am using, which read line but as soon as it read new line from log file its starts processing from very first line of file.
tail -F /logs/COMMON-ERROR.log | while read... (11 Replies)
Discussion started by: ketanraut
11 Replies
8. Shell Programming and Scripting
Hello,
I am trying to create an iptables script with tail ,sed and awk.
1st Request: Search keyword "secret" in access.log file
2nd Request: Get first column matching lines (ip address)
3rd Request: Save it to a file
This is what I did so far:
grep.sh
#!/bin/bash
while true;
do
tail... (23 Replies)
Discussion started by: baris35
23 Replies
9. UNIX for Beginners Questions & Answers
Hi Team,
Can anyone help me here:
I have to access server logs via putty and these logs file is a trailing file (continously updating) with ERROR and WARNINGS... I need to know if I can pull this trailing file to a local drive so that I can do some higlighting on some keywords through Notepad... (13 Replies)
Discussion started by: jitensetia
13 Replies
10. Homework & Coursework Questions
First month learning about the Linux terminal and it has been a challenge yet fun so far. We're learning by using a gameshell. I'm trying to display a certain line ( only allowed 1 command ) from a file only using the head or tail. I'm pretty about this answer:
head -23 history.txt | tail -1... (1 Reply)
Discussion started by: forzatekk
1 Replies
uulog(1) General Commands Manual uulog(1)
NAME
uulog - Displays UUCP log files
SYNOPSIS
/usr/lib/uucp/uulog -f system [-number]
uulog
uulog systems [-number]
uulog -s system [-number]
uulog -x [systems]
The uulog command displays the contents of a log file of uucico or uuxqt activities.
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
uulog: XCU5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
OPTIONS
[Tru64 UNIX] Performs a tail -f on the file transfer log for the specified system, displaying the end of the log file. Use the Interrupt
key sequence to leave the file and return to the prompt. Prints information about copy requests involving the specific system. If no sys-
tem is specified, information is displayed for all systems.
Note: System name can contain only ASCII characters. [Tru64 UNIX] Displays the uuxqt log file for the specified systems. If no
systems are specified, information is displayed for all systems. [Tru64 UNIX] Displays the last lines of the log file. The number
of lines is determined by the number argument. (To display the lines, the uulog command issues a tail for the specified number of
lines.)
DESCRIPTION
Individual log files are created for each remote system with which the local system communicates using the uucp, uusend, uuto, or uux com-
mands.
Use the uulog command to display a summary of uucp, uusend, uuto, and uux command requests by a system or systems. All of these transac-
tions are logged in files under the /usr/spool/uucp/.Log/ directory. The files are named daemon_name/system, where the daemon_name direc-
tory is named for the daemon involved and the system file is named for the remote system the daemon is contacting.
The uucp and uuto commands call the uucico daemon. The uucico activities are logged in the system file in the /usr/spool/uucp/.Log/uucico
directory.
The uux and uusend commands call the uuxqt daemon. The uuxqt activities are logged in the /usr/spool/uucp/.Log/uuxqt/system file.
You can examine these individual log files by issuing the uulog command directly. However, you can also have these temporary log files
appended to a primary log file that you can then examine. This is called compacting the log files and is handled by uudemon.cleanu, a
shell script in /usr/lib/uucp.
NOTES
The uulog utility is marked LEGACY in XCU Issue 5.
EXAMPLES
To display the uucico log file for system hera, enter: uulog -s hera [Tru64 UNIX] To display the uuxqt log file, enter: uulog -x [Tru64
UNIX] To display the last forty lines of the file transfer log for system zeus, enter: uulog -f zeus -40 To display the uucico log file
for systems pluto and venus, enter: uulog pluto venus [Tru64 UNIX] To display the uuxqt log file for systems pluto and venus, enter: uulog
-x pluto venus
FILES
Contains log files. Public directory.
SEE ALSO
Commands: ct(1), cu(1), tail(1), tip(1), uucico(8), uucleanup(8), uucp(1), uuencode(1), uudecode(1), uuname(1), uupick(1), uusched(8),
uusend(1), uustat(1), uuto(1), uux(1)
Standards: standards(5)
uulog(1)