1 of 2

How to find and print specific file paths with exclusions?

Goal: Output .txt file with the full directory path, including name, of all .html files except for those with "txt" or "text" in the .html file name.

I found the following line gives me the desired .txt file with the file's full directory path. The only problem is that it gives me ALL of the folder's contents:

ls -d "$PWD"/* > fileList.txt

Example Results:


Desired Results:



I'm fairly new to using the command line. I've been experimenting trying to figure this stuff out. I found that the following find helps find all .html files:

find . -iname '*.html' 

When used on the parent directory it will give me all .html files but not the full directory path, example result:


I'm not familiar enough with the parameters or assembling these commands and haven't been successful in getting a print of just the .html files without the ones with any of the variation of "text" in the name.

I have a TON of files to find with this and need that .txt file with the full paths. I want to understand this stuff so please provide detailed responses!

Any help appreciated (^-^)/)