You are not logged in.
Pages: 1
Is there any way to not display those annoying "find: permission denied" errors? I'm well aware that I don't have access to certain folders and I don't need find telling me . I tried -nowarn but to no avail. Also, I tried searching the forums/google but there is far too much ambiguity in the word "find" :cry: .
I found somewhere that you can simply type
find /tmp -name foo 2> /dev/null
However, it's rather annoying to type that after every find command. Any ideas?
--mune
(Alyptic)
Offline
well you could just do a script:
#!/bin/bash
[ $# != 2 ] && {
echo "requires two fields!"
exit 1
}
find $1 -name $2 2>/dev/null
then you would just need to type in <script> /tmp foo
but move it to /usr/bin/ and chmod 755 to make it global.
Offline
You could also make the script a function in your ~/.bashrc, since its so small.
Offline
You can just
find / -name foo 2> /dev/null
v/r
Suds
Offline
i prefer alias:
alias fn="find 2>/dev/null"
Offline
Thanks All of those work great.
--mune
(Alyptic)
Offline
You could alternatively use 'slocate', if that fits your needs. 'slocate -u' as root to update the list.
Offline
Pages: 1