tail command in SUN & HP_unix


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers tail command in SUN & HP_unix
# 1  
Old 05-08-2002
tail command in SUN & HP_unix

Hi any SUN expert,

All the while I using HP-Unix. Now when i turned into SUN environment, I not sure how the command should look like in SUN sys.

HP: tail -n3 file.log (this is the command i normally use)
SUN: tail [-n +3] [file.log] (this 1 not work, donno where went wrong)

Please help, thanks!
# 2  
Old 05-08-2002
This is some of the Sun Solaris cman page for tail,

The following options are supported for /usr/xpg4/bin/tail only:
-c number : The number option-argument must be a decimal integer whose sign affects the location in the file, measured in bytes, to begin the copying: + Copying starts relative to the beginning of the file. - Copying starts relative to the end of the file. none Copying starts relative to the end of the file. The origin for counting is 1; that is, -c+1 represents the first byte of the file, -c-1 the last.

-n number: Equivalent to -cnumber, except the starting loca- tion in the file is measured in lines instead of bytes. The origin for counting is 1; that is, -n+1 represents the first line of the file, -n-1 the last.

Anyway do post your OS Specs. are you running solaris 8 ?
# 3  
Old 05-08-2002
hey, anyway, thanks.

this command work

i found in HP-UX, "tail -n3 file.log"
in SUN, i use "tail -3 file.log", it is so simple :P

i am not sure what version is this server
also dont know how to check it
but it is Sun Solaris
# 4  
Old 05-08-2002
no need for -n in HPUX for tail/head command...

BTW, You don't have to use the -n option for HPUX. I haven't used the -n option for several years, on either "head" or "tail" commands...

Are you using an old version of HPUX? 10.10 or older???

Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Tail -f Command help

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

2. Shell Programming and Scripting

How do i use tail & grep in real time here??

Hi I have a file which is updated very frequently. Where in i wanted to use tail -f command in the script and wanted to grep for a particular word. But the issue is when i use tail -f filename|grep "word" ... it will show me blank until the word is found in the real time. if it shows... (13 Replies)
Discussion started by: nikhil jain
13 Replies

3. Shell Programming and Scripting

How to use command tail -f & show line number.

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

4. Shell Programming and Scripting

Averaging in increments using awk & head/tail

Hi, I only have a very limited understanding and experience with writing code and I was hoping I could get some help. I have a dataset of two columns (txt format, numbers in each row separated by a tab) Eg. 1 5 2 5 3 6 4 7 5 6 6 6 7 ... (5 Replies)
Discussion started by: Emred_Skye
5 Replies

5. Shell Programming and Scripting

Help with tail command

Hi All, My query seems to be silly but Iam unable to find where the exact problem lies. I have a script to unzip set of files here is the script #!/bin/ksh Count=`cat /home/gaddamja/Tempfile | wc -l` while do Filename=`cat /home/gaddamja/Tempfile |tail -$Count | head -1` cd... (7 Replies)
Discussion started by: jagadish_gaddam
7 Replies

6. UNIX for Advanced & Expert Users

Help: Sun Disk partitioning for Sun V240 & StorEdge 3300

Dear Sun gurus, I have Sun Fire V240 server with its StorEdge 3300 disk-array. Following are its disks appeared in format command. I have prepared its partitions thru format and metainit & metattach (may be i have made wrong steps, causing the errors below because I have done thru some document... (1 Reply)
Discussion started by: shafeeq
1 Replies

7. HP-UX

sending mail using HP_Unix

hi, I got stuckup with the issue of sending mail with attachment from HP-UX. Can any one please help me in resolving the issue. I am giving the criteria which i want below, 1. To address. 2. Cc address. 3. Subject 4. File attachment(the file i am using is :-- filename_`date... (1 Reply)
Discussion started by: medisetti
1 Replies

8. Shell Programming and Scripting

tail command..

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

9. UNIX for Dummies Questions & Answers

head & tail

I've a major file which includes other files and now I wanna 'cut' the file in several minor parts....like .... find / -name "*.tmp" >filea wc -l filea >fileb sed -e '1s/ filea//' fileb >filec AMOUNT=`cat filec` if ; then cat file a |head -100l (ell) |tail -100l >filec cat file a |head... (6 Replies)
Discussion started by: svennie
6 Replies

10. Shell Programming and Scripting

Implementing MORE,HEAD & TAIL

hai in my shell script i want to replace the following commands 1) more 2) head 3) tail i want to try all type of possible options avaliabul in the above commands please help in implementing those commands (9 Replies)
Discussion started by: g_s_r_c
9 Replies
Login or Register to Ask a Question