home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / question / 10532 < prev    next >
Encoding:
Text File  |  1992-08-30  |  1.3 KB  |  38 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!destroyer!ncar!noao!bordeaux.kpno.noao.edu!jdavis
  3. From: jdavis@bordeaux.kpno.noao.edu (Jim Davis)
  4. Subject: Re: A question on ls
  5. Message-ID: <1992Aug30.000142.18813@noao.edu>
  6. Sender: news@noao.edu
  7. Nntp-Posting-Host: bordeaux.kpno.noao.edu
  8. Organization: National Optical Astronomy Observatories, Tucson AZ
  9. References: <6786@tekig7.PEN.TEK.COM> <1992Aug29.233534.27967@umbc3.umbc.edu>
  10. Distribution: na
  11. Date: Sun, 30 Aug 1992 00:01:42 GMT
  12. Lines: 24
  13.  
  14. In article <1992Aug29.233534.27967@umbc3.umbc.edu> rouben@math9.math.umbc.edu (Rouben Rostamian) writes:
  15. >In article <6786@tekig7.PEN.TEK.COM> naren@tekig5.pen.tek.com (Naren Bala) writes:
  16. >>If I type
  17. >>% ls *.Z 
  18. >>All files with .Z extension are displayed.
  19. >>
  20. >>What command would I type to display all files that do not have a .Z 
  21. >>extension ?
  22. >
  23. >The wildcards are expanded by the shell, so the answer is: it depends on
  24. >the shell you are using.  In tcsh, you type:
  25. >% ls ^*.Z
  26. >In sh and csh you are out of luck.  In other shells, I don't know.
  27.  
  28. You're not out of luck if you remember about building UNIX commands out of
  29. other commands.  ls, and grep with the -v option (to 'inVert' the sense of
  30. the match) can be combined like so:
  31.  
  32. ls | grep -v '\.Z$'
  33.  
  34.  
  35. -- 
  36. Jim Davis            | "Knock it off, Uncle Owen.  Get an afterlife!"
  37. jdavis@noao.edu      |   -- Clarissa Darling
  38.