list last few lines command | Unix Linux Forums | UNIX for Dummies Questions & Answers

  Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

list last few lines command

UNIX for Dummies Questions & Answers


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-18-2004
zomboo zomboo is offline
Registered User
 
Join Date: Aug 2004
Last Activity: 19 November 2004, 12:25 PM EST
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
list last few lines command

Hi

If my ls -l results in 1000 lines and i just want to see the last few lines in the list what arguments do i pass


eg lets say i want to see only the last 5 lines of 'ls -l' result
Sponsored Links
    #2  
Old 08-18-2004
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
 
Join Date: Dec 2003
Last Activity: 13 May 2013, 9:02 AM EDT
Location: Melbourne, Australia
Posts: 2,185
Thanks: 3
Thanked 24 Times in 23 Posts
Pipe through "tail"

e.g.

ls -l | tail -5 (or ls -l | tail -n 5)

man tail

Cheers
ZB
Sponsored Links
    #3  
Old 08-18-2004
anarchie anarchie is offline
Registered User
 
Join Date: May 2004
Last Activity: 26 December 2004, 5:39 PM EST
Location: Hawaii
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Personally, I like to pipe it through less +G. This way I can hit b to go up a few more lines if I need to.

ls -l | less +G
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Appending lines from an existing list to each line in another existing list TAPE UNIX for Dummies Questions & Answers 4 09-10-2011 05:27 PM
Removing lines from one list from another list. LinuxRacr Shell Programming and Scripting 2 07-01-2010 03:25 PM
Filtering similar lines in a big list Andrew9191 UNIX for Dummies Questions & Answers 1 03-14-2010 07:23 AM
How to list file names instead of lines when grep a gzcat command? HugoH UNIX for Dummies Questions & Answers 2 07-14-2009 06:56 PM
extract lines with a given list of identifiers mskcc Shell Programming and Scripting 3 04-14-2006 12:15 AM



All times are GMT -4. The time now is 04:33 PM.