Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Unknown Newsgroups: comp.os.linux.misc Subject: Re: list but not dirs? Date: Tue, 3 Feb 2015 11:53:04 +0000 (UTC) Organization: A noiseless patient Spider Lines: 35 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 3 Feb 2015 11:53:04 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="ea6887ecdc90c816d706a3216cdf3233"; logging-data="30997"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+j8CEXfHvDAaJyy2PwOYYkgTAp6FXnZEs=" User-Agent: Pan/0.133 (House of Butterflies) Cancel-Lock: sha1:mC/fAh4GcLIVBRP6+SExk1VwQwc= Xref: csiph.com comp.os.linux.misc:13566 On Wed, 28 Jan 2015 14:51:30 +0000, Joe Beanfish wrote: > On Tue, 27 Jan 2015 08:10:30 +0000, Unknown wrote: > >> This must be one of the most fundamental commands !! >> >> I want to see all *.pdf [or any *] in all of my 30 workSpace, with each >> having average 3 eTerminals open. >> >> #!/bin/bash >> >> echo "List File:Arg1 inAll active Dirs:per:lsof" for Dirs in `lsof | >> grep cwd | awk '{print $9}' | sort| uniq`; do >> echo "In Dir: " $Dirs; >> # if [ -f "$Dirs/*$1" ]; then ?! Can't test BEFORE listing !! >> ls $Dirs/*$1; >> echo "<><><><><>"; >> done ----- >> But don't list any pdf > > "Works for me" as they say. Presumably you're running it as > scriptname pdf > > By do you mean $Dirs or sub directories of $Dirs? I probably meant *$1* must be a file [not directory-name]. > To go deep > use find instead of ls: > find $Dirs -name "*$1" -print; OK thanks, I'll need that too - later. Perhaps an alternative version. How do people keep their structured-menu of such utilities? Trying to remember is anti-computer-usage.