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
du -k shows different size in two nodes KhawHL UNIX for Advanced & Expert Users 15 10-01-2007 03:11 AM
moving directories to new directories on multiple servers mackdaddy07 Shell Programming and Scripting 0 04-06-2007 12:30 PM
setfacl -x doesn't shows it removed the ACL braindrain Shell Programming and Scripting 0 08-01-2006 06:09 AM
Monitor shows out of frequency sunilpatwal SUN Solaris 0 08-11-2005 06:39 PM
top shows stopped process IrishRogue UNIX for Dummies Questions & Answers 7 05-21-2003 01:41 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 12-03-2002
yls177
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
ls shows directories only? how

1) how to show directories in ls command? i went to man ls, and saw this -d flag but doesnt help..

2) say we put this
alias ls='ls -F' in .profile..

how do we let inform .profile that there is a new entry besides restarting the system. thanks.

my shell is KSH.
  #2 (permalink)  
Old 12-03-2002
Bab00shka Bab00shka is offline
Registered User
  
 

Join Date: Apr 2002
Location: Chesterfield, UK
Posts: 123
I've had loads of problems with this too. I got round it with the following which you can create an alias for. I'm sure there are better ways, but nevertheless it works.

ls -l | grep ^[d]| awk '{ print $9 }'
  #3 (permalink)  
Old 12-03-2002
hassan2 hassan2 is offline Forum Advisor  
Registered User
  
 

Join Date: Mar 2002
Location: London, England
Posts: 262
To excecute the .profile file without restarting your system issue . ./.profile from your .profile directory
  #4 (permalink)  
Old 12-03-2002
criglerj's Avatar
criglerj criglerj is offline
Registered User
  
 

Join Date: May 2002
Location: Atlanta
Posts: 129
Quote:
Originally posted by Bab00shka
ls -l | grep ^[d]| awk '{ print $9 }'
You can save a process this way:

Code:
ls -l | awk '/^d/ { print $NF }'

The point here is that you're using grep to select lines and then awk to select fields, but awk is perfectly capable of selecting lines as well.
  #5 (permalink)  
Old 12-05-2002
Bab00shka Bab00shka is offline
Registered User
  
 

Join Date: Apr 2002
Location: Chesterfield, UK
Posts: 123
Thanks criglerj. I knew there would be a better way
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 08:32 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