LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-02-2006, 09:41 AM   #1
chucker8
Member
 
Registered: Nov 2005
Posts: 52

Rep: Reputation: 15
truncating output of ls command


I'm running ls -lt to sort by time. but this directory had lots of files, I want to see only the first 10 results of the output. is there a way I can do this?

thanks
 
Old 03-02-2006, 09:46 AM   #2
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
Code:
ls -lt | head
head does 10 lines by default, you can specify a number as an option though
 
Old 03-02-2006, 10:01 AM   #3
chucker8
Member
 
Registered: Nov 2005
Posts: 52

Original Poster
Rep: Reputation: 15
cool thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Netstat - Why is it truncating the foreign address? lukasbradley Linux - Software 5 07-06-2018 04:21 PM
Redirecting output to a command-line argument of another command madiyaan Linux - Newbie 1 02-19-2005 04:35 PM
Samba truncating files to 0 bytes KimVette Linux - Networking 6 01-30-2005 06:42 PM
Truncating trailing characters liguorir Programming 0 05-23-2004 04:00 AM
Truncating a string nkendrick Linux - General 5 11-29-2003 09:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration