# Batch Remove Line From Files Recursively

**URL:** <https://community.unix.com/t/batch-remove-line-from-files-recursively/390725>\
**Category:** Shell Programming and Scripting\
**Created:** [April 14, 2023, 12:38am UTC](https://community.unix.com/t/batch-remove-line-from-files-recursively/390725 "2023-04-14T00:38:55Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![HouseOfCards](https://community.unix.com/letter_avatar/houseofcards/32/5_5575768a8748004e209b776fc1b2916d.png) [@HouseOfCards](https://community.unix.com/u/HouseOfCards)\
**Post date:** [April 14, 2023, 12:38am UTC](https://community.unix.com/t/batch-remove-line-from-files-recursively/390725/1 "2023-04-14T00:38:55Z")

</div>

Good day,

I have no experience in BASH scripting, so I'm hoping you all can help me find a solution to my problem. I've never been able to wrap my head around this stuff, so I really need help from the guru's.

I use UnRAID as a NAS (Linux based), and it has a useful plugin called "User Scripts" which let you easily run BASH scipts on a schedule. I'm using this plugin to have simple copy and remove scripts for my media server, which lets me move content in/out of my media server dynamically, like adding Christmas movies into the media server December 1st, and delete them on December 31st. Works great, with one issue...

The first time I add a movie, it creates an ".nfo" file and writes metadata which includes a "date added" tag. If I delete the file and recopy it again, it uses the original ".nfo" file and thus, the original date added. This keeps it from showing as "recently added".

In a nutshell, I need a bash script that I can run periodically, which will do the following.

1. Locate every file in the "All Movies" folder ending in ".nfo" recursively through all subfolders...
2. Open each ".nfo" and remove the line containing

```plaintext
<dateadded>SOMEDATETIME</dateadded>

```

1. Resave the modified ".nfo" file...

Any help would be greatly appreciated.

Thanks!

---

_[View the full topic](https://community.unix.com/t/batch-remove-line-from-files-recursively/390725)._
