Groups | Search | Server Info | Keyboard shortcuts | Login | Register
Groups > comp.os.linux.misc > #71641
| From | "Carlos E.R." <robin_listas@es.invalid> |
|---|---|
| Newsgroups | comp.os.linux.misc |
| Subject | Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without |
| Date | 2025-08-19 12:28 +0200 |
| Message-ID | <180enlxc26.ln2@Telcontar.valinor> (permalink) |
| References | <107gp14$3ko4l$1@dont-email.me> <sm0cy8ygm1d.fsf@lakka.kapsi.fi> <107louk$p5vg$4@dont-email.me> <slrn109vjas.e09o.candycanearter07@candydeb.host.invalid> |
On 2025-08-16 02:20, candycanearter07 wrote:
> Lawrence D'Oliveiro <ldo@nz.invalid> wrote at 22:45 this Thursday (GMT):
>> On Thu, 14 Aug 2025 14:50:06 +0300, Anssi Saari wrote:
>>
>>> Lawrence D'Oliveiro <ldo@nz.invalid> writes:
>>>
>>>> What’s an obvious omission from his list? To me, it’s the “find”
>>>> command.
>>>
>>> Possibly or something like it. I just started looking into rawhide which
>>> is another search tool. My interest is rawhide's ability to search for
>>> tags in extended attributes. I've started adding tags to videos and
>>> photos so I can search for those with rawhide.
>>
>> The “find” command has the ability to execute external commands. Those can
>> produce output on their own, and/or their success/failure exit status can
>> be used as a filter on matching files.
>
>
> To be fair, "find" can be a bit of a rabbithole to learn. I personally
> only know the basics of -name, -iname, and -type.
I have forgotten how to use find, I use it so few times. So instead of
learning again, when I need to use it, I use chatgpt to concoct the line
for me :-P
The other day I wanted to search a machine to find files created between
certain dates:
Laicolasse:~ # time find / -type d -newermt "2025-07-28" \
! -newermt "2025-07-31" 2>/dev/null | tee busqueda
^C
real 26m14.066s
user 0m3.725s
sys 1m5.634s
Laicolasse:~ #
Took way too long for a laptop with M2 disk. It was faster on other
machines.
Turned out that an automount was happening of an external nfs mount on
"/mnt/nfs/Isengard/xfsRaid/", and that raid is big and slow, the search
took for ever.
I did not want to do a refresher course on "find" again.
With the aid of chatgpt I came with:
# find / \( -path /mnt/nfs/Isengard/xfsRaid/ \) -prune \
-o -type d -newermt "2025-07-28" ! -newermt "2025-07-31" \
2>/dev/null | tee busqueda
But did not work, the directory was mounted again and scanned. I then
deleted the automount line from fstab:
#Isengard.valinor:/data/xfsRaid/ /mnt/nfs/Isengard/xfsRaid \
nfs4 noauto,nofail,x-systemd.automount,\
x-systemd.idle-timeout=300,_netdev,user,users,lazytime 0 0
But did not work because systemd has a memory (automatic mount units)
and still automounted the directory.
So what did I do?
Stop the network!
Brute force approach.
In retrospect, I should have used:
Laicolasse:~ # time find / \( -path /mnt/nfs/Isengard/ \) \
-prune -o -type d -newermt "2025-07-28" ! -newermt \
"2025-07-31" 2>/dev/null | tee busqueda
...
real 0m3.035s
user 0m0.836s
sys 0m2.180s
Laicolasse:~ #
--
Cheers, Carlos.
Back to comp.os.linux.misc | Previous | Next — Previous in thread | Next in thread | Find similar
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2025-08-16 00:20 +0000
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-08-16 02:07 +0000
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> - 2025-08-19 13:40 +0000
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without rbowman <bowman@montana.com> - 2025-08-16 09:47 +0000
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without Charlie Gibbs <cgibbs@kltpzyxm.invalid> - 2025-08-16 17:04 +0000
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-08-17 00:45 +0000
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without rbowman <bowman@montana.com> - 2025-08-17 07:20 +0000
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without rbowman <bowman@montana.com> - 2025-08-17 07:18 +0000
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without "Carlos E.R." <robin_listas@es.invalid> - 2025-08-19 12:28 +0200
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-08-20 00:59 +0000
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without "Carlos E.R." <robin_listas@es.invalid> - 2025-08-20 12:32 +0200
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-08-20 22:21 +0000
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without "Carlos E.R." <robin_listas@es.invalid> - 2025-08-21 02:29 +0200
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without Lawrence D’Oliveiro <ldo@nz.invalid> - 2025-08-21 01:29 +0000
Re: I’m A Linux Expert, And Here Are 6 Commands I Can’t Live Without "Carlos E.R." <robin_listas@es.invalid> - 2025-08-21 12:46 +0200
csiph-web