• Re: =?utf-8?Q?I=E2=80=99m?= A Linux Expert, And Here Are 6 CommandsI =?utf-8?Q?Can=E2=80=99t?= Live Without

    From Richard Kettlewell@invalid@invalid.invalid to comp.os.linux.misc on Mon Aug 18 08:31:03 2025
    From Newsgroup: comp.os.linux.misc

    Nuno Silva <nunojsilva@invalid.invalid> writes:
    BTW, is it just lack of coffee or both the online manual page and the
    GNU info manual section for GNU diff do not explain/specify the default output format? (Compare with IEEE 1003.1 [1].)

    [1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/diff.html

    The man page is little more than an option summary. The texinfo manual describes the default output format here:

    https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Normal.html
    --
    https://www.greenend.org.uk/rjk/
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.os.linux.misc on Mon Aug 18 08:21:50 2025
    From Newsgroup: comp.os.linux.misc

    On Mon, 18 Aug 2025 08:31:03 +0100, Richard Kettlewell wrote:

    On Sun, 17 Aug 2025 00:44:26 -0000 (UTC), Lawrence D’Oliveiro wrote:

    I had to recheck “info diff” (the man page being insufficient in
    this case) to refresh my memory of what context-diff looked like; I
    would agree with the vast majority of open-source software
    developers, that unified-diff is preferable.

    The man page is little more than an option summary. The texinfo
    manual describes the default output format here:

    https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Normal.html

    So I noticed.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Carlos E.R.@robin_listas@es.invalid to comp.os.linux.misc on Tue Aug 19 12:06:04 2025
    From Newsgroup: comp.os.linux.misc

    On 2025-08-16 20:28, Rich wrote:
    Stéphane CARPENTIER <sc@fiat-linux.fr> wrote:
    I never use "diff". I really don't like the way it's displayed. I'm using
    "vimdiff" or "nvim -d" a lot, because at the same time it's easier to
    see what I want and it's easier to make the right changes.

    diff's default output is an 'ed script' which is not very human
    readable at all.

    The unified output (-u option) provides a 'diff' view that is much more ameniable to being understood by humans.


    diff --side-by-side --suppress-common-lines --ignore-space-change \
    $1 $2 | less -S


    But lately what I use is "meld".
    --
    Cheers, Carlos.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Carlos E.R.@robin_listas@es.invalid to comp.os.linux.misc on Tue Aug 19 12:28:49 2025
    From Newsgroup: comp.os.linux.misc

    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.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From candycanearter07@candycanearter07@candycanearter07.nomail.afraid to comp.os.linux.misc on Tue Aug 19 13:40:10 2025
    From Newsgroup: comp.os.linux.misc

    Lawrence D’Oliveiro <ldo@nz.invalid> wrote at 02:07 this Saturday (GMT):
    On Sat, 16 Aug 2025 00:20:08 -0000 (UTC), candycanearter07 wrote:

    Lawrence D'Oliveiro <ldo@nz.invalid> wrote at 22:45 this Thursday (GMT):

    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.

    The term for that is “deep” software: it doesn’t scare you with a
    whole lot of complexity up front. Instead, it offers some initial
    features that aren’t that hard to use, but the more you dig beneath
    the surface, the more capabilities you find. This is why it’s good
    that the man page is always handy: you can keep going back to it and discovering new things as you need them.


    Well yeah, but the "basic" usage still requires a few switches, and its
    not outlined in examples. I'm not surprised those "important linux
    commands" lists were too lazy to provide that info.
    --
    user <candycane> is generated from /dev/urandom
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.os.linux.misc on Wed Aug 20 00:50:24 2025
    From Newsgroup: comp.os.linux.misc

    On Tue, 19 Aug 2025 12:06:04 +0200, Carlos E.R. wrote:

    But lately what I use is "meld".

    <https://meldmerge.org/> -- seems to do a lot.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.os.linux.misc on Wed Aug 20 00:59:15 2025
    From Newsgroup: comp.os.linux.misc

    On Tue, 19 Aug 2025 12:28:49 +0200, Carlos E.R. wrote:

    Laicolasse:~ # time find / -type d -newermt "2025-07-28" \
    ! -newermt "2025-07-31" 2>/dev/null | tee busqueda

    I never knew about -newermt. Why? Because it’s not listed in the man page, though it is documented in the info file.

    Nope. Scratch that. It *is* documented in the man page, in the form of “- newerXY” with explanations of what “X” and “Y” can be.

    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.

    Wouldn’t “-xdev” (“don’t descend directories on other filesystems”) have
    fixed that?
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Rene Kita@mail@rkta.de to comp.os.linux.misc on Wed Aug 20 05:54:57 2025
    From Newsgroup: comp.os.linux.misc

    Lawrence D’Oliveiro <ldo@nz.invalid> wrote:
    On Fri, 15 Aug 2025 04:55:04 -0000 (UTC), Rene Kita wrote:

    Charlie Gibbs <cgibbs@kltpzyxm.invalid> wrote:

    Favourite one-liner:
    grep foo * | cut -d: -f1 | uniq

    Why not 'grep -l foo *'?

    To “UUOC” (“Useless Use Of Cat”), we can add a new category: How about
    “UUOCP” (“Useless Use Of Complicated Pipelines”)?

    I like that.

    Somewhere downthread was another one using find and xargs. While this
    might be necessary under some circumstances find usually comes with
    -exec and shells have extended globbing to recursively go into
    directories.

    But I refrained from my duty call...

    Also I'm far from being a Linux Expert.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Carlos E.R.@robin_listas@es.invalid to comp.os.linux.misc on Wed Aug 20 12:20:37 2025
    From Newsgroup: comp.os.linux.misc

    On 2025-08-20 02:50, Lawrence D’Oliveiro wrote:
    On Tue, 19 Aug 2025 12:06:04 +0200, Carlos E.R. wrote:

    But lately what I use is "meld".

    <https://meldmerge.org/> -- seems to do a lot.

    For example, after an update an rpm based system there are a lot of
    .rpmold or .rpmorig files. I compare the config files with the other
    version and easily copy over the new or the old lines into the active file.
    --
    Cheers, Carlos.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Carlos E.R.@robin_listas@es.invalid to comp.os.linux.misc on Wed Aug 20 12:32:16 2025
    From Newsgroup: comp.os.linux.misc

    On 2025-08-20 02:59, Lawrence D’Oliveiro wrote:
    On Tue, 19 Aug 2025 12:28:49 +0200, Carlos E.R. wrote:

    Laicolasse:~ # time find / -type d -newermt "2025-07-28" \
    ! -newermt "2025-07-31" 2>/dev/null | tee busqueda

    I never knew about -newermt. Why? Because it’s not listed in the man page, though it is documented in the info file.

    Nope. Scratch that. It *is* documented in the man page, in the form of “- newerXY” with explanations of what “X” and “Y” can be.

    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.

    Wouldn’t “-xdev” (“don’t descend directories on other filesystems”) have
    fixed that?

    But I need to scan both root and home, which are separate filesystems.

    I just saw:

    -xautofs
    Don't descend directories on autofs filesystems.


    which I have tested now and works! I feared it might work with the
    classic automount but not with systemd. It does work. Nice!
    --
    Cheers, Carlos.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.os.linux.misc on Wed Aug 20 22:16:22 2025
    From Newsgroup: comp.os.linux.misc

    On Wed, 20 Aug 2025 12:20:37 +0200, Carlos E.R. wrote:

    For example, after an update an rpm based system there are a lot of
    .rpmold or .rpmorig files. I compare the config files with the other
    version and easily copy over the new or the old lines into the
    active file.

    On Debian with a package upgrade, if the config file from the old
    package hasn’t been changed from the default, it quietly replaces it
    with the version from the new package. If it has been changed, then it
    prompts you to ask what to do.

    So only in the latter case do you end up with leftover configs from
    the old version.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.os.linux.misc on Wed Aug 20 22:21:16 2025
    From Newsgroup: comp.os.linux.misc

    On Wed, 20 Aug 2025 12:32:16 +0200, Carlos E.R. wrote:

    On 2025-08-20 02:59, Lawrence D’Oliveiro wrote:

    Wouldn’t “-xdev” (“don’t descend directories on other filesystems”)
    have fixed that?

    But I need to scan both root and home, which are separate filesystems.

    I was going to say, explicitly list both / and /home (and whatever else)
    as directories to search in, with -xdev to avoid entering any other mount points, but ...

    I just saw:

    -xautofs
    Don't descend directories on autofs filesystems.


    which I have tested now and works! I feared it might work with the
    classic automount but not with systemd. It does work. Nice!

    ... that is probably simpler. ;)

    However, it’s not present on my “find” version (findutils 4.10.0-3, part of Debian Unstable as of last month).
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Carlos E.R.@robin_listas@es.invalid to comp.os.linux.misc on Thu Aug 21 02:29:57 2025
    From Newsgroup: comp.os.linux.misc

    On 2025-08-21 00:21, Lawrence D’Oliveiro wrote:
    On Wed, 20 Aug 2025 12:32:16 +0200, Carlos E.R. wrote:

    On 2025-08-20 02:59, Lawrence D’Oliveiro wrote:

    Wouldn’t “-xdev” (“don’t descend directories on other filesystems”)
    have fixed that?

    But I need to scan both root and home, which are separate filesystems.

    I was going to say, explicitly list both / and /home (and whatever else)
    as directories to search in, with -xdev to avoid entering any other mount points, but ...

    I just saw:

    -xautofs
    Don't descend directories on autofs filesystems.


    which I have tested now and works! I feared it might work with the
    classic automount but not with systemd. It does work. Nice!

    ... that is probably simpler. ;)

    However, it’s not present on my “find” version (findutils 4.10.0-3, part
    of Debian Unstable as of last month).

    Wow. And I'm using openSUSE Leap 15.6, which has ancient versions of
    almost everything.

    Telcontar:~ # rpm -q findutils
    findutils-4.8.0-150300.3.3.2.x86_64

    Weird.
    --
    Cheers, Carlos.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Lawrence =?iso-8859-13?q?D=FFOliveiro?=@ldo@nz.invalid to comp.os.linux.misc on Thu Aug 21 01:29:35 2025
    From Newsgroup: comp.os.linux.misc

    On Thu, 21 Aug 2025 02:29:57 +0200, Carlos E.R. wrote:

    On 2025-08-21 00:21, Lawrence D’Oliveiro wrote:

    However, it’s not present on my “find” version (findutils 4.10.0-3,
    part of Debian Unstable as of last month).

    Wow. And I'm using openSUSE Leap 15.6, which has ancient versions of
    almost everything.

    Telcontar:~ # rpm -q findutils
    findutils-4.8.0-150300.3.3.2.x86_64

    Weird.

    The patch is actually older than that, dating from 2009 <http://fedora.riscv.rocks:3000/rpms/findutils/commit/29ef88d6c3ded9300b7c0c1b1a29321b287cab7a?style=unified&whitespace=ignore-all&show-outdated=>.
    But it looks like it was never upstreamed into the GNU version <https://www.gnu.org/software/findutils/manual/html_mono/find.html>.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Anssi Saari@anssi.saari@usenet.mail.kapsi.fi to comp.os.linux.misc on Thu Aug 21 11:44:40 2025
    From Newsgroup: comp.os.linux.misc

    Charlie Gibbs <cgibbs@kltpzyxm.invalid> writes:

    How about a list of favourite options to common commands?
    Mine is "ls -ltr", which shows files in chronological order.

    For ls, I have

    - lsl is aliased to ls -lLF. I sometimes remove the L and then put it
    back because sometimes I want to see symlinks as symlinks and
    sometimes I don't. I think I'm tending towards seeing the symlinks
    again.
    - l is aliased to ls -lF|more or more -e now to retain the old behavior,
    i.e. paging only paging needed, exit otherwise.
    - lth is a function to run ls -lt | head -20 on its arguments or $PWD if
    no arguments.
    - I'm thinking of replacing the l alias with a function so it can be run
    on multiple directories and retain color. Something like
    ls --color=always -lF $* | less -iX -E -R
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Carlos E.R.@robin_listas@es.invalid to comp.os.linux.misc on Thu Aug 21 12:46:34 2025
    From Newsgroup: comp.os.linux.misc

    On 2025-08-21 03:29, Lawrence D’Oliveiro wrote:
    On Thu, 21 Aug 2025 02:29:57 +0200, Carlos E.R. wrote:

    On 2025-08-21 00:21, Lawrence D’Oliveiro wrote:

    However, it’s not present on my “find” version (findutils 4.10.0-3, >>> part of Debian Unstable as of last month).

    Wow. And I'm using openSUSE Leap 15.6, which has ancient versions of
    almost everything.

    Telcontar:~ # rpm -q findutils
    findutils-4.8.0-150300.3.3.2.x86_64

    Weird.

    The patch is actually older than that, dating from 2009 <http://fedora.riscv.rocks:3000/rpms/findutils/commit/29ef88d6c3ded9300b7c0c1b1a29321b287cab7a?style=unified&whitespace=ignore-all&show-outdated=>.
    But it looks like it was never upstreamed into the GNU version <https://www.gnu.org/software/findutils/manual/html_mono/find.html>.

    So, little mystery solved :-)
    --
    Cheers, Carlos.
    --- Synchronet 3.21a-Linux NewsLink 1.2
  • From Nuno Silva@nunojsilva@invalid.invalid to comp.os.linux.misc on Fri Aug 22 10:18:23 2025
    From Newsgroup: comp.os.linux.misc

    On 2025-08-18, Richard Kettlewell wrote:

    Nuno Silva <nunojsilva@invalid.invalid> writes:
    BTW, is it just lack of coffee or both the online manual page and the
    GNU info manual section for GNU diff do not explain/specify the default
    output format? (Compare with IEEE 1003.1 [1].)

    [1] https://pubs.opengroup.org/onlinepubs/9799919799/utilities/diff.html

    The man page is little more than an option summary. The texinfo manual describes the default output format here:

    https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Normal.html

    Thanks, that eluded me when I was looking at it, either I failed at
    searching, or I didn't search further because I assumed it was the
    coreutils info manual (hence why I mentioned "section"). It is indeed documented there :-)
    --
    Nuno Silva
    --- Synchronet 3.21a-Linux NewsLink 1.2