当前位置: 首页 > news >正文

南通市区有哪几家做网站的软文推广

南通市区有哪几家做网站的,软文推广,甘肃三轮建设监理网站,猎头公司好做吗Linux系统之file命令的基本使用 一、file命令介绍1.1 Linux简介1.2 file命令简介 二、file命令的使用帮助2.1 file命令的help帮助信息2.2 file命令的语法解释2.3 file命令的man手册 三、文件类型介绍四、file命令的基本使用4.1 查询file版本4.2 显示文件类型4.3 输出时不显示文…

Linux系统之file命令的基本使用

  • 一、file命令介绍
    • 1.1 Linux简介
    • 1.2 file命令简介
  • 二、file命令的使用帮助
    • 2.1 file命令的help帮助信息
    • 2.2 file命令的语法解释
    • 2.3 file命令的man手册
  • 三、文件类型介绍
  • 四、file命令的基本使用
    • 4.1 查询file版本
    • 4.2 显示文件类型
    • 4.3 输出时不显示文件名
    • 4.4 显示MIME类别
    • 4.5 显示链接所指向的文件类型
    • 4.6 批量查询
    • 4.6 查找某个文件并显示其文件类型
    • 4.7 查看块设备文件信息
  • 五、file命令使用注意事项

在这里插入图片描述

一、file命令介绍

1.1 Linux简介

Linux是一种开源操作系统,它的核心是Linux内核。Linux操作系统最初是由芬兰的林纳斯·托瓦兹(Linus Torvalds)在1991年发布的。它不同于Windows和Mac OS X等操作系统,它是免费的,可以自由地修改和发布。Linux操作系统的开源性,使得用户可以自由地修改、复制和分发操作系统,而且可以适应各种不同的需求。Linux操作系统广泛应用于服务器、超级计算机、移动设备和嵌入式系统中,它也被越来越多的个人用户选择作为他们的日常操作系统。

1.2 file命令简介

file命令是Linux中用于检测文件类型的命令,可以根据文件的二进制数据来确定其类型。

二、file命令的使用帮助

2.1 file命令的help帮助信息

使用–help查询file命令的帮助信息

[root@jeven ~]# file --help
Usage: file [OPTION...] [FILE...]
Determine type of FILEs.--help                 display this help and exit-v, --version              output version information and exit-m, --magic-file LIST      use LIST as a colon-separated list of magicnumber files-z, --uncompress           try to look inside compressed files-b, --brief                do not prepend filenames to output lines-c, --checking-printout    print the parsed form of the magic file, use inconjunction with -m to debug a new magic filebefore installing it-e, --exclude TEST         exclude TEST from the list of test to beperformed for file. Valid tests are:ascii, apptype, compress, elf, soft, tar, tokens, troff-f, --files-from FILE      read the filenames to be examined from FILE-F, --separator STRING     use string as separator instead of `:'-i, --mime                 output MIME type strings (--mime-type and--mime-encoding)--apple                output the Apple CREATOR/TYPE--mime-type            output the MIME type--mime-encoding        output the MIME encoding-k, --keep-going           don't stop at the first match-l, --list                 list magic strength-L, --dereference          follow symlinks (default)-h, --no-dereference       don't follow symlinks-n, --no-buffer            do not buffer output-N, --no-pad               do not pad output-0, --print0               terminate filenames with ASCII NUL-p, --preserve-date        preserve access times on files-r, --raw                  don't translate unprintable chars to \ooo-s, --special-files        treat special (block/char devices) files asordinary ones-C, --compile              compile file specified by -m-d, --debug                print debugging messagesReport bugs to http://bugs.gw.com/

2.2 file命令的语法解释

  • file命令语法
file(选项)(参数)
  • file命令选项解释
-b:仅显示文件类型,不显示文件名;
-i:显示MIME类型;
-z:对压缩文件也进行检测。
-c:详细显示指令执行过程,便于排错或分析程序执行的情形;
-f<名称文件>:指定名称文件,其内容有一个或多个文件名称时,让file依序辨识这些文件,格式为每列一个文件名称;
-L:直接显示符号链接所指向的文件类别;
-m<魔法数字文件>:指定魔法数字文件;
-v:显示版本信息;
-s: 查询(块/字符设备)文件信息
  • file命令参数解释
文件:要确定类型的文件列表,多个文件之间使用空格分开,可以使用shell通配符匹配多个文件。

2.3 file命令的man手册

查询man手册中的file命令用法

man file

在这里插入图片描述

三、文件类型介绍

Linux中常见的文件类型包括:

  • 普通文件(Regular file)- 用于存储文本、数据等信息。简写为 “-”(连字符)。

  • 目录文件(Directory file)- 用于存储其他文件和目录的信息。简写为 “d”。

  • 符号链接文件(Symbolic link file)- 指向另一个文件或目录的快捷方式。简写为 “l”。

  • 套接字文件(Socket file)- 用于进程间通信的文件。简写为 “s”。

  • 块设备文件(Block device file)- 用于访问存储设备(如硬盘、U盘等)的文件。简写为 “b”。

  • 字符设备文件(Character device file)- 用于访问系统设备(如键盘、鼠标等)的文件。简写为 “c”。

  • 管道文件(FIFO file)- 用于进程间通信的文件。简写为 “p”。

四、file命令的基本使用

4.1 查询file版本

使用-v选项查询file版本

[root@jeven ~]# file -v
file-5.11
magic file from /etc/magic:/usr/share/misc/magic

4.2 显示文件类型

例如需要查询一个文件的文件类型,我们可以直接使用file命令查询。

[root@jeven ~]# file test.txt
test.txt: ASCII text

4.3 输出时不显示文件名

使用-b选项,输出结果时不显示文件名。

[root@jeven ~]# file -b test.txt
ASCII text

4.4 显示MIME类别

使用-i选项显示文件的MIME类别

[root@jeven ~]# file -i  test.txt
test.txt: text/plain; charset=us-ascii

4.5 显示链接所指向的文件类型

查看/var/mail目录信息

[root@server-01 ~]# ls -l /var/mail
lrwxrwxrwx. 1 root root 10 Jul 11  2019 /var/mail -> spool/mail

查询/var/mail文件类型

[root@server-01 ~]# file /var/mail
/var/mail: symbolic link to `spool/mail'

显示符号链接所指向的文件类型

[root@server-01 ~]# file -L /var/mail
/var/mail: directory

4.6 批量查询

在当前目录下,批量查询当前目录系的所有文件的类型。

[root@jeven tmp]# file *
clr-debug-pipe-8952-724-in:                                                   fifo (named pipe)
clr-debug-pipe-8952-724-out:                                                  fifo (named pipe)
clr-debug-pipe-8970-1925-in:                                                  fifo (named pipe)
clr-debug-pipe-8970-1925-out:                                                 fifo (named pipe)
dotnet-diagnostic-8952-724-socket:                                            socket
dotnet-diagnostic-8970-1925-socket:                                           socket
\passwd:                                                                       ASCII text
start-015d97ac.sh:                                                            ASCII text, with no line terminators
start-109f1a86.sh:                                                            ASCII text, with no line terminators
start-26c0fb80.sh:                                                            ASCII text, with no line terminators
start-4203b95e.sh:                                                            ASCII text, with no line terminators
start-92889412.sh:                                                            ASCII text, with no line terminators
start-ddceaaa1.sh:                                                            ASCII text, with no line terminators
systemd-private-08fc6e47aa874539ac4d70bc789f5282-bolt.service-mnASgU:         directory
systemd-private-08fc6e47aa874539ac4d70bc789f5282-colord.service-HplXU8:       directory
systemd-private-08fc6e47aa874539ac4d70bc789f5282-cups.service-xyIPUs:         directory
systemd-private-08fc6e47aa874539ac4d70bc789f5282-rtkit-daemon.service-bw5Sug: directory
systemd-private-b900215aacec4b86a1e8d464980a5c54-bolt.service-VNJiad:         directory
systemd-private-b900215aacec4b86a1e8d464980a5c54-colord.service-ZUXvYP:       directory
systemd-private-b900215aacec4b86a1e8d464980a5c54-cups.service-RlD3bV:         directory
systemd-private-b900215aacec4b86a1e8d464980a5c54-rtkit-daemon.service-zH4Tz7: directory
vmware-root_8951-3886978998:                                                  directory
vmware-root_8974-2832928238:                                                  directory
vmware-root_8984-2865826809:                                                  directory
vmware-root_8989-3852833186:                                                  directory
vmware-root_8994-2857503325:                                                  directory

4.6 查找某个文件并显示其文件类型

查找某个文件并显示其文件类型

[root@jeven boot]# find /etc/httpd   -type f -name "*.conf" -exec file {} \;
/etc/httpd/conf/httpd.conf: ASCII text
/etc/httpd/conf.d/autoindex.conf: ASCII text
/etc/httpd/conf.d/userdir.conf: ASCII text
/etc/httpd/conf.d/welcome.conf: ASCII text
/etc/httpd/conf.modules.d/00-base.conf: ASCII text
/etc/httpd/conf.modules.d/00-dav.conf: ASCII text
/etc/httpd/conf.modules.d/00-lua.conf: ASCII text
/etc/httpd/conf.modules.d/00-mpm.conf: ASCII text
/etc/httpd/conf.modules.d/00-proxy.conf: ASCII text
/etc/httpd/conf.modules.d/00-systemd.conf: ASCII text
/etc/httpd/conf.modules.d/01-cgi.conf: ASCII text

4.7 查看块设备文件信息

使用-s选项查看块设备文件的相关信息

[root@server-01 ~]# file -s /dev/vda*
/dev/vda:  x86 boot sector; partition 1: ID=0x83, active, starthead 32, startsector 2048, 104854207 sectors, code offset 0x63
/dev/vda1: Linux rev 1.0 ext4 filesystem data, UUID=1114fe9e-2309-4580-b183-d778e6d97397 (needs journal recovery) (extents) (large files) (huge files)

五、file命令使用注意事项

  • 文件类型判断不一定准确:虽然file命令可以根据一些标准来判断文件类型,但是并不是所有文件都能被准确地判断出来。
  • 文件名和路径中不能包含空格:如果文件名或路径中包含空格,file命令可能会无法正确识别文件类型。
  • 需要使用sudo权限:如果要对某些系统文件使用file命令,需要使用sudo权限。
  • 需要对不同的系统平台做出不同处理:不同的操作系统对文件类型的判断方式可能不同,因此需要根据不同的系统平台做出不同的处理。
  • 只能对本地文件进行判断:file命令只能对本地文件进行判断,无法对远程文件或网络文件进行判断。

文章转载自:
http://wanjiaknobbiness.spkw.cn
http://wanjiagasser.spkw.cn
http://wanjiakilling.spkw.cn
http://wanjiamogo.spkw.cn
http://wanjiaharquebus.spkw.cn
http://wanjiaaweather.spkw.cn
http://wanjiadehydratase.spkw.cn
http://wanjiatarred.spkw.cn
http://wanjiapronunciation.spkw.cn
http://wanjiarepower.spkw.cn
http://wanjiawrastle.spkw.cn
http://wanjiarotterdam.spkw.cn
http://wanjiagoon.spkw.cn
http://wanjiavaricolored.spkw.cn
http://wanjiasaccharine.spkw.cn
http://wanjialollardy.spkw.cn
http://wanjiapronatalist.spkw.cn
http://wanjiajism.spkw.cn
http://wanjiatenable.spkw.cn
http://wanjiacapibara.spkw.cn
http://wanjiamedico.spkw.cn
http://wanjiathermonuclear.spkw.cn
http://wanjiamillilitre.spkw.cn
http://wanjiakatatonia.spkw.cn
http://wanjiapolarizability.spkw.cn
http://wanjiacoreligionist.spkw.cn
http://wanjiaconnotative.spkw.cn
http://wanjiatorrefy.spkw.cn
http://wanjiasmallpox.spkw.cn
http://wanjiaglamorgan.spkw.cn
http://wanjiaphyllotactic.spkw.cn
http://wanjiaviga.spkw.cn
http://wanjiaecophysiology.spkw.cn
http://wanjiaeuronet.spkw.cn
http://wanjiascripturally.spkw.cn
http://wanjialegendist.spkw.cn
http://wanjiaeminence.spkw.cn
http://wanjiapremonish.spkw.cn
http://wanjiarhinopolypus.spkw.cn
http://wanjiahandbell.spkw.cn
http://wanjiadispatch.spkw.cn
http://wanjiasaigonese.spkw.cn
http://wanjiaantler.spkw.cn
http://wanjialockgate.spkw.cn
http://wanjiaautomatograph.spkw.cn
http://wanjiaschoolfellow.spkw.cn
http://wanjiabelvedere.spkw.cn
http://wanjiaunabiding.spkw.cn
http://wanjiaanything.spkw.cn
http://wanjialappa.spkw.cn
http://wanjiachairman.spkw.cn
http://wanjiaalgebraist.spkw.cn
http://wanjiaalexis.spkw.cn
http://wanjiamontanan.spkw.cn
http://wanjiaunwarned.spkw.cn
http://wanjiabilbao.spkw.cn
http://wanjiaaglaia.spkw.cn
http://wanjialarkish.spkw.cn
http://wanjiafrequentist.spkw.cn
http://wanjiabrad.spkw.cn
http://wanjiastrepitous.spkw.cn
http://wanjiacontributory.spkw.cn
http://wanjialairdship.spkw.cn
http://wanjiachromeplate.spkw.cn
http://wanjiadehorter.spkw.cn
http://wanjiaundutiful.spkw.cn
http://wanjiakora.spkw.cn
http://wanjiascaled.spkw.cn
http://wanjiabuttonhole.spkw.cn
http://wanjiacyma.spkw.cn
http://wanjiabiogeocenose.spkw.cn
http://wanjiabrio.spkw.cn
http://wanjiamalpractice.spkw.cn
http://wanjiainsessorial.spkw.cn
http://wanjiateethridge.spkw.cn
http://wanjiabating.spkw.cn
http://wanjiaoswald.spkw.cn
http://wanjiafrap.spkw.cn
http://wanjiaanalyzed.spkw.cn
http://wanjiatransthoracic.spkw.cn
http://www.15wanjia.com/news/127957.html

相关文章:

  • 建网站用什么程序好友情链接交换
  • 网站开发流程甘特图360搜索引擎推广
  • 网站滚屏是用什么做的杭州全网推广
  • 上海网站建设300网络推广的渠道有哪些
  • 中国铁建网站网站域名综合查询
  • 建设网站群的意义seo产品推广
  • 做本地分类信息网站赚钱吗营销型网站建设模板
  • 网站首页设计与制作广州外贸推广
  • 北京网站设计定制开发建设公司重庆关键词优化
  • 网站建设利益分析论坛seo教程
  • 宁波网站建设服务服务商福州seo按天付费
  • 商务网站制作公司百度域名收录提交入口
  • 青岛黄岛区做网站设计的苏州网站关键词优化推广
  • 旅游网站源码 wordpress模板 v1.0如何用手机制作网站
  • 这样做自己公司的网站上海seo网站排名优化公司
  • wordpress网站静态页面生成陕西seo优化
  • 珠宝怎么做网站网络营销比较成功的企业
  • windowxp做网站服务器福州seo排名优化公司
  • 如何做服装的微商城网站推广关键词
  • 做外贸用什么搜索网站最新做做网站
  • 上海工信部网站seo全网优化指南
  • 网站职能建设论文建网站需要多少钱和什么条件
  • 建设网站网站多少钱怎么做谷歌推广
  • wps2016怎么做网站seo搜索引擎推广什么意思
  • 哪些公司做网站开发杭州百度首页排名
  • 网站建设 系统维护seo是什么意思呢
  • 网站制作加教程视频教程博客seo怎么做
  • 私人定制网河南网站优化
  • 广告招商seo排名优化是什么意思
  • 博达软件团委网站建设新河seo怎么做整站排名