home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / question / 10914 < prev    next >
Encoding:
Text File  |  1992-09-10  |  1.9 KB  |  55 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!gatech!concert!sas!mozart.unx.sas.com!sasmob
  3. From: sasmob@chewy.unx.sas.com (Mark C. Burhans)
  4. Subject: Re: A question on ls
  5. Originator: sasmob@chewy.unx.sas.com
  6. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  7. Message-ID: <BuDG12.4Ly@unx.sas.com>
  8. Date: Thu, 10 Sep 1992 16:48:38 GMT
  9. Distribution: na
  10. References: <6786@tekig7.PEN.TEK.COM> <1992Aug29.233534.27967@umbc3.umbc.edu> <Uec1x2y00VolE4IFF=@andrew.cmu.edu>
  11. Nntp-Posting-Host: chewy.unx.sas.com
  12. Organization: SAS Institute Inc.
  13. Lines: 40
  14.  
  15.  
  16. In article <Uec1x2y00VolE4IFF=@andrew.cmu.edu>, sm86+@andrew.cmu.edu (Stefan Monnier) writes:
  17. |> Excerpts from netnews.comp.unix.questions: 29-Aug-92 Re: A question on
  18. |> ls Bill Bohrer@mcc.com (1088)
  19. |> 
  20. |> > In article <1992Aug29.233534.27967@umbc3.umbc.edu>
  21. |> > rouben@math9.math.umbc.edu (Rouben Rostamian) writes:
  22. |> > >In article <6786@tekig7.PEN.TEK.COM> naren@tekig5.pen.tek.com (Naren
  23. |> > Bala) writes:
  24. |> > >>If I type
  25. |> > >>% ls *.Z 
  26. |> > >>All files with .Z extension are displayed.
  27. |> > >>
  28. |> > >>What command would I type to display all files that do not have a .Z 
  29. |> > >>extension ?
  30. |> > >
  31.  
  32. |> > >the shell you are using.  In tcsh, you type:
  33. |> > >% ls ^*.Z
  34. |> > >In sh and csh you are out of luck.  In other shells, I don't know.
  35. |> >  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  36. |> 
  37. |> > Not true, this should work in ALL shells:
  38. |> 
  39. |> > ls | grep -v '.Z'
  40. |> 
  41. |> All this is true, but don't forget that it won't list ALL the files
  42. |> ending in .Z
  43. |> the files beginning with a point will be 'forgotten' !
  44. |> (I had quite a surprise a week ago)
  45.  
  46. This will:  ls -A | grep -v '\.Z$'
  47.  
  48. This one will even search subdirectories:  ls -AR | grep -v '\.Z$'
  49. -- 
  50. ---Mark C. Burhans---sasmob@chewy.unx.sas.com---919/677-8001 ext 7324
  51. SAS Institute, Inc., USA, SAS Campus Drive, Cary, NC 27513.
  52. "If you want a resume, I'll put it in writing.  It's only good for a day
  53. and the contents are frightening."  -- Lyrics by Harry Connick, Jr.
  54.  
  55.