Re: dir /ad - equiv

2001-04-16 Thread Alvin Oga

hi ya bounce

find / -type d -ls

or use -print instead  of -ls

c ya
alvin


On Mon, 16 Apr 2001 [EMAIL PROTECTED] wrote:

 What is the best way to get the equivalent of the DOS command 
 dir /ad in linux?  That command will show just the (sub)directories 
 and not ordinary files.
 
 I thought that ls -d would be the equivalent but it is not. 
 
 I know I can do ls -f | grep / to get the directory, but putting it
 into a script like this fails because the / does not appear when the
 output of ls is redirected:
 ---
 #!/bin/sh
 if [ ! -z $1 ]
 then
   WAAR=$1
 else
   WAAR=.
 fi
 ls -f $WAAR | grep /
 --
 
 The following script works:
 -
 #!/bin/sh
 if [ ! -z $1 ]
 then
   WAAR=$1
 else
   WAAR=.
 fi
 ls -la $WAAR | grep ^d
 -
 
 Is there another way of doing this?
 Johann
 -- 
 J.H. Spies - Tel. 082 782 0336.  Posbus 4668, Tygervallei 7536
  But seek ye first the kingdom of God, and his  
   righteousness; and all these things shall be added 
   unto you. Matthew 6:33 
 
 
 
 
 -- 
 To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
 with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
 



Re: dir /ad - equiv

2001-04-16 Thread Karsten M. Self
on Mon, Apr 16, 2001 at 07:00:57AM -0400, [EMAIL PROTECTED] ([EMAIL PROTECTED]) 
wrote:
 What is the best way to get the equivalent of the DOS command 
 dir /ad in linux?  That command will show just the (sub)directories 
 and not ordinary files.
 
 I thought that ls -d would be the equivalent but it is not. 

Yet another way:  

$ tree -d -L 1

Cheers.

-- 
Karsten M. Self kmself@ix.netcom.comhttp://kmself.home.netcom.com/
 What part of Gestalt don't you understand?   There is no K5 cabal
  http://gestalt-system.sourceforge.net/ http://www.kuro5hin.org


pgpUtQ3boV1Yb.pgp
Description: PGP signature


Re: dir /ad - equiv

2001-04-16 Thread Johann Spies
On Mon, Apr 16, 2001 at 04:10:19AM -0700, Alvin Oga wrote:

 hi ya bounce

Sorry for that one.

 find / -type d -ls
 
 or use -print instead  of -ls

Thanks.

JOhann

-- 
J.H. Spies - Tel. 082 782 0336.  Posbus 4668, Tygervallei 7536
 But seek ye first the kingdom of God, and his  
  righteousness; and all these things shall be added 
  unto you. Matthew 6:33 



Re: dir /ad - equiv

2001-04-16 Thread Raja R Harinath
Johann Spies [EMAIL PROTECTED] writes:
 On Mon, Apr 16, 2001 at 04:10:19AM -0700, Alvin Oga wrote:
 
  hi ya bounce
 
 Sorry for that one.
 
  find / -type d -ls
  
  or use -print instead  of -ls

Even simpler,

 echo */.

This even follows symlinks.

- Hari
-- 
Raja R Harinath -- [EMAIL PROTECTED]
When all else fails, read the instructions.  -- Cahn's Axiom
Our policy is, when in doubt, do the right thing.   -- Roy L Ash