The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Alias a command b_garima UNIX for Advanced & Expert Users 2 10-22-2007 07:06 AM
a question about alias command jayyu317 UNIX for Dummies Questions & Answers 1 12-11-2006 08:07 PM
alias for rm command shriashishpatil UNIX for Advanced & Expert Users 8 02-23-2006 05:42 AM
I want to create a command alias cstovall UNIX for Dummies Questions & Answers 2 12-03-2002 07:20 AM
Alias's & Functions - simple question kornshellmaven Shell Programming and Scripting 6 11-01-2002 06:34 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-23-2008
Supporter
 

Join Date: Dec 2007
Posts: 59
alias a simple ls -l command

how do I alias the following command:
ls -l |egrep 'drw|dr-|d--|d-w'

The alias command needs single quotes and so does the above command, so this does not work:

alias LSDIR 'ls -l |egrep 'drw|dr-|d--|d-w' '

My problem is how do I get a listing of only directories?
Solaris 8
SUN Ultra 10

Thank you so much!
Reply With Quote
Forum Sponsor
  #2  
Old 01-23-2008
Registered User
 

Join Date: Oct 2007
Posts: 70
alias lsdir="ls -l |egrep 'drw|dr-|d--|d-w'"

Hope it will work for you
Reply With Quote
  #3  
Old 01-23-2008
Registered User
 

Join Date: Feb 2005
Location: Ontario
Posts: 20
Why bother with an alias.

Code:
ls -ld
Reply With Quote
  #4  
Old 01-23-2008
Supporter
 

Join Date: Dec 2007
Posts: 59
ls -ld

thank you bobbydsk, the double quotes was the magic... that works.
I dont know why, but ls -ld does not give me a listing of directories....?
Reply With Quote
  #5  
Old 01-23-2008
Resident BOFH
 

Join Date: Dec 2007
Posts: 262
how about this
Code:
alias lsdir="ls -l |grep ^d"
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:45 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