Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!sun!amdahl!krs From: krs@uts.amdahl.com (Kris Stephens [Hail Eris!]) Newsgroups: comp.sys.mac.comm Subject: Re: NCSA Telnet - ftp - and ls -lt | head Message-ID: <32ct025Bbaf=01@amdahl.uts.amdahl.com> Date: 24 Jul 90 22:39:39 GMT References: <48418215MES@MSU> Reply-To: krs@amdahl.uts.amdahl.com (Kris Stephens [Hail Eris!]) Organization: Amdahl Corporation, Sunnyvale CA Lines: 28 In article <48418215MES@MSU> 18215MES@MSU.BITNET writes: >Hi folks, >I find it valuable to connect to stanford - sumex via ncsa telnet, >and would like to see the most recent postings in a few of the >directories. I know that I can do a ls -lt to list sorted by >most recent additions, but how can I limit it to the first >10 - 15 lines of output? Sure: ls -lt | sed 15q -or- ls -ltd */* | sed 15q where the sed in each case will quit (and close stdin) after reading and printing 15 lines. I use the second call (ls -ltd */*) to get a time-ordered list of files in subdirectories, without listing either the directory names themselves or files lower than that. ...Kris -- Kristopher Stephens, | (408-746-6047) | krs@uts.amdahl.com | KC6DFS Amdahl Corporation | | | [The opinions expressed above are mine, solely, and do not ] [necessarily reflect the opinions or policies of Amdahl Corp. ]