Is there a mac terminal command to change all .html files to .txt including the files in sub folders too?
Mac – Change html files to txt on entire folder
command linemacterminal
Related Question
- RTF files created using the ‘touch’ command will not open
- Change *.txt to *.csv
- Mac Terminal – Read and Append .txt Files in Folder to Specific File
- MacOS – El Capitan folder permissions to make admin accounts read-only
- Sourcing and opening multiple files of same name, in specified folder, in Terminal? Is there a way
- macOS Terminal Command – Find Files Installed by a Particular App Using Terminal
- Modifying the timestamps of multiple files
Best Answer
I guess actually you just want to rename them. Run the following from inside the folder. If you do not trust the command, add
echo
beforemv
to see what it would do.This does the following:
-type f
) in the current folder (.
) whose name is ends with ".html" (-name "*.html"
)dirname
), adds a slash (/
) and the name of the original file without the ".html" suffix (basename -s.html
) and adds a ".txt" suffix.mv
).