The UNIX and Linux Forums  

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
listing .sl files for each process id in hp-ux 11i sanjaykhuntia HP-UX 0 02-25-2008 06:41 AM
Listing Files krishna_sicsr High Level Programming 3 04-05-2007 10:32 AM
Listing of files Vitalka Linux 1 03-02-2005 06:32 AM
help - listing files richarmj Filesystems, Disks and Memory 2 10-02-2003 06:14 AM
Recursive directory listing without listing files psingh UNIX for Dummies Questions & Answers 4 05-10-2002 07:52 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 05-31-2007
Registered User
 

Join Date: May 2007
Posts: 4
listing files along with grep -v

When I run the command ls | grep -v SNMP It outputs all the files into one column. How can I list them in multiple columns?
Reply With Quote
Forum Sponsor
  #2  
Old 05-31-2007
radoulov's Avatar
addict
 

Join Date: Jan 2007
Location: Milano, Italia/Варна, България
Posts: 1,857
Quote:
Originally Posted by charlie11k
When I run the command ls | grep -v SNMP It outputs all the files into one column. How can I list them in multiple columns?
For ksh:

Code:
ls !(*SNMP*)
For bash:

Code:
shopt -s extglob
ls !(*SNMP*)
Reply With Quote
  #3  
Old 05-31-2007
Registered User
 

Join Date: May 2007
Posts: 4
Sorry, these are directories. When I run the command you suggest, it lists all the directories and their files. Is there a command to list just the directories?
Reply With Quote
  #4  
Old 05-31-2007
radoulov's Avatar
addict
 

Join Date: Jan 2007
Location: Milano, Italia/Варна, България
Posts: 1,857
Quote:
Originally Posted by charlie11k
Sorry, these are directories. When I run the command you suggest, it lists all the directories and their files. Is there a command to list just the directories?
Code:
ls -d !(*SNMP*)
Reply With Quote
  #5  
Old 05-31-2007
Registered User
 

Join Date: May 2007
Posts: 4
what would be the syntax for csh?
Reply With Quote
  #6  
Old 06-01-2007
radoulov's Avatar
addict
 

Join Date: Jan 2007
Location: Milano, Italia/Варна, България
Posts: 1,857
Why csh?
Don't know if csh (and variants) supports extended globbing ...

Code:
ls|grep -v 'SNMP'|pr -5 -l10
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:18 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0