<script type="application/ld+json">{"@context":"http://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.simcentric.com/sc/"},{"@type":"ListItem","position":2,"name":"如何在Linux中使用file命令确定文件类型?","item":"https://www.simcentric.com/sc/hong-kong-dedicated-server-sc/how-to-determine-file-types-in-linux-with-the-file-command/"}]}</script> {"id":17613,"date":"2024-10-17T12:18:49","date_gmt":"2024-10-17T04:18:49","guid":{"rendered":"https:\/\/www.simcentric.com\/uncategorized-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/"},"modified":"2024-10-17T13:56:34","modified_gmt":"2024-10-17T05:56:34","slug":"how-to-determine-file-types-in-linux-with-the-file-command","status":"publish","type":"post","link":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/","title":{"rendered":"\u5982\u4f55\u5728Linux\u4e2d\u4f7f\u7528file\u547d\u4ee4\u786e\u5b9a\u6587\u4ef6\u7c7b\u578b?"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<p>\u5728<a href=\"https:\/\/www.simcentric.com\/sc\/\" target=\"_blank\" rel=\"noopener\">\u9999\u6e2f\u670d\u52a1\u5668<\/a>\u7ba1\u7406\u9886\u57df,\u65e0\u8bba\u60a8\u662f\u5904\u7406\u670d\u52a1\u5668\u79df\u7528\u8fd8\u662f\u670d\u52a1\u5668\u6258\u7ba1\u670d\u52a1,\u4e86\u89e3\u6587\u4ef6\u7684\u6027\u8d28\u90fd\u81f3\u5173\u91cd\u8981\u3002<a href=\"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-configure-and-use-ipv6-server-on-linux-system\/\" target=\"_blank\" rel=\"noopener\">Linux<\/a>\u7684&#8217;file&#8217;\u547d\u4ee4\u662f\u7cfb\u7edf\u7ba1\u7406\u5458\u548c\u5f00\u53d1\u4eba\u5458\u4e0d\u53ef\u6216\u7f3a\u7684\u5de5\u5177,\u5b83\u63d0\u4f9b\u4e86\u4e00\u79cd\u5feb\u901f\u53ef\u9760\u7684\u65b9\u6cd5\u6765\u786e\u5b9a\u6587\u4ef6\u7c7b\u578b\u3002\u672c\u6307\u5357\u5c06\u6df1\u5165\u63a2\u8ba8&#8217;file&#8217;\u547d\u4ee4\u7684\u590d\u6742\u6027,\u5c55\u793a\u5176\u5728\u9999\u6e2f\u670d\u52a1\u5668\u4e0a\u8bc6\u522b\u6587\u4ef6\u7c7b\u578b\u7684\u5f3a\u5927\u529f\u80fd\u3002<\/p>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>&#8216;file&#8217;\u547d\u4ee4\u7684\u672c\u8d28<\/strong><\/h2>\n<p>&#8216;file&#8217;\u547d\u4ee4\u7684\u6838\u5fc3\u529f\u80fd\u662f\u68c0\u67e5\u6587\u4ef6\u7684\u5185\u5bb9,\u5e76\u5c1d\u8bd5\u57fa\u4e8e\u5404\u79cd\u6d4b\u8bd5\u5bf9\u5176\u8fdb\u884c\u5206\u7c7b\u3002\u5b83\u4e0d\u4ec5\u4ec5\u5173\u6ce8\u6587\u4ef6\u6269\u5c55\u540d,\u800c\u662f\u67e5\u770b\u6587\u4ef6\u5185\u7684\u5b9e\u9645\u6570\u636e\u6765\u505a\u51fa\u5224\u65ad\u3002\u8fd9\u4f7f\u5f97\u5b83\u5728\u7ba1\u7406\u9999\u6e2f\u670d\u52a1\u5668\u4e0a\u7684\u5404\u79cd\u6587\u4ef6\u7c7b\u578b\u65f6\u6210\u4e3a\u4e00\u4e2a\u65e0\u4ef7\u7684\u8d44\u4ea7\u3002<\/p>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>\u57fa\u672c\u8bed\u6cd5\u548c\u7528\u6cd5<\/strong><\/h2>\n<p>&#8216;file&#8217;\u547d\u4ee4\u7684\u57fa\u672c\u8bed\u6cd5\u975e\u5e38\u7b80\u5355:<\/p>\n<pre><code>file [\u9009\u9879] \u6587\u4ef6\u540d<\/code><\/pre>\n<p>\u8ba9\u6211\u4eec\u63a2\u7d22\u4e00\u4e9b\u5b9e\u9645\u4f8b\u5b50:<\/p>\n<pre><code>$ file \/etc\/passwd\r\n\/etc\/passwd: ASCII text\r\n\r\n$ file \/bin\/bash\r\n\/bin\/bash: ELF 64-bit LSB shared object, x86-64\r\n\r\n$ file image.jpg\r\nimage.jpg: JPEG image data, JFIF standard 1.01<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>\u9ad8\u7ea7&#8217;file&#8217;\u547d\u4ee4\u9009\u9879<\/strong><\/h2>\n<p>\u4e3a\u4e86\u63d0\u5347\u60a8\u7684\u670d\u52a1\u5668\u7ba1\u7406\u6c34\u5e73,\u8ba9\u6211\u4eec\u6df1\u5165\u4e86\u89e3\u4e00\u4e9b\u9ad8\u7ea7\u9009\u9879:<\/p>\n<h3>1. \u83b7\u53d6MIME\u7c7b\u578b (-i)<\/h3>\n<pre><code>$ file -i script.py\r\nscript.py: text\/x-python; charset=us-ascii<\/code><\/pre>\n<h3>2. \u68c0\u67e5\u538b\u7f29\u6587\u4ef6 (-z)<\/h3>\n<pre><code>$ file -z compressed.gz\r\ncompressed.gz: ASCII text (gzip compressed data)<\/code><\/pre>\n<h3>3. \u7b80\u6d01\u6a21\u5f0f (-b)<\/h3>\n<pre><code>$ file -b \/etc\/hosts\r\nASCII text<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>\u5728\u9999\u6e2f\u670d\u52a1\u5668\u4e0a\u7684\u5b9e\u9645\u5e94\u7528<\/strong><\/h2>\n<p>\u5728\u7ba1\u7406\u9999\u6e2f\u670d\u52a1\u5668\u65f6,&#8217;file&#8217;\u547d\u4ee4\u5728\u5404\u79cd\u573a\u666f\u4e2d\u90fd\u975e\u5e38\u6709\u7528:<\/p>\n<h3>1. \u9a8c\u8bc1\u7f51\u9875\u8d44\u6e90<\/h3>\n<p>\u786e\u4fdd\u60a8\u7684\u7f51\u7edc\u670d\u52a1\u5668\u63d0\u4f9b\u6b63\u786e\u7684\u6587\u4ef6\u7c7b\u578b:<\/p>\n<pre><code>#!\/bin\/bash\r\nfor file in \/var\/www\/html\/*; do\r\n    echo \"$(file -b \"$file\"): $file\"\r\ndone<\/code><\/pre>\n<h3>2. \u65e5\u5fd7\u6587\u4ef6\u5206\u6790<\/h3>\n<p>\u5feb\u901f\u8bc6\u522b\u65e5\u5fd7\u6587\u4ef6\u683c\u5f0f:<\/p>\n<pre><code>$ file \/var\/log\/*.log<\/code><\/pre>\n<h3>3. \u5b89\u5168\u68c0\u67e5<\/h3>\n<p>\u9a8c\u8bc1\u4e0a\u4f20\u7684\u6587\u4ef6\u4ee5\u9632\u6b62\u6076\u610f\u5185\u5bb9:<\/p>\n<pre><code>#!\/bin\/bash\r\nupload=\"\/path\/to\/upload\/directory\"\r\nfor file in \"$upload\"\/*; do\r\n    if file \"$file\" | grep -qi \"executable\"; then\r\n        echo \"\u8b66\u544a: \u68c0\u6d4b\u5230\u53ef\u6267\u884c\u6587\u4ef6 - $file\"\r\n    fi\r\ndone<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text]<\/p>\n<h2><strong>\u5728\u670d\u52a1\u5668\u7ba1\u7406\u811a\u672c\u4e2d\u96c6\u6210&#8217;file&#8217;<\/strong><\/h2>\n<p>\u4e3a\u4e86\u9ad8\u6548\u7ba1\u7406\u9999\u6e2f\u670d\u52a1\u5668,\u5c06&#8217;file&#8217;\u547d\u4ee4\u96c6\u6210\u5230\u60a8\u7684\u811a\u672c\u4e2d\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u5bf9\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u8fdb\u884c\u5206\u7c7b\u7684\u793a\u4f8b:<\/p>\n<pre><code>#!\/bin\/bash\r\n\r\ndirectory=\"\/path\/to\/examine\"\r\n\r\ndeclare -A file_types\r\n\r\nwhile IFS= read -r -d '' file; do\r\n    type=$(file -b \"$file\")\r\n    file_types[\"$type\"]=$((file_types[\"$type\"] + 1))\r\ndone < <(find \"$directory\" -type f -print0)\r\n\r\necho \"\u6587\u4ef6\u7c7b\u578b\u5206\u5e03:\"\r\nfor type in \"${!file_types[@]}\"; do\r\n    echo \"$type: ${file_types[$type]}\"\r\ndone<\/code><\/pre>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=\"blog-detail-section\"][vc_column][vc_column_text]<\/p>\n<h2><strong>\u5c40\u9650\u6027\u548c\u66ff\u4ee3\u65b9\u6848<\/strong><\/h2>\n<p>\u5c3d\u7ba1\u529f\u80fd\u5f3a\u5927,'file'\u547d\u4ee4\u5e76\u975e\u4e07\u80fd\u3002\u5b83\u53ef\u80fd\u5728\u5904\u7406\u67d0\u4e9b\u4e13\u6709\u683c\u5f0f\u6216\u52a0\u5bc6\u6587\u4ef6\u65f6\u9047\u5230\u56f0\u96be\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b,\u53ef\u4ee5\u8003\u8651\u4f7f\u7528'libmagic'\u7b49\u66ff\u4ee3\u65b9\u6848\u6216\u9488\u5bf9\u7279\u5b9a\u6587\u4ef6\u7c7b\u578b\u7684\u4e13\u95e8\u5de5\u5177\u3002<\/p>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=\"blog-detail-section\"][vc_column][vc_column_text]<\/p>\n<h2><strong>\u7ed3\u8bba<\/strong><\/h2>\n<p>\u638c\u63e1'file'\u547d\u4ee4\u5bf9\u7ba1\u7406\u9999\u6e2f\u670d\u52a1\u5668\u6765\u8bf4\u662f\u4e00\u4e2a\u6e38\u620f\u89c4\u5219\u6539\u53d8\u8005\u3002\u65e0\u8bba\u60a8\u662f\u5904\u7406\u670d\u52a1\u5668\u79df\u7528\u8fd8\u662f\u670d\u52a1\u5668\u6258\u7ba1\u670d\u52a1,\u8fd9\u4e2a\u5de5\u5177\u90fd\u80fd\u63d0\u5347\u60a8\u7406\u89e3\u548c\u63a7\u5236\u670d\u52a1\u5668\u73af\u5883\u7684\u80fd\u529b\u3002\u901a\u8fc7\u5c06'file'\u547d\u4ee4\u6574\u5408\u5230\u60a8\u7684\u5de5\u4f5c\u6d41\u7a0b\u4e2d,\u60a8\u5c06\u80fd\u591f\u7b80\u5316\u64cd\u4f5c,\u52a0\u5f3a\u5b89\u5168\u6027,\u5e76\u4f18\u5316\u6574\u4e2a\u9999\u6e2f\u670d\u52a1\u5668\u57fa\u7840\u8bbe\u65bd\u7684\u6027\u80fd\u3002<\/p>\n<p>[\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=\"blog-detail-section\"][vc_column][vc_column_text]<\/p>\n<h2><strong>\u5e38\u89c1\u95ee\u9898<\/strong><\/h2>\n<h3>\u95ee: 'file'\u547d\u4ee4\u662f\u5426\u5728\u9999\u6e2f\u670d\u52a1\u5668\u4f7f\u7528\u7684\u6240\u6709Linux\u53d1\u884c\u7248\u4e0a\u90fd\u53ef\u7528?<\/h3>\n<p>\u7b54: \u662f\u7684,'file'\u547d\u4ee4\u662f\u4e00\u4e2a\u6807\u51c6\u5de5\u5177,\u51e0\u4e4e\u5728\u6240\u6709Linux\u53d1\u884c\u7248\u4e0a\u90fd\u53ef\u7528,\u5305\u62ec\u9999\u6e2f\u670d\u52a1\u5668\u73af\u5883\u4e2d\u5e38\u7528\u7684\u90a3\u4e9b\u3002<\/p>\n<h3>\u95ee: 'file'\u547d\u4ee4\u80fd\u68c0\u6d4b\u6076\u610f\u8f6f\u4ef6\u5417?<\/h3>\n<p>\u7b54: \u867d\u7136'file'\u547d\u4ee4\u53ef\u4ee5\u8bc6\u522b\u6587\u4ef6\u7c7b\u578b,\u4f46\u5b83\u5e76\u4e0d\u662f\u4e3a\u6076\u610f\u8f6f\u4ef6\u68c0\u6d4b\u800c\u8bbe\u8ba1\u7684\u3002\u5728\u9999\u6e2f\u670d\u52a1\u5668\u4e0a\u8fdb\u884c\u5b89\u5168\u626b\u63cf\u65f6,\u8bf7\u4f7f\u7528\u4e13\u95e8\u7684\u9632\u75c5\u6bd2\u5de5\u5177\u3002<\/p>\n<h3>\u95ee: \u5982\u4f55\u5728Windows\u670d\u52a1\u5668\u4e0a\u4f7f\u7528\u7c7b\u4f3c'file'\u7684\u529f\u80fd?<\/h3>\n<p>\u7b54: Windows\u6ca1\u6709\u76f4\u63a5\u7684\u7b49\u6548\u547d\u4ee4,\u4f46PowerShell\u7684'Get-ItemProperty' cmdlet\u53ef\u4ee5\u63d0\u4f9b\u7c7b\u4f3c\u7684\u4fe1\u606f\u3002\u4e3a\u4e86\u83b7\u5f97\u66f4\u63a5\u8fd1\u7684\u5339\u914d,\u53ef\u4ee5\u8003\u8651\u4f7f\u7528Windows\u5b50\u7cfb\u7edffor Linux (WSL)\u6216\u7b2c\u4e09\u65b9\u5de5\u5177,\u5982GnuWin32\u7684'file'\u79fb\u690d\u7248\u3002<\/p>\n<p>\u901a\u8fc7\u6709\u6548\u5229\u7528Linux 'file'\u547d\u4ee4,\u60a8\u5c06\u63d0\u5347\u7ba1\u7406\u548c\u4fdd\u62a4\u9999\u6e2f\u670d\u52a1\u5668\u7684\u80fd\u529b,\u65e0\u8bba\u662f\u5728\u670d\u52a1\u5668\u79df\u7528\u8fd8\u662f\u670d\u52a1\u5668\u6258\u7ba1\u73af\u5883\u4e2d\u3002\u8fd9\u4e2a\u5f3a\u5927\u7684\u5de5\u5177,\u7ed3\u5408\u60a8\u4e0d\u65ad\u589e\u957f\u7684\u4e13\u4e1a\u77e5\u8bc6,\u65e0\u7591\u5c06\u628a\u60a8\u7684\u670d\u52a1\u5668\u7ba1\u7406\u6280\u80fd\u63d0\u5347\u5230\u65b0\u7684\u9ad8\u5ea6\u3002<\/p>\n<p>[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text] \u5728\u9999\u6e2f\u670d\u52a1\u5668\u7ba1\u7406\u9886\u57df,\u65e0\u8bba\u60a8\u662f\u5904\u7406\u670d\u52a1\u5668\u79df\u7528\u8fd8\u662f\u670d\u52a1\u5668\u6258\u7ba1\u670d\u52a1,\u4e86\u89e3\u6587\u4ef6\u7684\u6027\u8d28\u90fd\u81f3\u5173\u91cd\u8981\u3002Linux\u7684&#8217;file&#8217;\u547d\u4ee4\u662f\u7cfb\u7edf\u7ba1\u7406\u5458\u548c\u5f00\u53d1\u4eba\u5458\u4e0d\u53ef\u6216\u7f3a\u7684\u5de5\u5177,\u5b83\u63d0\u4f9b\u4e86\u4e00\u79cd\u5feb\u901f\u53ef\u9760\u7684\u65b9\u6cd5\u6765\u786e\u5b9a\u6587\u4ef6\u7c7b\u578b\u3002\u672c\u6307\u5357\u5c06\u6df1\u5165\u63a2\u8ba8&#8217;file&#8217;\u547d\u4ee4\u7684\u590d\u6742\u6027,\u5c55\u793a\u5176\u5728\u9999\u6e2f\u670d\u52a1\u5668\u4e0a\u8bc6\u522b\u6587\u4ef6\u7c7b\u578b\u7684\u5f3a\u5927\u529f\u80fd\u3002 [\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text] &#8216;file&#8217;\u547d\u4ee4\u7684\u672c\u8d28 &#8216;file&#8217;\u547d\u4ee4\u7684\u6838\u5fc3\u529f\u80fd\u662f\u68c0\u67e5\u6587\u4ef6\u7684\u5185\u5bb9,\u5e76\u5c1d\u8bd5\u57fa\u4e8e\u5404\u79cd\u6d4b\u8bd5\u5bf9\u5176\u8fdb\u884c\u5206\u7c7b\u3002\u5b83\u4e0d\u4ec5\u4ec5\u5173\u6ce8\u6587\u4ef6\u6269\u5c55\u540d,\u800c\u662f\u67e5\u770b\u6587\u4ef6\u5185\u7684\u5b9e\u9645\u6570\u636e\u6765\u505a\u51fa\u5224\u65ad\u3002\u8fd9\u4f7f\u5f97\u5b83\u5728\u7ba1\u7406\u9999\u6e2f\u670d\u52a1\u5668\u4e0a\u7684\u5404\u79cd\u6587\u4ef6\u7c7b\u578b\u65f6\u6210\u4e3a\u4e00\u4e2a\u65e0\u4ef7\u7684\u8d44\u4ea7\u3002 [\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text] \u57fa\u672c\u8bed\u6cd5\u548c\u7528\u6cd5 &#8216;file&#8217;\u547d\u4ee4\u7684\u57fa\u672c\u8bed\u6cd5\u975e\u5e38\u7b80\u5355: file [\u9009\u9879] \u6587\u4ef6\u540d \u8ba9\u6211\u4eec\u63a2\u7d22\u4e00\u4e9b\u5b9e\u9645\u4f8b\u5b50: $ file \/etc\/passwd \/etc\/passwd: ASCII text $ file \/bin\/bash \/bin\/bash: ELF 64-bit LSB shared object, x86-64 $ file image.jpg image.jpg: JPEG image data, JFIF standard 1.01 [\/vc_column_text][\/vc_column][\/vc_row][vc_row el_class=&#8221;blog-detail-section&#8221;][vc_column][vc_column_text] \u9ad8\u7ea7&#8217;file&#8217;\u547d\u4ee4\u9009\u9879 \u4e3a\u4e86\u63d0\u5347\u60a8\u7684\u670d\u52a1\u5668\u7ba1\u7406\u6c34\u5e73,\u8ba9\u6211\u4eec\u6df1\u5165\u4e86\u89e3\u4e00\u4e9b\u9ad8\u7ea7\u9009\u9879: 1. \u83b7\u53d6MIME\u7c7b\u578b (-i) $ file -i script.py script.py: text\/x-python; charset=us-ascii [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":3,"featured_media":17608,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[62],"tags":[4138,4139,1551,353,265],"class_list":["post-17613","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hong-kong-dedicated-server-sc","tag-linux-file-command-sc","tag-file-type-identification-sc","tag-server-management-sc","tag-server-rental-sc","tag-265"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u5982\u4f55\u5728Linux\u4e2d\u4f7f\u7528file\u547d\u4ee4\u786e\u5b9a\u6587\u4ef6\u7c7b\u578b?<\/title>\n<meta name=\"description\" content=\"Discover how to leverage the Linux &#039;file&#039; command to identify file types on Hong Kong servers. Boost your server management skills with practical examples.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/17613\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"company\" \/>\n<meta property=\"og:title\" content=\"\u5982\u4f55\u5728Linux\u4e2d\u4f7f\u7528file\u547d\u4ee4\u786e\u5b9a\u6587\u4ef6\u7c7b\u578b?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/17613\" \/>\n<meta property=\"og:site_name\" content=\"\u65b0\u5929\u57df\u4e92\u8054\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-17T04:18:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-17T05:56:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/10\/sim_1017b.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"620\" \/>\n\t<meta property=\"og:image:height\" content=\"343\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u5982\u4f55\u5728Linux\u4e2d\u4f7f\u7528file\u547d\u4ee4\u786e\u5b9a\u6587\u4ef6\u7c7b\u578b?","description":"Discover how to leverage the Linux 'file' command to identify file types on Hong Kong servers. Boost your server management skills with practical examples.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/17613","og_locale":"zh_CN","og_type":"company","og_title":"\u5982\u4f55\u5728Linux\u4e2d\u4f7f\u7528file\u547d\u4ee4\u786e\u5b9a\u6587\u4ef6\u7c7b\u578b?","og_url":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/17613","og_site_name":"\u65b0\u5929\u57df\u4e92\u8054","article_published_time":"2024-10-17T04:18:49+00:00","article_modified_time":"2024-10-17T05:56:34+00:00","og_image":[{"width":620,"height":343,"url":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/10\/sim_1017b.jpg","type":"image\/jpeg"}],"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/#article","isPartOf":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/"},"author":{"name":"Felix Cheung","@id":"https:\/\/simcentric.com\/tc\/#\/schema\/person\/2865b3454f789caf7083a203799d4a6d"},"headline":"\u5982\u4f55\u5728Linux\u4e2d\u4f7f\u7528file\u547d\u4ee4\u786e\u5b9a\u6587\u4ef6\u7c7b\u578b?","datePublished":"2024-10-17T04:18:49+00:00","dateModified":"2024-10-17T05:56:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/"},"wordCount":193,"publisher":{"@id":"https:\/\/simcentric.com\/tc\/#organization"},"image":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/#primaryimage"},"thumbnailUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/10\/sim_1017b.jpg","keywords":["Linux file\u547d\u4ee4","\u6587\u4ef6\u7c7b\u578b\u8bc6\u522b","\u670d\u52a1\u5668\u7ba1\u7406","\u670d\u52a1\u5668\u79df\u7528","\u9999\u6e2f\u670d\u52a1\u5668"],"articleSection":["\u9999\u6e2f\u670d\u52a1\u5668"],"inLanguage":"zh-CHN"},{"@type":"WebPage","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/","url":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/","name":"\u5982\u4f55\u5728Linux\u4e2d\u4f7f\u7528file\u547d\u4ee4\u786e\u5b9a\u6587\u4ef6\u7c7b\u578b?","isPartOf":{"@id":"https:\/\/simcentric.com\/tc\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/#primaryimage"},"image":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/#primaryimage"},"thumbnailUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/10\/sim_1017b.jpg","datePublished":"2024-10-17T04:18:49+00:00","dateModified":"2024-10-17T05:56:34+00:00","description":"Discover how to leverage the Linux 'file' command to identify file types on Hong Kong servers. Boost your server management skills with practical examples.","breadcrumb":{"@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/#breadcrumb"},"inLanguage":"zh-CHN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/"]}]},{"@type":"ImageObject","inLanguage":"zh-CHN","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/#primaryimage","url":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/10\/sim_1017b.jpg","contentUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2024\/10\/sim_1017b.jpg","width":620,"height":343},{"@type":"BreadcrumbList","@id":"https:\/\/www.simcentric.com\/sc\/hong-kong-dedicated-server-sc\/how-to-determine-file-types-in-linux-with-the-file-command\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.simcentric.com\/sc\/"},{"@type":"ListItem","position":2,"name":"\u5982\u4f55\u5728Linux\u4e2d\u4f7f\u7528file\u547d\u4ee4\u786e\u5b9a\u6587\u4ef6\u7c7b\u578b?"}]},{"@type":"WebSite","@id":"https:\/\/simcentric.com\/tc\/#website","url":"https:\/\/simcentric.com\/tc\/","name":"Simcentric Solutions","description":"","publisher":{"@id":"https:\/\/simcentric.com\/tc\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/simcentric.com\/tc\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-CHN"},{"@type":"Organization","@id":"https:\/\/simcentric.com\/tc\/#organization","name":"Simcentric Solutions","url":"https:\/\/simcentric.com\/tc\/","logo":{"@type":"ImageObject","inLanguage":"zh-CHN","@id":"https:\/\/simcentric.com\/tc\/#\/schema\/logo\/image\/","url":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2023\/06\/sim-logo-2023.png","contentUrl":"https:\/\/www.simcentric.com\/wp-content\/uploads\/2023\/06\/sim-logo-2023.png","width":800,"height":222,"caption":"Simcentric Solutions"},"image":{"@id":"https:\/\/simcentric.com\/tc\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/simcentric.com\/tc\/#\/schema\/person\/2865b3454f789caf7083a203799d4a6d","name":"Felix Cheung","image":{"@type":"ImageObject","inLanguage":"zh-CHN","@id":"https:\/\/secure.gravatar.com\/avatar\/836e6f2be80c47f0897198ffea03fae331dad9aaafbc988c752691eb595e0e2f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/836e6f2be80c47f0897198ffea03fae331dad9aaafbc988c752691eb595e0e2f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/836e6f2be80c47f0897198ffea03fae331dad9aaafbc988c752691eb595e0e2f?s=96&d=mm&r=g","caption":"Felix Cheung"}}]}},"_links":{"self":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/17613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/comments?post=17613"}],"version-history":[{"count":2,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/17613\/revisions"}],"predecessor-version":[{"id":17617,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/posts\/17613\/revisions\/17617"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/media\/17608"}],"wp:attachment":[{"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/media?parent=17613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/categories?post=17613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.simcentric.com\/sc\/wp-json\/wp\/v2\/tags?post=17613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}