This question already has an answer here:
I would like to preview a file which macOS has no idea how to open as a text file. For example, when I'm previewing
bar.png, I want Preview.app to be opened and render a PDF document or an image, as in the default behavior. However, when previewing
.bash_history, I want to see the content of the file in text, instead of a huge white icon as shown below.