Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1110227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:21:45+00:00 2026-05-17T02:21:45+00:00

On a Mac, I have a directory of html files that are all document

  • 0

On a Mac, I have a directory of html files that are all document fragments. Using the TexFinderX app, I was easily able to do a find/replace and add everything at the top of the documents that I wanted (i.e. etc.) .

Now I need to find a way to add the closing tags to all of the documents (i.e. ). TexFinderX does not have a way to do this since the documents do not have anything in common at the end of the files.

Is there a Terminal command that can do this for all html files in a directory and it’s subdirectories?

Thanks,
Linda

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:21:46+00:00Added an answer on May 17, 2026 at 2:21 am

    EDIT:

    Well i was trying to keep it simple and avoid Bash scripting but it seems find doesnt allow for output redirection… so try this instead:

    for f in ~/html/*.html; do echo "Processing $f file.." && cat ~/close.html >> $f; done


    Put your closing tags in a file… well call it close.html and we’ll jsut put it in your home directory /Users/youruser/close.html. Well assume your docs are in /Users/youruser/html

    Open Terminal.app and do the following command:

    find ~/html -type f -name "*.html" -exec cat ~/close.html >> {} \;
    

    youll want to test that first… my find kung-fu is rusty

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a mac application using the WebView. But issue is that webView
I have a directory with sub-directories and files with names that start with a
I'm using Mac OSX Lion and I would like to have a script that
I have a mac with a custom PHP 5 install that built from about
I have extracted a MAC address into a char* array such that each section
Im using SVN at the moment on Mac for iPhone development,and I have accidentally
I have an html file that loads a java applet. It works perfectly if
I have a directory (directory A) with 10,000 files in it. I want to
I have files being exported by Excel for Mac 2011 VBA in Western (Mac
I have a directory which contains multiple sub-directories with mov and jpg files. /dir/

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.