The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
List all files that contain a specific directory Sat510 SUN Solaris 7 04-17-2007 11:57 AM
List of files in sub directory along with their properties ravikirankethe UNIX for Dummies Questions & Answers 3 11-13-2006 05:19 PM
cp list of files into another directory pavan_test UNIX for Dummies Questions & Answers 4 05-08-2006 10:08 PM
list of files in one Directory venkyA UNIX for Dummies Questions & Answers 3 06-24-2005 05:49 PM
list directory without use ls command? ashamry High Level Programming 3 06-08-2004 05:17 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-10-2004
venkat venkat is offline
Registered User
  
 

Join Date: Mar 2004
Posts: 2
can we list other than c files in a directory with only 'ls' command?

Guys,
can anybody help me in the following........

I have different types(c files,ordinary text files etc) in a directory.
is there any way to list other than .c files using the 'ls' command only.

i tried with the following.

ls *.[!c]*.
its not listing the .c files,but at the same time not listing the files which ends with c [eg: filec]
is there anywhy to get it with only 'ls' command.

Thanks in advance....
  #2 (permalink)  
Old 03-10-2004
Optimus_P Optimus_P is offline Forum Advisor  
flim flam flamma jamma
  
 

Join Date: May 2001
Location: Chicago IL, USA
Posts: 1,006
why not use grep?

venkat: did you ever work for a company in chicago, Illinois?
  #3 (permalink)  
Old 03-10-2004
Ygor's Avatar
Ygor Ygor is offline Forum Staff  
Moderator
  
 

Join Date: Oct 2003
Location: -31.96,115.84
Posts: 1,409
Try this...

ls !(*.c)

From man ksh....
Quote:
In addition to the notation described in regexp(5), ksh recognizes
composite patterns made up of one or more pattern lists separated from
each other with a |. Composite patterns can be formed with one or
more of the following:

?(pattern-list) Optionally matches any one of the given patterns.

*(pattern-list) Matches zero or more occurrences of the given patterns.

+(pattern-list) Matches one or more occurrences of the given patterns.

@(pattern-list) Matches exactly one of the given patterns.

!(pattern-list) Matches anything, except one of the given patterns.
  #4 (permalink)  
Old 03-12-2004
venkat venkat is offline
Registered User
  
 

Join Date: Mar 2004
Posts: 2
Ygor,
it worked well.thanks a lot for ur info.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:27 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0