Find the answer to your Linux question:
Results 1 to 2 of 2
This is what I have to do: Display any lines that contain applet tags (containing '<applet') in the files that end in either .html or .htm under the $HOME/public_html directory. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2011
    Posts
    1

    How do I find tags?


    This is what I have to do:
    Display any lines that contain applet tags (containing '<applet') in the files that end in either .html or .htm under the $HOME/public_html directory. If there are one or more lines then print: "applets". No other output should be displayed. Hint: use >2> and &&


    I entered this command

    find /public_html/index.html: 2<applet

    but nothing happened.

  2. #2
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    627
    You need to look a them man pages for the commands of "find", "xargs" and "grep":

    Assuming it is not a homework assignment here is an example of one of many solutions.
    Code:
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    (find ./public_html/ -name '*.html' -print0 ; find ./public_html/ -name '*.htm' -print0) | xargs -0 grep '<applet'

Posting Permissions

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