Normal Linux commands to Locate your system files, INSTANTLY

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#81 Post by smokey01 »

musher0 wrote: * First, my apologies to Smokeyp01, who doesn't get a GUI...
No apologies required. I live in the cli, many others don't though.
musher0 wrote: * updating takes 2-3 seconds max on my rig (I have +/- 165 Mg's worth of files on
__ 8 partitions.)
I have a lot more files than that, TB in fact.
musher0 wrote: * Speaking of which, the original slocate config. and script in /etc have been
__ removed, we don't need them with Médor's script.
It'a still looking for it though, see attached.
Attachments
image-2.jpg
(53.03 KiB) Downloaded 281 times

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#82 Post by smokey01 »

A few weird things happening. Notice the . on sdb2 and sdb3 path.

This is causing a failed db.

Also the search desktop file doesn't seem to do anything. Running the script from the cli works fine though.
Attachments
image-3.jpg
(52.27 KiB) Downloaded 282 times

gcmartin

#83 Post by gcmartin »

Image

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#84 Post by musher0 »

Thanks for the tests, guys.

@Smokey01: thanks for pointing out the "weirdities". Will look into it.

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#85 Post by musher0 »

Last edited by musher0 on Mon 23 Feb 2015, 00:26, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#86 Post by Puppus Dogfellow »

musher0 wrote:
Puppus Dogfellow wrote:(...)
cool, musher. works well and is very fast. is there a way to read the .db files as text or
html, or a way to convert the databases to something a browser or text editor can
read? could you add (something like) output to file.txt as a choice for each of the
databases created?

thanks in advance.
Thanks, Puppus.

As to your request, best I can do is attached. (For you -- and others -- to test.
If you find it useful, I'll include it as an extra in the next version. Because the files ls
creates are large, and that the directories are not mentioned on each line, it shouldn't
become the main script IMO.)

I tried loading the slocate db's in a text editor, and it loads only the first byte.
You can read an slocate db using less, but it's meaningless, because only some (?)
filenames are visible, and they are separated by code (perhaps vars for the folders,
I really don,t know).

This attached script uses ls instead of slocate. The db files created are huge, by
comparison, but they can be read in any text editor, or in a browser.

Same principle, meaning: the db's are on the indexed drive.

I hope that helps.

BFN.

musher0
~~~~~~~~
PS. It's a variant of a script I uploaded previously on this thread..

thanks, i'll give it a try (or just use some of it--not sure if i need it done for every drive....)

fwiw, gnumeric was able to open the .db slocate created--it wasn't very readable (compared to what ls or even tree would give), but it did open.


___________

bug report on the slocate version of the indexing script: search from menu entry doesn't work (update does and the search works from the file itself).

gcmartin

An earlier reference to "updatedb" command

#87 Post by gcmartin »

I just found something out which refers to what @Smokey01 alluded to, couple days back.

I just had enough time to begin a test for concept using FATDOG700-RC as there is several other tests I needed to run.

Seems; namely "updatedb" is being used as @Smokey01 was asking.

What FATDOG has in the current FATDOG700-RC, builtin, is this command. So, in a terminal without ANY LOCAL DRIVES mounted, I ran it for finding couple normal files usually in the ISO's booted filesystem. Since the command is present, results are expected; "locate filename-only" returns immediate results.

So, I mounted my local NTFS drive. Opened it in ROX, and issued a terminal command to find one of its files. Needless to say "it failed to find it".

Now, here's where what @Smokey01's comments comes into view. I re-ran the "updatedb" command. And guess what happened. Firstly, it took noticeably longer and just when I was about to clobber it, it completed. Next, I re-opened the drive in ROX, selected a file which is NOT in the FATDOG filesystem and only exist on the drive to be the target for the locate command.

I got an immediate response! FATDOG has addressed this need but has done it totally using Linux's updatedb/locate commands.

THIS DOES NOT invalidate what has been achieved as it was clear to me when @Musher0 stated his objectives in database space management to move the db out of RAM to the actual device level. FATDOG's approach shares that there is an operational 2nd solution available, as well.

How that would be extracted and added to WOOFCE, is beyond me, but, it appears that FATDOG (and Lighthouse) have this solution present in their arsenal for user needs. And, since @BarryK is now entrenched in his combination T2 and WOOFQ, this is all too easy for him as well.

I will project the three alternatives in the opening post for developers to locate posts of the work done by members in this thread.

Thanks EVERYONE! It now rests in the hands of the WOOFers for all future PUPs. You have made clear the problem, the benefit and addressed it with solutions that can be available to all PUPs in the future.

Edit: corrected a misspelling and added clarity in one paragraph's sentence.
Last edited by gcmartin on Fri 20 Feb 2015, 07:01, edited 1 time in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#88 Post by musher0 »

Hello, folks.

Here's PuppyTerrier-01b. All corrections from testing above have been
incorporated.

* Thanks in particular to Smokey01 for catching the need to restore a conf file in
/etc for slocate. Also the search from menu should work nicely.

* A *.txt version, as per Puppus' request, is now present as an extra.

* Menu names have been made clearer (thanks gcmartin, for the suggestion over PM)

The edited scripts seem to work well on my slacko-6.0b Puppy. But again, your
testing will be much appreciated.

BFN.

musher0

~~~~~~~
Edit, Febr. 21, 2015 -- Previous attachment deleted. Please see newer version at:
http://murga-linux.com/puppy/viewtopic. ... ost#829853
Thanks.
Last edited by musher0 on Sat 21 Feb 2015, 17:36, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Puppus Dogfellow
Posts: 1667
Joined: Tue 08 Jan 2013, 01:39
Location: nyc

#89 Post by Puppus Dogfellow »

musher0 wrote:Hello, folks.

Here's PuppyTerrier-01b. All corrections from testing above have been
incorporated.

* Thanks in particular to Smokey01 for catching the need to restore a conf file in
/etc for slocate. Also the search from menu should work nicely.

* A *.txt version, as per Puppus' request, is now present as an extra.

* Menu names have been made clearer (thanks gcmartin, for the suggestion over PM)

The edited scripts seem to work well on my slacko-6.0b Puppy. But again, your
testing will be much appreciated.

BFN.

musher0
awesome. thanks, musher0.

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#90 Post by smokey01 »

musher0, I should have mentioned it before but your pet should include a couple more components just to make it easier to get it running.

1. place a 0 byte file called /var/lib/slocate/slocate.db in you main system. Without it it seems to bork and not create the slocate.db file. The other drives seem to have their db created, a bit odd.

2. Create a group for slocate when installing. You just need to append it to the existing group file in /etc/. It doesn't work without it. Try a fresh frugal install and you will see what I mean.

This is now a pretty good application and I don't even mind the db files being on their respective drives but you can't search them unless the drives are mounted. The script that searches all databases drives is clever but not so good if you have 20 drives and only one or two mounted.
For me and many others I'm sure this will be an issue. I still think it's more functional if one large database is used and stored on /mnt/home so it's always available. Yes, you still have to mount and index each drive but if you operate like me, most of the work is done on 3 or 4 drives which are changing regularly.

Working quite nicely.

Cheers

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#91 Post by musher0 »

Thanks, Smokey01, for the compliments and for the valuable recommendations.

About your #1, providing an empty db file in the pet is no trouble at all. However,
I'm puzzled by the fact that you don't have a db file there even after a first run of
slocate.

About your #2, an slocate group is already in my "/etc/group" file. (See pic.)
Do you mean that "owners" should be appended to the line?

Image
I'm unfamiliar with "groups".

As to your #3, I suppose a question could be asked to the user at the beginning
about where to store, or even simply copy the drive db's. Actually, it doesn't matter
where the db's are, as long as they are available. For us humans, that is... :)

Through various tests, I discovered that slocate apparently needs to create & store
a particular drive's db on the particular drive. If you want to create a db for say,
/mnt/sda1, in /varlib/slocate, it won''t do it. (But maybe I have to test "harder"!)

We have to check if slocate has the same "reaction" when searching db's.

Again thanks for this. BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#92 Post by musher0 »

@smokey01

My baby got a lot of attention recently, but I believe Drive_Index_Creator-4 by
Slavvo67
already does what you want:
http://murga-linux.com/puppy/viewtopic. ... ost#828928
It creates a huge 80Mb + index in /root of all files on all mounted drives, and does
the sub-searches on it.

There's also searchmonkey's variant by mikeb, but it's not clear to me
if it can index all mounted drives in a single file:
http://www.murga-linux.com/puppy/viewto ... ost#737444
Maybe ask mikeb? :)

Lazy side of me speaking: I feel like I've done enough coding for the week! ;) BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#93 Post by musher0 »

@ Slavvo67

About your Drive_Index_Creator-4 at:
http://murga-linux.com/puppy/viewtopic. ... ost#828928

I am not sure it'is advisable to create a 80Mb + index in /root if you're running
Puppy in frugal or CD/DVD mode. That said, your searches are extremely fast,
perhaps because of it.

Another suggestion I would have is: perhaps use the "more" utility during the
listing so we don't have to backtrack the list using the side bar so much?

Perhaps also add the option to abort once we've found the file we want.

I like that the index and the search results are text-editor friendly.

Very good job. :) TWYL.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#94 Post by slavvo67 »

Musher0:

Thanks for the input. I run puppy with a full USB install, so that hasn't been an issue for me but it is important not to alienate others that might be using Puppy that way.

Thanks for the suggestions. I was just toying around with it so I'm not sure how much further I want to go.

When you mention the 80MB file, I'm guessing you mean with the copy function where files are moved over. You don't have an 80MB text file listing the files / directories, I would guess....

I'm playing with the idea of having a pop-up window to choose the destination directory. Maybe I'll take some weekend time and do that.

I haven't used your final or near-final product yet but I look forward to it over the weekend, as well.

Best,

Slavvo67

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#95 Post by mikeb »

There's also searchmonkey's variant by mikeb, but it's not clear to me
if it can index all mounted drives in a single file:
hi , I'd stopped watching :D

No indexing...its like 'find' with a friendly face...just search when you need it where you need it and pretty fast... and then there's content searching and a handy regular expression maker.
I do think it keeps a temporary index as content searches are much faster after the first pass.

Thats it...have fun :)

mike

gcmartin

#96 Post by gcmartin »

@Slaavvo67,it is a nice utility.

I don't know if 80MB RAM in the root filesystem on today's PC's is any hardship. In 32bit (or even 4bit) PUPs, the trade-off from the old way of doing things is invaluable. Thus, an 80MB penalty for instantaneously finding stuff is pretty small considering the reduction on CPU and disk I/O.

I also, would envision, that as PUPs move further into the future, this need for applications to discover files would have a tremendous reduction on CPU utilization for searches.

I do understand @Musher0 sharing and the concern he shares. It merely a trade-off, though. This is a traditional problem that has plagued programming and will continue until all things in the technology world are RAM resident (I don't ever expect that to happen).

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#97 Post by musher0 »

Attachments
PuppyTerrier-01e_BIL.pet
Blingual FR-EN version. It should be easy enough to localize to other languages.
(Just PM me and I'll explain how to do it.)
(37.39 KiB) Downloaded 233 times
Last edited by musher0 on Mon 23 Feb 2015, 00:21, edited 3 times in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

slavvo67
Posts: 1610
Joined: Sat 13 Oct 2012, 02:07
Location: The other Mr. 305

#98 Post by slavvo67 »

Hi Musher0:

I really like the interface on your search. Once the databases are created, it's fast. I did notice that if I searched for file type, such as .pdf or .jpg, it doesn't seem to find just by extension.

Can you let me / us know where it is storing everything?

Thanks,

Slavvo67

P.S. - Updated Drive Index Creator with your suggestions. I'll probably upload later this evening after I test a bit more.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#99 Post by musher0 »

Hi, Slavvo67.

I'm glad you like the new search interface. It's wider, easier to read, eh?

In answer to your question, there is one main db for the Puppy system files:
/var/lib/slocate/slocate.db (for internal Puppy files)

and each mounted drive has its own db for its own files:
/mnt/sd??/slocate-sd??.db (for the files on drives sd??)

Break a leg on that script of yours! :) BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#100 Post by musher0 »

Hello again.

I seem to have no problem finding jpg's.

Image

I asked slocate to find "jpg", though, not ".jpg" ?

BFN.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

Post Reply