problem with find and root (/) directory
Hello!
As writen in subject, I have some problems using find with / directory. I want to list all the files on the system using: find / It works fine on the command line. But when added in a script it displays nothing. So, if I write Code:
for i in `find /`; do Thank you and enjoy, Luka |
Hello,
Locate (or slocate, if on slackware) should do the trick. If you've never used locate before, you need to create the dB. As root: Code:
updatedb then: Code:
locate * -Jason P.S. If you've already created the dB, locate -u, will update it. |
Hi,
What does your script look like? 'Cause it works for me: Code:
#!/bin/bash Hope this helps. |
Hi!
username17: sure locate would fix the problem but not all machines the script will run on will have slocate database (not that they will not have it, but it should be done so they don't have to have it). About the script: it's something like TripWire, it lists one file at the time, calculates it's md5 and sha1 digest, inode, owner, group, size .... druuna: Tried that before but it doesnt work. Thank you both, but search for the soulution continues ;) Enjoy, Luka |
Hi again,
Show what you have scripted so far, gives us an idea of what could have gone wrong (if it's anything in the script that is). |
Hi!
There actually is nothing else than what i have posted before. Well the problem appears even if I write the part of the script shown above on the command line. so: for i in `find /`; do echo $i; done does nothing for me. Enjoy, Luka P.S. But the thing is: i've tried it on several machines running from *BSD to Slack. And nothing changes. |
Type in the command line locate / for the root directory if you want to list all the files
|
All times are GMT -5. The time now is 07:09 PM. |