• Re: locate question

    From Pocket@21:1/5 to gene heskett on Tue Nov 7 17:50:01 2023
    On 11/7/23 11:32, gene heskett wrote:
    Greetings all;
    I dunno if I've forgot how to use it, or it broken by the same bug
    that killing me with the lagging access to my home raid10.

    Fact: there are probably over 100 files in my /home/gene directory and
    all its subs with assorted names ending in ".scad", made by OpenSCAD
    Fact: I just ran "sudo updatedb" and generated a new date just now, /var/cache/locate/locatedb.n
    so that s/b uptodate.
    Al of those files should be spit out by:
    "locate *.scad" issued from an xfce terminal
    but I get:
    gene@coyote:~$ locate *.scad
    /home/gene/vac_ctrl_box.scad
    /home/gene/xhome_cable.scad

    Acc an ls -R|wc -l  there are
    433179
    files in my /home/gene directory

    so locate isn't working as I think it should.
    try find but it finds the whole my whole local net:
    gene@coyote:~$ find .scad .  |wc -l
    find: ‘.scad’: No such file or directory
    1176532

    What am I doing wrong?

    find . -name '*.scad'|wc -l

    --
    It's not easy to be me

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Markus_Sch=C3=B6nhaber?=@21:1/5 to All on Tue Nov 7 18:00:01 2023
    Am 07.11.23 um 17:32 schrieb gene heskett:

    Greetings all;
    I dunno if I've forgot how to use it, or it broken by the same bug that killing me with the lagging access to my home raid10.

    Fact: there are probably over 100 files in my /home/gene directory and
    all its subs with assorted names ending in ".scad", made by OpenSCAD
    Fact: I just ran "sudo updatedb" and generated a new date just now, /var/cache/locate/locatedb.n
    so that s/b uptodate.
    Al of those files should be spit out by:
    "locate *.scad" issued from an xfce terminal
    but I get:
    gene@coyote:~$ locate *.scad

    Since you're not escaping the '*' you (i. e. the shell) implicitly did:

    gene@coyote:~$ locate vac_ctrl_box.scad xhome_cable.scad

    instead, try

    gene@coyote:~$ locate .scad

    /home/gene/vac_ctrl_box.scad
    /home/gene/xhome_cable.scad

    Acc an ls -R|wc -l  there are
    433179
    files in my /home/gene directory

    so locate isn't working as I think it should.
    try find but it finds the whole my whole local net:

    No, it searches starting at ".scad" and ".". The former doesn't exist
    and the latter is your home directory (because that is the $CWD when you
    issued the command) which find recursively searches for everything,
    since you didn't specify what to search for.

    gene@coyote:~$ find .scad .  |wc -l
    find: ‘.scad’: No such file or directory
    1176532

    What am I doing wrong?

    Try

    gene@coyote:~$ find . -name '*.scad'

    --
    Regards
    mks

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gene heskett@21:1/5 to All on Tue Nov 7 17:40:01 2023
    Greetings all;
    I dunno if I've forgot how to use it, or it broken by the same bug that
    killing me with the lagging access to my home raid10.

    Fact: there are probably over 100 files in my /home/gene directory and
    all its subs with assorted names ending in ".scad", made by OpenSCAD
    Fact: I just ran "sudo updatedb" and generated a new date just now, /var/cache/locate/locatedb.n
    so that s/b uptodate.
    Al of those files should be spit out by:
    "locate *.scad" issued from an xfce terminal
    but I get:
    gene@coyote:~$ locate *.scad
    /home/gene/vac_ctrl_box.scad
    /home/gene/xhome_cable.scad

    Acc an ls -R|wc -l there are
    433179
    files in my /home/gene directory

    so locate isn't working as I think it should.
    try find but it finds the whole my whole local net:
    gene@coyote:~$ find .scad . |wc -l
    find: ‘.scad’: No such file or directory
    1176532

    What am I doing wrong?

    I put some more code into
    Downloads/3dp-stf/vise-screws/master_vise_screw.scad in October, saving
    it many times, but there is not a trace of that added code in it now.

    Looking at that file with an ls -l the saved date seems correct,
    -rw-r--r-- 1 gene gene 29069 Oct 24 11:36 Downloads/3dp.stf/vise-screw/master_vise_screw.scad
    but the file itself is weeks, maybe a couple months old.

    Its as if the file systems (ext4) cache is NOT being properly updated
    and its updating the file dates but not the contents. I can probably
    re-invent that wheel but its at least a days work.

    I am also a heavy user of LinuxCNC, and its been forcing me to reload my
    gcode after saving the modified file by useing the same open NEW file
    procedure used to load a new file, the menu's reload entry gets me old
    code, and so does the linuxcnc's axis gui's convenient reload button. I
    gets old code from the cache But I must force a re-display of the file
    list and select it by name in order to get the code I just edited.

    If the name starts with a v its 2 minutes of scrolling thru the list to
    get to it, very distracting from the train of thought when debugging the g-code.

    This is just one of many times this same basic problem has attacked me.

    Is there a more dependable linux filesystem than ext4?

    I can demo this behavior problem on at least 3 other amd64 machines on
    my home net. I don't recall seeing it on my single armhf, and relatively untested recent bookworm arm64 install. A test edit, adding a comment
    at the end of the file, was successfully reloaded with the comment so I
    don't believe the armhf or arm64 version has this problem.

    Thanks all.

    Cheers, Gene Heskett.
    --
    "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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From The Wanderer@21:1/5 to gene heskett on Tue Nov 7 18:00:01 2023
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
    On 2023-11-07 at 11:32, gene heskett wrote:

    Greetings all;
    I dunno if I've forgot how to use it, or it broken by the same bug that killing me with the lagging access to my home raid10.

    Fact: there are probably over 100 files in my /home/gene directory and
    all its subs with assorted names ending in ".scad", made by OpenSCAD
    Fact: I just ran "sudo updatedb" and generated a new date just now, /var/cache/locate/locatedb.n
    so that s/b uptodate.
    Al of those files should be spit out by:
    "locate *.scad" issued from an xfce terminal
    but I get:
    gene@coyote:~$ locate *.scad
    /home/gene/vac_ctrl_box.scad
    /home/gene/xhome_cable.scad

    Try instead:

    $ locate '*.scad'

    That should prevent the shell from expanding the wildcard before running
    the command.

    Acc an ls -R|wc -l there are
    433179
    files in my /home/gene directory

    so locate isn't working as I think it should.
    try find but it finds the whole my whole local net:
    gene@coyote:~$ find .scad . |wc -l
    find: ‘.scad’: No such file or directory
    1176532

    Try

    $ find . -name '*.scad'

    What am I doing wrong?

    For locate, you're not quoting the arguments properly.

    For find, you're also putting the arguments in the wrong order.

    --
    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-----

    iQIzBAEBCgAdFiEEJCOqsZEc2qVC44pUBKk1jTQoMmsFAmVKazYACgkQBKk1jTQo MmtmGw//ePygZw36EIwpIDU/4MbqYUQeRq/SafaA/X51fWHDO/pCD8UGaHQTpkzw ljYKvRJaPFup/PDxrzWmTPt7Brpl0w/bYqpqJaM+dFis/26SlVZrAspRZdD0XAi1 HNXpcWG1IKpUlSSsTWf11F42AJGtFV7cJ2gJN8PqExfHikrNQ23SeRlmgbB1SS/x cBPz8xFEYK73W6SrRJpni5IqS+Q+qp9U3yJuCoXj4yH8Ue5wWb8y9SKlAoGcyWTb FzPR+tCZyHTyLjt+7qkbSDvSMGwatUF4FjRqZWGzw7lizNtadnGmQEq3eDqi68vi CSJaGcKuqn1DZ3tcVDokPneAzjunYEkh3gVBbgo4ZPaPurtbxlbSkI2saWt/g9NF hNe7cO0D+/ospGVz4fTAE9UMTkjUIkDXHv2bZ0b4xH0Xmo4vUFg7KF2tpvvIatws 7ZbBmElW39qMDhsv9gGpzeOmcFsV2q0C2gw4xYVpOzozdhG//XYPxEl1rJEmbtDX C0OUEzAaLZLdogEq0i/7MEUsM3oCpd2KQhBuuPym2OLV7mf7CFNEQ2PkB35fpeFo 01woRi46voOBdi6ifnPRkB2j07o3FKpbl/fJ6hIBroHX4N/nV5nnovtnIy3sFL41 rAn+lB58MU6Mnz60UgcTqyvrodJB
  • From tomas@tuxteam.de@21:1/5 to gene heskett on Tue Nov 7 20:40:01 2023
    On Tue, Nov 07, 2023 at 11:32:21AM -0500, gene heskett wrote:
    Greetings all;

    [...]

    gene@coyote:~$ locate *.scad
    /home/gene/vac_ctrl_box.scad
    /home/gene/xhome_cable.scad

    Markus and The Wanderer were spot on.

    As a reminder to all: this "naked" *.scad gets already expanded
    by the shell (try "echo *.scad"), so what locate gets to see is
    an already expanded list of all files ending in .scad in whatever
    directory you happen to be, most probably:

    locate vac_ctrl_box.scad xhome_cable.scad

    ... because these are most probably the only two files matching
    that glob pattern living in your home directory (where you happen
    to be, if your prompt ain't lying to us).

    Shell is handy, but shell is nasty at times.

    Cheers
    --
    t

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZUqSSwAKCRAFyCz1etHa RiR2AJ9kAEGcFx0M3x9K3dWXIni3IOnvdACeNrhH8QDGFIDbkldQ4YluC5H56K4=
    =ojqw
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to tomas@tuxteam.de on Tue Nov 7 21:30:01 2023
    On Tue, Nov 07, 2023 at 08:38:51PM +0100, tomas@tuxteam.de wrote:
    On Tue, Nov 07, 2023 at 11:32:21AM -0500, gene heskett wrote:
    gene@coyote:~$ locate *.scad
    /home/gene/vac_ctrl_box.scad
    /home/gene/xhome_cable.scad

    Markus and The Wanderer were spot on.

    As a reminder to all: this "naked" *.scad gets already expanded
    by the shell (try "echo *.scad"), so what locate gets to see is
    an already expanded list of all files ending in .scad in whatever
    directory you happen to be, most probably:

    locate vac_ctrl_box.scad xhome_cable.scad

    ... because these are most probably the only two files matching
    that glob pattern living in your home directory (where you happen
    to be, if your prompt ain't lying to us).

    And THAT is why we like to see the shell prompt along with the
    command and its output. It tells us (or gives us strong hints about)
    the current working directory and whether the command is being executed
    as a normal user or a UID=0 user.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gene heskett@21:1/5 to mick.crane on Tue Nov 7 21:40:01 2023
    On 11/7/23 14:24, mick.crane wrote:
    On 2023-11-07 16:32, gene heskett wrote:
    Greetings all;
    I dunno if I've forgot how to use it, or it broken by the same bug
    that killing me with the lagging access to my home raid10.

    Fact: there are probably over 100 files in my /home/gene directory and
    all its subs with assorted names ending in ".scad", made by OpenSCAD
    Fact: I just ran "sudo updatedb" and generated a new date just now,
    /var/cache/locate/locatedb.n
    so that s/b uptodate.
    Al of those files should be spit out by:
    "locate *.scad" issued from an xfce terminal
    but I get:
    gene@coyote:~$ locate *.scad
    /home/gene/vac_ctrl_box.scad
    /home/gene/xhome_cable.scad

    I dunno.
    You can make separate local databases for locate.
    maybe try that.
    mick

    That sounds helpful as I generally am not interested in random hits from
    the rest of the system. I'll read the manpage again. Thanks mick
    .

    Cheers, Gene Heskett.
    --
    "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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gene heskett@21:1/5 to All on Tue Nov 7 21:30:01 2023
    On 11/7/23 11:52, Markus Schönhaber wrote:
    Am 07.11.23 um 17:32 schrieb gene heskett:

    Greetings all;
    I dunno if I've forgot how to use it, or it broken by the same bug that
    killing me with the lagging access to my home raid10.

    Fact: there are probably over 100 files in my /home/gene directory and
    all its subs with assorted names ending in ".scad", made by OpenSCAD
    Fact: I just ran "sudo updatedb" and generated a new date just now,
    /var/cache/locate/locatedb.n
    so that s/b uptodate.
    Al of those files should be spit out by:
    "locate *.scad" issued from an xfce terminal
    but I get:
    gene@coyote:~$ locate *.scad

    Since you're not escaping the '*' you (i. e. the shell) implicitly did:

    gene@coyote:~$ locate vac_ctrl_box.scad xhome_cable.scad

    instead, try

    gene@coyote:~$ locate .scad

    /home/gene/vac_ctrl_box.scad
    /home/gene/xhome_cable.scad

    Acc an ls -R|wc -l  there are
    433179
    files in my /home/gene directory

    so locate isn't working as I think it should.
    try find but it finds the whole my whole local net:

    No, it searches starting at ".scad" and ".". The former doesn't exist
    and the latter is your home directory (because that is the $CWD when you issued the command) which find recursively searches for everything,
    since you didn't specify what to search for.

    gene@coyote:~$ find .scad .  |wc -l
    find: ‘.scad’: No such file or directory
    1176532

    What am I doing wrong?

    Try

    gene@coyote:~$ find . -name '*.scad'

    And that works, thanks all.

    Cheers, Gene Heskett.
    --
    "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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gene heskett@21:1/5 to tomas@tuxteam.de on Tue Nov 7 21:40:01 2023
    On 11/7/23 14:38, tomas@tuxteam.de wrote:
    On Tue, Nov 07, 2023 at 11:32:21AM -0500, gene heskett wrote:
    Greetings all;

    [...]

    gene@coyote:~$ locate *.scad
    /home/gene/vac_ctrl_box.scad
    /home/gene/xhome_cable.scad

    Markus and The Wanderer were spot on.

    As a reminder to all: this "naked" *.scad gets already expanded
    by the shell (try "echo *.scad"), so what locate gets to see is
    an already expanded list of all files ending in .scad in whatever
    directory you happen to be, most probably:

    locate vac_ctrl_box.scad xhome_cable.scad

    ... because these are most probably the only two files matching
    that glob pattern living in your home directory (where you happen
    to be, if your prompt ain't lying to us).

    Shell is handy, but shell is nasty at times.

    And its regex needs housebroke much of the time. ;o)>

    Cheers

    Cheers, Gene Heskett.
    --
    "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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?J=C3=B6rg-Volker_Peetz?=@21:1/5 to All on Wed Nov 8 14:00:01 2023
    If you just want to see files in /home/gene try

    locate -r 'home/gene/.*\.scad'

    In that way, regex syntax can be used to narrow down the search.

    Regards,
    Jörg.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roy J. Tellason, Sr.@21:1/5 to All on Wed Nov 8 16:40:01 2023
    On Tuesday 07 November 2023 11:32:21 am gene heskett wrote:
    so locate isn't working as I think it should.
    try find but it finds the whole my whole local net:
    gene@coyote:~$ find .scad .  |wc -l
    find: ‘.scad’: No such file or directory

    Try putting a * before the period in that find command?

    --
    Member of the toughest, meanest, deadliest, most unrelenting -- and
    ablest -- form of life in this section of space,  a critter that can
    be killed but can't be tamed.  --Robert A. Heinlein, "The Puppet Masters"
    -
    Information is more dangerous than cannon to a society ruled by lies. --James M Dakin

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From tomas@tuxteam.de@21:1/5 to Sr. on Wed Nov 8 17:20:01 2023
    On Wed, Nov 08, 2023 at 11:45:30AM -0400, Roy J. Tellason, Sr. wrote:
    On Tuesday 07 November 2023 11:32:21 am gene heskett wrote:
    so locate isn't working as I think it should.
    try find but it finds the whole my whole local net:
    gene@coyote:~$ find .scad .  |wc -l
    find: ‘.scad’: No such file or directory

    Try putting a * before the period in that find command?

    No, it is more than that. The non-option arguments to find
    are the starting points. So "find .scad" would look for
    something (hopefully a directory, but in a pinch, a file
    would do, see below) and find everything in there which
    fulfills the search criteria.

    Since those are empty, you would get a listing of .scad
    and everything below it. If there's no .scad, the result
    is empty.

    Putting a * in front of it would get expanded *by the
    shell* (not by find), as was discussed elsewhere in this
    thread. Find would see the expanded result, so, if e.g.
    you have foo.scad, bar.scad and baz.scad in your current
    dir, the command actually run would be

    find foo.scad bar.scad baz.scad

    which would, if those are plain files, just list those
    three (something you can get far cheaper with ls).

    Cheers
    --
    tomás

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZUu0WQAKCRAFyCz1etHa RnKWAJ0TaWPIgp/NYCFPr0d/PZiy6pnXTQCdHdPwMpXkTdgNquWs0LlllyH5g7E=
    =zsvK
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to tomas@tuxteam.de on Wed Nov 8 17:30:01 2023
    On Wed, Nov 08, 2023 at 05:16:26PM +0100, tomas@tuxteam.de wrote:
    On Wed, Nov 08, 2023 at 11:45:30AM -0400, Roy J. Tellason, Sr. wrote:
    On Tuesday 07 November 2023 11:32:21 am gene heskett wrote:
    so locate isn't working as I think it should.
    try find but it finds the whole my whole local net:
    gene@coyote:~$ find .scad .  |wc -l
    find: ‘.scad’: No such file or directory

    Try putting a * before the period in that find command?

    No, it is more than that. [...]

    Putting a * in front of it would get expanded *by the
    shell* (not by find), as was discussed elsewhere in this
    thread. Find would see the expanded result, so, if e.g.
    you have foo.scad, bar.scad and baz.scad in your current
    dir, the command actually run would be

    find foo.scad bar.scad baz.scad

    Also note that there are *two* periods in Gene's original find command.
    He's asking find to look for stuff, beginning in ".scad" and then also beginning in ".".

    If you changed it to

    find *.scad .

    then it would ask find to look for stuff beginning in "foo.scad" and
    also beginning in "bar.scad" and also beginning in ".".

    Changing it to

    find '*.scad' .

    would ask find to look for stuff beginning in "*.scad" (a literal
    asterisk character) and then also beginning in ".". That's still not
    what's wanted.

    What's wanted was already posted earlier, but just for redundancy:

    find . -iname '*.scad'

    is probably the best answer. You can use -name instead of -iname if
    you want the matching to be case sensitive.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)