[ale] find + ls commands: commentary [was: Bash script]
jc.lightner at comcast.net
jc.lightner at comcast.net
Tue Apr 15 17:30:42 EDT 2025
That makes me think of the first HP-UX conference I attended. I'd been
working on UNIX variants including HP-UX for a few years.
In a small group of other admins there I mentioned how I wanted to do
something more easily and 3 or 4 immediately responded that I should use
lsof.
In those days I'd relied on the OS versions of most binaries to do tasks.
Which was sometimes maddening as different variants had different
implementations.
I'd never heard of lsof but it quickly became my go to tool for many things
for several years both on UNX and Linux.
A co-worker I told about it on my return from the conference was enthralled
by it once I installed it and found dozens of uses.
P.S. I once had to write a script on IBM Sequent systems that would emulate
the simple output most other UNIX variants had in a single command.
Sometimes you're not allowed to install open source software.
P.P.S. I was aghast at a more recent job when they didn't have the telnet
client (not server) OR netcat (nc) tool on their Linux systems to
troubleshoot simple network issues. They felt it was a security risk so
wouldn't allow me to install it. They seemed to think I was trying to put
in a back door which was silly given their extensive use of firewalling
between systems. Of course the issue WAS the firewall in that use case but
I'd have been more easily able to confirm it wasn't the OS with nc rather
than having to convince the network and security teams to look into it
without any evidence.
-----Original Message-----
From: Ale <ale-bounces at ale.org> On Behalf Of Ron via Ale
Sent: Tuesday, April 15, 2025 3:31 PM
To: ale at ale.org
Cc: Ron <admin at bclug.ca>
Subject: Re: [ale] find + ls commands: commentary [was: Bash script]
Bob Toxen via Ale wrote on 2025-04-14 18:59:
> WOW!
>
> find . -exec something \+
> ^^
>
> Never heard of it!
This is my favourite thing about LUGs - learning of some tool or option
that's been there all along that I wasn't aware of. I love when that
happens.
> Not in "man find" on any system of mine, except my newest,
That's odd, I've been using it for ages. I wonder when it was introduced?
Another new option discovery: `apt changelog findutils` shows it from 2005:
> - find supports -exec ... {} +
> findutils (4.2.14-1) experimental; urgency=low > -- Andreas Metzler
<ametzler at debian.org> Tue, 25 Jan 2005 11:40:21 +0100
The man page is kinda opaque, searching `man find` for " -exec" gives:
> -exec command ;
> ...
Then, the NEXT hit gives:
> -exec command {} +
> ...
So, it's possible to overlook the second entry. (And, why doesn't the first
entry include the {} ?)
Further along are these:
> -execdir command ;
>
> -execdir command {} +
I was either unaware or had forgotten about these - they could be really
handy for something like generating hashes meant to exist in same
directory as the hashed file, etc.
I'll be looking for opportunities to try these.
New knowledge, awesome!
_______________________________________________
Ale mailing list
Ale at ale.org
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
More information about the Ale
mailing list