Re: find and it uncommon syntax - grrrrrrrrr

2024-02-10 Thread gene heskett

On 2/10/24 16:07, Greg Wooledge wrote:

On Sat, Feb 10, 2024 at 02:58:24PM -0600, Nicholas Geovanis wrote:

On Sat, Feb 10, 2024, 2:46 PM gene heskett  wrote:


Greetings;

I have misplaced file someplace in /home/gene.
its name is bpim5*shelf.scad



Assuming that you are searching in the current working directory:
  find bpim*  -print | grep 'shelf.scad'


That's not correct.  The argument(s) that immediately follow find should
be the starting point(s) where it will begin its search.  Normally these
would be directories, especially the "." directory, which is actually
the default in GNU find (but not a default in POSIX find).

This command would only work if the file Gene's looking for happens to
be in his home directory, *or*, if the file he's looking for happens to
be underneath a *directory* whose name matches the bpim* glob.  This is
possible, but I wouldn't count on it.

Especially here. I resaved it, after a couple mods, in 
3dp-stf/genes-nas.  So searching thru all the children of "." should be 
the expected behavious. But finding that fraudulent pile of 2T disks was 
as bogus as a $3 bill, upsets my plans. The only usb-sata adapter I 
trust is StarTech, and its cable is 3x longer than I need. This bogus 
drive came sealed in a case that I had printed supports for that fit in 
2 shelf spaces, leaving room in the bottom of the care for a psu.  The 
sata package is bigger but would take 3 spaces for 6 of them, exiling 
the psu external to the cage.  So this job now printing is 4 more 
shelves, w/o the pi bolt pattern.  3dprinting is hard on memory, I've 
12G of 3dp.stf now.  Slicers and such are plain stupid, generating as 
much as 2 gigabytes for one complex part that takes 3 days to run. I've 
written 3 days jobs for a milling machine In 90 LOC because linuxcnc 
understands loops, none of the slicers or machines do, so the file you 
feed the printer is totally unrolled. And 10 to 30 times the size needed 
if the part file was converted from additive to subtractive.  It may get 
there, but probably after I miss roll call.


Thanks Greg.  Take care.

.


Cheers, Gene Heskett, CET.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis



Re: find and it uncommon syntax - grrrrrrrrr

2024-02-10 Thread Andy Smith
Hello,

On Sat, Feb 10, 2024 at 06:03:39PM -0500, gene heskett wrote:
> On 2/10/24 15:55, Greg Wooledge wrote:
> > find . -iname 'bpim5*shelf.scad'
> 
> Thank you Greg, it worked and 4 more copies are under construction now, but
> why is this not in the man page? Mind boggling.

Why can Gene not locate "iname" when it's right there in the "find"
man page? Mind boggling.

Why can Gene not type "how do I use GNU find to find a file by
name" into a web search engine and read any of the several links on
the first page of results? Mind boggling.

Thanks,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting



Re: find and it uncommon syntax - grrrrrrrrr

2024-02-10 Thread Andy Smith
Hello,

On Sat, Feb 10, 2024 at 03:46:09PM -0500, gene heskett wrote:
> I have misplaced file someplace in /home/gene.
> its name is bpim5*shelf.scad
> As usual it outputs 100,000 filenames, none of which is the one I am looking
> for. How in heck do you shut this thing up so it only spits out
> /the/path/to/the/file its looking for it it even found it?

Gene and his inability as usual to show us what he has tried and the
output he got - gr

> And where do I put that as an alias, in my .bashrc?

find is an extremely flexible command that can do a lot of different
queries so to get any sort of meaningful answer to this you'd have
to show us what exactly you tried.

Thanks,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting



Re: find and it uncommon syntax - grrrrrrrrr

2024-02-10 Thread gene heskett

On 2/10/24 15:55, Greg Wooledge wrote:

find . -iname 'bpim5*shelf.scad'


Thank you Greg, it worked and 4 more copies are under construction now, 
but why is this not in the man page? Mind boggling.


Cheers, Gene Heskett, CET.
--
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis



Re: find and it uncommon syntax - grrrrrrrrr

2024-02-10 Thread Greg Wooledge
On Sat, Feb 10, 2024 at 02:58:24PM -0600, Nicholas Geovanis wrote:
> On Sat, Feb 10, 2024, 2:46 PM gene heskett  wrote:
> 
> > Greetings;
> >
> > I have misplaced file someplace in /home/gene.
> > its name is bpim5*shelf.scad
> >
> 
> Assuming that you are searching in the current working directory:
>  find bpim*  -print | grep 'shelf.scad'

That's not correct.  The argument(s) that immediately follow find should
be the starting point(s) where it will begin its search.  Normally these
would be directories, especially the "." directory, which is actually
the default in GNU find (but not a default in POSIX find).

This command would only work if the file Gene's looking for happens to
be in his home directory, *or*, if the file he's looking for happens to
be underneath a *directory* whose name matches the bpim* glob.  This is
possible, but I wouldn't count on it.



Re: find and it uncommon syntax - grrrrrrrrr

2024-02-10 Thread Nicholas Geovanis
On Sat, Feb 10, 2024, 2:46 PM gene heskett  wrote:

> Greetings;
>
> I have misplaced file someplace in /home/gene.
> its name is bpim5*shelf.scad
>

Assuming that you are searching in the current working directory:
 find bpim*  -print | grep 'shelf.scad'

As usual it outputs 100,000 filenames, none of which is the one I am
> looking for. How in heck do you shut this thing up so it only spits out
> /the/path/to/the/file its looking for it it even found it?
>
> And where do I put that as an alias, in my .bashrc?
>
> Cheers, Gene Heskett, CET.
> --
> "There are four boxes to be used in defense of liberty:
>   soap, ballot, jury, and ammo. Please use in that order."
> -Ed Howdershelt (Author, 1940)
> If we desire respect for the law, we must first make the law respectable.
>   - Louis D. Brandeis
>
>


Re: find and it uncommon syntax - grrrrrrrrr

2024-02-10 Thread Greg Wooledge
On Sat, Feb 10, 2024 at 03:46:09PM -0500, gene heskett wrote:
> I have misplaced file someplace in /home/gene.
> its name is bpim5*shelf.scad
> As usual it outputs 100,000 filenames, none of which is the one I am looking

cd
find . -iname 'bpim5*shelf.scad'



Re: find question

2024-01-13 Thread Greg Wooledge
On Sun, Jan 14, 2024 at 12:25:03AM +1300, Richard Hector wrote:
> Except that from the man page, -delete implies -depth. Maybe that's a
> GNUism; I don't know.

Oh, maybe that's new?  I'm not sure.  Anyway, yeah, -delete is a GNUism.
POSIX find doesn't have it at all.

> That leaves the question: When using -delete (and -depth), does the deletion
> of files within a directory update the mtime of that directory, thereby
> rendering the directory inelegible for deletion when it would have been
> before? Or is the mtime of that directory recorded before the contents are
> processed?
> 
> I just did a quick test (using -mmin -1 instead), and it did delete the
> whole lot.

I don't know the answer to that.  Even in the worst case, though, you'd
just have an empty directory sitting around until some future run of
the cleanup script.  It would eventually be removed.

On the other hand, it might Just Work as you desire.

> So I'm still unclear why sometimes the top-level directory (or a directory
> within it) gets left behind. I've just noticed that one of the directories
> (not the one in $dir) contains a '@' symbol; I don't know if that affects
> it?

find should not care about the characters in the directory name.

> I'm tempted to avoid the problem by only using find for the top-level
> directory, and exec'ing "rm -r(f)" on it. I'm sure you'll tell me there are
> problems with that, too :-)

You never said that was an allowed solution. ;-)  The only drawback
to that solution would be if you didn't *want* to remove the entire
directory recursively.  If a directory has a timestamp that makes it
eligible for cleanup, but some file down inside it does not, do you
want to remove that file anyway?  If so, then sure, -exec rm -rf {} +
will get it done.



Re: find question

2024-01-13 Thread Richard Hector

On 30/12/23 01:27, Greg Wooledge wrote:

On Fri, Dec 29, 2023 at 10:56:52PM +1300, Richard Hector wrote:

find $dir -mtime +7 -delete


"$dir" should be quoted.


Got it, thanks.


Will that fail to delete higher directories, because the deletion of files
updated the mtime?

Or does it get all the mtimes first, and use those?


It doesn't delete directories recursively.

unicorn:~$ mkdir -p /tmp/foo/bar
unicorn:~$ touch /tmp/foo/bar/file
unicorn:~$ find /tmp/foo -name bar -delete
find: cannot delete ‘/tmp/foo/bar’: Directory not empty


Understood.


But I suppose you're asking "What if it deletes both the file and the
directory, because they both qualify?"

In that case, you should use the -depth option, so that it deletes
the deepest items first.

unicorn:~$ find /tmp/foo -depth -delete
unicorn:~$ ls /tmp/foo
ls: cannot access '/tmp/foo': No such file or directory

Without -depth, it would try to delete the directory first, and that
would fail because the directory's not empty.

-depth must appear AFTER the pathnames, but BEFORE any other arguments
such as -mtime or -name.


Except that from the man page, -delete implies -depth. Maybe that's a 
GNUism; I don't know.



And how precise are those times? If I'm running a cron job that deletes
7-day-old directories then creates a new one less than a second later, will
that reliably get the stuff that's just turned 7 days old?


The POSIX documentation describes it pretty well:

-mtime n  The primary shall evaluate as true if the  file  modification
  time  subtracted  from  the  initialization  time, divided by
  86400 (with any remainder discarded), is n.

To qualify for -mtime +7, a file's age as calculated above must be at
least 8 days.  (+7 means more than 7.  It does not mean 7 or more.)


So 7 days and one second doesn't count as "more than 7 days"? It 
truncates the value to integer days before comparing?


Ah, yes, I see that now under -atime. Confusing. Thanks for pushing me 
to investigate :-)



It's not uncommon for the POSIX documentation of a command to be superior
to the GNU documentation of that same command, especially a GNU man page.
GNU info pages are often better, but GNU man pages tend to be lacking.


Understood, thanks. Though it might be less correct where GNUisms exist.

That leaves the question: When using -delete (and -depth), does the 
deletion of files within a directory update the mtime of that directory, 
thereby rendering the directory inelegible for deletion when it would 
have been before? Or is the mtime of that directory recorded before the 
contents are processed?


I just did a quick test (using -mmin -1 instead), and it did delete the 
whole lot.


So I'm still unclear why sometimes the top-level directory (or a 
directory within it) gets left behind. I've just noticed that one of the 
directories (not the one in $dir) contains a '@' symbol; I don't know if 
that affects it?


I'm tempted to avoid the problem by only using find for the top-level 
directory, and exec'ing "rm -r(f)" on it. I'm sure you'll tell me there 
are problems with that, too :-)


Apologies for the slow response - sometimes the depression kicks in and 
I don't get back to a problem for a while :-(


Cheers,
Richard



Re: find question

2023-12-29 Thread Greg Wooledge
On Fri, Dec 29, 2023 at 10:56:52PM +1300, Richard Hector wrote:
> find $dir -mtime +7 -delete

"$dir" should be quoted.

> Will that fail to delete higher directories, because the deletion of files
> updated the mtime?
> 
> Or does it get all the mtimes first, and use those?

It doesn't delete directories recursively.

unicorn:~$ mkdir -p /tmp/foo/bar
unicorn:~$ touch /tmp/foo/bar/file
unicorn:~$ find /tmp/foo -name bar -delete
find: cannot delete ‘/tmp/foo/bar’: Directory not empty

But I suppose you're asking "What if it deletes both the file and the
directory, because they both qualify?"

In that case, you should use the -depth option, so that it deletes
the deepest items first.

unicorn:~$ find /tmp/foo -depth -delete
unicorn:~$ ls /tmp/foo
ls: cannot access '/tmp/foo': No such file or directory

Without -depth, it would try to delete the directory first, and that
would fail because the directory's not empty.

-depth must appear AFTER the pathnames, but BEFORE any other arguments
such as -mtime or -name.

> And how precise are those times? If I'm running a cron job that deletes
> 7-day-old directories then creates a new one less than a second later, will
> that reliably get the stuff that's just turned 7 days old?

The POSIX documentation describes it pretty well:

   -mtime n  The primary shall evaluate as true if the  file  modification
 time  subtracted  from  the  initialization  time, divided by
 86400 (with any remainder discarded), is n.

To qualify for -mtime +7, a file's age as calculated above must be at
least 8 days.  (+7 means more than 7.  It does not mean 7 or more.)

It's not uncommon for the POSIX documentation of a command to be superior
to the GNU documentation of that same command, especially a GNU man page.
GNU info pages are often better, but GNU man pages tend to be lacking.



Re: Find packages from a specific maintainer

2021-06-14 Thread Jonathan Dowland

On Sat, Jun 12, 2021 at 08:33:19PM +0200, Rasmus MK wrote:

Is it possible to search in the maintainer field with apt? If not, can
I lookup this information somewhere else?


The Debian QA site can provide you with a list.

For Debian XMPP Maintainers:


You can tweak the options below the big table to change filtering and
presentation to suit.


--
Please do not CC me, I am subscribed to the list.

  Jonathan Dowland
✎j...@debian.org
   https://jmtd.net



Re: Find packages from a specific maintainer

2021-06-12 Thread Francisco M Neto
Hello,

On 2021-06-12 20:33, Rasmus MK wrote:
> 
> Is it possible to search in the maintainer field with apt? If not, can I 
> lookup this
> information somewhere else?

I'm not sure about apt but you can check the tracker page for
that package. It will give you the name of the maintainer and clicking
on the 'DMD' link will take you to their dashboard. In the dashboard you
can see all the packages that person is involved with.

Cheers,

--
Francisco M Neto



Re: Find packages from a specific maintainer

2021-06-12 Thread Teemu Likonen
* 2021-06-12 20:33:19+0200, Rasmus MK wrote:

> When I run the command `apt show profanity` I can see that it is
> maintained by "Debian XMPP Maintainers". I'm interested in what other
> packages this maintainer/group maintains but don't understand how to
> get hold of it.
>
> Is it possible to search in the maintainer field with apt?

Yes. "aptitude" can do that:

aptitude search '?maintainer(Debian XMPP)'

-- 
/// Teemu Likonen - .-.. https://www.iki.fi/tlikonen/
// OpenPGP: 4E1055DC84E9DFF613D78557719D69D324539450


signature.asc
Description: PGP signature


Re: Find packages from a specific maintainer

2021-06-12 Thread Brad Rogers
On Sat, 12 Jun 2021 20:33:19 +0200
Rasmus MK  wrote:

Hello Rasmus,

>Is it possible to search in the maintainer field with apt? If not, can

IDK if that's possible but

>I lookup this information somewhere else?

...look up any package the maintainers deal with (profanity in this case)
at https://packages.debian.org

Select one of the repos (buster, jessie, etc. it doesn't matter)

On the page you're taken to on the right hand side of the screen is a
column "Links for {package name}".  Part way down is a section entitled
'Maintainers'.  In that section, click the link to 'QA Page' and you'll
be taken to the page with the info you're interested in.

-- 
 Regards  _
 / )   "The blindingly obvious is
/ _)radnever immediately apparent"
It's not your heart, it's your bank I want to break
It's Yer Money - Wonder Stuff


pgp9pEHw4fHkC.pgp
Description: OpenPGP digital signature


Re: Find packages from a specific maintainer

2021-06-12 Thread Greg Wooledge
On Sat, Jun 12, 2021 at 08:33:19PM +0200, Rasmus MK wrote:
> When I run the command `apt show profanity` I can see that it is
> maintained by "Debian XMPP Maintainers". I'm interested in
> what other packages this maintainer/group maintains

First, I looked at /var/lib/dpkg/status -- and that's fine, but it only
shows the packages that I have installed.  I'm guessing you want to search
for uninstalled packages as well.

So, next I looked in /var/lib/apt/lists/ and picked one of the several
lists there.  The format is easy enough to parse.  You can even do it
with an awk one-liner.

unicorn:~$ awk '/^Package:/{p=$2} /^Maintainer: Debian XMPP/{print p}' 
/var/lib/apt/lists/ftp.us.debian.org_debian_dists_bullseye_main_binary-amd64_Packages
dino-im
dino-im-common
gajim
gajim-antispam
gajim-appindicatorintegration
gajim-lengthnotifier
gajim-omemo
gajim-openpgp
gajim-pgp
gajim-plugininstaller
gajim-syntaxhighlight
gajim-triggers
gajim-urlimagepreview
gsasl
gsasl-common
gsasl-doc
libgsasl-dev
libgsasl7
libgsasl7-dev
jabber-muc
jabberd2
libjs-jac
jwchat
libphp-jabber
libsignal-protocol-c-dev
libsignal-protocol-c2.3.2
libstrophe-dev
libstrophe0
libloudmouth1-0
libloudmouth1-dev
mcabber
painintheapt
poezio
python3-poezio-poopt
profanity
profanity-light
prosody
prosody-modules
psi
psi-l10n
purple-rocketchat
python-nbxmpp-doc
python3-nbxmpp
python3-omemo
python3-omemo-backend-signal
libqxmpp-dev
libqxmpp-doc
libqxmpp3
sat-xmpp-core
sat-xmpp-jp
sat-xmpp-primitivus
sat-pubsub
sat-templates
python-slixmpp-doc
python3-slixmpp
python3-slixmpp-lib
sms4you
sms4you-doc
sms4you-email
sms4you-xmpp
libjs-strophe
libtaningia-dev
libtaningia0
telegram-purple
python3-urwid-satext



Re: Find latest netinstall iso

2020-08-06 Thread basti
Thanks, I get it.

FYI:

curl -sl
ftp://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/current/amd64/iso-cd/
| grep -m 1 -Po "[0-9.]{1,}(?=-amd64-netinst\.iso)"


On 06.08.20 12:36, Reco wrote:
>   Hi.
> 
> On Thu, Aug 06, 2020 at 12:14:23PM +0200, basti wrote:
>> Hello,
>> I try to setup a service that build a headless netinstall iso.
>> Is there a way to find the latest version number?
>>
>> I think grep the https://www.debian.org/CD/netinst/ site is not the best
>> option.
> 
> Will parsing [1] do, for instance searching kernel-image?
> 
> Reco
> 
> [1] 
> http://ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/udeb.list
> 



Re: Find latest netinstall iso

2020-08-06 Thread Reco
Hi.

On Thu, Aug 06, 2020 at 12:14:23PM +0200, basti wrote:
> Hello,
> I try to setup a service that build a headless netinstall iso.
> Is there a way to find the latest version number?
> 
> I think grep the https://www.debian.org/CD/netinst/ site is not the best
> option.

Will parsing [1] do, for instance searching kernel-image?

Reco

[1] 
http://ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/udeb.list



Re: Find obsolete packages without using aptitude?

2015-01-26 Thread Bob Proulx
Jörg-Volker Peetz wrote:
 Thanks Bob for the pointer. Yes the patch works. I also saw your reply to the
 bug report. Good idea.

And the bug in apt-show-versions was fixed and uploaded and all is
good now.  And a correction for my previous message which mentioned
Jessie.  As far as I can see the buggy version was never in Jessie.
It was Sid only and all fixed now.

  # apt-show-versions |grep xlockmore
  xlockmore:amd64 1:5.31-1.1 installed: No available version in archive

Bob


signature.asc
Description: Digital signature


Re: Find obsolete packages without using aptitude?

2015-01-20 Thread Jörg-Volker Peetz
Thanks Bob for the pointer. Yes the patch works. I also saw your reply to the
bug report. Good idea.
-- 
Regards,
jvp.



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/m9l3kl$e76$1...@ger.gmane.org



Re: Find obsolete packages without using aptitude?

2015-01-19 Thread Chris Bannister
On Sun, Jan 18, 2015 at 04:36:06PM -0700, Bob Proulx wrote:
 I think everyone should be worried about removed but not purged
 packages too.  Otherwise they are a source of lint that builds up on a
 system. 

apt-cache show cruft

I believe that lint is a c code checker. :)

-- 
If you're not careful, the newspapers will have you hating the people
who are being oppressed, and loving the people who are doing the 
oppressing. --- Malcolm X


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20150119161627.GD31842@tal



Re: Find obsolete packages without using aptitude?

2015-01-19 Thread Jörg-Volker Peetz
Note that apt-show-versions is not able to find installed packages which are no
longer available in the suite/release, e.g. on a testing/sid system, the
packages libtiff4 or xlockmore.
-- 
Regards,
jvp.



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/m9j506$ef8$1...@ger.gmane.org



Re: Find obsolete packages without using aptitude?

2015-01-19 Thread Bob Proulx
Chris Bannister wrote:
 Bob Proulx wrote:
  I think everyone should be worried about removed but not purged
  packages too.  Otherwise they are a source of lint that builds up on a
  system. 
 
 apt-cache show cruft

I had forgotten about cruft.  I just tried it again after many years.
It wasn't very good the last time I tried it.  I just started a run a
some minutes ago and it it is still running.  It appears that it will
run for a while.  I think it will probably be too slow to recommend.

 I believe that lint is a c code checker. :)

Yes.  Lint is also all of that blue stuff that collects in your
belly button.  Along with many other extra bits of fluff.  :-)

Bob


signature.asc
Description: Digital signature


Re: Find obsolete packages without using aptitude?

2015-01-19 Thread Bob Proulx
Jörg-Volker Peetz wrote:
 Note that apt-show-versions is not able to find installed packages
 which are no longer available in the suite/release, e.g. on a
 testing/sid system, the packages libtiff4 or xlockmore.

Works in Wheezy.

  Wheezy$ apt-show-versions | grep xlockmore
  xlockmore 1:5.31-1 installed: No available version in archive

But it appears to be a bug in Sid/Jessie.  I see this has already been
reported with this bug filed against it.

  https://bugs.debian.org/768978

There is a patch attached to the report.  When I try the attached
patch I see the correct output for xlockmore.

  Sid$ apt-show-versions | grep xlockmore
  xlockmore:amd64 1:5.31-1.1 installed: No available version in archive

It appears the bug needs some tlc and attention and will otherwise
release with Jessie.

Bob


signature.asc
Description: Digital signature


Re: Find obsolete packages without using aptitude?

2015-01-18 Thread Bob Proulx
Fredrik Jonson wrote:
 Jörg-Volker Peetz wrote:
   Bob Proulx wrote on 01/14/2015 06:25:
   Fredrik Jonson wrote:
I'm trying to find obsolete packages on a system that's been
dist-upgraded. How would you [do that without using] aptitude?
   
   Try this:
   
 apt-show-versions | grep -v uptodate
  
   This doesn't show all the results aptitude search ~o finds on my system
   [...] This shell command works for me:
  
   awk '/^Package: / {print $2}' /var/lib/dpkg/status | sort |
   (awk '/^Package: / {print $2}' /var/lib/apt/lists/*_Packages | sort |
   comm -23 --nocheck-order /dev/fd/3 -) 30
 
 Interesting. The shell command above indeed does include more packages that
 are obsolete on my system too.
 
 As far as I can tell the difference is that your awk command
 includes packages that have been removed but not purged, while
 apt-show-versions ignores non-purged packages that have only config
 files left.

Hmm...  If you have removed but not purged packages they aren't
installed packages.  So this difference isn't surprising.

I think everyone should be worried about removed but not purged
packages too.  Otherwise they are a source of lint that builds up on a
system.  They are a very useful inbetween status for packages.  Local
modifications can remain on the system in /etc and the package can be
quickly installed again and resume from the previous configuration.

But between major release upgrades they cause problems.  For example
files in /etc/init.d/* previously did not have LSB tags and now they
are required.  For example at some point in the future files from the
pre-systemd era will be problematic in a post-systemd one.  For
example there has been a lot of problems with php packages loading
shared libraries where there isn't a way to conditionally load them
based upon existence.  (Currently /etc crontabs always conditionally
load based upon file existence to work within the removed but not
purged state of things for example.)

Having a good backup mitigates the fear of purging a package.  With a
full backup of /etc any package can be purged and then if the local
admin wants to reverse that and install the package again the previous
configuration can be restored from backup.

Using a tool such as etckeeper also keeps track of files in /etc.
That is very useful.  I have become a convert to using etckeeper.
That also provides a good safety net for purging packages.

The easiest way to find removed but not purged is with grep.

  dpkg -l | grep ^rc

Or since I like grep-status and friends this can be done precisely
using it too.

  grep-status -sPackage -n -FStatus deinstall ok config-files

Purging lib packages should be very safe.  After reviewing the list I
often do it on the command line.

  dpkg --purge $(grep-status -sPackage -n -FStatus deinstall ok config-files 
| grep ^lib)

I do that for non-lib packages too but only after reviewing the list.

Bob


signature.asc
Description: Digital signature


Re: Find obsolete packages without using aptitude?

2015-01-17 Thread Jörg-Volker Peetz
Hi,

Bob Proulx wrote on 01/14/2015 06:25:
 Fredrik Jonson wrote:
 Here's a small challenge. I'm trying to find obsolete or orphaned packages
 on a system that's been dist-upgraded.
 ...
 How would you accomplish that assuming you cannot use aptitude?
 
 Try this:
 
   apt-show-versions | grep -v uptodate
 
snip

this doesn't show all the results aptitude serach ~o finds on my system (e.g.,
the package xlockmore). What the aptitude command does, I think, is comparing
the list of installed packages (as listed in the file /var/lib/dpkg/status)
against the list of known available packages (as listed in the files
/var/lib/apt/lists/*_Packages).
This shell command works for me:

awk '/^Package: / {print $2}' /var/lib/dpkg/status | sort |
(awk '/^Package: / {print $2}' /var/lib/apt/lists/*_Packages | sort |
 comm -23 --nocheck-order /dev/fd/3 -) 30

The comm command finds the packages only listed in the installed package list.

Regards,
jvp.



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/m9df1q$88l$1...@ger.gmane.org



Re: Find obsolete packages without using aptitude?

2015-01-17 Thread Fredrik Jonson
Jörg-Volker Peetz wrote:
  Bob Proulx wrote on 01/14/2015 06:25:
  Fredrik Jonson wrote:
   I'm trying to find obsolete packages on a system that's been
   dist-upgraded. How would you [do that without using] aptitude?
  
  Try this:
  
apt-show-versions | grep -v uptodate
 
  This doesn't show all the results aptitude search ~o finds on my system
  [...] This shell command works for me:
 
  awk '/^Package: / {print $2}' /var/lib/dpkg/status | sort |
  (awk '/^Package: / {print $2}' /var/lib/apt/lists/*_Packages | sort |
  comm -23 --nocheck-order /dev/fd/3 -) 30

Interesting. The shell command above indeed does include more packages that
are obsolete on my system too.

As far as I can tell the difference is that your awk command includes packages
that have been removed but not purged, while apt-show-versions ignores 
non-purged packages that have only config files left.

-- 
Fredrik Jonson


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/slrnmbklog.c3p.fred...@biggles.jonson.org



Re: Find obsolete packages without using aptitude?

2015-01-14 Thread Fredrik Jonson
Bob Proulx wrote:
 
  Try this:
 
apt-show-versions | grep -v uptodate
 
  Or read my answer posted here Saturday:
 
https://lists.debian.org/debian-user/2015/01/msg00358.html

Thanks, excellent. I'll try to improve the variety of my search phrases,
and digging deeper in the archive before posting next time.

-- 
Fredrik Jonson


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/slrnmbd6gi.g6k.fred...@biggles.jonson.org



Re: Find obsolete packages without using aptitude?

2015-01-13 Thread Bob Proulx
Fredrik Jonson wrote:
 Here's a small challenge. I'm trying to find obsolete or orphaned packages
 on a system that's been dist-upgraded.
 ...
 How would you accomplish that assuming you cannot use aptitude?

Try this:

  apt-show-versions | grep -v uptodate

Or read my answer posted here Saturday:

  https://lists.debian.org/debian-user/2015/01/msg00358.html

Bob


signature.asc
Description: Digital signature


Re: find problem

2014-11-25 Thread Roland Mueller
Hello,

2014-11-12 12:40 GMT+02:00 Raffaele Morelli raffaele.more...@gmail.com:

 On 11/11/14 at 04:09pm, B. M. wrote:
  Hi all,
 
  I'm struggling with a find problem.
 
  I want to combine find and par2create recursively in order to get the
  following done:
 
  Foreach file with a certain suffix (e.g. avi) do par2create for that
  file in its directory, so e.g.
 
  I'm in /video
  There are subfolders user1, user2 with videos video1.avi, video2.avi ...
  in them.
 
  The script should do something equivalent to:
  cd /video/user1
  par2create .video1.avi video1.avi
  par2create .video2.avi video2.avi
  cd /video/user2
  par2create .video3.avi video3.avi
  par2create .video4.avi video4.avi
  cd initial directory
 
  But I want to achieve this using the find command.
 


One solution should be to use find together with a read loop. Inside the
look get needed directory and base file names, and in a subshell jump into
the directory and execute the command (in following only using pwd and echo
for testing purposes).

Another alternative could use pushd/popd commands ...

$



*find . -type f -name *.avi | \   while read avi   do
avi_fn=$(basename $avi); avi_dir=$(dirname $avi);   ( cd $avi_dir
 pwd  echo par2create .${avi_fn}  $avi_fn );done*
/tmp/test/e/f
par2create .fifth.avi fifth.avi
/tmp/test/a/b
par2create .first.avi first.avi
/tmp/test/a/b
par2create .second.avi second.avi
/tmp/test/b
par2create .sixth.avi sixth.avi
/tmp/test/d
par2create .third.avi third.avi

Here is the contents of the test dir:
$ find . -type f
./e/f/fifth.avi
./a/b/first.avi
./a/b/second.avi
./b/sixth.avi
./d/third.avi

BR,
Roland



  So I'd expect something like
  find * -name *.avi -execdir par2create .'{}' '{} \;
  but this doesn't work as expected - it creates the .*.avi files one
  folder above.
 
  How does it work using the find command?
 
  Thanks a lot!

 I did a test with cp:
 find config/ -name custom.php -execdir cp '{}' '{}'.pippo \;
 files are copied with added suffix.


 --
 « Nunc est bibendum, nunc pede libero pulsanda tellus »


 --
 To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
 with a subject of unsubscribe. Trouble? Contact
 listmas...@lists.debian.org
 Archive: https://lists.debian.org/20141112104025.ga1...@gmail.com




Re: find problem

2014-11-12 Thread Raffaele Morelli
On 11/11/14 at 04:09pm, B. M. wrote:
 Hi all,
 
 I'm struggling with a find problem.
 
 I want to combine find and par2create recursively in order to get the
 following done:
 
 Foreach file with a certain suffix (e.g. avi) do par2create for that
 file in its directory, so e.g.
 
 I'm in /video
 There are subfolders user1, user2 with videos video1.avi, video2.avi ...
 in them.
 
 The script should do something equivalent to:
 cd /video/user1
 par2create .video1.avi video1.avi
 par2create .video2.avi video2.avi
 cd /video/user2
 par2create .video3.avi video3.avi
 par2create .video4.avi video4.avi
 cd initial directory
 
 But I want to achieve this using the find command.
 
 So I'd expect something like
 find * -name *.avi -execdir par2create .'{}' '{} \;
 but this doesn't work as expected - it creates the .*.avi files one
 folder above.
 
 How does it work using the find command?
 
 Thanks a lot!

I did a test with cp:
find config/ -name custom.php -execdir cp '{}' '{}'.pippo \;
files are copied with added suffix.


-- 
« Nunc est bibendum, nunc pede libero pulsanda tellus »


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20141112104025.ga1...@gmail.com



Re: find all installed packages from a specific release

2014-11-02 Thread Andrei POPESCU
On Du, 02 nov 14, 00:57:45, kamaraju kusumanchi wrote:
 
 Thanks. This is useful and solves my first question.

Oh, missed that one[1]. Aptitude, at least in interactive mode can do 
it, because it presents a Security Updates (or something like that) 
package group. One can just Shift-U on the group to update just those 
packages.

For the commandline it should be possible to come up with a pattern that 
finds upgradeable packages from a certain archive (origin?). Then it's 
only a matter of substituting 'search' with 'install'[2].

See chapter 2 in the aptitude user's manual (package aptitude-doc-en).

[1] maybe you shouldn't post unrelated questions in the same message?
[2] APT tools usually don't have a 'upgrade-package [list]' command, 
because 'install' does it.

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
http://nuvreauspam.ro/gpg-transition.txt


signature.asc
Description: Digital signature


Re: find all installed packages from a specific release

2014-11-01 Thread Andrei POPESCU
On Sb, 01 nov 14, 18:12:35, kamaraju kusumanchi wrote:
 
 Now, I want to retire the squeeze mirror. But before I do that I'd like to
 find all the packages installed on my machine from this mirror. Then I can
 decide whether I want to upgrade or delete or keep then as-is. Is there a
 way to find that out?

I think this should do it

aptitude search '?narrow(?installed,?archive(oldstable))'

You can replace the 'search' with 'remove' or 'purge' if you're 
satisfied with the result.

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic
http://nuvreauspam.ro/gpg-transition.txt


signature.asc
Description: Digital signature


Re: find all installed packages from a specific release

2014-11-01 Thread kamaraju kusumanchi
On Sat, Nov 1, 2014 at 7:38 PM, Andrei POPESCU andreimpope...@gmail.com
wrote:

 I think this should do it

 aptitude search '?narrow(?installed,?archive(oldstable))'


Thanks. This is useful and solves my first question.

raju
-- 
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/


Re: find out why a package was installed

2014-10-12 Thread Lisi Reisz
On Friday 10 October 2014 14:31:26 Marius Gavrilescu wrote:
 Rob Owens row...@ptd.net writes:
  Is there an apt command that will tell me why package X was installed?
  For instance, was it manually installed, or installed as a
  dependency/recommends of package Y?

 aptitude why package

I like to look (again) at commands atht come up in thsi way.  So I ran a 
specimen.  I loved teh conversation that ensued and its ending:

 lisi@Tux-II:~$ aptitude why cups
i   printer-driver-splix Depends cups (= 1.5.0-3~)
lisi@Tux-II:~$ aptitude why printer-driver-splix
i   splix Depends printer-driver-splix
lisi@Tux-II:~$ aptitude why splix
Unable to find a reason to install splix.
lisi@Tux-II:~$
;-))

The reason, of course, is that I told it to do so.

Lisi


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/201410121722.09025.lisi.re...@gmail.com



Re: find out why a package was installed

2014-10-10 Thread Marius Gavrilescu
Rob Owens row...@ptd.net writes:

 Is there an apt command that will tell me why package X was installed?
 For instance, was it manually installed, or installed as a
 dependency/recommends of package Y?

aptitude why package
-- 
Marius Gavrilescu


pgpikZUJbtMQu.pgp
Description: PGP signature


Re: find out why a package was installed

2014-10-10 Thread Martin Read

On 10/10/14 14:28, Rob Owens wrote:

Is there an apt command that will tell me why package X was installed?  For 
instance, was it manually installed, or installed as a dependency/recommends of 
package Y?


aptitude why package-x

will show you exactly one reason why package-x is installed.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org

Archive: https://lists.debian.org/5437e226.4090...@zen.co.uk



Re: find out why a package was installed

2014-10-10 Thread Rob Owens
- Original Message -
 From: Marius Gavrilescu mar...@ieval.ro
 Rob Owens row...@ptd.net writes:
 
  Is there an apt command that will tell me why package X was installed?
  For instance, was it manually installed, or installed as a
  dependency/recommends of package Y?
 
 aptitude why package

Thanks Marius and Martin.  That was jingling around in my head somewhere, but I 
was trying 'apt-cache why'.

-Rob


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/599489661.9765229.1412959428648.javamail.zim...@ptd.net



Re: find

2014-09-24 Thread The Wanderer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 09/24/2014 at 10:29 AM, Gokan Atmaca wrote:

 Within a directory backup tar.gz files you want to delete older 
 than 1 day.
 
 I'm doing this as follows. But do not be.
 
 find /backup/ +1 -delete -mtime
 
 Can you help?

I'm not terribly familiar with the intricacies of find options, though
I'm decently competent with the basics - but at a glance, I think the +1
is in the wrong place. Positioned before the options like that, I think
it's being treated as another path to search.

Does

find /backup/ -delete -mtime +1

do what you want?

- -- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man. -- George Bernard Shaw
-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAEBCgAGBQJUItcXAAoJEASpNY00KDJrJr8QAJNghpUt2kKwUkPvgUUa4zst
NW080v/tU6V2VAJCtb9I7YuFxUp44bAYMXxxawBpB1SDTEAzq/IOe0GGpNYMWjvh
uEM/7tQ93FdG0JIO6GnESMGCOsb6VH8G8Km8N7L55tuhdmfjhXSTRSIB/BEqHCrN
2sfom/pNB6LMXafTv24RBvUMM1JQeHSVQPsqyyC0klolAatOHOU+3tAqtA1QpNbL
R3132NDGDR0zo81Gfih220GE7qZrF63t/Un9GQgcR71nm0w3dvoM1sSWAUF+EJk3
xAaNHatCo+/hqzfeDpPGUgeDXWRRl+UqWcoWHWPzr/sHfFEAbp9Njg1xAUjyY6kX
ZEy01dVqeWFWhC937t5rMxUa3ioh5gBzDJH92XHXJkZLxXmdfXR+eBavAO4lrUeu
zZ9AL4TkLBew5TyvBwuuyUIZVYuIdlR53KqOUN9WlzaBpmwavj+Q5HTyvbBHPPk4
7erYttns0Fs/kCE0r7xg0ifT/W1hV2kyYvAJE5sCnwJ5C+mI7C3p1UqdDfbARS1E
oszRpddgZNJ/6OC0qQy3i8RxGyI2RnooZDaO3rZx+uOig0iLr9uEhQNzGpGsJaqn
3sJQChE5VcrNf6VCpTMJkhaDGLUlunmI9ndj8hOZXVY44QNmkPj086t6lNBLYw4n
NWU2l5Bt1A7O+ckiRR6w
=oHTU
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/5422d717.7090...@fastmail.fm



Re: find

2014-09-24 Thread Gokan Atmaca
Thanks for the correction.

Indeed, will be as follows;
find /arsiv/backup/ -mtime +1 -delete

On Wed, Sep 24, 2014 at 5:37 PM, The Wanderer wande...@fastmail.fm wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA512

 On 09/24/2014 at 10:29 AM, Gokan Atmaca wrote:

 Within a directory backup tar.gz files you want to delete older
 than 1 day.

 I'm doing this as follows. But do not be.

 find /backup/ +1 -delete -mtime

 Can you help?

 I'm not terribly familiar with the intricacies of find options, though
 I'm decently competent with the basics - but at a glance, I think the +1
 is in the wrong place. Positioned before the options like that, I think
 it's being treated as another path to search.

 Does

 find /backup/ -delete -mtime +1

 do what you want?

 - --
The Wanderer

 The reasonable man adapts himself to the world; the unreasonable one
 persists in trying to adapt the world to himself. Therefore all
 progress depends on the unreasonable man. -- George Bernard Shaw
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1

 iQIcBAEBCgAGBQJUItcXAAoJEASpNY00KDJrJr8QAJNghpUt2kKwUkPvgUUa4zst
 NW080v/tU6V2VAJCtb9I7YuFxUp44bAYMXxxawBpB1SDTEAzq/IOe0GGpNYMWjvh
 uEM/7tQ93FdG0JIO6GnESMGCOsb6VH8G8Km8N7L55tuhdmfjhXSTRSIB/BEqHCrN
 2sfom/pNB6LMXafTv24RBvUMM1JQeHSVQPsqyyC0klolAatOHOU+3tAqtA1QpNbL
 R3132NDGDR0zo81Gfih220GE7qZrF63t/Un9GQgcR71nm0w3dvoM1sSWAUF+EJk3
 xAaNHatCo+/hqzfeDpPGUgeDXWRRl+UqWcoWHWPzr/sHfFEAbp9Njg1xAUjyY6kX
 ZEy01dVqeWFWhC937t5rMxUa3ioh5gBzDJH92XHXJkZLxXmdfXR+eBavAO4lrUeu
 zZ9AL4TkLBew5TyvBwuuyUIZVYuIdlR53KqOUN9WlzaBpmwavj+Q5HTyvbBHPPk4
 7erYttns0Fs/kCE0r7xg0ifT/W1hV2kyYvAJE5sCnwJ5C+mI7C3p1UqdDfbARS1E
 oszRpddgZNJ/6OC0qQy3i8RxGyI2RnooZDaO3rZx+uOig0iLr9uEhQNzGpGsJaqn
 3sJQChE5VcrNf6VCpTMJkhaDGLUlunmI9ndj8hOZXVY44QNmkPj086t6lNBLYw4n
 NWU2l5Bt1A7O+ckiRR6w
 =oHTU
 -END PGP SIGNATURE-


 --
 To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
 with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
 Archive: https://lists.debian.org/5422d717.7090...@fastmail.fm



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/cahg8tea7ox6paqz8onv9q8vwqxwmk3egbzq-l1vi4x1a6hq...@mail.gmail.com



Re: find

2014-09-24 Thread Rob Owens
- Original Message -
 From: Gokan Atmaca linux.go...@gmail.com
 
 Thanks for the correction.
 
 Indeed, will be as follows;
 find /arsiv/backup/ -mtime +1 -delete
 

The +1 will get rounded up, according to the man page:

 File was last accessed n*24 hours ago.  When  find  figures  out
how  many  24-hour  periods  ago the file was last accessed, any
fractional part is ignored, so to match -atime +1, a file has to
have been accessed at least two days ago.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/759560357.3288267.1411569959186.javamail.zim...@ptd.net



Re: find

2014-09-24 Thread Jonathan Dowland
On Wed, Sep 24, 2014 at 05:40:08PM +0300, Gokan Atmaca wrote:
 Indeed, will be as follows;
 find /arsiv/backup/ -mtime +1 -delete

Yes, it's important the delete comes after -mtime, otherwise it will be
performed before the mtime check. You may also want a '-type f' or
/arsiv/backup itself might be removed.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/20140924144713.GA2627@debian



Re: find

2014-09-24 Thread Martin Steigerwald
Am Mittwoch, 24. September 2014, 17:29:22 schrieb Gokan Atmaca:
 Within a directory backup tar.gz files you want to delete older than 1
 day.
 
 I'm doing this as follows. But do not be.
 
 find /backup/ +1 -delete -mtime
 
 Can you help?

find /backup -mtime +0 -delete

find counts days as integers. More than 1 day in integer is everything from day 
2 onwards.

(yes thats crazy, but that is how find calculates it.

Use -ls instead of -delete for a test run.

Ciao,
-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/26638004.6Kn25MoDr0@merkaba



Re: find

2014-09-24 Thread Gokan Atmaca
 find /backup -mtime +0 -delete

Command worked. So 7 days than what do I do to delete old files.

Example: find /backup -mtime +6 -delete ?

Thanks...



On Wed, Sep 24, 2014 at 5:49 PM, Martin Steigerwald mar...@lichtvoll.de wrote:
 Am Mittwoch, 24. September 2014, 17:29:22 schrieb Gokan Atmaca:
 Within a directory backup tar.gz files you want to delete older than 1
 day.

 I'm doing this as follows. But do not be.

 find /backup/ +1 -delete -mtime

 Can you help?

 find /backup -mtime +0 -delete

 find counts days as integers. More than 1 day in integer is everything from 
 day
 2 onwards.

 (yes thats crazy, but that is how find calculates it.

 Use -ls instead of -delete for a test run.

 Ciao,
 --
 Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
 GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7


 --
 To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
 with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
 Archive: https://lists.debian.org/26638004.6Kn25MoDr0@merkaba



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
https://lists.debian.org/cahg8tebmyftzh8zbytiwbkbnm5fxjxab7yp-a0tzh+szt7g...@mail.gmail.com



Re: find d'un répertoire et supprimer une expression dans des fichiers

2013-10-16 Thread Jean-Jacques Doti

Salut,

Le 16/10/2013 14:48, andre_deb...@numericable.fr a écrit :

Bonjour,

Honte à moi, je sais pas faire,

Je désire accoupler à la commande find,
la recherche d'une expression dans tous les fichiers
d'un répertoire et ensuite de supprimer cette expression par rien.

Soit un modèle comme ceci :
- find /var -exec egrep -n expression {} \; -print;
- cat fichier | grep -n expression
- sed -i 's/expression//g' fichier

Je n'arrive pas à le faire par une ligne sinon par un programme bash.

Merci d'avance.

andré

Tu peux laisser tomber le find en utilisant la possibilité qu'a grep de 
parcourir une arborescence et à ne cracher que les noms des fichiers 
dans lesquels le motif a été trouvé.

Je pense que quelque chose comme ça doit pouvoir répondre à ta demande :

$ egrep -lR expression /var/ | xargs -d '\n' -n 1 sed -i 
's/expression//g'


egrep va sortir les noms des fichiers qui contiennent on expression et 
xargs va appeler sed pour chacun de ces noms, en prenant le retour à la 
ligne comme séparateur, ce qui permet de traiter correctement les 
fichiers dont le nom contient des espaces (l'option -n 1 de xargs 
permet d'appeler sed pour chacun des fichiers dans lesquels expression 
a été trouvé ; tu peux supprimer cette option et n'appeler sed qu'une 
seule fois pour plus d'efficacité à condition qu'il n'y ait pas trop de 
résultats ou mettre une valeur plus importante pour faire moins d'appels 
à sed).


A+
Jean-Jacques

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: http://lists.debian.org/525e9037.40...@doti.fr



Re: find d'un répertoire et supprimer une expression dans des fichiers

2013-10-16 Thread Sébastien NOBILI
Bonjour,

Le mercredi 16 octobre 2013 à 14:48, andre_deb...@numericable.fr a écrit :
 Soit un modèle comme ceci :
 - find /var -exec egrep -n expression {} \; -print;
 - cat fichier | grep -n expression
 - sed -i 's/expression//g' fichier

Quelque chose comme ça ?
find /var -type f -exec sed -i 's/expression//g' {} \;

Je te conseille de tester ta commande dans un dossier moins sensible que /var
avant de te lancer (et p'têt aussi de t'assurer que tu as une bonne sauvegarde
dans un coin…).

Seb

-- 
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: http://lists.debian.org/20131016131139.gf14...@sebian.nob900.homeip.net



Re: find d'un répertoire et supprimer une expression dans des fichiers

2013-10-16 Thread Dominique Asselineau
Sébastien NOBILI wrote on Wed, Oct 16, 2013 at 03:11:39PM +0200
 Bonjour,
 
 Le mercredi 16 octobre 2013 à 14:48, andre_deb...@numericable.fr a écrit :
  Soit un modèle comme ceci :
  - find /var -exec egrep -n expression {} \; -print;
  - cat fichier | grep -n expression
  - sed -i 's/expression//g' fichier
 
 Quelque chose comme ça ?
 find /var -type f -exec sed -i 's/expression//g' {} \;
 
 Je te conseille de tester ta commande dans un dossier moins sensible que /var
 avant de te lancer (et p'têt aussi de t'assurer que tu as une bonne sauvegarde
 dans un coin???).

Et ça n'est pas du tout sûr que ce soit suffisant.  Le /var contient
des choses dynamiques, notamment si un serveur SQL tourne avec le
risque de désynchroiser les fichiers et ce que contient le cache du
dit serveur.  Et il y a peut-être d'autres daemons qui pourraient être
« impactés » ?  Bref, ça me paraît bien téméraire de lancer une telle
commande globalement sur tout /var.

dom
--

-- 
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: http://lists.debian.org/20131016135951.gc15...@telecom-paristech.fr



Re: find d'un répertoire et supprimer une expression dans des fichiers

2013-10-16 Thread Philippe Gras

OK, tournons la question avec un autre exemple que /var

Moi aussi, ça m'intéresse ce truc :-)

Le 16 oct. 13 à 15:59, Dominique Asselineau a écrit :


Sébastien NOBILI wrote on Wed, Oct 16, 2013 at 03:11:39PM +0200

Bonjour,

Le mercredi 16 octobre 2013 à 14:48, andre_deb...@numericable.fr a  
écrit :

Soit un modèle comme ceci :
- find /var -exec egrep -n expression {} \; -print;
- cat fichier | grep -n expression
- sed -i 's/expression//g' fichier


Quelque chose comme ça ?
find /var -type f -exec sed -i 's/expression//g' {} \;

Je te conseille de tester ta commande dans un dossier moins  
sensible que /var
avant de te lancer (et p'têt aussi de t'assurer que tu as une  
bonne sauvegarde

dans un coin???).


Et ça n'est pas du tout sûr que ce soit suffisant.  Le /var contient
des choses dynamiques, notamment si un serveur SQL tourne avec le
risque de désynchroiser les fichiers et ce que contient le cache du
dit serveur.  Et il y a peut-être d'autres daemons qui pourraient être
« impactés » ?  Bref, ça me paraît bien téméraire de lancer une telle
commande globalement sur tout /var.

dom
--

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet  
unsubscribe

vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: http://lists.debian.org/20131016135951.GC15973@telecom- 
paristech.fr




--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: 
http://lists.debian.org/97bf1b3f-fb7f-4003-a753-6199d6363...@worldonline.fr



Re: find d'un répertoire et supprimer une expression dans des fichiers

2013-10-16 Thread andre_debian
On Wednesday 16 October 2013 17:44:39 Philippe Gras wrote:
 OK, tournons la question avec un autre exemple que /var
 Moi aussi, ça m'intéresse ce truc :-)

Merci. 

Ça marche très bien :

$ egrep -lR expression /home/andre/essai/ | xargs -d '\n' -n 1 sed -i 
's/expression//g'

 Le 16 oct. 13 à 15:59, Dominique Asselineau a écrit :
  Sébastien NOBILI wrote on Wed, Oct 16, 2013 at 03:11:39PM +0200
  Quelque chose comme ça ?
  find /var -type f -exec sed -i 's/expression//g' {} \;
  Je te conseille de tester ta commande dans un dossier moins
  sensible que /var
  avant de te lancer (et p'têt aussi de t'assurer que tu as une
  bonne sauvegarde
  dans un coin???).

  Et ça n'est pas du tout sûr que ce soit suffisant.  Le /var contient
  des choses dynamiques, notamment si un serveur SQL tourne avec le
  risque de désynchroniser les fichiers et ce que contient le cache du
  dit serveur.  Et il y a peut-être d'autres daemons qui pourraient être
  « impactés » ?  Bref, ça me paraît bien téméraire de lancer une telle
  commande globalement sur tout /var.
  dom

Merci de me prévenir, je vais faire très attention en me limitant à des 
sous-répertoires
de /var/ ...

andré

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: http://lists.debian.org/201310161900.12696.andre_deb...@numericable.fr



Re: find and copy [Solved]

2013-09-17 Thread Chris Bannister
On Mon, Sep 16, 2013 at 12:19:39PM -0500, Craig L. wrote:
 On Fri, Sep 06, 2013 at 12:52:09PM +1000, Zenaan Harkness wrote:
  
  You should be bonza, fab, good to go :)
[...]
 Well I don't know about bonza, and I thought fab was back in the sixties :).

http://news.bbc.co.uk/2/hi/entertainment/1002177.stm

-- 
If you're not careful, the newspapers will have you hating the people
who are being oppressed, and loving the people who are doing the 
oppressing. --- Malcolm X


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130917150811.GE12457@tal



Re: find and copy [Solved]

2013-09-16 Thread Craig L.
On Fri, Sep 06, 2013 at 12:52:09PM +1000, Zenaan Harkness wrote:
 
 Sorry, I forgot you needed renaming. So -I option to xargs may be
 useful for you.
 
 OK, try something like this:
 
   sh -c 'cp $0 /tmp/data.backup/${HOSTNAME}.${0:2}' {} \;
 
 find /tmp/var -mmin -60 -a -iname '*.sql' -type f \
  | xargs -n 50 basename -a \
  | xargs -I NAME echo cp /tmp/data.backup/NAME \
  /tmp/var/$HOSTNAME.`date +%Y%m%d-%H.%M.%S.%N`.NAME.backup
 
 You should be bonza, fab, good to go :)
 
 Let us know if that does the trick,
 Zenaan

Hi Zenaan,

Well I don't know about bonza, and I thought fab was back in the sixties :).
But you got it, with two minor caveats. There is no -a for basename, and (I
wouldn't expect you to really catch this, just pointing it out) the directory
names are backwards in the cp statement. I want to copy from /tmp/var/ to
/tmp/data.backup.

But you get the kudos, and my appreciation for putting the time into this. I've
been stuck taking care of some broken databases, but then that is my job and I
do actually enjoy it. :)

Zenaan, thanks for the help.

Craig


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130916171939.ga5...@prod1.getsouthern.com



Re: find and copy

2013-09-05 Thread Craig L.
Thanks Zenaan, for moving this back on-list (to anyone interested, I replied
privately by mistake. Zenaan was gracious enough to accept my mistake)

On Wed, Sep 04, 2013 at 07:16:42AM +1000, Zenaan Harkness wrote:
 
 It seems I was a bit cavalier on more than one count. My apologies.

No apology necessary. I was cranky that day, and I think we're good. You were
trying to help and that's more important to me.

 
  Actaully I considered xargs, but I am very lacking in knowledge
  of it, and the man page did not offer a solution (that I could see)
  either. Your suggestion included here will not work, nor will your
  follow-up suggestion (although the suggestions are appreciated).
 
 Actually, a bit of tweaking and it will work.

Of course. That's the beauty of an OS built on user desires. :)

 
  Both seem to be trying to copy the string '{}' and the directory
  /var/data.backup/ to the directory name that is being piped to
  xargs, the name of the found file in this case, which is how I
  understand xargs to funtion. Regardless, I get the same error to
  both:
 
 cp: target `dump_08-31-13.sql' is not a directory
 
 Ah yes, well then an argument to cp should do it:
 ... | xargs cp -t /var/data.backup/
 
 ought to do the job. And you can test first with the following:
 ... | xargs echo cp -t /var/data.backup/
 

This works in that it copies the found files to /var/data.backup, but does not
rename it in the process. I'm on another system right now without PostgreSQL,
but my testing was as follows:
   mkdir /tmp/var
   mkdir /tmp/data.backup
   touch /tmp/var/test.sql
   find /tmp/var -mmin -60 -a -iname '*.sql' 2/dev/null | \
  xargs echo cp -t /tmp/data.backup

which outputs this:
   cp -t /tmp/data.backup /tmp/var/test.sql

and then this (without the echo this time)
   find /tmp/var -mmin -60 -a -iname '*.sql' 2/dev/null | \
  xargs cp -t /tmp/data.backup
   ls -l /tmp/data.backup/

outputs this:
   -rw-r--r--  1 craig craig0 Sep  5 19:13 test.sql


Of course, being Linux, there is always yet another way (this without xargs):
   find /tmp/var -mmin -60 -a -iname '*.sql' -execdir \
  sh -c 'cp $0 /tmp/data.backup/${HOSTNAME}.${0:2}' {} \;
   ls -l /tmp/data.backup/

results in:
   -rw-r--r--  1 craig craig0 Sep  5 19:14 craigbox.test.sql
   -rw-r--r--  1 craig craig0 Sep  5 19:13 test.sql

The {} argument to sh is $0, and ${0:2} extracts the substring starting after
position 2, from the string represented by {} (./test.sql in this case). It
effectively strips the leading ./

Two caveats regarding that solution:
I have sh pointing to bash on my system. None of the above is tested using dash
which is the default shell on Debian these days. I would expect the same
results, but I am completely unfamiliar with dash.
And, I am pretty sure the sh spawns a subshell for each file found, so in my
case where I know there will only be up to three files it will take minimal
time and resources. I am unsure about the hit a large number of matches would
incur, especially if the files copied are large too.

Cheers,
Craig


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20130906011026.ga26...@prod1.getsouthern.com



Re: find and copy

2013-09-05 Thread Zenaan Harkness
On 9/6/13, Craig L. cr...@gtek.biz wrote:
 On Wed, Sep 04, 2013 at 07:16:42AM +1000, Zenaan Harkness wrote:

  Both seem to be trying to copy the string '{}' and the directory
  /var/data.backup/ to the directory name that is being piped to
  xargs, the name of the found file in this case, which is how I
  understand xargs to funtion. Regardless, I get the same error to
  both:
 
 cp: target `dump_08-31-13.sql' is not a directory

 Ah yes, well then an argument to cp should do it:
 ... | xargs cp -t /var/data.backup/

 ought to do the job. And you can test first with the following:
 ... | xargs echo cp -t /var/data.backup/
 

 This works in that it copies the found files to /var/data.backup, but does
 not
 rename it in the process. I'm on another system right now without
 PostgreSQL,
 but my testing was as follows:
mkdir /tmp/var
mkdir /tmp/data.backup
touch /tmp/var/test.sql
find /tmp/var -mmin -60 -a -iname '*.sql' 2/dev/null | \
   xargs echo cp -t /tmp/data.backup

 which outputs this:
cp -t /tmp/data.backup /tmp/var/test.sql

Sorry, I forgot you needed renaming. So -I option to xargs may be
useful for you.

OK, try something like this:

  sh -c 'cp $0 /tmp/data.backup/${HOSTNAME}.${0:2}' {} \;

find /tmp/var -mmin -60 -a -iname '*.sql' -type f \
 | xargs -n 50 basename -a \
 | xargs -I NAME echo cp /tmp/data.backup/NAME \
 /tmp/var/$HOSTNAME.`date +%Y%m%d-%H.%M.%S.%N`.NAME.backup

You should be bonza, fab, good to go :)

Let us know if that does the trick,
Zenaan


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/caosgnsrevtp3wew58jj31mremt60xk+3iqipdnwdjg7_ifj...@mail.gmail.com



Re: find and copy

2013-09-03 Thread Zenaan Harkness
On 9/3/13, Craig L. cr...@gtek.biz wrote:
 On Sun, Sep 01, 2013 at 11:26:07AM +1000, Zenaan Harkness wrote:
 On 9/1/13, Craig L. cr...@gtek.biz wrote:
  but evidently not quite ...
 
 find /var/lib/postgresql/9.1/backup -mmin -60 -a -iname '*.sql' \
 -execdir cp '{}' /var/data.backup/ ';'
 
  copies the file to /var/data.backup/dump_08-31-13.sql just fine.

 It is evident that you are achieving part of what you want.

 It is evident (since you are asking a question), that you are failing
 to achieve the other part of what you want. It was unnecessary to have
 pointed it out, so apologies for that.

 That was my reason for stating it the way I did, to show that I could do
 it,
 but only I did not want my file renamed in the process.

It seems I was a bit cavalier on more than one count. My apologies.

 Actually, what you want I think is independent of stdout, as in, you
 perhaps could use xargs

 I think so too.

  I'm not familiar with -exec option.
 
  With all due respect, follow your advice: man find and search for
  -exec.

 With all due respect, _you_ are the one seeking assistance. I tried to
 point you in a direction I knew about and thought might be useful to
 you. It is not my job to come up with the perfect solution for you, so

 Agreed, but the suggestion you first offered (formatted shell output) seemed
 to
 have nothing to do with my goal of command execution. Then you mentioned
 ignorance at the action I was trying to use, so I offered you the same help
 you
 offered me: read the man page. I was not trying to offend you and apologies
 if
 you were. FWIW, I always go to the man page first. After all they've been
 around a lot longer that Google has. Or Debian for that matter.

:)

  I would still like to know how to do it as a find action if anyone
  has suggestions.

 I don't. But |xargs is how I would do it, eg:

 find /var/lib/postgresql/9.1/backup -mmin -60 -a -iname '*.sql' -printf
 blah \
 | xargs cp '{}' /var/data.backup/

 Actaully I considered xargs, but I am very lacking in knowledge
 of it, and the man page did not offer a solution (that I could see)
 either. Your suggestion included here will not work, nor will your
 follow-up suggestion (although the suggestions are appreciated).

Actually, a bit of tweaking and it will work.

 Both seem to be trying to copy the string '{}' and the directory
 /var/data.backup/ to the directory name that is being piped to
 xargs, the name of the found file in this case, which is how I
 understand xargs to funtion. Regardless, I get the same error to
 both:

cp: target `dump_08-31-13.sql' is not a directory

Ah yes, well then an argument to cp should do it:
... | xargs cp -t /var/data.backup/

ought to do the job. And you can test first with the following:
... | xargs echo cp -t /var/data.backup/


Cheers :)
Zenaan


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/caosgnstn4fzxp_bbu-tzu2mjxnth9tduxokix_zey7agoyo...@mail.gmail.com



Re: find and coy

2013-08-31 Thread Zenaan Harkness
On 9/1/13, cr...@gtek.biz cr...@gtek.biz wrote:
 find the recent file and copy only it. I have no problem developing that
 find command,

but evidently not quite ...

 but I want to rename the copy in the process by pre-pending
 the file name with the hostname so I can differentiate between dumps from
 different servers. I don't want bother with having to implement a
 destination directory structure since new systems may come and go. So I am
 trying to see how this works by echoing the find output, and I can see what
 the problem is but I don't know how to get around it. find's {} place holder
 is expanding to ./filename and I need just filename

man find, and search for -printf format,
ie type man findenter/\-printf format

Looks like you want a variation on this option:
  -printf %f\n

or perhaps -fprintf option

I'm not familiar with -exec option.

Good luck
Zenaan


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/caosgnsqsis3x-r06az_p0tha_7pkd_q-n0+gpjs5ajgzf8e...@mail.gmail.com



Re: find and coy

2013-08-31 Thread Craig L.
Thanks Zenaan (and apologies to all for the poor formatting of my original
post. I forgot this bloody web interface defaults to that. fmt to the rescue)

On Saturday, August 31, 2013 11:16, Zenaan Harkness z...@freedbms.net said:

 On 9/1/13, cr...@gtek.biz cr...@gtek.biz wrote:
 find the recent file and copy only it. I have no problem developing that
 find command,
 
 but evidently not quite ...

   find /var/lib/postgresql/9.1/backup -mmin -60 -a -iname '*.sql' \
   -execdir cp '{}' /var/data.backup/ ';'

copies the file to /var/data.backup/dump_08-31-13.sql just fine.

 but I want to rename the copy in the process by pre-pending
 the file name with the hostname so I can differentiate between dumps from
 different servers. I don't want bother with having to implement a
 destination directory structure since new systems may come and go. So I am
 trying to see how this works by echoing the find output, and I can see what
 the problem is but I don't know how to get around it. find's {} place holder
 is expanding to ./filename and I need just filename
 
 man find, and search for -printf format,
 ie type man findenter/\-printf format
 
 Looks like you want a variation on this option:
   -printf %f\n

printf is one of the actions that find can take when a match occurs,
and its action is to output the match to stdout. I don't want to output
the filename to stdout.

 
 I'm not familiar with -exec option.

With all due respect, follow your advice: man find and search for
-exec. It is another possible action, not an option. It is listed in the
man page about 13 actions up from -printf format. Instead of printing
the match to stdout, it allows you to define a command to execute on the
match, substituting the string {} with the match and then executing the
defined command on each match. -execdir does the same, but does so as if
CWD was the directory in which the match occurred. This is what I need,
but the match is still returned as a relative path and I need to strip
the leading ./ off of that return.

That being said, this is Linux and there is always more than one way
to accomplish your goal. The following does what I need:

   for dumpfile in \
   `find /var/lib/postgresql/9.1/backup -mmin -60 -a-iname '*.sql'`
   do
  cp $dumpfile /var/data.backup/`hostname`.`basename $dumpfile`
   done

I would still like to know how to do it as a find action if anyone
has suggestions.

Regards,
Craig


Sent - Gtek Web Mail



--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1377971948.555816...@webmail.gtek.biz



Re: find and coy

2013-08-31 Thread Zenaan Harkness
On 9/1/13, Craig L. cr...@gtek.biz wrote:
 Thanks Zenaan (and apologies to all for the poor formatting of my original
 post. I forgot this bloody web interface defaults to that. fmt to the
 rescue)

 On Saturday, August 31, 2013 11:16, Zenaan Harkness z...@freedbms.net
 said:

 On 9/1/13, cr...@gtek.biz cr...@gtek.biz wrote:
 find the recent file and copy only it. I have no problem developing that
 find command,

 but evidently not quite ...

find /var/lib/postgresql/9.1/backup -mmin -60 -a -iname '*.sql' \
-execdir cp '{}' /var/data.backup/ ';'

 copies the file to /var/data.backup/dump_08-31-13.sql just fine.

It is evident that you are achieving part of what you want.

It is evident (since you are asking a question), that you are failing
to achieve the other part of what you want. It was unnecessary to have
pointed it out, so apologies for that.

 but I want to rename the copy in the process by pre-pending
 the file name with the hostname so I can differentiate between dumps from
 different servers. I don't want bother with having to implement a
 destination directory structure since new systems may come and go. So I
 am
 trying to see how this works by echoing the find output, and I can see
 what
 the problem is but I don't know how to get around it. find's {} place
 holder
 is expanding to ./filename and I need just filename

 man find, and search for -printf format,
 ie type man findenter/\-printf format

 Looks like you want a variation on this option:
   -printf %f\n

 printf is one of the actions that find can take when a match occurs,
 and its action is to output the match to stdout. I don't want to output
 the filename to stdout.

Actually, what you want I think is independent of stdout, as in, you
perhaps could use xargs

 I'm not familiar with -exec option.

 With all due respect, follow your advice: man find and search for
 -exec.

With all due respect, _you_ are the one seeking assistance. I tried to
point you in a direction I knew about and thought might be useful to
you. It is not my job to come up with the perfect solution for you, so
it is not for me to follow the advice, since it's not my problem. Not
the best way to invite further assistance...

 It is another possible action, not an option. It is listed in the
 man page about 13 actions up from -printf format. Instead of printing
 the match to stdout, it allows you to define a command to execute on the
 match, substituting the string {} with the match and then executing the
 defined command on each match. -execdir does the same, but does so as if
 CWD was the directory in which the match occurred. This is what I need,
 but the match is still returned as a relative path and I need to strip
 the leading ./ off of that return.

 That being said, this is Linux and there is always more than one way
 to accomplish your goal. The following does what I need:

for dumpfile in \
`find /var/lib/postgresql/9.1/backup -mmin -60 -a-iname '*.sql'`
do
   cp $dumpfile /var/data.backup/`hostname`.`basename $dumpfile`
done

 I would still like to know how to do it as a find action if anyone
 has suggestions.

I don't. But |xargs is how I would do it, eg:

find /var/lib/postgresql/9.1/backup -mmin -60 -a -iname '*.sql' -printf blah \
| xargs cp '{}' /var/data.backup/


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/caosgnst0egt_-lcr+6wnwemxq3u5+g_zipkse84jvhw_rfq...@mail.gmail.com



Re: find and coy

2013-08-31 Thread Zenaan Harkness
On 9/1/13, Zenaan Harkness z...@freedbms.net wrote:
 On 9/1/13, Craig L. cr...@gtek.biz wrote:
 find /var/lib/postgresql/9.1/backup -mmin -60 -a -iname '*.sql' -printf
 blah \
 | xargs cp '{}' /var/data.backup/

That second line should perhaps be
| xargs -n 1 cp '{}' /var/data.backup/


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/caosgnsrgqtldkol54snfoucz_rxlyz2vek9lxwfewvxptt+...@mail.gmail.com



Re: find associated process

2013-06-17 Thread Darac Marjal
On Fri, Jun 14, 2013 at 09:31:08PM -0700, james gray wrote:
how do i find the file address associated with each process.

If you know the process ID (pid. ps should be able to help you find it),
then look at what /proc/$PID/exe points to. That's the executable
associated with that pid.

The fan is operational, but with out control. could be the BIOS could be
acpi.

Some fans are uncontrollable. Check your motherboard manual to see if
they should be user-controlable.

i have been thru the jungle of acpi and pm senors and etc for the last few
months.
i would just like to find out what ? is controlling the fan and then go
from there to find the source code.
Thank you 


signature.asc
Description: Digital signature


Re: find -printf ' %TT

2012-08-06 Thread Martin Steigerwald
Am Sonntag, 5. August 2012 schrieb Sven Joachim:
 On 2012-08-05 18:33 +0200, Mike McClain wrote:
  Thanks Sven.
  
  On Sun, Aug 05, 2012 at 08:33:54AM +0200, Sven Joachim wrote:
  On 2012-08-05 07:57 +0200, Mike McClain wrote:
  snip
  
   Given find / -type f -printf '%TT %p\n'.
  
  snip
  
   Is there a way to get back the hh:mm:ss output as it used to be
   short of piping the output through sed 's/.00//'?
  
  Use %.8TT instead.
  
  That's so obvious I'm embarrassed but I'll use it.
  
  The sed command won't work anyway if the filesystem
  supports high resolution timestamps.
  
  I can't see that, how is the filesystem support going to affect sed?
 
 The numbers after the seconds won't be all zeros then.

ext3 has second resolution.

XFS, BTRFS and Ext4 have higher resolutions. Example:

martin@merkaba:~ LANG=C stat /etc/fstab
  File: `/etc/fstab'
  Size: 1733Blocks: 8  IO Block: 4096   regular file
Device: 10h/16d Inode: 2973Links: 1
Access: (0644/-rw-r--r--)  Uid: (0/root)   Gid: (0/root)
Access: 2012-07-31 23:26:42.031002223 +0200
Modify: 2012-07-03 15:20:29.047930787 +0200
Change: 2012-07-03 15:20:29.048930791 +0200
 Birth: -

(on BTRFS.)

-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/201208061031.08434.mar...@lichtvoll.de



Re: find -printf ' %TT

2012-08-06 Thread Mike McClain
On Mon, Aug 06, 2012 at 10:31:08AM +0200, Martin Steigerwald wrote:
snip 
 ext3 has second resolution.
 
 XFS, BTRFS and Ext4 have higher resolutions. Example:
 
 martin@merkaba:~ LANG=C stat /etc/fstab
   File: `/etc/fstab'
   Size: 1733Blocks: 8  IO Block: 4096   regular file
 Device: 10h/16d Inode: 2973Links: 1
 Access: (0644/-rw-r--r--)  Uid: (0/root)   Gid: (0/root)
 Access: 2012-07-31 23:26:42.031002223 +0200
 Modify: 2012-07-03 15:20:29.047930787 +0200
 Change: 2012-07-03 15:20:29.048930791 +0200
  Birth: -
 
 (on BTRFS.)

Interesting Martin, thank you.
Mike
-- 
Satisfied user of Linux since 1997.
O ascii ribbon campaign - stop html mail - www.asciiribbon.org


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120806165518.GA23975@playground



Re: find -printf ' %TT

2012-08-05 Thread Sven Joachim
On 2012-08-05 07:57 +0200, Mike McClain wrote:

 Given find / -type f -printf '%TT %p\n'.
 Gnu find previously printed hh:mm:ss for the files modify time
 but now is printing hh:mm:ss.00 for all 33K+ files on
 my Squeeze system.

 The man page still says:
 T  time, 24-hour (hh:mm:ss)

It also says, in the line above

 SSecond (00.00 .. 61.00).  There is a fractional part.

The same applies to T, it seems.

 Is there a way to get back the hh:mm:ss output as it used to be short
 of piping the output through sed 's/.00//'?

Use %.8TT instead.  The sed command won't work anyway if the filesystem
supports high resolution timestamps.

Cheers,
   Sven


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/873941q23x@turtle.gmx.de



Re: find -printf ' %TT

2012-08-05 Thread Camaleón
On Sat, 04 Aug 2012 22:57:55 -0700, Mike McClain wrote:

 Given find / -type f -printf '%TT %p\n'. Gnu find previously printed
 hh:mm:ss for the files modify time but now is printing
 hh:mm:ss.00 for all 33K+ files on my Squeeze system.
 
 The man page still says:
 T  time, 24-hour (hh:mm:ss)

Mmm... man page also says:

Nanosecond-resolution timestamps were implemented in findutils-4.3.3.

 Is there a way to get back the hh:mm:ss output as it used to be short of
 piping the output through sed 's/.00//'?

Good question. I see no option/sample on how to configure the number of 
nanoseconds to be printed (maybe I overlooked the man page and also 
info doc) and curiously enough, %Tr does not get the decimal part :-?

Greetings,

-- 
Camaleón


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/jvllha$kog$5...@dough.gmane.org



Re: find -printf ' %TT

2012-08-05 Thread Martin Steigerwald
Am Sonntag, 5. August 2012 schrieb Camaleón:
 On Sat, 04 Aug 2012 22:57:55 -0700, Mike McClain wrote:
  Given find / -type f -printf '%TT %p\n'. Gnu find previously
  printed hh:mm:ss for the files modify time but now is printing
  hh:mm:ss.00 for all 33K+ files on my Squeeze system.
  
  The man page still says:
  T  time, 24-hour (hh:mm:ss)
 
 Mmm... man page also says:
 
 Nanosecond-resolution timestamps were implemented in findutils-4.3.3.

Not quite backwards-compatible for scripts parsing the output I´d say ;)

-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/201208051401.04656.mar...@lichtvoll.de



Re: find -printf ' %TT

2012-08-05 Thread Camaleón
On Sun, 05 Aug 2012 14:01:04 +0200, Martin Steigerwald wrote:

 Am Sonntag, 5. August 2012 schrieb Camaleón:
 On Sat, 04 Aug 2012 22:57:55 -0700, Mike McClain wrote:
  Given find / -type f -printf '%TT %p\n'. Gnu find previously
  printed hh:mm:ss for the files modify time but now is printing
  hh:mm:ss.00 for all 33K+ files on my Squeeze system.
  
  The man page still says:
  T  time, 24-hour (hh:mm:ss)
 
 Mmm... man page also says:
 
 Nanosecond-resolution timestamps were implemented in findutils-4.3.3.
 
 Not quite backwards-compatible for scripts parsing the output I´d say ;)

Agree, but changes do (and have to) happen. What I miss is a better 
documentation for the changes and how to get an old behaviour with the 
new version.

Greetings,

-- 
Camaleón


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/jvlsu7$kog$1...@dough.gmane.org



Re: find -printf ' %TT

2012-08-05 Thread Mike McClain
Thanks Sven.
On Sun, Aug 05, 2012 at 08:33:54AM +0200, Sven Joachim wrote:
 On 2012-08-05 07:57 +0200, Mike McClain wrote:
snip 
  Given find / -type f -printf '%TT %p\n'.
snip 
  Is there a way to get back the hh:mm:ss output as it used to be short
  of piping the output through sed 's/.00//'?
 
 Use %.8TT instead.  

That's so obvious I'm embarrassed but I'll use it.

 The sed command won't work anyway if the filesystem
 supports high resolution timestamps.

I can't see that, how is the filesystem support going to affect sed?

Thanks again, that's the help I needed.
Mike
-- 
Satisfied user of Linux since 1997.
O ascii ribbon campaign - stop html mail - www.asciiribbon.org


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20120805163329.GA6154@playground



Re: find -printf ' %TT

2012-08-05 Thread Sven Joachim
On 2012-08-05 18:33 +0200, Mike McClain wrote:

 Thanks Sven.
 On Sun, Aug 05, 2012 at 08:33:54AM +0200, Sven Joachim wrote:
 On 2012-08-05 07:57 +0200, Mike McClain wrote:
 snip 
  Given find / -type f -printf '%TT %p\n'.
 snip 
  Is there a way to get back the hh:mm:ss output as it used to be short
  of piping the output through sed 's/.00//'?
 
 Use %.8TT instead.  

 That's so obvious I'm embarrassed but I'll use it.

 The sed command won't work anyway if the filesystem
 supports high resolution timestamps.

 I can't see that, how is the filesystem support going to affect sed?

The numbers after the seconds won't be all zeros then.

Cheers,
   Sven


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/87txwhnsk6@turtle.gmx.de



Re: Find the broken link

2012-05-07 Thread Camaleón
On Mon, 07 May 2012 13:34:25 +0800, lina wrote:

 I don't know how to find out all the broken links in the system.

What do you mean by broken links?

 I can't enter into interface,

Enter into what? You mean you can't login?

 One reason is my /var has no space, I have deleted some cache to release
 the space.

Put here the output of df -h.

 I tried purge fglrx driver.  

Are you sure you want that?

What's the command did you use (apt-get, aptitude...)?

 It complains:
 
 Update-alternatives: warning: forcing reinstallation of alternative
 /usr/lib/fglrx because link group glx is broken.

Ah! Here is the link thingy :-)

Despite the warning, is the package removed? What's the full output you 
get? Accustom yourself to add the exact command you run and the full 
output you get as it helps others (who are not in front of your screen) 
to have a better understanding of the problem.

Greetings,

-- 
Camaleón


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/jo8ndu$e2o$3...@dough.gmane.org



Re: Find which package has installed some file under /etc

2011-12-23 Thread Vincent Lefevre
On 2011-12-22 16:30:57 +0100, Tom H wrote:
 You can check whether a file in /etc/default/ is sourced by a file
 in /etc/init.d/.

It's impossible to do this reliably (e.g. recursively), and the
/etc/default/ file may be sourced by another script.

For instance, /etc/default/cryptdisks is not directly sourced by
/etc/init.d/cryptdisks, but by /lib/cryptsetup/cryptdisks.functions
(which is itself sourced by /etc/init.d/cryptdisks).

/etc/default/acpi-support is not sourced by /etc/init.d/acpi-support
either, and not by files sourced from /etc/init.d/acpi-support either.
I've found that it is sourced by scripts from /etc/acpi/ but I don't
see how I could do such detections automatically in the general case.

Another example: /etc/default/debsums is provided by debsums, but
debsums doesn't provide an init.d script. /etc/default/debsums is
actually sourced by the /etc/cron.*/debsums files.

-- 
Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/
100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111224002352.gd15...@xvii.vinc17.org



Re: Find which package has installed some file under /etc

2011-12-22 Thread Tom H
On Thu, Dec 22, 2011 at 4:23 AM, Vincent Lefevre vinc...@vinc17.net wrote:
 On 2011-12-20 14:20:51 -0700, Bob Proulx wrote:

 But I think this discussion of /etc/default/ collisions is all rather
 academic.  No one has yet to mention any real world case of a problem.
 Just the potential that it might be a problem.  Unless it is a real
 problem, and I haven't seen it yet, then I don't think there is much
 benefit trying to prevent it, since it hasn't been happening.

 I thought about writing a script that would automatically clean up
 the /etc/default directory, but if some filenames are not based on
 package names, there would be real problems.

You can check whether a file in /etc/default/ is sourced by a file
in /etc/init.d/.


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CAOdo=sxeko9t4hpuhqkakkj3rwrxdvr_rd06co6squctiya...@mail.gmail.com



Re: Find which package has installed some file under /etc

2011-12-21 Thread Osamu Aoki
Hi,

On Tue, Dec 20, 2011 at 11:06:04PM +0200, Andrei Popescu wrote:
 On Ma, 20 dec 11, 20:56:11, Osamu Aoki wrote:
  On Tue, Dec 20, 2011 at 12:29:01AM +0100, Vincent Lefevre wrote:
   The point is what the Debian Policy says. 
  
  Anyway, if you feel strong to enforce this ipart of policy, most
  effective thing to do is file a wishlist bug with patch to lintian to
  enforce package_name for both init.d script and default file.
 
 AFAIK init.d scripts always belong to a package, so not the same thing 
 (name clashes would be detected by dpkg).

Yah ... that is why no DD cares about hypothetical name crash and live
with common sense.

Osamu



-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111221151544.gb8...@goofy.lan



Re: Find which package has installed some file under /etc

2011-12-21 Thread Vincent Lefevre
On 2011-12-20 14:20:51 -0700, Bob Proulx wrote:
 But I think this discussion of /etc/default/ collisions is all rather
 academic.  No one has yet to mention any real world case of a problem.
 Just the potential that it might be a problem.  Unless it is a real
 problem, and I haven't seen it yet, then I don't think there is much
 benefit trying to prevent it, since it hasn't been happening.

I thought about writing a script that would automatically clean up
the /etc/default directory, but if some filenames are not based on
package names, there would be real problems.

-- 
Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/
100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111222032329.ga25...@xvii.vinc17.org



Re: Find which package has installed some file under /etc

2011-12-20 Thread Osamu Aoki
On Tue, Dec 20, 2011 at 12:29:01AM +0100, Vincent Lefevre wrote:
 The point is what the Debian Policy says. 

Anyway, if you feel strong to enforce this ipart of policy, most
effective thing to do is file a wishlist bug with patch to lintian to
enforce package_name for both init.d script and default file.

I realy do not see any major issue with current state relying common
sense and some huristics to handle common case such as apache2.

Osamu


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111220115611.ga3...@goofy.lan



Re: Find which package has installed some file under /etc

2011-12-20 Thread Andrei Popescu
On Ma, 20 dec 11, 20:56:11, Osamu Aoki wrote:
 On Tue, Dec 20, 2011 at 12:29:01AM +0100, Vincent Lefevre wrote:
  The point is what the Debian Policy says. 
 
 Anyway, if you feel strong to enforce this ipart of policy, most
 effective thing to do is file a wishlist bug with patch to lintian to
 enforce package_name for both init.d script and default file.

AFAIK init.d scripts always belong to a package, so not the same thing 
(name clashes would be detected by dpkg).

Kind regards,
Andrei
-- 
Offtopic discussions among Debian users and developers:
http://lists.alioth.debian.org/mailman/listinfo/d-community-offtopic


signature.asc
Description: Digital signature


Re: Find which package has installed some file under /etc

2011-12-20 Thread Bob Proulx
Andrei Popescu wrote:
 Osamu Aoki wrote:
  Vincent Lefevre wrote:
   The point is what the Debian Policy says. 
  
  Anyway, if you feel strong to enforce this ipart of policy, most
  effective thing to do is file a wishlist bug with patch to lintian to
  enforce package_name for both init.d script and default file.
 
 AFAIK init.d scripts always belong to a package, so not the same thing 
 (name clashes would be detected by dpkg).

I think you missed that it was the /etc/default/ file naming that was
under discussion.  Those files are often not packaged (for the good
reasons mentioned) and so a conflict would not be detected by dpkg.
But usually also when they are not packaged they are often not created
programmatically but are left to the local admin to create.  That is
the best practice to use and the one I like to see the most.

Presumably the local admin being a human can deal with the problem.
If I needed to create a /etc/default/ file as a local admin action and
found that it was in conflict between two init.d scripts then I would
edit the /etc/init.d/ conffile to remove the conflict and file a bug
against one or both of the packages to fix it upstream.

But I think this discussion of /etc/default/ collisions is all rather
academic.  No one has yet to mention any real world case of a problem.
Just the potential that it might be a problem.  Unless it is a real
problem, and I haven't seen it yet, then I don't think there is much
benefit trying to prevent it, since it hasn't been happening.

Bob


signature.asc
Description: Digital signature


Re: Find which package has installed some file under /etc

2011-12-19 Thread Vincent Lefevre
On 2011-12-18 21:20:06 -0700, Bob Proulx wrote:
 Well...  We are all friends here.  Have you hit a problem with one of
 them?  I am sure something could be worked out.

No problems with /etc/default yet. But I think that it would have
been preferable to avoid problems that could arise in the future
(and even though problems can be fixed, it's much better to avoid
them in the first place, e.g. before losing a config file because
it is overwritten by some other package).

-- 
Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/
100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111219125748.gf5...@xvii.vinc17.org



Re: Find which package has installed some file under /etc

2011-12-19 Thread Osamu Aoki
Hi,

On Mon, Dec 19, 2011 at 01:02:22AM +0100, Vincent Lefevre wrote:
 On 2011-12-18 13:18:02 -0700, Bob Proulx wrote:
  The namespace is defined by Debian Policy.  The filename should be
  named after the package name.  Since the package names must be
  different the file name derived from it must be different.  (I think
  it is okay for /etc/default/foo to be part of a foo-common package
  though.  The namespace intention has been preserved.)
 
 It's not always the case:

did you check apt-cache showsrc ...
 
 /etc/default/alsa created by alsa-base
Package: alsa-driver
Binary: linux-sound-base, alsa-base, alsa-base-udeb, alsa-source

Not exactly in any way now but close enough

 /etc/default/apache2 created by apache2.2-common
Package: apache2
Binary: apache2.2-common, apache2.2-bin, apache2-mpm-worker,
apache2-mpm-prefork, apache2-mpm-event, apache2-mpm-itk, apache2-utils,
apache2-suexec, apache2-suexec-custom, apache2, apache2-doc,
apache2-prefork-dev, apache2-threaded-dev, apache2-dbg

So this is following source package name

 /etc/default/bluetooth created by bluez
Package: bluez
Binary: libbluetooth3, libbluetooth3-dbg, libbluetooth-dev, bluetooth,
bluez, bluez-dbg, bluez-alsa, bluez-gstreamer, bluez-cups,
bluez-pcmcia-support, bluez-compat, bluez-utils, bluez-audio

So this is following a associated package name from the same source
package

 /etc/default/bootlogd created by initscripts

Package: sysvinit
Binary: sysvinit, sysvinit-utils, sysv-rc, initscripts
sysvinit-utils: /sbin/bootlogd
initscripts: /etc/default/bootlogd

...

and the rests are almost same situation.  Some are shorthand name ... others
are one of those associated package name.


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111219140207.ga10...@goofy.lan



Re: Find which package has installed some file under /etc

2011-12-19 Thread Vincent Lefevre
Hi,

On 2011-12-19 23:02:07 +0900, Osamu Aoki wrote:
 On Mon, Dec 19, 2011 at 01:02:22AM +0100, Vincent Lefevre wrote:
  On 2011-12-18 13:18:02 -0700, Bob Proulx wrote:
   The namespace is defined by Debian Policy.  The filename should be
   named after the package name.  Since the package names must be
   different the file name derived from it must be different.  (I think
   it is okay for /etc/default/foo to be part of a foo-common package
   though.  The namespace intention has been preserved.)
  
  It's not always the case:
 
 did you check apt-cache showsrc ...

What apt-cache showsrc ... says doesn't matter. The point is what
the Debian Policy says. If it isn't followed and some new package
creates a /etc/default/... file that clashes with some other package
because of that, there would be a problem (with potential data loss).
The fact that the filename is close to the package name is not
sufficient to avoid problems.

-- 
Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/
100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111219232901.ga3...@xvii.vinc17.org



Re: Find which package has installed some file under /etc

2011-12-18 Thread Vincent Lefevre
On 2011-12-17 18:55:45 -0700, Bob Proulx wrote:
 Sometimes I see people file bugs to the BTS against a package asking
 for the package to provide a /etc/default/ file as part of the
 package.  When I see those I usually counter with a request that it
 not be made part of the package.  If the file is part of a package
 there there will always need to be handling of modifications to it.

But if they are not part of the package, how can clashes between
packages (e.g. 2 packages using the same name for the /etc/default
file) be handled?

-- 
Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/
100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111218182410.gb5...@xvii.vinc17.org



Re: Find which package has installed some file under /etc

2011-12-18 Thread Bob Proulx
Vincent Lefevre wrote:
 Bob Proulx wrote:
  Sometimes I see people file bugs to the BTS against a package asking
  for the package to provide a /etc/default/ file as part of the
  package.  When I see those I usually counter with a request that it
  not be made part of the package.  If the file is part of a package
  there there will always need to be handling of modifications to it.
 
 But if they are not part of the package, how can clashes between
 packages (e.g. 2 packages using the same name for the /etc/default
 file) be handled?

The namespace is defined by Debian Policy.  The filename should be
named after the package name.  Since the package names must be
different the file name derived from it must be different.  (I think
it is okay for /etc/default/foo to be part of a foo-common package
though.  The namespace intention has been preserved.)

Bob


signature.asc
Description: Digital signature


Re: Find which package has installed some file under /etc

2011-12-18 Thread Vincent Lefevre
On 2011-12-18 13:18:02 -0700, Bob Proulx wrote:
 The namespace is defined by Debian Policy.  The filename should be
 named after the package name.  Since the package names must be
 different the file name derived from it must be different.  (I think
 it is okay for /etc/default/foo to be part of a foo-common package
 though.  The namespace intention has been preserved.)

OK, so for these files, that's another way to know what package
they may be associated with. :)

-- 
Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/
100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111218212107.gc5...@xvii.vinc17.org



Re: Find which package has installed some file under /etc

2011-12-18 Thread Bob Proulx
Vincent Lefevre wrote:
 Bob Proulx wrote:
  The namespace is defined by Debian Policy.  The filename should be
  named after the package name.  Since the package names must be
  different the file name derived from it must be different.  (I think
  it is okay for /etc/default/foo to be part of a foo-common package
  though.  The namespace intention has been preserved.)
 
 OK, so for these files, that's another way to know what package
 they may be associated with. :)

Uhm...  Yes.  They may have the name of the package they are
associated with in the filename.  But I thought that was too obvious
to require a mention!  :-)

Bob


signature.asc
Description: Digital signature


Re: Find which package has installed some file under /etc

2011-12-18 Thread Vincent Lefevre
On 2011-12-18 13:18:02 -0700, Bob Proulx wrote:
 The namespace is defined by Debian Policy.  The filename should be
 named after the package name.  Since the package names must be
 different the file name derived from it must be different.  (I think
 it is okay for /etc/default/foo to be part of a foo-common package
 though.  The namespace intention has been preserved.)

It's not always the case:

/etc/default/alsa created by alsa-base
/etc/default/apache2 created by apache2.2-common
/etc/default/bluetooth created by bluez
/etc/default/bootlogd created by initscripts
/etc/default/cacerts created by ca-certificates-java
/etc/default/cryptdisks created by cryptsetup
/etc/default/decnet created by dnet-common
/etc/default/devpts created by initscripts
/etc/default/halt created by initscripts
/etc/default/keyboard created by keyboard-configuration
/etc/default/locale created by locales
/etc/default/nss created by libc-bin
/etc/default/saned created by sane-utils
/etc/default/ssh created by openssh-server
/etc/default/tmpfs created by initscripts
/etc/default/useradd created by passwd
/etc/default/wicd created by wicd-daemon

-- 
Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/
100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111219000222.gd5...@xvii.vinc17.org



Re: Find which package has installed some file under /etc

2011-12-18 Thread Bob Proulx
Vincent Lefevre wrote:
 Bob Proulx wrote:
  The namespace is defined by Debian Policy.  The filename should be
  named after the package name.  Since the package names must be
  different the file name derived from it must be different.  (I think
  it is okay for /etc/default/foo to be part of a foo-common package
  though.  The namespace intention has been preserved.)
 
 It's not always the case:
 
 /etc/default/alsa created by alsa-base
 /etc/default/apache2 created by apache2.2-common
 /etc/default/bluetooth created by bluez
 /etc/default/bootlogd created by initscripts
 /etc/default/cacerts created by ca-certificates-java
 /etc/default/cryptdisks created by cryptsetup
 /etc/default/decnet created by dnet-common
 /etc/default/devpts created by initscripts
 /etc/default/halt created by initscripts
 /etc/default/keyboard created by keyboard-configuration
 /etc/default/locale created by locales
 /etc/default/nss created by libc-bin
 /etc/default/saned created by sane-utils
 /etc/default/ssh created by openssh-server
 /etc/default/tmpfs created by initscripts
 /etc/default/useradd created by passwd
 /etc/default/wicd created by wicd-daemon

Okay I was wrong on the strictly exact names.  But most of those do
exist within the expected namespace of the parent package.  The only
ones that are a stretch are devpts and tmpfs.  The others are pretty
obvious.

Bob


signature.asc
Description: Digital signature


Re: Find which package has installed some file under /etc

2011-12-18 Thread Vincent Lefevre
On 2011-12-18 17:09:35 -0700, Bob Proulx wrote:
 Vincent Lefevre wrote:
  /etc/default/alsa created by alsa-base
  /etc/default/apache2 created by apache2.2-common
  /etc/default/bluetooth created by bluez
  /etc/default/bootlogd created by initscripts
  /etc/default/cacerts created by ca-certificates-java
  /etc/default/cryptdisks created by cryptsetup
  /etc/default/decnet created by dnet-common
  /etc/default/devpts created by initscripts
  /etc/default/halt created by initscripts
  /etc/default/keyboard created by keyboard-configuration
  /etc/default/locale created by locales
  /etc/default/nss created by libc-bin
  /etc/default/saned created by sane-utils
  /etc/default/ssh created by openssh-server
  /etc/default/tmpfs created by initscripts
  /etc/default/useradd created by passwd
  /etc/default/wicd created by wicd-daemon
 
 Okay I was wrong on the strictly exact names.  But most of those do
 exist within the expected namespace of the parent package.  The only
 ones that are a stretch are devpts and tmpfs.  The others are pretty
 obvious.

But this not sufficient to avoid a possible clash for some of them.

-- 
Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/
100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111219005827.ge5...@xvii.vinc17.org



Re: Find which package has installed some file under /etc

2011-12-18 Thread Bob Proulx
Vincent Lefevre wrote:
 Bob Proulx wrote:
  Okay I was wrong on the strictly exact names.  But most of those do
  exist within the expected namespace of the parent package.  The only
  ones that are a stretch are devpts and tmpfs.  The others are pretty
  obvious.
 
 But this not sufficient to avoid a possible clash for some of them.

Well...  We are all friends here.  Have you hit a problem with one of
them?  I am sure something could be worked out.

Bob


signature.asc
Description: Digital signature


Re: Find which package has installed some file under /etc

2011-12-17 Thread Bob Proulx
Vincent Lefevre wrote:
 Is there a way to find which package has installed some file
 under /etc?

Yes, if the package owns the file.  No, if the package put it there
but didn't keep ownership of it.

 For conffiles, there is dlocate or dpkg -S,

Exactly!  If the package kept track of the file as a conffile then you
can locate it with 'dpkg -S'.

 but what about the other files (installed in postinst)?

Then the answer is No.  There isn't a database for it.

But if the package's postinst is still current then you should be able
to locate the script that did it.  Assume that /etc/foofile is the
file from /etc.

  grep foofile /var/lib/dpkg/info/*.postinst

That should locate the script the references it.  If the script is
still current.  If the package was purged and the file left behind
then nothing will be found.  If the file was left behind by a previous
version of the postinst script which was subsequently update to a
newer version that no longer references it then nothing will be found.
But if it still references it then you should be able to locate the
package by the script doing it.  (Sorry for this being confusing.)

Bob


signature.asc
Description: Digital signature


Re: Find which package has installed some file under /etc

2011-12-17 Thread Michael Biebl
On 18.12.2011 01:00, Vincent Lefevre wrote:
 Is there a way to find which package has installed some file
 under /etc? For conffiles, there is dlocate or dpkg -S, but
 what about the other files (installed in postinst)?

ucf is also used to manage configuration files.
As those files are not registered in the dpkg db, you need to use ucfq
to query the ucf internal database.

Michael
-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?



signature.asc
Description: OpenPGP digital signature


Re: Find which package has installed some file under /etc

2011-12-17 Thread Vincent Lefevre
On 2011-12-18 02:11:33 +0100, Michael Biebl wrote:
 On 18.12.2011 01:00, Vincent Lefevre wrote:
  Is there a way to find which package has installed some file
  under /etc? For conffiles, there is dlocate or dpkg -S, but
  what about the other files (installed in postinst)?
 
 ucf is also used to manage configuration files.
 As those files are not registered in the dpkg db, you need to use ucfq
 to query the ucf internal database.

Thanks, this is OK for dictd:

xvii:~ ll /etc/default/dictd
-rw-r--r-- 1 root root 857 2009-06-04 19:27:26 /etc/default/dictd
xvii:~ dpkg -S /etc/default/dictd
dpkg-query: no path found matching pattern /etc/default/dictd.
xvii:~ ucfq /etc/default/dictd
Configuration filePackage Exists Changed
/etc/default/dictddictd   YesYes

However there are still packages for which neither dpkg -S, nor ucfq
gives information about the package:

xvii:~ ll /etc/default/ntfs-3g
-rw-r--r-- 1 root root 48 2011-12-08 00:21:36 /etc/default/ntfs-3g
xvii:~ dpkg -S /etc/default/ntfs-3g
dpkg-query: no path found matching pattern /etc/default/ntfs-3g.
xvii:~ ucfq /etc/default/ntfs-3g
Configuration filePackage Exists Changed
/etc/default/ntfs-3g  Yes

-- 
Vincent Lefèvre vinc...@vinc17.net - Web: http://www.vinc17.net/
100% accessible validated (X)HTML - Blog: http://www.vinc17.net/blog/
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20111218013111.ga5...@xvii.vinc17.org



Re: Find which package has installed some file under /etc

2011-12-17 Thread Bob Proulx
Vincent Lefevre wrote:
 However there are still packages for which neither dpkg -S, nor ucfq
 gives information about the package:
 
 xvii:~ ll /etc/default/ntfs-3g
 -rw-r--r-- 1 root root 48 2011-12-08 00:21:36 /etc/default/ntfs-3g
 xvii:~ dpkg -S /etc/default/ntfs-3g
 dpkg-query: no path found matching pattern /etc/default/ntfs-3g.
 xvii:~ ucfq /etc/default/ntfs-3g
 Configuration filePackage Exists 
 Changed
 /etc/default/ntfs-3g  Yes

Files in /etc/default/ are often expected to be under the control of
the local admin.  Often if they exist at all then they are created not
by a package but by the local admin.  In those cases there wouldn't
ever be a database listing them.

I would grep through /etc/init.d/* for references to those files.
Since those files are (mostly) included by boot time init.d scripts
that is where you will see them included.

  $ grep ntfs-3g /etc/init.d/*

Sometimes I see people file bugs to the BTS against a package asking
for the package to provide a /etc/default/ file as part of the
package.  When I see those I usually counter with a request that it
not be made part of the package.  If the file is part of a package
there there will always need to be handling of modifications to it.
That is why there is default dpkg behavior and why there is additional
helpers like ucf to help manage those changes.  But if the file is not
part of the package at all then things are simple and no management is
required.  Simple is better.  I prefer not to see /etc/default/ files
as part of the package.

Bob


signature.asc
Description: Digital signature


Re: find arama komutu yardım

2011-03-11 Thread ilker AYDIN

evet bir şekilde işimi gördü ama birşey farkettim
-prune ile budanan *_thm ve *_res dizinleri arama yapılan dizinde gecerli.
3-5 yada daha alt dizinlerdeki thm ve res dizinlerini budayamıyorum.

Güzel bir yardımdı, bunun üzerinden denemelerimi yapıyorum.
Teşekkürler...


10-03-2011 23:25, Onur Aslan yazmış:

Merhaba su isinizi gorecektir, devamina -exec ile istediginizi ekleyin:

find . \
   \( -path '*_thm' -o -path '*_res' \) -prune \
   -o \( -iname '*.jpg' -o -iname '*.png' \) -print

2011/3/10 ilker AYDINil...@erse.com.tr:

Selamlar,
Sistemde çeşitli amaçlar için gerek konsolda gerek scrpitlerde find komutunu
kendimce kullanıyorum.
misal samba için silinmiş öğeleri kontrol ederek 30 günden eski dosyaları
bulup siliyorum, yada büyük boyutlu dosyaları bularak txt içine yazıyorum
gibi

Neyse şimdi ben find komutu yada varsa başka komut ile operator (yada flag
ta deniyor olabilir) kullanımı hakkında yardım istiyorum.

Amacım şu;
/images dizini altında yüzlerce dizin binlerce dosya var.
find komutu ile hem *.jpg hemde *.png dosyalarını aynı anda aramak istiyorum
-iname ile büyük-kücük harf ayırmadan yapmak istiyorum

ama hedef dizini gösterirken hani vardırya ! yada başka opertor ile
_res yada _thm ismi ile başlayan dizinleri aramasın diyebilirmiyim?

bilmediğimden sallıyorum
find /images _thm!,_res! -iname *.jpg , *.png exec mogrify -print -exec
/usr/bin/mogrify -resize 1024\{} \;

gibi birşey yapabilirmiyim?
Yani /images dizininde arama yaparken _thm ve _res isimleri ile başlayan
dizinleri aramasın hem jpg hemde png dosyalarını arasın yapılabilirmi?

Ben bu dizindeki tüm 1024 pixelden yuksek cozunurluklu resimleri 1024 e
ufaltıyorum, 1024 ufakları 1024e büyütmüyorum.
ama tüm durumda mogrify komutu resimleri işlesede işlemesede dosya değişim
tarihlerini işlem saati ile değiştiriyor.

Birde yeri gelmişken danışmak isterim find ile arama yaparken 1024
çözünürlükten büyük dosyaları bul listele falan denilebilirmi?

Umarım yapmak istediğimi sizlere anlatabilmişimdir.

Teşekkürler...


--
To UNSUBSCRIBE, email to debian-user-turkish-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact
listmas...@lists.debian.org
Archive: http://lists.debian.org/4d7879b1.6060...@erse.com.tr





--
To UNSUBSCRIBE, email to debian-user-turkish-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4d79ef9b.7000...@erse.com.tr



Re: find arama komutu yardım

2011-03-11 Thread ilker AYDIN

Düzeltme;
komut düzgün çalışıyor fakat türkçe karakterli altdizinlerde çalışmıyormuş.
.../..././././././Örme/_res/abc.jpg
.../..././././././İstenilen/_res/abc.jpg
gibi yüzlerce çıktı geliyor. Buna bakıyorum birde find komutu versiyonu 
ile alakalı olabilirmi diye başka bir OS ta deniyeceğim.


evet bir şekilde işimi gördü ama birşey farkettim
-prune ile budanan *_thm ve *_res dizinleri arama yapılan dizinde gecerli.
3-5 yada daha alt dizinlerdeki thm ve res dizinlerini budayamıyorum.

Güzel bir yardımdı, bunun üzerinden denemelerimi yapıyorum.
Teşekkürler...

10-03-2011 23:25, Onur Aslan yazmış:

Merhaba su isinizi gorecektir, devamina -exec ile istediginizi ekleyin:

find . \
   \( -path '*_thm' -o -path '*_res' \) -prune \
   -o \( -iname '*.jpg' -o -iname '*.png' \) -print




--
To UNSUBSCRIBE, email to debian-user-turkish-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4d79f689.3020...@erse.com.tr



Re: find et fichiers avec espaces

2011-02-28 Thread Luxpopuli Open source
Bonjour,

Le 27 février 2011 15:42, Jeremie COURREGES-ANGLAS kt...@wxcvbn.org a
écrit :

 On Sunday 27 February 2011 à 01:16:35PM, Luxpopuli Open source wrote:
  Bonjour et merci pour votre contribution.
 
  La seule version qui marche vraiment est:
 
  time find /usr/local/www/ -type f -size +10M -print0 | xargs -0 ls -Ssh1
 |wc
  -l

 Non, ce n'est pas la seule :-)


C'est vrai !


  Les résultats sont classés et c'est la plus rapide (pas de beaucoup mais
  bon...)

 Non plus, ce n'est pas la plus rapide. ;-)


Je ne sais pas si c'est la plus rapide ou non, mais de toute façon mes
mesures de temps étaient bidon puisque les résultats étaient en cache.
D'ailleurs, comment je fais pour mesure le temps d'exécution d'une commande
en étant certain de ne pas bénéficier du cache ? (perso, la seule solution
que je connaisse c'est de se déloguer, ce qui est un lourd)


  Celle-ci
 
  time find /usr/local/www/ -size +10M -exec ls -Ssh1 {} \;|wc -l
 
  fonctionne mais ne classe pas les résultats. On voit qu'il n'est
  effectivement pas besoin de protéger {}
 
  Et celle-ci:
 
  find /foo -size +10M -exec ls -bla {} +
 
  ne marche pas du tout ;-)
 
  il faut au minimum ajouter «\;» et supprimer le +

 Non, faut juste ne pas la copier/coller betement dans un terminal.
 Une version prete à etre copiée/collée :


Alors là, quand même, faut pas pousser mémé dans les orties ! ;-) J'avais
pris la peine de remplacer bla par Ssh1. Cela dit, je ne sais pas ce que
j'ai fait, mais je viens de retester et aujourd'hui cette commande marche
parfaitement.
Donc, autant pour moi.


 $ time find /usr/local/www -size +10M -exec ls -Ssh1 {} +

 Et chez moi ça donne dans tous les cas de meilleurs résultats que find
 -print0
 | xargs -0.

 Sinon, pourquoi utiliser ls -Ssh1 si le but est de compter le nombre de ces
 fichiers ?


Non, j'ai ajouté wc -l uniquement pour m'assurer que pour chaque version de
commande testée tous les fichiers étaient bien trouvés. Mais c'est bien la
liste des fichiers qui m'intéressent.


 $ time find /usr/local/www -size +10M -exec printf %.sx {} + | wc -c

 Cette version diffère dans le sens où un 'x' est affiché pour chaque
 fichier,
 et on compte le nombre de x final. Fonctionne sans ls -1 en cas de fichiers
 comportant des caractères exotiques dans leur nom, et ptet plus efficace vu
 qu'on écrit moins de choses dans le pipe.

 Sinon, man find, info find, http://mywiki.wooledge.org/UsingFind

 Ciao

 --
 Free software, free society.
 Jérémie Courrèges-Anglas
 GPG key : 06A11494




Re: find et fichiers avec espaces

2011-02-27 Thread Luxpopuli Open source
Bonjour et merci pour votre contribution.

La seule version qui marche vraiment est:

time find /usr/local/www/ -type f -size +10M -print0 | xargs -0 ls -Ssh1 |wc
-l

Les résultats sont classés et c'est la plus rapide (pas de beaucoup mais
bon...)

Celle-ci

time find /usr/local/www/ -size +10M -exec ls -Ssh1 {} \;|wc -l

fonctionne mais ne classe pas les résultats. On voit qu'il n'est
effectivement pas besoin de protéger {}

Et celle-ci:

find /foo -size +10M -exec ls -bla {} +

ne marche pas du tout ;-)

il faut au minimum ajouter «\;» et supprimer le +

Cordialement,



Le 27 février 2011 03:33, Jeremie COURREGES-ANGLAS kt...@wxcvbn.org a
écrit :

  Tu peux essayer cette commande :
 
  find / -size +10M -exec ls -Ssh1 '{}' \;

 Cette version ne fournit pas un affichage classé (trié) puisque chaque
 invocation de ls se fera sur un seul fichier.
 Pour avoir une seule invocation de ls (dans le meilleur des cas), il faut
 utiliser :

 find /foo -size +10M -exec ls -bla {} +

 Pas besoin de protéger {}

 My two cents.

 --
 Free software, free society.
 Jérémie Courrèges-Anglas
 GPG key : 06A11494



Re: find et fichiers avec espaces

2011-02-27 Thread Benoit Bastit

Le 27/02/2011 13:16, Luxpopuli Open source a écrit :

Bonjour et merci pour votre contribution.

La seule version qui marche vraiment est:

time find /usr/local/www/ -type f -size +10M -print0 | xargs -0 ls 
-Ssh1 |wc -l


Les résultats sont classés et c'est la plus rapide (pas de beaucoup 
mais bon...)


Celle-ci

time find /usr/local/www/ -size +10M -exec ls -Ssh1 {} \;|wc -l

fonctionne mais ne classe pas les résultats. On voit qu'il n'est 
effectivement pas besoin de protéger {}


Et celle-ci:

find /foo -size +10M -exec ls -bla {} +

ne marche pas du tout ;-)

il faut au minimum ajouter «\;» et supprimer le +

Cordialement,



Le 27 février 2011 03:33, Jeremie COURREGES-ANGLAS kt...@wxcvbn.org 
mailto:kt...@wxcvbn.org a écrit :


 Tu peux essayer cette commande :

 find / -size +10M -exec ls -Ssh1 '{}' \;

Cette version ne fournit pas un affichage classé (trié) puisque chaque
invocation de ls se fera sur un seul fichier.
Pour avoir une seule invocation de ls (dans le meilleur des cas),
il faut
utiliser :

find /foo -size +10M -exec ls -bla {} +

Pas besoin de protéger {}

My two cents.

--
Free software, free society.
Jérémie Courrèges-Anglas
GPG key : 06A11494



find /usr/local/www/ -type f -size +10M -printf '%s %p\n'  | sort -n

Cela n'est pas plus simple et surement beaucoup plus rapide ?





Re: find et fichiers avec espaces

2011-02-27 Thread Jeremie COURREGES-ANGLAS
On Sunday 27 February 2011 à 01:16:35PM, Luxpopuli Open source wrote:
 Bonjour et merci pour votre contribution.

 La seule version qui marche vraiment est:

 time find /usr/local/www/ -type f -size +10M -print0 | xargs -0 ls -Ssh1 |wc
 -l

Non, ce n'est pas la seule :-)

 Les résultats sont classés et c'est la plus rapide (pas de beaucoup mais
 bon...)

Non plus, ce n'est pas la plus rapide. ;-)

 Celle-ci

 time find /usr/local/www/ -size +10M -exec ls -Ssh1 {} \;|wc -l

 fonctionne mais ne classe pas les résultats. On voit qu'il n'est
 effectivement pas besoin de protéger {}

 Et celle-ci:

 find /foo -size +10M -exec ls -bla {} +

 ne marche pas du tout ;-)

 il faut au minimum ajouter «\;» et supprimer le +

Non, faut juste ne pas la copier/coller betement dans un terminal.
Une version prete à etre copiée/collée :

$ time find /usr/local/www -size +10M -exec ls -Ssh1 {} +

Et chez moi ça donne dans tous les cas de meilleurs résultats que find -print0
| xargs -0.

Sinon, pourquoi utiliser ls -Ssh1 si le but est de compter le nombre de ces
fichiers ?

$ time find /usr/local/www -size +10M -exec printf %.sx {} + | wc -c

Cette version diffère dans le sens où un 'x' est affiché pour chaque fichier,
et on compte le nombre de x final. Fonctionne sans ls -1 en cas de fichiers
comportant des caractères exotiques dans leur nom, et ptet plus efficace vu
qu'on écrit moins de choses dans le pipe.

Sinon, man find, info find, http://mywiki.wooledge.org/UsingFind

Ciao

--
Free software, free society.
Jérémie Courrèges-Anglas
GPG key : 06A11494



pgpWWoofVv6MA.pgp
Description: PGP signature


Re: find et fichiers avec espaces

2011-02-27 Thread Jeremie COURREGES-ANGLAS
On Sunday 27 February 2011 à 03:31:07PM, Benoit Bastit wrote:
[snip]
 find /usr/local/www/ -type f -size +10M -printf '%s %p\n'  | sort -n

 Cela n'est pas plus simple et surement beaucoup plus rapide ?

Nope, meme si celà est très efficace. A noter que l'on cherche sort -rn, ici,
et que cette solution produit des résultats incohérents avec des fichiers
contenant des caractères newline. Ca tombe bien, le printf de find(1) comprend
\0 et sort(1) comprend -z sur debian, donc faudrait un pipe en plus pour
afficher correctement le résultat. A noter qu'on pourrait alors en profiter
pour afficher les tailles de fichier dans une unité plus lisible par l'etre
humain (ce que fais ls -s). Mais à ce moment on perd au niveau performance.
Ca coute cher, les cycles CPU, non mais !

My two cents.

--
Free software, free society.
Jérémie Courrèges-Anglas
GPG key : 06A11494


pgpNuawxoZU5x.pgp
Description: PGP signature


Re: find et fichiers avec espaces

2011-02-26 Thread Guillaume Caron
Le samedi 26 février 2011 à 20:15 +0100, Luxpopuli Open source a écrit :
 Bonjour,
 
 Je cherche à lister les fichiers de plus de 10 Mo.
 
 J'utilise cette commande:
 
 ls -Ssh1 `find /usr/local/www/ -size +10M -print0 | xargs -0`
 
 Par contre impossible de lire les fichiers avec des espaces.
 
 Cette autre commande:
 
 find /usr/local/www/ -size +10M
 
 renvoie bien tous les fichiers même ceux contenant des espaces. 
 
 Mais je n'arrive pas à assembler ces deux commandes sachant que
 l'intérêt de la première commande est que la sortie est classée et
 affiche la taille des fichiers.
 
 Cordialement,
 
 
Bonsoir,

D'habitude j'utilise plutôt xargs de cette manière, et ça fonctionne
chez moi ainsi :
$ find -size +10M -print0 | xargs -0 ls -Ssh1

Cordialement,
-- 
Guillaume

-- 
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: http://lists.debian.org/1298754205.32332.1.camel@tomoyo



Re: find et fichiers avec espaces

2011-02-26 Thread Frédéric MASSOT

Le 26/02/2011 22:03, Guillaume Caron a écrit :

Le samedi 26 février 2011 à 20:15 +0100, Luxpopuli Open source a écrit :

Bonjour,

Je cherche à lister les fichiers de plus de 10 Mo.

J'utilise cette commande:

ls -Ssh1 `find /usr/local/www/ -size +10M -print0 | xargs -0`

Par contre impossible de lire les fichiers avec des espaces.

Cette autre commande:

find /usr/local/www/ -size +10M

renvoie bien tous les fichiers même ceux contenant des espaces.

Mais je n'arrive pas à assembler ces deux commandes sachant que
l'intérêt de la première commande est que la sortie est classée et
affiche la taille des fichiers.

Cordialement,



Bonsoir,

D'habitude j'utilise plutôt xargs de cette manière, et ça fonctionne
chez moi ainsi :
$ find -size +10M -print0 | xargs -0 ls -Ssh1


Tu peux essayer cette commande :

find / -size +10M -exec ls -Ssh1 '{}' \;

--
Lisez la FAQ de la liste avant de poser une question :
http://wiki.debian.org/fr/FrenchLists

Pour vous DESABONNER, envoyez un message avec comme objet unsubscribe
vers debian-user-french-requ...@lists.debian.org
En cas de soucis, contactez EN ANGLAIS listmas...@lists.debian.org
Archive: http://lists.debian.org/4d69978b.2010...@juliana-multimedia.com



Re: find et fichiers avec espaces

2011-02-26 Thread Jeremie COURREGES-ANGLAS
 Tu peux essayer cette commande :

 find / -size +10M -exec ls -Ssh1 '{}' \;

Cette version ne fournit pas un affichage classé (trié) puisque chaque
invocation de ls se fera sur un seul fichier.
Pour avoir une seule invocation de ls (dans le meilleur des cas), il faut
utiliser :

find /foo -size +10M -exec ls -bla {} +

Pas besoin de protéger {}

My two cents.

--
Free software, free society.
Jérémie Courrèges-Anglas
GPG key : 06A11494


pgpOmd5wqqOrM.pgp
Description: PGP signature


Re: Find bugs reported by x

2010-10-28 Thread Camaleón
On Thu, 28 Oct 2010 14:32:10 +, David Van Mosselbeen wrote:

 Just about curiosity, i'm trying to search how less bugs i reported or
 replied on.
 
 Here[1] we can search submitters of bugs. But when i look on the
 generated page, i only get 2 reported bugs on my name. I know i reported
 less but not that less.

(...)

Use your e-mail address instead your name. Besides, check the archived  
unarchived option. That way I can get all the bugs I've reported :-)

Greetings,

-- 
Camaleón


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/pan.2010.10.28.15.21...@gmail.com



  1   2   3   4   5   >