Page 1 of 2

Searching - looking for a better way

Posted: 27 Apr 2014, 06:24
by Ed_P
When I search for something that I have no where to look I set the spaceFM location to be /. I want to search every Porteus file and folder for it. Unfortunately / includes /mnt which includes all my hard drive partitions. PQSERVICE, SYSTEM RESERVED, BACKUPS and Acer not just the drive where porteus is located.

The other day I tried to find where Adobe Flash stores my Preferences, after an hr the search was still running and nothing had been found.

How do I config spaceFM to search all Porteus files and folders but not include all my hard drive partitions?

Re: Searching - looking for a better way

Posted: 27 Apr 2014, 12:47
by francois
The slocate utility is stock on porteus 3.0. It is really fast. To get it going:

Code: Select all

root@sensei:~# updatedb
root@sensei:~# locate *.iso
Example: locate *.iso will give you all the iso on your computer.

To get the arguments for locate:

Code: Select all

root@sensei:~#  locate -h

Re: Searching - looking for a better way

Posted: 27 Apr 2014, 12:59
by donald
@Ed
but not include all my hard drive partitions?
I would simply unmount them before searching.. :wink:

Re: Searching - looking for a better way

Posted: 27 Apr 2014, 17:17
by fanthom
I would simply unmount them before searching..
what about this:

Code: Select all

mkdir /mnt/root_fs
mount -o bind / /mnt/foot_fs
find /mnt/root_fs -name "*whatever*"
this way you are searching only rootfs (aufs) and not /dev, /proc, /sys, external drives, mounted shares :)

or better - do not mount/unmount anything and do a search in /mnt/live/memory then remove /mnt/live/memory/{changes,images} from path.

Re: Searching - looking for a better way

Posted: 27 Apr 2014, 18:04
by francois
Midnight commander (mc) in command line, has a find function that permits you to select the path you are searching for.

Re: Searching - looking for a better way

Posted: 27 Apr 2014, 20:25
by Ed_P
francois wrote:The slocate utility is stock on porteus 3.0. It is really fast. To get it going:

Code: Select all

root@sensei:~# updatedb
root@sensei:~# locate *.iso
donald wrote:I would simply unmount them before searching.. :wink:
fanthom wrote: what about this:

Code: Select all

mkdir /mnt/root_fs
mount -o bind / /mnt/foot_fs
find /mnt/root_fs -name "*whatever*"
this way you are searching only rootfs (aufs) and not /dev, /proc, /sys, external drives, mounted shares :)

or better - do not mount/unmount anything and do a search in /mnt/live/memory then remove /mnt/live/memory/{changes,images} from path.
Some excellent suggestions guys. Thank you. :beer:

The unmounting suggestion should help but I'm not sure the other two, while certainly fast, will help in the search I was doing. a. I don't understand Porteus's folder structure so I don't know what folder/s to search in for an Adobe Flash file. b. I don't know what naming convention a Flash user config options file would take in Linux. c. To circumvent my limitations I was searching for the contents of a file that contained the Adobe Flash Trusted Location path that I entered and saved. Thus I could back it up and restore it the next time I booted. It isn't being saved in my save.dat file.

Re: Searching - looking for a better way

Posted: 29 Apr 2014, 23:58
by Ed_P
I came across an interesting thread today that kinda relates to this quest. http://forum.porteus.org/viewtopic.php? ... b01#p24263 I tried the script and the commands but didn't get what I was expecting.

Code: Select all

guest@porteus:~$ find /home/guest -mmin 600 -type d -name "*"
guest@porteus:~$ find /home/guest -mmin 60 -type d -name "*"
guest@porteus:~$ find /home/guest -mmin 200 -type d -name "*"
guest@porteus:~$ 
I was looking for files I had changed/made in my /home/guest folder recently similar to tb01's quest and found none. I tried the find --help command but that wasn't much help.

I did find the dir2xzm command an interesting find though.

Re: Searching - looking for a better way

Posted: 30 Apr 2014, 01:10
by brokenman

Code: Select all

find /home/guest -mmin 200 -type d -name "*"
This will look for directories (-d)
Use the -f switch to search for files changed/created.

Good to see you digging through files. Take a look in /opt/porteus-scripts/changes-time. Remove "$changes/home|" from line 30 and run it.

Re: Searching - looking for a better way

Posted: 30 Apr 2014, 03:07
by Ed_P
Unfortunately

Code: Select all

guest@porteus:~$ find /home/guest -mmin 600 -type f -name "*"
guest@porteus:~$ 
same results. Larger time value to cover changes made earlier.

The changes-time script change didn't fair much better

Code: Select all

guest@porteus:~$ ./changes-time
bash: ./changes-time: Permission denied
guest@porteus:~$ su
Password: 
root@porteus:/home/guest# ./changes-time
bash: ./changes-time: Permission denied
root@porteus:/home/guest# 
I saved the modified script in my /home/guest folder/directory so maybe that's the problem. But intrigued as to what this script does and will review it more before running it in it's native form.

Thanks brokenman.

Re: Searching - looking for a better way

Posted: 30 Apr 2014, 21:28
by Ed_P
Still getting no where with the find command. Read the man find writeup and tried different options. Same result.

Code: Select all

guest@porteus:~$ find /home/guest -mmin 200 -type f -name "*"
guest@porteus:~$ su
Password: 
root@porteus:/home/guest# find /home/guest -mmin 200 -type f -name "*"
root@porteus:/home/guest# find /home/guest/ -mmin 200 -type f -name "*"
root@porteus:/home/guest# find /home/guest/ -mmin 60 -type f -name "*"
root@porteus:/home/guest# find /home/guest -mmin 60 -type f -name "*"
root@porteus:/home/guest# find /home/guest -cmin 120 -type f -name "*"
root@porteus:/home/guest# find /home/guest -cmin 120 -type d -name "*"
root@porteus:/home/guest# find /home/guest/ -cmin 120 -type f -name "*"
root@porteus:/home/guest# find /home/guest/ -ctime 1 -type f -name "*"
root@porteus:/home/guest#  
:wall:

Re: Searching - looking for a better way

Posted: 03 May 2014, 03:38
by Ed_P
In addition to find not working...

Code: Select all

guest@porteus:~$ unmount /mnt/sda1
bash: unmount: command not found
guest@porteus:~$ su
Password: 
root@porteus:/home/guest# unmount /mnt/sda1
bash: unmount: command not found
root@porteus:/home/guest# ./unmount /mnt/sda1
bash: ./unmount: No such file or directory
root@porteus:/home/guest# 
:wall:

Re: Searching - looking for a better way

Posted: 03 May 2014, 10:28
by donald
umount... :wink:

e.g.
umount /dev/sda1

Re: Searching - looking for a better way

Posted: 03 May 2014, 18:39
by brokenman
Try running bash scripts with: sh /path/to/script.sh
This way they will run whether they are executable or not.

If nothing is returned from the find command it means that no file was found with a new timestamp. This means that either adobe flash is not saving the configuration in a plain text config file (i suspect this is the case) or the file is updated somehow without the timestamp being modified.

Re: Searching - looking for a better way

Posted: 03 May 2014, 19:57
by Ed_P
donald wrote:umount... :wink:

e.g.
umount /dev/sda1
Image Thank you donald.
brokenman wrote:Try running bash scripts with: sh /path/to/script.sh
This way they will run whether they are executable or not.
Ok. Thanks.
If nothing is returned from the find command it means that no file was found with a new timestamp.
The files I was hoping the find commands would show were .sh and .txt files that I had manually changed earlier, using Leafpad. I was hoping to find a command that would show me changes I had made, manually, and downloads so I could be sure to back them up before I shutdown.

I'm unclear as to if there is a limit to the mmin value, of either 60 or 99, but if so it could explain the problem.

Re: Searching - looking for a better way

Posted: 03 May 2014, 20:32
by fanthom
everything happens in /mnt/live/memory/changes directory - so just watch this one.
the rest is static.