Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!RODAN.ACS.SYR.EDU!jdpeek From: jdpeek@RODAN.ACS.SYR.EDU (Jerry Peek) Newsgroups: comp.unix.questions Subject: Re: type discriminating directory listing Keywords: ls, subdirectories, symbolic-links Message-ID: <8905110644.AA01902@rodan.acs.syr.edu> Date: 11 May 89 07:44:38 GMT References: <1529@cmx.npac.syr.edu> Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: jdpeek@rodan.acs.syr.edu Organization: Syracuse University; Syracuse, New York Lines: 20 In article <1529@cmx.npac.syr.edu> gefuchs@logiclab.cis.syr.edu (Gill E. Fuchs) writes: > what would be the command for getting a partial directory listings > of only the subdirectories and symbolic-links ? I saw a few solutions that used "ls -l". How about "ls -F", which (on BSD) marks subdirectories with a trailing "/" and symlinks with a trailing "@"? ls -F | grep '[/@]$' When you feed BSD "ls" into a pipe, it doesn't print the filenames in columns; that's good for this test but it looks lousy on the screen if there are lots of filenames. A kludge for that looks like this: ls -F | grep '[/@]$' | pr -4 -l1 -t The "-4" gives 4 columns -- adjust that, depending on the filename length. --Jerry Peek; Syracuse University Academic Computing Services; Syracuse, NY jdpeek@rodan.acs.syr.edu, jdpeek@suvm.bitnet +1 315 443-3995