When using the find command, I am getting hundreds of 'permission denied' when not using the user root. I did a google search and found that I should add " 2>/dev/nul" to the line (obviously this needs an alias), but now I get one line of bash: /dev/nul: "permission denied" the complete line is: find / -iname filename 2>/dev/nul thoughts? -- John Sowden American Sentry Systems. Inc. 1221 Andersen Drive San Rafael, CA 94901 U.L. Listed Central Station Alarm Service Serving the San Francisco Bay Area Since 1967 mail@americansentry.net http://www.americansentry.net
John, El Sáb 12 Feb 2005 21:35, John Sowden escribió:
the complete line is: find / -iname filename 2>/dev/nul
thoughts?
It's /dev/null - with a double 'l'. -- Andreas Philipp Noema Ltda. Bogotá, D.C. - Colombia http://www.noemasol.com
Excellent! Thanks all. On Saturday 12 February 2005 18:43, Andreas Philipp wrote:
John,
El Sáb 12 Feb 2005 21:35, John Sowden escribió:
the complete line is: find / -iname filename 2>/dev/nul
thoughts?
It's /dev/null - with a double 'l'.
-- John Sowden American Sentry Systems. Inc. 1221 Andersen Drive San Rafael, CA 94901 U.L. Listed Central Station Alarm Service Serving the San Francisco Bay Area Since 1967 mail@americansentry.net http://www.americansentry.net
John Sowden wrote:
When using the find command, I am getting hundreds of 'permission denied' when not using the user root. I did a google search and found that I should add " 2>/dev/nul" to the line (obviously this needs an alias), but now I get one line of bash: /dev/nul: "permission denied"
the complete line is: find / -iname filename 2>/dev/nul
thoughts?
Just one thought. Try putting two "l"s at the end of null. :) Jim
John, On Saturday 12 February 2005 18:35, John Sowden wrote:
When using the find command, I am getting hundreds of 'permission denied' when not using the user root. I did a google search and found that I should add " 2>/dev/nul" to the line (obviously this needs an alias), but now I get one line of bash: /dev/nul: "permission denied"
the complete line is: find / -iname filename 2>/dev/nul
thoughts?
You've been told about the proper name for /dev/null. However, for such simple invocations of find, you really should be using the "locate" command. It's far faster, won't be restricted from disclosing files in unreadable sub-directories and will be far easier on your hard drives. "man locate" for all the details.
John Sowden
Randall Schulz
Thanks, but I looked for the locate command several years ago. It seems that locate is not installed in any of the suse distros that I have used, currently 8.2. I tried it again just now, to be sure and got a command not found, including under user root. John On Saturday 12 February 2005 19:23, Randall R Schulz wrote:
John,
On Saturday 12 February 2005 18:35, John Sowden wrote:
When using the find command, I am getting hundreds of 'permission denied' when not using the user root. I did a google search and found that I should add " 2>/dev/nul" to the line (obviously this needs an alias), but now I get one line of bash: /dev/nul: "permission denied"
the complete line is: find / -iname filename 2>/dev/nul
thoughts?
You've been told about the proper name for /dev/null.
However, for such simple invocations of find, you really should be using the "locate" command. It's far faster, won't be restricted from disclosing files in unreadable sub-directories and will be far easier on your hard drives.
"man locate" for all the details.
John Sowden
Randall Schulz
On Saturday 12 February 2005 7:43 pm, John Sowden wrote:
Thanks, but I looked for the locate command several years ago. It seems that locate is not installed in any of the suse distros that I have used, currently 8.2. I tried it again just now, to be sure and got a command not found, including under user root.
It's not installed by default, you have to add it. Look for the findutils-locate package and install it. Scott -- POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/ Linux 2.6.8-24.11-default x86_64
On Sat, 2005-02-12 at 19:56 -0800, Scott Leighton wrote:
On Saturday 12 February 2005 7:43 pm, John Sowden wrote:
Thanks, but I looked for the locate command several years ago. It seems that locate is not installed in any of the suse distros that I have used, currently 8.2. I tried it again just now, to be sure and got a command not found, including under user root.
It's not installed by default, you have to add it. Look for the findutils-locate package and install it.
Scott
If memory serves, I no longer had to go back and install it after a fresh installation if I checked "Experienced User" in the Selection menu. This as of, I think, 9.0 or 9.1.
Am Sonntag 13 Februar 2005 04:23 schrieb Randall R Schulz:
However, for such simple invocations of find, you really should be using the "locate" command. It's far faster, won't be restricted from disclosing files in unreadable sub-directories and will be far easier on your hard drives. Apart from these advantages, AFAIR the trouble is, that it updates "atime" on all files, which can mess up backups. That is probably, why it is not installed by default.
Regrds Dan
John Sowden wrote:
Thanks, but I looked for the locate command several years ago. It seems that locate is not installed in any of the suse distros that I have used, currently 8.2. I tried it again just now, to be sure and got a command not found, including under user root.
You have to install the findutils-locate package.
James Knott wrote:
John Sowden wrote:
Thanks, but I looked for the locate command several years ago. It seems that locate is not installed in any of the suse distros that I have used, currently 8.2. I tried it again just now, to be sure and got a command not found, including under user root.
You have to install the findutils-locate package.
And run updatedb (as root) before running it. Good idea to put updatedb in cron to run in off hours. Jim
Dan, On Sunday 13 February 2005 04:22, Dan Am wrote:
Am Sonntag 13 Februar 2005 04:23 schrieb Randall R Schulz:
However, for such simple invocations of find, you really should be using the "locate" command. It's far faster, won't be restricted from disclosing files in unreadable sub-directories and will be far easier on your hard drives.
Apart from these advantages, AFAIR the trouble is, that it updates "atime" on all files, which can mess up backups. That is probably, why it is not installed by default.
How's that? What modifies the access time? The cron job that builds the database queried by the "locate" job? That's certainly not true. Why would it (the cron job) read all the files on your system? Naturally, it enumerates directory contents and their access times get set when that happens, but so what? And why would a backup program care about file access times? Naturally, a newer modification time might cause a file to be backed up again (if its contents actually changed) but backup software that tried to track all access times would not be something I'd want to use.
Regrds Dan
Randall Schulz
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Randall R Schulz wrote: <snip> | And why would a backup program care about file access times? Naturally, | a newer modification time might cause a file to be backed up again (if | its contents actually changed) but backup software that tried to track | all access times would not be something I'd want to use. Thanks, Randall! Your response means I can put the heart medicine back and delete that draft reply I was working on... ;-) - - Carl - -- ____________________________________________________________________ C. E. Hartung Business Development & Support Services http://www.cehartung.com/ carlh@cehartung.com Dover Foxcroft, Maine, USA Public Key #0x68396713 Reg. Linux User #350527 http://counter.li.org/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFCD4b0usxgymg5ZxMRAkjeAJ4rD5A2Vw6RJzEILxtFWIG0OobduwCdEKcV 2B9iGNJlkmhGgkTNSr/M9w8= =dVrY -----END PGP SIGNATURE-----
On Sunday 13 February 2005 07:07, Jim Sabatke wrote:
James Knott wrote:
John Sowden wrote:
Thanks, but I looked for the locate command several years ago. It seems that locate is not installed in any of the suse distros that I have used, currently 8.2. I tried it again just now, to be sure and got a command not found, including under user root.
You have to install the findutils-locate package.
And run updatedb (as root) before running it. Good idea to put updatedb in cron to run in off hours.
Jim
Thanks all for the find/locate help. I found locate (as was advised, it was under a different name), and ran updatedb as root, not user. I didn't see this reference in the man page. I also wrote an alias for find (locate to come) as follows, if it helps anyone else: alias findd='find / -iname '$1' 2>dev/null' It seems that the whole documentation issue for linux is lacking. The doc tells 90% of the story, and I end up going to the net search out that last 10%, including bothering all of you helpful people. As programs are written, or updated, a new type of doc should be created that is a superset of the other 3? (man, howto, info), so they become either irrelevant or very tercnnical for the more advanced user (e.g. man pages). When I write foxpro/dos apps in my office, I listen closely to the users, as their "mistakes" are my programming/documentation errors. Well, I have another stupid question, but I will save that for a different subject line. Thanks again, John
John, On Sunday 13 February 2005 13:53, John Sowden wrote:
On Sunday 13 February 2005 07:07, Jim Sabatke wrote:
James Knott wrote:
John Sowden wrote:
Thanks, but I looked for the locate command several years ago. It seems that locate is not installed in any of the suse distros that I have used, currently 8.2. I tried it again just now, to be sure and got a command not found, including under user root.
You have to install the findutils-locate package.
And run updatedb (as root) before running it. Good idea to put updatedb in cron to run in off hours.
Jim
Thanks all for the find/locate help. I found locate (as was advised, it was under a different name), and ran updatedb as root, not user. I didn't see this reference in the man page.
If you installed the SuSE distribution's findutils-locate package, then the cron job should have been created for you. Make sure your system is running at 4:00 am or that you modify the cron job to run at a time when your system _is_ up. Alternately, you can remove the cron job and handle running updatedb manually.
...
Thanks again, John
Randall Schulz
The Sunday 2005-02-13 at 13:22 +0100, Dan Am wrote:
Apart from these advantages, AFAIR the trouble is, that it updates "atime" on all files, which can mess up backups. That is probably, why it is not installed by default.
Not so. The issue is security: not allowing any user to know the names and locations of every file. -- Cheers, Carlos Robinson
The Sunday 2005-02-13 at 13:53 -0800, John Sowden wrote:
Thanks all for the find/locate help. I found locate (as was advised, it was under a different name), and ran updatedb as root, not user. I didn't see this reference in the man page.
Locate is named locate, as always. It is the rpm which has a different name. However, using yast, or better, "pin", you could easily have found "locate".
It seems that the whole documentation issue for linux is lacking. The doc tells 90% of the story, and I end up going to the net search out that last 10%, including bothering all of you helpful people. As programs are written, or updated, a new type of doc should be created that is a superset of the other 3? (man, howto, info), so they become either irrelevant or very tercnnical for the more advanced user (e.g. man pages).
Agreed. For example, check the man pages for ls in suse 9.1. The spanish page is for version fileutils-4.0, dated november 1998, whereas the english or default version comes from "coreutils 5.2.1", dated 2004. The spanish version is not only outdated, but incorrect/incomplete. That's quality control. :-( -- Cheers, Carlos Robinson
On Monday 14 Feb 2005 20:31 pm, Carlos E. R. wrote:
The Sunday 2005-02-13 at 13:22 +0100, Dan Am wrote:
Apart from these advantages, AFAIR the trouble is, that it updates "atime" on all files, which can mess up backups. That is probably, why it is not installed by default.
Not so. The issue is security: not allowing any user to know the names and locations of every file.
Indeed. If this worries you, make sure you run the updatedb as "nobody". This can be set in /etc/sysconfig/locate with the normal SuSE package (and may be the default, I can't remember.) It's the RUN_UPDATEDB_AS variable. You can also set up various options for directories not to look into, etc., in that file. This can be edited nicely with the "Editor for /etc/sysconfig files" in YaST, of course. M -- "It's the small gaps between the rain that count, and learning how to live amongst them." -- Jeff Noon
Matt, On Tuesday 15 February 2005 08:57, Matt Gibson wrote:
On Monday 14 Feb 2005 20:31 pm, Carlos E. R. wrote:
...
Not so. The issue is security: not allowing any user to know the names and locations of every file.
Indeed. If this worries you, make sure you run the updatedb as "nobody". This can be set in /etc/sysconfig/locate with the normal SuSE package (and may be the default, I can't remember.) It's the RUN_UPDATEDB_AS variable. You can also set up various options for directories not to look into, etc., in that file.
This can be edited nicely with the "Editor for /etc/sysconfig files" in YaST, of course.
I believe it defaults to "nobody". At least it did for my 9.1 installation performed from scratch (not as an update to an existing installation).
M
Randall Schulz
The Tuesday 2005-02-15 at 09:02 -0800, Randall R Schulz wrote:
I believe it defaults to "nobody". At least it did for my 9.1 installation performed from scratch (not as an update to an existing installation).
That's correct. In fact, it has been the default for years. You can also keep another locate database, complete, made by root, in root's own directory so that nobody else can reach it. Also, users could have their own local file for their home tree. -- Cheers, Carlos Robinson
participants (11)
-
Andreas Philipp
-
Carl E. Hartung
-
Carlos E. R.
-
Dan Am
-
James Knott
-
Jim Sabatke
-
John Sowden
-
Matt Gibson
-
Randall R Schulz
-
Scott Leighton
-
Tim Hanson