Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #202943
| From | David Wright <deblis@lionunicorn.co.uk> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: An appropriate directory search tool? |
| Date | 2018-12-01 18:20 +0100 |
| Message-ID | <x0h5U-83v-3@gated-at.bofh.it> (permalink) |
| References | <wKEzv-4gD-5@gated-at.bofh.it> <wKFce-4tV-11@gated-at.bofh.it> <wKFvz-4Ph-1@gated-at.bofh.it> <wODES-8pe-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue 30 Oct 2018 at 09:52:52 (-0500), David Wright wrote:
> On Fri 19 Oct 2018 at 12:03:42 (-0400), Greg Wooledge wrote:
> > On Fri, Oct 19, 2018 at 10:48:42AM -0500, David Wright wrote:
> > > find . -type f -exec chmod a-wx {} \;
> >
> > For this one, you probably want to replace \; with + to get the efficiency
> > boost, which would be pretty significant here. You probably wrote this
> > one a long time ago.
>
> You're dead right. It could even have been copied straight from Unix
> Power Tools 1st ed. And, of course, with the other example
> find . -type f -exec file {} \; | less
> it can make a huge difference to the number of "find: ‘file’
> terminated by signal 13" messages if you lose interest and quit
> out of less.
[…]
> Updated. I'm more careful in writing my bash functions than this
> commandline¹ stuff where the filename population tends to be
> more restricted (ie I generated them).
… and so I was running my eyes over my .bashrc file to see if there
were any similar constructions that had survived over the years and
could do with updating. In doing so, I came across examples where
a little extra thought is required:
find "$@" -depth -xdev -type d -empty -ok rmdir {} \;
find "$@" -depth -xdev -type d -empty -print -exec rmdir {} \;
Using + in the second example won't work correctly.
There's a warning in man find about the potential of + to
short-circuit running all the commands in case of error, but
perhaps it should also warn of the dangers of mixing + and -depth.
Cheers,
David.
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-19 17:10 +0200
Re: An appropriate directory search tool? Roberto C. Sánchez <roberto@debian.org> - 2018-10-19 17:20 +0200
Re: An appropriate directory search tool? Roberto C. Sánchez <roberto@debian.org> - 2018-10-19 17:20 +0200
Re: An appropriate directory search tool? <tomas@tuxteam.de> - 2018-10-19 17:30 +0200
Re: An appropriate directory search tool? Greg Wooledge <wooledg@eeg.ccf.org> - 2018-10-19 17:40 +0200
Re: An appropriate directory search tool? <tomas@tuxteam.de> - 2018-10-19 17:50 +0200
Re: An appropriate directory search tool? rhkramer@gmail.com - 2018-10-20 15:30 +0200
Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-19 17:50 +0200
Re: An appropriate directory search tool? Greg Wooledge <wooledg@eeg.ccf.org> - 2018-10-19 18:10 +0200
Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-30 16:00 +0100
Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-12-01 18:20 +0100
Re: An appropriate directory search tool? songbird <songbird@anthive.com> - 2018-10-20 00:40 +0200
Re: An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-20 11:40 +0200
Re: An appropriate directory search tool? <tomas@tuxteam.de> - 2018-10-20 11:50 +0200
Re: An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-20 12:30 +0200
Re: An appropriate directory search tool? Joe <joe@jretrading.com> - 2018-10-20 13:40 +0200
Re: An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-20 14:30 +0200
Re: An appropriate directory search tool? Brian <ad44@cityscape.co.uk> - 2018-10-20 21:10 +0200
Re: An appropriate directory search tool? Håkon Alstadheim <hakon@alstadheim.priv.no> - 2018-10-21 00:00 +0200
Re: An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-21 12:10 +0200
Re: An appropriate directory search tool? Andrew McGlashan <andrew.mcglashan@affinityvision.com.au> - 2018-10-21 11:00 +0200
Re: An appropriate directory search tool? <tomas@tuxteam.de> - 2018-10-21 11:20 +0200
Re: An appropriate directory search tool? Roberto C. Sánchez <roberto@debian.org> - 2018-10-20 14:10 +0200
Re: An appropriate directory search tool? John Crawley <john@bunsenlabs.org> - 2018-10-21 03:20 +0200
Re: An appropriate directory search tool? mick crane <mick.crane@gmail.com> - 2018-10-21 07:30 +0200
Re: An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-21 12:30 +0200
Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-21 15:50 +0200
Re: An appropriate directory search tool? rhkramer@gmail.com - 2018-10-21 16:40 +0200
Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-21 17:30 +0200
Re: An appropriate directory search tool? rhkramer@gmail.com - 2018-10-21 17:50 +0200
Re: An appropriate directory search tool? Curt <curty@free.fr> - 2018-10-21 18:40 +0200
Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-21 18:40 +0200
Re: An appropriate directory search tool? rhkramer@gmail.com - 2018-10-21 19:20 +0200
Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-21 21:00 +0200
Re: An appropriate directory search tool? rhkramer@gmail.com - 2018-10-21 23:50 +0200
Re: An appropriate directory search tool? John Crawley <john@bunsenlabs.org> - 2018-10-22 03:20 +0200
Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-22 17:30 +0200
Re: An appropriate directory search tool? Greg Wooledge <wooledg@eeg.ccf.org> - 2018-10-22 15:20 +0200
Re: An appropriate directory search tool? David Wright <deblis@lionunicorn.co.uk> - 2018-10-22 17:30 +0200
Re: An appropriate directory search tool? Greg Wooledge <wooledg@eeg.ccf.org> - 2018-10-22 17:50 +0200
Re: An appropriate directory search tool? Curt <curty@free.fr> - 2018-10-21 12:00 +0200
Re: An appropriate directory search tool? Joe <joe@jretrading.com> - 2018-10-20 13:30 +0200
Re: An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-20 14:30 +0200
Re: An appropriate directory search tool? Étienne Mollier <etienne.mollier@mailoo.org> - 2018-10-20 12:30 +0200
Re: An appropriate directory search tool? Richard Owlett <rowlett@cloud85.net> - 2018-10-20 14:40 +0200
Re: An appropriate directory search tool? Dan Purgert <dan@djph.net> - 2018-10-20 15:20 +0200
Re: An appropriate directory search tool? rhkramer@gmail.com - 2018-10-20 15:30 +0200
csiph-web