Find the answer to your Linux question:
Results 1 to 6 of 6
Hello, I'm a linux newbie and I'm trying to help a friend. We were trying to get a list of .html files on her drive into a text file and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2008
    Posts
    73

    find command and permission denied


    Hello,

    I'm a linux newbie and I'm trying to help a friend. We were trying to get a list of .html files on her drive into a text file and I had her issue the following command in Terminal:

    find / -name "*.html" >/home/mandiw/htmlfiles.txt

    This results in the following output -

    find: /proc/4971/task/4971/fdinfo: Permission denied
    find: /proc/4971/fd: Permission denied
    find: /proc/4971/fdinfo: Permission denied
    find: /proc/4972/task/4972/fd: Permission denied
    find: /proc/4972/task/4972/fdinfo: Permission denied
    find: /proc/4972/fd: Permission denied
    find: /proc/4972/fdinfo: Permission denied
    find: /proc/5013/task/5013/fd: Permission denied
    find: /proc/5013/task/5013/fdinfo: Permission denied
    find: /proc/5013/fd: Permission denied
    find: /proc/5013/fdinfo: Permission denied
    find: /proc/5087/task/5087/fd: Permission denied
    find: /proc/5087/task/5087/fdinfo: Permission denied
    find: /proc/5087/fd: Permission denied
    find: /proc/5087/fdinfo: Permission denied
    find: /proc/5106/task/5106/fd: Permission denied
    find: /proc/5106/task/5106/fdinfo: Permission denied
    find: /proc/5106/fd: Permission denied

    She is logged into the mandiw account which has no admin priveleges, could this be the problem?

    Thanks, Ray Parrish

  2. #2
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,042
    The permission denied is because you don't have rights to the folders ... you probably will not find what you want in /proc anyway ... see here

    Ed: are the html files in the home area for your current user?

  3. #3
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    You can use locate or stick with find and re-direct stderr to /dev/null:
    Code:
    find / -name "*.html" 1>/home/mandiw/htmlfiles.txt 2>/dev/null

  4. #4
    Just Joined!
    Join Date
    Jul 2008
    Posts
    73
    Quote Originally Posted by Jonathan183 View Post
    The permission denied is because you don't have rights to the folders ... you probably will not find what you want in /proc anyway ... see here

    Ed: are the html files in the home area for your current user?
    The .html files are all over the drive. We're new linux users and want a list of all the html files on the drive so we can use it to find and open those files in the browser to learn more about linux and Ubuntu.

    Later, Ray Parrish

  5. #5
    Just Joined!
    Join Date
    Jul 2008
    Posts
    73
    Quote Originally Posted by Thrillhouse View Post
    You can use locate or stick with find and re-direct stderr to /dev/null:
    Code:
    find / -name "*.html" 1>/home/mandiw/htmlfiles.txt 2>/dev/null
    That works a treat! Thank you very much!

    Now what command can I use to prepend file:// to the start of each line in the file?

    I now have a sitemap to all html files on my system.

    Later, Ray Parrish

  6. #6
    Linux Engineer Thrillhouse's Avatar
    Join Date
    Jun 2006
    Location
    Arlington, VA, USA
    Posts
    1,377
    Quote Originally Posted by rayparrish View Post
    Now what command can I use to prepend file:// to the start of each line in the file?
    Using awk:
    Code:
    find / -name "*.html" 2>/dev/null | awk '{print "file://"$1}' > /home/mandiw/htmlfiles.txt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •