Thomas Halahan [EMAIL PROTECTED] writes:
On Tue, 17 Oct 2000, USM Bish wrote:
I am on bash. This is part of the the output of the
command ls -d */ on my home directory. Only the
sub dirs are displayed.
your solution is more elegant than what i have put together with a
find call. however
`find ~ -maxdepth 1 -type d' maybe?
or define a function `function lsd() { find $1 -maxdepth 1 -type d ; }'
HTH Micce
--
Mikael Hedin, MSc +46 (0)980 79176
Swedish Institute of Space Physics +46 (0)980 73547 (home)
S-Box 812, 981 28 KIRUNA, Sweden+46 (0)980 79050 (fax)
Sorry to be late in replying. I pick up mail once a
day only.
On your queiry on recursive dir
AFAIK, using my technique NO! Essentially each */
represents one level of directory structure. It is
possible to get the second level with ls -d */*/
and third level with ls -d */*/*/, but in
Hello,
I am trying to determine an easy alias or sh script that will list
only the directories in a directory. It should have similar
functionality to the ls command. E.g.
[tom]$ lsd ~
should list only the directories in my home folder, not the files.
Does anyone know of a way to do this
On Tue, Oct 17, 2000 at 02:36:05PM +, Thomas Halahan wrote:
Hello,
I am trying to determine an easy alias or sh script that will list
only the directories in a directory. It should have similar
functionality to the ls command. E.g.
[tom]$ lsd ~
should list only the directories in my
On Tue, 17 Oct 2000, Thomas Halahan wrote:
I am trying to determine an easy alias or sh script that will list
only the directories in a directory. It should have similar
functionality to the ls command. E.g.
[tom]$ lsd ~
Try this one:
--snip--
#!/bin/sh
if [ $1 ]; then
find $1
On Tue, Oct 17, 2000 at 02:36:05PM +, Thomas Halahan wrote:
Hello,
I am trying to determine an easy alias or sh script that will list
only the directories in a directory. It should have similar
functionality to the ls command. E.g.
[tom]$ lsd ~
should list only the directories in
note that it won't list links to directories, you might want to use
-follow see below:
panther:~/rrrl
total 6
drwxr-xr-x 2 esteffl pbidev 512 Oct 17 09:15 dir
lrwxrwxrwx 1 esteffl pbidev 3 Oct 17 09:15 dir.link - dir
-rw-r--r-- 1 esteffl pbidev14 Oct 17 09:15
I am on bash. This is part of the the output of the
command ls -d */ on my home directory. Only the
sub dirs are displayed.
aedes:~$ls -d */
Mail/ page/ nsmail/
bd4v605/free/ tklatex/
HTH
alias lsd=ls -d */ should do your job !
USM Bish
I _LIKE_ IT (ie 'ls -d */')! :) Up 'til now I've been using:
lld() {
ls -l $@ | grep -E ^d
return 0
}
But your solution is much more elegant.
thks.jeff
On Tue, Oct 17, 2000 at 11:49:32PM +0518, USM Bish wrote:
I am on bash. This is part of the the output of the
Perfect,
Thanks very much. I have just added a bit so that I can list
directories recursively. E.g.
lsd -R
At present file ~/home/bin/lsd is
--snip--
#!/bin/sh
if [ $1 ]; then
if [ $1 = -R ]; then
MAXDEPTH=
DIR=$2
#echo $1 MAXDEPTH = $MAXDEPTH
fi
else
your solution is more elegant than what i have put together with a
find call. however how could you get it to list recursively?
i have tried
ls -1 -R -d */
tom
On Tue, 17 Oct 2000, USM Bish wrote:
I am on bash. This is part of the the output of the
command ls -d */ on my home directory.
using -d for this is confusing like hell because -d is 'well known'
switch in standard unix ls - it lists directory as if it were file, i.e.
does not list the content of the directory (useful with -l), it has no
effect on files (they are listed just like they would be without -d)
erik
On Tue, Oct 17, 2000 at 02:36:05PM +, Thomas Halahan ([EMAIL PROTECTED])
wrote:
Hello,
I am trying to determine an easy alias or sh script that will list
only the directories in a directory. It should have similar
functionality to the ls command. E.g.
[tom]$ lsd ~
should list
On 17-Oct-2000 USM Bish wrote:
I am on bash. This is part of the the output of the
command ls -d */ on my home directory. Only the
sub dirs are displayed.
aedes:~$ls -d */
Mail/ page/ nsmail/
bd4v605/ free/ tklatex/
HTH
alias
I use alias ld='ls -l | grep ^d'
Many interesting ways of doing the same thing :)
Just make sure you don't get that confused with the _real_ ld command (the
GNU linker)! :-P
--
Dwayne C. Litzenberger - [EMAIL PROTECTED]
- Please always Cc to me when replying to me on the lists.
- Please
; --xHFwDpU9dbj6ez1V
; Content-Type: text/plain; charset=us-ascii
; Content-Disposition: inline
; Content-Transfer-Encoding: quoted-printable
;
; I use alias ld=3D'ls -l | grep ^d'
; =20
; Many interesting ways of doing the same thing :)
;
; Just make sure you don't get that confused with the
On 18-Oct-2000 Dwayne C . Litzenberger wrote:
I use alias ld='ls -l | grep ^d'
Many interesting ways of doing the same thing :)
Just make sure you don't get that confused with the _real_ ld command (the
GNU linker)! :-P
I never thought of that... I must change that alias.
thanks
--
18 matches
Mail list logo