The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 04-26-2006
Ecclesiastes Ecclesiastes is offline
Registered User
 

Join Date: Apr 2006
Posts: 8
echo `ls -d */ | cut -f 1 -d /` that gets rid of the "/" but then the output is as follows:

e.g. echo `ls -d */ | cut -f 1 -d /` gives

dir1 dir2 dir3 dir4 dir5 dir6 etc

if you use it without the echo and it works fine

ls -d */ | cut -f 1 -d /

dir1
dir2
dir3
...
Peace

Last edited by Ecclesiastes; 04-26-2006 at 01:32 AM.
Reply With Quote