Searching - looking for a better way

Post here if you are a new Porteus member and you're looking for some help.
User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Searching - looking for a better way

Post#1 by Ed_P » 27 Apr 2014, 06:24

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

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: Searching - looking for a better way

Post#2 by francois » 27 Apr 2014, 12:47

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
Last edited by francois on 27 Apr 2014, 18:02, edited 1 time in total.
Prendre son temps, profiter de celui qui passe.

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: Searching - looking for a better way

Post#3 by donald » 27 Apr 2014, 12:59

@Ed
but not include all my hard drive partitions?
I would simply unmount them before searching.. :wink:

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Searching - looking for a better way

Post#4 by fanthom » 27 Apr 2014, 17:17

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.
Please add [Solved] to your thread title if the solution was found.

User avatar
francois
Contributor
Contributor
Posts: 6434
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

Re: Searching - looking for a better way

Post#5 by francois » 27 Apr 2014, 18:04

Midnight commander (mc) in command line, has a find function that permits you to select the path you are searching for.
Prendre son temps, profiter de celui qui passe.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Searching - looking for a better way

Post#6 by Ed_P » 27 Apr 2014, 20:25

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

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Searching - looking for a better way

Post#7 by Ed_P » 29 Apr 2014, 23:58

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

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Searching - looking for a better way

Post#8 by brokenman » 30 Apr 2014, 01:10

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.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Searching - looking for a better way

Post#9 by Ed_P » 30 Apr 2014, 03:07

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

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Searching - looking for a better way

Post#10 by Ed_P » 30 Apr 2014, 21:28

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

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Searching - looking for a better way

Post#11 by Ed_P » 03 May 2014, 03:38

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

donald
Full of knowledge
Full of knowledge
Posts: 2064
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Re: Searching - looking for a better way

Post#12 by donald » 03 May 2014, 10:28

umount... :wink:

e.g.
umount /dev/sda1

User avatar
brokenman
Site Admin
Site Admin
Posts: 6105
Joined: 27 Dec 2010, 03:50
Distribution: Porteus v4 all desktops
Location: Brazil

Re: Searching - looking for a better way

Post#13 by brokenman » 03 May 2014, 18:39

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.
How do i become super user?
Wear your underpants on the outside and put on a cape.

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: Searching - looking for a better way

Post#14 by Ed_P » 03 May 2014, 19:57

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

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

Re: Searching - looking for a better way

Post#15 by fanthom » 03 May 2014, 20:32

everything happens in /mnt/live/memory/changes directory - so just watch this one.
the rest is static.
Please add [Solved] to your thread title if the solution was found.

Post Reply