Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-02-2006, 09:41 AM   #1
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?

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

Rep: Reputation: 45
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
Registered: Nov 2005
Posts: 52

Original Poster
Rep: Reputation: 15
cool thanks


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:31 AM.

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