Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!apple!oliveb!mipos3!omepd!merlyn From: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Newsgroups: comp.unix.questions Subject: Re: type discriminating directory listing Summary: bug in code Message-ID: <4437@omepd.UUCP> Date: 16 May 89 14:08:49 GMT References: <14660011@hpsal2.HP.COM> Sender: news@omepd.UUCP Reply-To: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Organization: Stonehenge; netaccess via BiiN, Hillsboro, Oregon, USA Lines: 22 In-reply-to: morrell@hpsal2.HP.COM (Michael Morrell) In article <14660011@hpsal2.HP.COM>, morrell@hpsal2 (Michael Morrell) writes: | You can also force multicolumn output using the "-C" option to "ls". | Thus, "ls -CF | grep '[/@]$'" will work. Well, only if a directory or symbolic link shows up as the *last* file in a line. The other solution I saw, with ls -F | grep '[/@]$' | pr -5 -l1 -t is probably the only way to do it in one line with existing tools. (You need to adjust the "5" by trial-and-error.) Another bizarre solution is: ls -CFd `find . '(' -type d -o -type l ')' -print` which produces roughly the same list, if you don't mind getting subdirectories as well. And, I dislike having to 'ls' a file that 'find' already saw, but that's life. Just a UN*X Hacker, -- ***** PLEASE IGNORE THE ADDRESS IN THE HEADER ***** /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095===\ { ...!uunet!agora.hf.intel.com!merlyn } \=Cute quote: "Welcome to Oregon... home of the California Raisins!"=/