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
listing .sl files for each process id in hp-ux 11i sanjaykhuntia HP-UX 0 02-25-2008 09:41 AM
Listing Files krishna_sicsr High Level Programming 3 04-05-2007 01:32 PM
Listing of files Vitalka Linux 1 03-02-2005 09:32 AM
help - listing files richarmj Filesystems, Disks and Memory 2 10-02-2003 09:14 AM
Recursive directory listing without listing files psingh UNIX for Dummies Questions & Answers 4 05-10-2002 10:52 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 05-31-2007
charlie11k charlie11k is offline
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?
  #2 (permalink)  
Old 05-31-2007
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,854
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*)
  #3 (permalink)  
Old 05-31-2007
charlie11k charlie11k is offline
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?
  #4 (permalink)  
Old 05-31-2007
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
addict
  
 

Join Date: Jan 2007
Location: Варна, България / Milano, Italia
Posts: 2,854
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*)
  #5 (permalink)  
Old 06-01-2007
charlie11k charlie11k is offline
Registered User
  
 

Join Date: May 2007
Posts: 4
what would be the syntax for csh?
  #6 (permalink)  
Old 06-01-2007
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
addict
  
 

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

Code:
ls|grep -v 'SNMP'|pr -5 -l10
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 10:30 PM.


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