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