![Cat filename.html 在 centos 7 中返回奇怪的文本](https://linux22.com/image/1609107/Cat%20filename.html%20%E5%9C%A8%20centos%207%20%E4%B8%AD%E8%BF%94%E5%9B%9E%E5%A5%87%E6%80%AA%E7%9A%84%E6%96%87%E6%9C%AC.png)
我有一个vishal.html
文件,文件的内容是:
<html>
<body>
<h1>This is a cool idea</.h1>
</body>
</html>
我想使用 cat 命令读取内容,但是当我尝试cat vishal.html
输出时是:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="1671.6">
<style type="text/css">
p.p1 {
margin: 0.0px 0.0px 0.0px 0.0px;
line-height: 14.0px;
font: 12.0px Helvetica;
color: #000000;
-webkit-text-stroke: #000000
}
span.s1 {
font-kerning: none
}
</style>
</head>
<body>
<p class="p1"><span class="s1"><html></span></p>
<p class="p1"><span class="s1"><body></span></p>
<p class="p1"><span class="s1"><h1>This is a cool
idea</.h1></span></p>
<p class="p1"><span class="s1"></body></span></p>
<p class="p1"><span class="s1"></html></span></p>
<p class="p1"><span class="s1"><br> </span></p>
</body>
</html>
但预期的输出是:
<html>
<body>
<h1>This is a cool idea</.h1>
</body>
</html>
在 Mac OS 上也是同样的效果,但不确定为什么 centos 会出现这个问题或者我遗漏了什么东西?