viewing lines


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting viewing lines
# 1  
Old 08-18-2009
viewing lines

Hey,

I know the head and tail function is to view like the top or bottom lines for each file. But lets say I want to view the top/bottom 100 or top/bottom 1000 for a file. whats the command that I use to do this?

thanks
# 2  
Old 08-18-2009
tail -n 100
head -n 1000

Hope that helps!

EDIT: or use the number you want with the -n switch

Last edited by LoveSquid; 08-18-2009 at 07:00 PM.. Reason: Clarification
# 3  
Old 08-18-2009
Quote:
Originally Posted by kylle345
I know the head and tail function <snip> whats the command that I use to do this?
Have you tried "man head" or "man tail" already? In case everything else fails one can always resort to reading the manual as a last-ditch effort.

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Emergency UNIX and Linux Support

Help in viewing the junk character

Hello All, I have issues in unix file when I loaded that to database and do select * from table where description like '%'+char(13)+'%' on it I am able to get records. I tried to view the file in unix it is all having blank character which I think is all non ascii which I am not able view.... (11 Replies)
Discussion started by: arunkumar_mca
11 Replies

2. Tips and Tutorials

Viewing changes in directory

Hi, I have a directory, and there is a job running and constantly writes and removes files from and to this directory. I would like to see somehow these changes without pressing `ls` every second. Kind of `tail -f` command, but for a directory list and not for file content. I thought maybe kind... (5 Replies)
Discussion started by: ilya_dv
5 Replies

3. UNIX for Dummies Questions & Answers

Viewing a large file

Sometime I have to deal with very large log files and I cannot view them for analysis using more or vi. The attempts to open the files error out saying there is not enough memory. Is there any tool or method with which I can go through huge files? (2 Replies)
Discussion started by: rcchume
2 Replies

4. Shell Programming and Scripting

Viewing the commands executed

Hi, I have executed a set of commands on the linux server and later rebooted the server. Is it possible to get the details of the commands I executed prior to the reboot? If yes please let me know how? Thanks. (1 Reply)
Discussion started by: yoursdavinder
1 Replies

5. UNIX for Dummies Questions & Answers

Need help with viewing process on another server

Greetings everyone, I am new to the unix environment and I need help with my question below. I need to monitor certain critical processes on several servers and we have scripts that will grep and display those we need to monitor but we need to open new PuTTy sessions to each server in order... (4 Replies)
Discussion started by: kumaran21
4 Replies

6. UNIX for Dummies Questions & Answers

viewing specific lines

hi, is there any command on viewing specific line number of a file? thanks (3 Replies)
Discussion started by: dakid
3 Replies

7. UNIX for Dummies Questions & Answers

Viewing files

I have a file (called CORE) that is a dump created by a crashing process. This file, I believe, is in "binary" form, so when I try to use cat, more, or vi on it, it has a bunch of garbage. Is there anything I can use to "read" or view this file just like I might a non-binary file? I am running... (2 Replies)
Discussion started by: dsimpg1
2 Replies

8. UNIX for Dummies Questions & Answers

viewing are .tar.gz file

I have a dilema. We have a .tar.gz file that is 2.2 GB. I can't xfer to another machine with ftp, because ftp chokes on the 2 gb size. We can't uncompress the tarball either because it will blow any filesystem we have on this Sun box. Is there a way to view or even extract certain files from... (2 Replies)
Discussion started by: lawadm1
2 Replies

9. UNIX for Dummies Questions & Answers

pdf viewing

How do I view pdf files on a Solaris 9 environment? Links and such would be grateful. "AAAAHHH!! They're everywhere!!!" - Halo Grunt (3 Replies)
Discussion started by: antalexi
3 Replies

10. UNIX for Dummies Questions & Answers

viewing tables

I have completely blanked out on this and I have done it a million times. I need to modify some tables in unix. What is the command for opening/viewing the tables? Thanks so much. :o (2 Replies)
Discussion started by: itldp
2 Replies
Login or Register to Ask a Question