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 07:43:24 +0000 (UTC) Organization: A noiseless patient Spider Lines: 45 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 3 Feb 2015 07:43:24 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="ff4ecb1c933bae7750625ba671465bfd"; logging-data="10092"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18oJtmR6RpMiEfG66FQmqdYK+E85ymHk98=" User-Agent: Pan/0.133 (House of Butterflies) Cancel-Lock: sha1:u5YCP2Gw/CfLxUV78abBIuBRAYU= Xref: csiph.com comp.os.linux.misc:13560 On Tue, 27 Jan 2015 11:56:13 +0000, Chris Davies wrote: > Unknown wrote: >> 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" > > Your code appears to try to list all files matching a specified suffix > in the current directory of each process you have running. Is that what > you want? > > #!/bin/bash > # > SUFFIX="$1" > echo "Listing files of type $SUFFIX in all active directories" > > for DIR in $( lsof -u "$USER" | awk '$4=="cwd" && $5=="DIR" {print $9}' > | sort -u ) do > echo "In directory: $DIR" > for FILE in "$DIR"/*."$SUFFIX" > do > test -f "$FILE" && echo " $FILE" > done > echo > done > exit 0 > > Chris !! Fantastic !! Imagine how this helps you find recently accessed files in your 99 open eterminals. I've patched it to be more general purpose:.... for FILE in "$DIR"/*"$PartFlID"* Thanks a lot. The next big problem is to associate WorkSpaceNumber with pid/eTerminal. Old-kde3 showed each-pid grouped to its WS, via `pstree -p` Since then, `pstree -p` shows all pid, as descendents of ONE , with blackbox, my prefered windowManager.