Linux equivalent to QNX's ws (walk directory structure) command?

G. Matthew Rice matt-s/rLXaiAEBtBDgjK7y7TUQ at public.gmane.org
Wed Jan 4 17:46:35 UTC 2006


bob <fcsoft-3Emkkp+1Olsmp8TqCH86vg at public.gmane.org> writes:
> QNX had a command which would walk down a directory structure executing a 
> command at each level.     They called it "ws".
> 
> Is there an equivalent in Linux?

Sure.  It's called find(1):

       find <somedir or 2> -type d (maybe -depth) 

and then pipe that to xargs(1) or use the -exec option with find.  I usually
prefer xargs(1).  Especially if there are a lot of matches.


> I did a quick look through my reference material and couldn't find it, so I
> thought I would ask before I set out to write my own.

It's very rare that I have to resort to writing my own programs.  Unix tools
generally are flexible enough to do what you want.  You may want to consider
grabbing a reference book like 'Linux in a Nutshell' and read over a lot of
the utilities that are available (or just start pouring over the section 1
man pages).

HTH,
-- 
g. matthew rice <matt-s/rLXaiAEBtBDgjK7y7TUQ at public.gmane.org>           starnix, toronto, ontario, ca
phone: 647.722.5301 x242                                  gpg id: EF9AAD20
http://www.starnix.com              professional linux services & products
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list