Re: locate question

2023-11-08 Thread Greg Wooledge
On Wed, Nov 08, 2023 at 05:16:26PM +0100, to...@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.



Re: locate question

2023-11-08 Thread tomas
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


signature.asc
Description: PGP signature


Re: locate question

2023-11-08 Thread Roy J. Tellason, Sr.
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



Re: locate question

2023-11-08 Thread Jörg-Volker Peetz

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.



Re: locate question

2023-11-07 Thread gene heskett

On 11/7/23 14:38, to...@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



Re: locate question

2023-11-07 Thread gene heskett

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



Re: locate question

2023-11-07 Thread gene heskett

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



Re: locate question

2023-11-07 Thread Greg Wooledge
On Tue, Nov 07, 2023 at 08:38:51PM +0100, to...@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.



Re: locate question

2023-11-07 Thread tomas
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


signature.asc
Description: PGP signature


Re: locate question

2023-11-07 Thread mick.crane

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



Re: locate question

2023-11-07 Thread The Wanderer
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



signature.asc
Description: OpenPGP digital signature


Re: locate question

2023-11-07 Thread Markus Schönhaber
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



Re: locate question

2023-11-07 Thread Pocket



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



locate question

2023-11-07 Thread 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
/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



Re: Locate question

2000-01-28 Thread Kevin Dalley
Yes, there was a bad NMU to findutils just before the freeze.  4.1-37
fixes this problem.

John Bagdanoff <[EMAIL PROTECTED]> writes:

> I've noticed this the last few days with both slink to potato upgrade and a 
> fresh
> potato install on another drive.  The problem looks like the latest findutils
> package.  I downgraded to the slink findutils which fixed the problem.
> 
> John
> 
> Svante Signell wrote:
> 
> > Hello,
> >
> > Sometime during updates from slink to potato the locate database is
> > not updated any longer. Anacron is running after a reboot, but the
> > updatedb does not locate recent files. Can somebody enlightenment me
> > how things are workingtogether:
> > find, locate, update, updatedb, anacron and cron.


-- 
Kevin Dalley
[EMAIL PROTECTED]


Re: Locate question

2000-01-25 Thread John Bagdanoff
I've noticed this the last few days with both slink to potato upgrade and a 
fresh
potato install on another drive.  The problem looks like the latest findutils
package.  I downgraded to the slink findutils which fixed the problem.

John

Svante Signell wrote:

> Hello,
>
> Sometime during updates from slink to potato the locate database is
> not updated any longer. Anacron is running after a reboot, but the
> updatedb does not locate recent files. Can somebody enlightenment me
> how things are workingtogether:
> find, locate, update, updatedb, anacron and cron.
>
> Svante Signell
>
> --
> Unsubscribe?  mail -s unsubscribe [EMAIL PROTECTED] < /dev/null


Re: Locate question

2000-01-24 Thread Paul J. Keenan
On Mon, Jan 24, 2000 at 10:13:42PM +0100, Svante Signell wrote:
> Hello,
> 
> Sometime during updates from slink to potato the locate database is
> not updated any longer. Anacron is running after a reboot, but the
> updatedb does not locate recent files. Can somebody enlightenment me
> how things are workingtogether:
> find, locate, update, updatedb, anacron and cron.
> 
> Svante Signell

cron runs all entries in /etc/cron.d, which includes
/etc/cron.d/anacron.  This contains log entries which frequently invoke
anacron.

anacron uses timestamp information from /var/spool/anacron/* to decide
when to run the daily, weekly and monthly jobs, which are stored in
/etc/cron.(daily|weekly|monthly).

/etc/cron.daily/find is run each day by anacron by virtue of being
in the /etc/cron.d directory.  It contains the updatedb command.

locate uses the information produced by updatedb for fast file
searches.

A find command can be used for the same task as locate, but slower.
Find has a million and one options for specialised searches, though.

update is a command to periodically flush filesystem buffers, so I
think you might be onto a red herring here ... :-)

HTH.

-- 
Regards,
Paul


Locate question

2000-01-24 Thread Svante Signell
Hello,

Sometime during updates from slink to potato the locate database is
not updated any longer. Anacron is running after a reboot, but the
updatedb does not locate recent files. Can somebody enlightenment me
how things are workingtogether:
find, locate, update, updatedb, anacron and cron.

Svante Signell